From 91aa8b0d4c02cae4649d85c8e210a275899b9227 Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Thu, 12 Sep 2019 14:01:34 +0200 Subject: [PATCH] Only store newly created signatures as valid in the non-streaming case When streaming, we're not actually sure yet that signing won't fail. --- src/packet/signature.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/packet/signature.js b/src/packet/signature.js index 8165017d..607c3f47 100644 --- a/src/packet/signature.js +++ b/src/packet/signature.js @@ -190,13 +190,13 @@ Signature.prototype.sign = async function (key, data, detached = false, streamin this.signature = stream.fromAsync(signed); } else { this.signature = await signed(); - } - // Store the fact that this signature is valid, e.g. for when we call `await - // getLatestValidSignature(this.revocationSignatures, key, data)` later. Note - // that this only holds up if the key and data passed to verify are the same - // as the ones passed to sign. - this.verified = true; + // Store the fact that this signature is valid, e.g. for when we call `await + // getLatestValidSignature(this.revocationSignatures, key, data)` later. + // Note that this only holds up if the key and data passed to verify are the + // same as the ones passed to sign. + this.verified = true; + } return true; };