mirror of
https://github.com/reactos/wine.git
synced 2025-02-20 12:50:53 +00:00
crypt32: Make sure a signed encode message's signer info is always initialized.
This commit is contained in:
parent
9ae5ef6641
commit
6763841e19
@ -1248,33 +1248,41 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
if (ret && info->cSigners)
|
||||
if (ret)
|
||||
{
|
||||
msg->msg_data.info->rgSignerInfo =
|
||||
CryptMemAlloc(info->cSigners * sizeof(CMSG_SIGNER_INFO));
|
||||
if (msg->msg_data.info->rgSignerInfo)
|
||||
if (info->cSigners)
|
||||
{
|
||||
msg->msg_data.info->cSignerInfo = info->cSigners;
|
||||
memset(msg->msg_data.info->rgSignerInfo, 0,
|
||||
msg->msg_data.info->cSignerInfo * sizeof(CMSG_SIGNER_INFO));
|
||||
ret = CSignedMsgData_AllocateHandles(&msg->msg_data);
|
||||
for (i = 0; ret && i < msg->msg_data.info->cSignerInfo; i++)
|
||||
msg->msg_data.info->rgSignerInfo =
|
||||
CryptMemAlloc(info->cSigners * sizeof(CMSG_SIGNER_INFO));
|
||||
if (msg->msg_data.info->rgSignerInfo)
|
||||
{
|
||||
ret = CSignerInfo_Construct(
|
||||
&msg->msg_data.info->rgSignerInfo[i],
|
||||
&info->rgSigners[i]);
|
||||
if (ret)
|
||||
msg->msg_data.info->cSignerInfo = info->cSigners;
|
||||
memset(msg->msg_data.info->rgSignerInfo, 0,
|
||||
msg->msg_data.info->cSignerInfo * sizeof(CMSG_SIGNER_INFO));
|
||||
ret = CSignedMsgData_AllocateHandles(&msg->msg_data);
|
||||
for (i = 0; ret && i < msg->msg_data.info->cSignerInfo; i++)
|
||||
{
|
||||
ret = CSignedMsgData_ConstructSignerHandles(
|
||||
&msg->msg_data, i, info->rgSigners[i].hCryptProv);
|
||||
if (dwFlags & CMSG_CRYPT_RELEASE_CONTEXT_FLAG)
|
||||
CryptReleaseContext(info->rgSigners[i].hCryptProv,
|
||||
0);
|
||||
ret = CSignerInfo_Construct(
|
||||
&msg->msg_data.info->rgSignerInfo[i],
|
||||
&info->rgSigners[i]);
|
||||
if (ret)
|
||||
{
|
||||
ret = CSignedMsgData_ConstructSignerHandles(
|
||||
&msg->msg_data, i, info->rgSigners[i].hCryptProv);
|
||||
if (dwFlags & CMSG_CRYPT_RELEASE_CONTEXT_FLAG)
|
||||
CryptReleaseContext(info->rgSigners[i].hCryptProv,
|
||||
0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
{
|
||||
msg->msg_data.info->cSignerInfo = 0;
|
||||
msg->msg_data.signerHandles = NULL;
|
||||
}
|
||||
}
|
||||
if (ret)
|
||||
ret = CRYPT_ConstructBlobArray(
|
||||
|
Loading…
x
Reference in New Issue
Block a user