diff --git a/dev/Model/Message.js b/dev/Model/Message.js index 356924eca..ce7200029 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -663,7 +663,11 @@ export class MessageModel extends AbstractModel { const oMessage = this; PgpUserStore.verify(oMessage).then(result => { if (result) { - oMessage.pgpSigned(result); + oMessage.pgpSigned({ + ...oMessage.pgpSigned(), + error: null, + ...result + }); } else { alert('Verification failed or no valid public key found'); } diff --git a/dev/Stores/User/OpenPGP.js b/dev/Stores/User/OpenPGP.js index ef5926ab6..49450a72a 100644 --- a/dev/Stores/User/OpenPGP.js +++ b/dev/Stores/User/OpenPGP.js @@ -330,9 +330,14 @@ export const OpenPGPUserStore = new class { // expectSigned: true, // !!detachedSignature signature: signature }); + const verified = await Promise.allSettled( + result.signatures.map(signature => signature.verified) + ); return { fingerprint: publicKey.fingerprint, - success: result && !!result.signatures.length + success: verified.length > 0 && verified.every( + entry => entry.status === 'fulfilled' && entry.value === true + ) }; } } diff --git a/dev/Stores/User/Pgp.js b/dev/Stores/User/Pgp.js index 9a0a0362a..2b59e076f 100644 --- a/dev/Stores/User/Pgp.js +++ b/dev/Stores/User/Pgp.js @@ -113,8 +113,7 @@ export const let result; if (signed) { try { - // OpenPGP only when inline, else we must download the whole message - if (!signed.sigPartId && OpenPGPUserStore.hasPublicKeyForEmails([sender])) { + if (OpenPGPUserStore.hasPublicKeyForEmails([sender])) { result = await OpenPGPUserStore.verify(message); } else if (GnuPGUserStore.hasPublicKeyForEmails([sender])) { result = await GnuPGUserStore.verify(message);