Check if any (sub)key is decrypted in Key.prototype.isDecrypted (#1182)

`key.isDecrypted()` now returns true if either the primary key or any subkey
is decrypted.

Additionally, implement `SecretKeyPacket.prototype.makeDummy` for encrypted
keys.
This commit is contained in:
larabr
2021-01-24 18:19:27 +01:00
committed by Daniel Huigens
parent c23ed58387
commit 66c06dab3e
7 changed files with 75 additions and 26 deletions

View File

@@ -208,7 +208,7 @@ export class Message {
// do not check key expiration to allow decryption of old messages
const privateKeyPackets = (await privateKey.getDecryptionKeys(keyPacket.publicKeyId, null)).map(key => key.keyPacket);
await Promise.all(privateKeyPackets.map(async function(privateKeyPacket) {
if (!privateKeyPacket) {
if (!privateKeyPacket || privateKeyPacket.isDummy()) {
return;
}
if (!privateKeyPacket.isDecrypted()) {