Commit 3ffb4b1c authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Detached hash messages don't contain the content, so don't make a copy of it.

parent f83da5cc
......@@ -387,27 +387,23 @@ static BOOL CHashEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
{
if (fFinal)
msg->base.finalized = TRUE;
if (msg->base.streamed)
if (msg->base.streamed || (msg->base.open_flags & CMSG_DETACHED_FLAG))
{
/* Doesn't do anything, as stream output is never called, and you
/* Doesn't do much, as stream output is never called, and you
* can't get the content.
*/
ret = CryptHashData(msg->hash, pbData, cbData, 0);
}
else
{
if (!(msg->base.open_flags & CMSG_DETACHED_FLAG) && !fFinal)
if (!fFinal)
SetLastError(CRYPT_E_MSG_ERROR);
else
{
ret = CryptHashData(msg->hash, pbData, cbData, 0);
if (ret)
{
if (msg->data.pbData)
msg->data.pbData = CryptMemRealloc(msg->data.pbData,
msg->data.cbData + cbData);
else
msg->data.pbData = CryptMemAlloc(cbData);
msg->data.pbData = CryptMemAlloc(cbData);
if (msg->data.pbData)
{
memcpy(msg->data.pbData + msg->data.cbData, pbData,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment