mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
#89 OpenPGP.js verify cleartext
This commit is contained in:
parent
f625abe0b2
commit
acfe13bdc2
2 changed files with 4 additions and 4 deletions
|
|
@ -213,7 +213,9 @@ export const OpenPGPUserStore = new class {
|
||||||
data.Folder = message.folder;
|
data.Folder = message.folder;
|
||||||
data.Uid = message.uid;
|
data.Uid = message.uid;
|
||||||
data.GnuPG = 0;
|
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) {
|
if (response) {
|
||||||
const signature = response.Result.signature
|
const signature = response.Result.signature
|
||||||
? await openpgp.readSignature({ armoredSignature: response.Result.signature })
|
? await openpgp.readSignature({ armoredSignature: response.Result.signature })
|
||||||
|
|
|
||||||
|
|
@ -179,9 +179,7 @@ export const PgpUserStore = new class {
|
||||||
async verify(message) {
|
async verify(message) {
|
||||||
const plain = message.plain();
|
const plain = message.plain();
|
||||||
if (/-----BEGIN PGP SIGNED MESSAGE-----/.test(plain) && /-----BEGIN PGP SIGNATURE-----/.test(plain)) {
|
if (/-----BEGIN PGP SIGNED MESSAGE-----/.test(plain) && /-----BEGIN PGP SIGNATURE-----/.test(plain)) {
|
||||||
let result = await OpenPGPUserStore.verify(plain);
|
return await OpenPGPUserStore.verify(message);
|
||||||
console.dir(result);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (message.pgpSigned()) {
|
if (message.pgpSigned()) {
|
||||||
const sender = message.from[0].email;
|
const sender = message.from[0].email;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue