Skip to content

Commit 76554e4

Browse files
committed
refactor: only handle error if security command not found
1 parent 2a0ed1e commit 76554e4

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

internal/decrypter/decrypter.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ import (
1414
)
1515

1616
var (
17-
errSecurityKeyIsEmpty = errors.New("input [security find-generic-password -wa 'Chrome'] in terminal")
18-
errPasswordIsEmpty = errors.New("password is empty")
19-
errDecodeASN1Failed = errors.New("decode ASN1 data failed")
20-
errEncryptedLength = errors.New("length of encrypted password less than block size")
17+
errPasswordIsEmpty = errors.New("password is empty")
18+
errDecodeASN1Failed = errors.New("decode ASN1 data failed")
19+
errEncryptedLength = errors.New("length of encrypted password less than block size")
2120
)
2221

2322
type ASN1PBE interface {

internal/decrypter/decrypter_darwin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package decrypter
22

3+
var (
4+
errSecurityKeyIsEmpty = errors.New("input [security find-generic-password -wa 'Chrome'] in terminal")
5+
)
6+
37
func Chromium(key, encryptPass []byte) ([]byte, error) {
48
if len(encryptPass) <= 3 {
59
return nil, errPasswordIsEmpty

0 commit comments

Comments
 (0)