fix: fix syntax errors and remove unused variables

- Fix syntax error and remove unnecessary comments in crypto.go
feat/library
moonD4rk 1 year ago
parent 48d38ef39c
commit 0d6642ead9
No known key found for this signature in database
GPG Key ID: 5AB6217E08D39ABA
  1. 2
      browingdata/password/password.go
  2. 20
      crypto/crypto.go
  3. 1
      firefox.go

@ -169,7 +169,7 @@ const (
queryNssPrivate = `SELECT a11, a102 from nssPrivate` queryNssPrivate = `SELECT a11, a102 from nssPrivate`
) )
func (f *FirefoxPassword) Parse(masterKey []byte) error { func (f *FirefoxPassword) Parse(_ []byte) error {
globalSalt, metaBytes, nssA11, nssA102, err := getFirefoxDecryptKey(item.TempFirefoxKey4) globalSalt, metaBytes, nssA11, nssA102, err := getFirefoxDecryptKey(item.TempFirefoxKey4)
if err != nil { if err != nil {
return err return err

@ -32,22 +32,22 @@ func NewASN1PBE(b []byte) (pbe ASN1PBE, err error) {
l loginPBE l loginPBE
errs []string errs []string
) )
if _, err := asn1.Unmarshal(b, &n); err == nil { if _, err = asn1.Unmarshal(b, &n); err == nil {
return n, nil return n, nil
} else {
errs = append(errs, err.Error())
} }
if _, err := asn1.Unmarshal(b, &m); err == nil {
return m, nil
} else {
errs = append(errs, err.Error()) errs = append(errs, err.Error())
if _, err = asn1.Unmarshal(b, &m); err == nil {
return m, nil
} }
if _, err := asn1.Unmarshal(b, &l); err == nil {
return l, nil
} else {
errs = append(errs, err.Error()) errs = append(errs, err.Error())
if _, err = asn1.Unmarshal(b, &l); err == nil {
return l, nil
} }
return nil, fmt.Errorf("%w: %s", err, strings.Join(errs, "; ")) errs = append(errs, err.Error())
return nil, fmt.Errorf("%w: %s", errDecodeASN1Failed, strings.Join(errs, "; "))
} }
// nssPBE Struct // nssPBE Struct

@ -9,6 +9,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
// import sqlite3 driver
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
"github.com/moond4rk/hackbrowserdata/crypto" "github.com/moond4rk/hackbrowserdata/crypto"

Loading…
Cancel
Save