don't assume all mpi type for encsessionkey

This commit is contained in:
Sanjana Rajan 2018-01-19 15:02:17 +01:00
parent a173a63b16
commit fa5805eaf7

View File

@ -164,7 +164,8 @@ PublicKeyEncryptedSessionKey.prototype.decrypt = async function (key) {
*/
PublicKeyEncryptedSessionKey.prototype.postCloneTypeFix = function() {
this.publicKeyId = type_keyid.fromClone(this.publicKeyId);
var types = crypto.getEncSessionKeyParamTypes(this.publicKeyAlgorithm);
for (var i = 0; i < this.encrypted.length; i++) {
this.encrypted[i] = type_mpi.fromClone(this.encrypted[i]);
this.encrypted[i] = types[i].fromClone(this.encrypted[i]);
}
};