From acfe13bdc2396d6d5ca11bc5e7109d2de2de791a Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Wed, 2 Feb 2022 17:00:27 +0100 Subject: [PATCH] #89 OpenPGP.js verify cleartext --- dev/Stores/User/OpenPGP.js | 4 +++- dev/Stores/User/Pgp.js | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/Stores/User/OpenPGP.js b/dev/Stores/User/OpenPGP.js index 6e7281764..5c3b907bc 100644 --- a/dev/Stores/User/OpenPGP.js +++ b/dev/Stores/User/OpenPGP.js @@ -213,7 +213,9 @@ export const OpenPGPUserStore = new class { data.Folder = message.folder; data.Uid = message.uid; data.GnuPG = 0; - let response = await Remote.post('MessagePgpVerify', null, data); + let response = data.SigPartId + ? await Remote.post('MessagePgpVerify', null, data) + : { Result: { text: message.plain(), signature: null } }; if (response) { const signature = response.Result.signature ? await openpgp.readSignature({ armoredSignature: response.Result.signature }) diff --git a/dev/Stores/User/Pgp.js b/dev/Stores/User/Pgp.js index 58e90ca83..ce9e128b8 100644 --- a/dev/Stores/User/Pgp.js +++ b/dev/Stores/User/Pgp.js @@ -179,9 +179,7 @@ export const PgpUserStore = new class { async verify(message) { const plain = message.plain(); if (/-----BEGIN PGP SIGNED MESSAGE-----/.test(plain) && /-----BEGIN PGP SIGNATURE-----/.test(plain)) { - let result = await OpenPGPUserStore.verify(plain); - console.dir(result); - return; + return await OpenPGPUserStore.verify(message); } if (message.pgpSigned()) { const sender = message.from[0].email;