From 59f4c67f411e35be5cc15797510fc743503a210d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=8D=E1=B4=8F=E1=B4=8F=C9=B4D4=CA=80=E1=B4=8B?= Date: Wed, 29 Jul 2020 11:36:54 +0800 Subject: [PATCH] fix chrome for windows decrypt error. Close #21 --- core/decrypt/decrypt.go | 2 +- core/decrypt/decrypt_windows.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/decrypt/decrypt.go b/core/decrypt/decrypt.go index ced96b3..b322ff4 100644 --- a/core/decrypt/decrypt.go +++ b/core/decrypt/decrypt.go @@ -19,7 +19,7 @@ var ( func aes128CBCDecrypt(key, iv, encryptPass []byte) ([]byte, error) { block, err := aes.NewCipher(key) if err != nil { - return []byte{}, err + return nil, err } dst := make([]byte, len(encryptPass)) mode := cipher.NewCBCDecrypter(block, iv) diff --git a/core/decrypt/decrypt_windows.go b/core/decrypt/decrypt_windows.go index db4d309..ce359f3 100644 --- a/core/decrypt/decrypt_windows.go +++ b/core/decrypt/decrypt_windows.go @@ -14,7 +14,7 @@ import ( "golang.org/x/crypto/pbkdf2" ) -func ChromePass(encryptPass, key []byte) ([]byte, error) { +func ChromePass(key, encryptPass []byte) ([]byte, error) { if len(encryptPass) > 15 { // remove prefix 'v10' return aesGCMDecrypt(encryptPass[15:], key, encryptPass[3:15])