From e5265a899d4750c4085b1fea5740e47f843aab31 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 26 Feb 2022 15:09:44 +0100 Subject: [PATCH] Fix signature profile generation --- server/keys.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/keys.js b/server/keys.js index 242a815..d336179 100644 --- a/server/keys.js +++ b/server/keys.js @@ -138,7 +138,9 @@ const fetchSignature = (signature) => { // Check validity of signature let signatureData try { - signatureData = await openpgp.cleartext.readArmored(signature) + signatureData = await openpgp.readCleartextMessage({ + cleartextMessage: signature + }) } catch (error) { reject(new Error(`Signature could not be properly read (${error.message})`)) } @@ -161,10 +163,10 @@ const fetchSignature = (signature) => { // Check validity of signature const verified = await openpgp.verify({ message: signatureData, - publicKeys: output.publicKey + verificationKeys: output.publicKey }) - const { valid } = verified.signatures[0] - if (!valid) { + + if (!await verified.signatures[0].verified) { reject(new Error('Signature was invalid')) }