add one pass in case where no priv keys are passed in for signing

This commit is contained in:
Sanjana Rajan 2017-03-22 17:14:30 -07:00
parent 79160abcc9
commit 25d16046c2

View File

@ -320,6 +320,9 @@ Message.prototype.sign = function(privateKeys=[], signature=null) {
onePassSig.hashAlgorithm = config.prefer_hash_algorithm;
onePassSig.publicKeyAlgorithm = sigPacket.publicKeyAlgorithm;
onePassSig.signingKeyId = sigPacket.issuerKeyId;
if (!privateKeys.length && i === 0) {
onePassSig.flags = 1;
}
packetlist.push(onePassSig);
}
}