refactor: only handle error if security command not found

pull/159/head
ᴍᴏᴏɴD4ʀᴋ 3 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 ( var (
errSecurityKeyIsEmpty = errors.New("input [security find-generic-password -wa 'Chrome'] in terminal") errPasswordIsEmpty = errors.New("password is empty")
errPasswordIsEmpty = errors.New("password is empty") errDecodeASN1Failed = errors.New("decode ASN1 data failed")
errDecodeASN1Failed = errors.New("decode ASN1 data failed") errEncryptedLength = errors.New("length of encrypted password less than block size")
errEncryptedLength = errors.New("length of encrypted password less than block size")
) )
type ASN1PBE interface { type ASN1PBE interface {

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

Loading…
Cancel
Save