From fa5805eaf72f2b18d89e80dbee30acd70d20cc85 Mon Sep 17 00:00:00 2001 From: Sanjana Rajan Date: Fri, 19 Jan 2018 15:02:17 +0100 Subject: [PATCH] don't assume all mpi type for encsessionkey --- src/packet/public_key_encrypted_session_key.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packet/public_key_encrypted_session_key.js b/src/packet/public_key_encrypted_session_key.js index 79672d8f..2b4d5c58 100644 --- a/src/packet/public_key_encrypted_session_key.js +++ b/src/packet/public_key_encrypted_session_key.js @@ -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]); } };