From 61151e29f62f32f772bf5c0a88005dad45d5b149 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Thu, 1 Dec 2011 17:42:24 +0400 Subject: [eterwine 2/2] crypt32: Add support of changing algorithm identifier (eterbug #5694). --- dlls/crypt32/msg.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index be8ac07..9926e27 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1986,7 +1986,22 @@ static HCRYPTMSG CEnvelopedEncodeMsg_Open(DWORD dwFlags, { ret = CRYPT_GenKey(&encryptInfo, algID); if (ret) + { msg->key = encryptInfo.hContentEncryptKey; + if (encryptInfo.dwFlags & CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG) + { + CryptMemFree(msg->algo.Parameters.pbData); + CRYPT_ConstructBlob(&msg->algo.Parameters, + &encryptInfo.ContentEncryptionAlgorithm.Parameters); + } + if (encryptInfo.dwFlags & CMSG_CONTENT_ENCRYPT_FREE_OBJID_FLAG) + { + CryptMemFree(msg->algo.pszObjId); + msg->algo.pszObjId = CryptMemAlloc( + strlen(encryptInfo.ContentEncryptionAlgorithm.pszObjId) + 1); + strcpy(msg->algo.pszObjId, encryptInfo.ContentEncryptionAlgorithm.pszObjId); + } + } } } for (i = 0; ret && i < msg->cRecipientInfo; ++i) -- 1.7.7.3