refactor: only handle error if security command not found

pull/159/head
ᴍᴏᴏɴD4ʀᴋ 2 years ago
parent 2a0ed1ebbf
commit 76554e48c3
  1. 7
      internal/decrypter/decrypter.go
  2. 4
      internal/decrypter/decrypter_darwin.go

@ -14,10 +14,9 @@ import (
)
var (
errSecurityKeyIsEmpty = errors.New("input [security find-generic-password -wa 'Chrome'] in terminal")
errPasswordIsEmpty = errors.New("password is empty")
errDecodeASN1Failed = errors.New("decode ASN1 data failed")
errEncryptedLength = errors.New("length of encrypted password less than block size")
errPasswordIsEmpty = errors.New("password is empty")
errDecodeASN1Failed = errors.New("decode ASN1 data failed")
errEncryptedLength = errors.New("length of encrypted password less than block size")
)
type ASN1PBE interface {

@ -1,5 +1,9 @@
package decrypter
var (
errSecurityKeyIsEmpty = errors.New("input [security find-generic-password -wa 'Chrome'] in terminal")
)
func Chromium(key, encryptPass []byte) ([]byte, error) {
if len(encryptPass) <= 3 {
return nil, errPasswordIsEmpty

Loading…
Cancel
Save