style: add error text

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2021-09-24 19:44:12 +08:00
parent 733311368a
commit 265b93e288
+2 -1
View File
@@ -19,6 +19,7 @@ var (
errSecurityKeyIsEmpty = errors.New("input [security find-generic-password -wa 'Chrome'] in terminal")
errDecryptFailed = errors.New("decrypt failed, password is empty")
errDecodeASN1Failed = errors.New("decode ASN1 data failed")
errEncryptedLength = errors.New("length of encrypted password less than block size")
)
type ASN1PBE interface {
@@ -164,7 +165,7 @@ func aes128CBCDecrypt(key, iv, encryptPass []byte) ([]byte, error) {
}
encryptLen := len(encryptPass)
if encryptLen < block.BlockSize() {
return nil, err
return nil, errEncryptedLength
}
dst := make([]byte, encryptLen)