Commit 39ba0bbe authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

crypt32: Always set returned size in CRYPT_CopySignerInfo.

parent 2a2ecdd5
......@@ -2727,12 +2727,10 @@ static BOOL CRYPT_CopySignerInfo(void *pvData, DWORD *pcbData,
size += CRYPT_SizeOfAttributes(&in->UnauthAttrs);
if (!pvData)
{
*pcbData = size;
ret = TRUE;
}
else if (*pcbData < size)
{
*pcbData = size;
SetLastError(ERROR_MORE_DATA);
ret = FALSE;
}
......@@ -2765,6 +2763,7 @@ static BOOL CRYPT_CopySignerInfo(void *pvData, DWORD *pcbData,
CRYPT_CopyAttributes(&out->UnauthAttrs, &in->UnauthAttrs, &nextData);
}
}
*pcbData = size;
TRACE("returning %d\n", ret);
return ret;
}
......
......@@ -2857,7 +2857,7 @@ static void test_decode_msg_get_param(void)
HCRYPTPROV hCryptProv;
HCRYPTKEY key = 0;
BOOL ret;
DWORD size = 0, value;
DWORD size = 0, value, req_size;
LPBYTE buf;
CMSG_CTRL_DECRYPT_PARA decryptPara = { sizeof(decryptPara), 0 };
......@@ -2947,7 +2947,10 @@ static void test_decode_msg_get_param(void)
signer.SerialNumber.cbData = sizeof(serialNum);
signer.SerialNumber.pbData = serialNum;
signer.HashAlgorithm.pszObjId = oid_rsa_md5;
req_size = size;
size += 10;
CryptMsgGetParam(msg, CMSG_SIGNER_INFO_PARAM, 0, buf, &size);
ok(size == req_size, "size = %u, expected %u\n", size, req_size);
compare_signer_info((CMSG_SIGNER_INFO *)buf, &signer);
CryptMemFree(buf);
}
......
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