refactor: only handle error if security command not found

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ 2022-08-14 23:04:15 +08:00
parent 2a0ed1ebbf
commit 76554e48c3
2 changed files with 7 additions and 4 deletions

View File

@ -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 {

View File

@ -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