fix: wrong browser profile path for linux

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2022-04-14 14:53:16 +08:00
parent 86d900527f
commit da2beb9453
6 changed files with 28 additions and 97 deletions
+13
View File
@@ -16,6 +16,19 @@ func ChromePass(key, encryptPass []byte) ([]byte, error) {
}
}
func ChromePassForYandex(key, encryptPass []byte) ([]byte, error) {
if len(encryptPass) > 15 {
// remove Prefix 'v10'
// gcmBlockSize = 16
// gcmTagSize = 16
// gcmMinimumTagSize = 12 // NIST SP 800-38D recommends tags with 12 or more bytes.
// gcmStandardNonceSize = 12
return aesGCMDecrypt(encryptPass[12:], key, encryptPass[0:12])
} else {
return nil, errPasswordIsEmpty
}
}
// chromium > 80 https://source.chromium.org/chromium/chromium/src/+/master:components/os_crypt/os_crypt_win.cc
func aesGCMDecrypt(crypted, key, nounce []byte) ([]byte, error) {
block, err := aes.NewCipher(key)