From 7fb3784ef631822b8495bc8fbfc3a812016b36b0 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 26 Feb 2022 09:27:49 +0100 Subject: [PATCH] Fixing signature verification --- static-src/ui.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/static-src/ui.js b/static-src/ui.js index 2850185..fee9f45 100644 --- a/static-src/ui.js +++ b/static-src/ui.js @@ -138,13 +138,13 @@ const runVerificationForm = () => { // Try two different methods of signature reading let signature = null, verified = null, readError = null; try { - signature = await openpgp.createMessage({ + signature = await openpgp.readMessage({ armoredMessage: elFormVerify.querySelector('.input').value }); } catch(e) { try { - signature = await openpgp.createCleartextMessage({ - armoredMessage: elFormVerify.querySelector('.input').value + signature = await openpgp.readCleartextMessage({ + cleartextMessage: elFormVerify.querySelector('.input').value }); } catch(e) { readError = e; @@ -158,7 +158,8 @@ const runVerificationForm = () => { verificationKeys: window.kx.key.object }); - if (verified.signatures[0].valid) { + console.log(verified); + if (await verified.signatures[0].verified) { elFormVerify.querySelector('.output').value = `The message was signed by the profile's key.`; } else { elFormVerify.querySelector('.output').value = `The message was NOT signed by the profile's key.`;