diff --git a/src/packet/literal.js b/src/packet/literal.js index 3d9c7988..55c099cd 100644 --- a/src/packet/literal.js +++ b/src/packet/literal.js @@ -62,7 +62,7 @@ Literal.prototype.setText = function(text, format='utf8') { * @returns {String} literal data as text */ Literal.prototype.getText = function(clone=false) { - if (this.text === null || this.text.locked) { + if (this.text === null || util.isStream(this.text)) { // Assume that this.text has been read let lastChar = ''; const decoder = new TextDecoder('utf8'); // eslint-disable-next-line no-inner-declarations diff --git a/src/packet/signature.js b/src/packet/signature.js index ba860c3b..436cf1e6 100644 --- a/src/packet/signature.js +++ b/src/packet/signature.js @@ -710,6 +710,7 @@ Signature.prototype.verify = async function (key, data) { const endian = publicKeyAlgorithm === enums.publicKey.eddsa ? 'le' : 'be'; const mpi = []; let i = 0; + this.signature = await stream.readToEnd(this.signature); for (let j = 0; j < mpicount; j++) { mpi[j] = new type_mpi(); i += mpi[j].read(this.signature.subarray(i, this.signature.length), endian);