From d1e7e96d0ad9df1dd3c33a20527ac2158ea8b3a2 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Thu, 6 Oct 2022 18:17:25 +0200 Subject: [PATCH] Check validity of data to be cached --- server/keys.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/keys.js b/server/keys.js index 8a04f08..b3b2476 100644 --- a/server/keys.js +++ b/server/keys.js @@ -29,7 +29,7 @@ more information on this, and how to apply and follow the GNU AGPL, see { reject(new Error(`No public keys could be fetched using WKD`)) } - if (c) { + if (c && plaintext instanceof Uint8Array) { await c.set(hash, plaintext.toString(), 60 * 1000) } } @@ -147,7 +147,7 @@ const fetchHKP = (id, keyserverDomain) => { reject(new Error(`No public keys could be fetched using HKP`)) } - if (c) { + if (c && output.publicKey instanceof PublicKey) { await c.set(hash, output.publicKey.armor(), 60 * 1000) }