Don't remember OpenPGP key passphrase when it fails #840

This commit is contained in:
the-djmaze 2023-02-02 14:04:37 +01:00
parent 78938caaf3
commit acc1c0badc

View file

@ -31,12 +31,13 @@ const
'OPENPGP/'+btnTxt 'OPENPGP/'+btnTxt
); );
if (pass) { if (pass) {
pass.remember && passphrases.set(key, pass.password); const passphrase = pass.password,
let passphrase = pass.password; result = await openpgp.decryptKey({
return await openpgp.decryptKey({ privateKey: privateKey.key,
privateKey: privateKey.key, passphrase
passphrase });
}); result && pass.remember && passphrases.set(key, passphrase);
return result;
} }
}, },