Commit 937b27f3 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Implement getting outer content of a signed message.

parent b80101eb
......@@ -797,6 +797,34 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
switch (dwParamType)
{
case CMSG_CONTENT_PARAM:
{
CRYPT_CONTENT_INFO info;
ret = CryptMsgGetParam(hCryptMsg, CMSG_BARE_CONTENT_PARAM, 0, NULL,
&info.Content.cbData);
if (ret)
{
info.Content.pbData = CryptMemAlloc(info.Content.cbData);
if (info.Content.pbData)
{
ret = CryptMsgGetParam(hCryptMsg, CMSG_BARE_CONTENT_PARAM, 0,
info.Content.pbData, &info.Content.cbData);
if (ret)
{
char oid_rsa_signed[] = szOID_RSA_signedData;
info.pszObjId = oid_rsa_signed;
ret = CryptEncodeObjectEx(X509_ASN_ENCODING,
PKCS_CONTENT_INFO, &info, 0, NULL, pvData, pcbData);
}
CryptMemFree(info.Content.pbData);
}
else
ret = FALSE;
}
break;
}
case CMSG_BARE_CONTENT_PARAM:
{
CRYPT_SIGNED_INFO info;
......
......@@ -1292,7 +1292,6 @@ static void test_signed_msg_encoding(void)
check_param("detached signed empty bare content", msg,
CMSG_BARE_CONTENT_PARAM, signedEmptyBareContent,
sizeof(signedEmptyBareContent));
todo_wine
check_param("detached signed empty content", msg, CMSG_CONTENT_PARAM,
signedEmptyContent, sizeof(signedEmptyContent));
ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
......@@ -1301,7 +1300,6 @@ static void test_signed_msg_encoding(void)
signedHash, sizeof(signedHash));
check_param("detached signed bare content", msg, CMSG_BARE_CONTENT_PARAM,
detachedSignedBareContent, sizeof(detachedSignedBareContent));
todo_wine
check_param("detached signed content", msg, CMSG_CONTENT_PARAM,
detachedSignedContent, sizeof(detachedSignedContent));
SetLastError(0xdeadbeef);
......@@ -1317,14 +1315,12 @@ static void test_signed_msg_encoding(void)
check_param("signed empty bare content", msg, CMSG_BARE_CONTENT_PARAM,
signedEmptyBareContent, sizeof(signedEmptyBareContent));
todo_wine
check_param("signed empty content", msg, CMSG_CONTENT_PARAM,
signedEmptyContent, sizeof(signedEmptyContent));
ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError());
check_param("signed bare content", msg, CMSG_BARE_CONTENT_PARAM,
signedBareContent, sizeof(signedBareContent));
todo_wine
check_param("signed content", msg, CMSG_CONTENT_PARAM,
signedContent, sizeof(signedContent));
......
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