refactor: remove unused err message

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2022-08-16 19:24:36 +08:00
parent e9bbe16c7d
commit 86a747143b
3 changed files with 5 additions and 22 deletions
-11
View File
@@ -1,20 +1,9 @@
package decrypter
import (
"errors"
)
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
}
if len(key) == 0 {
return nil, errSecurityKeyIsEmpty
}
iv := []byte{32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}
return aes128CBCDecrypt(key, iv, encryptPass[3:])
-6
View File
@@ -11,9 +11,6 @@ func Chromium(key, encryptPass []byte) ([]byte, error) {
if len(encryptPass) < 3 {
return nil, errPasswordIsEmpty
}
if len(key) == 0 {
return nil, errSecurityKeyIsEmpty
}
return aesGCMDecrypt(encryptPass[15:], key, encryptPass[3:15])
}
@@ -22,9 +19,6 @@ func ChromiumForYandex(key, encryptPass []byte) ([]byte, error) {
if len(encryptPass) < 3 {
return nil, errPasswordIsEmpty
}
if len(key) == 0 {
return nil, errSecurityKeyIsEmpty
}
// remove Prefix 'v10'
// gcmBlockSize = 16
// gcmTagSize = 16