From 76894e21063e17d880e1251210c107bbbafef17a Mon Sep 17 00:00:00 2001 From: brusher_ru Date: Thu, 12 Sep 2024 11:00:55 -0300 Subject: [PATCH] fix: use kdf params from the wallet file to unlock --- src/utils/aes-gcm.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils/aes-gcm.ts b/src/utils/aes-gcm.ts index c790418..038825e 100644 --- a/src/utils/aes-gcm.ts +++ b/src/utils/aes-gcm.ts @@ -137,7 +137,12 @@ export const decrypt = async ( const salt = fromHexString(encryptedMessage.kdfparams.salt); const iv = fromHexString(encryptedMessage.cipherParams.iv); const cipherText = fromHexString(encryptedMessage.cipherText); - const key = await pbkdf2Key(password, salt); + const key = await pbkdf2Key( + password, + salt, + encryptedMessage.kdfparams.dklen, + encryptedMessage.kdfparams.iterations + ); const decryptedBytes = await subtle.decrypt( { name: 'AES-GCM',