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
);
if (pass) {
pass.remember && passphrases.set(key, pass.password);
let passphrase = pass.password;
return await openpgp.decryptKey({
privateKey: privateKey.key,
passphrase
});
const passphrase = pass.password,
result = await openpgp.decryptKey({
privateKey: privateKey.key,
passphrase
});
result && pass.remember && passphrases.set(key, passphrase);
return result;
}
},