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.
This commit is contained in:
parent
2877bac018
commit
91aa8b0d4c
|
@ -190,13 +190,13 @@ Signature.prototype.sign = async function (key, data, detached = false, streamin
|
||||||
this.signature = stream.fromAsync(signed);
|
this.signature = stream.fromAsync(signed);
|
||||||
} else {
|
} else {
|
||||||
this.signature = await signed();
|
this.signature = await signed();
|
||||||
}
|
|
||||||
|
|
||||||
// Store the fact that this signature is valid, e.g. for when we call `await
|
// Store the fact that this signature is valid, e.g. for when we call `await
|
||||||
// getLatestValidSignature(this.revocationSignatures, key, data)` later. Note
|
// getLatestValidSignature(this.revocationSignatures, key, data)` later.
|
||||||
// that this only holds up if the key and data passed to verify are the same
|
// Note that this only holds up if the key and data passed to verify are the
|
||||||
// as the ones passed to sign.
|
// same as the ones passed to sign.
|
||||||
this.verified = true;
|
this.verified = true;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user