Commit 4e289449 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Implement getting content of a data message.

parent 95bb1be2
......@@ -743,6 +743,13 @@ static BOOL CDecodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
ret = CRYPT_CopyParam(pvData, pcbData, (const BYTE *)&msg->type,
sizeof(msg->type));
break;
case CMSG_CONTENT_PARAM:
if (msg->data)
ret = CRYPT_CopyParam(pvData, pcbData, msg->data->pbData,
msg->data->cbData);
else
SetLastError(CRYPT_E_INVALID_MSG_TYPE);
break;
default:
FIXME("unimplemented for parameter %d\n", dwParamType);
SetLastError(CRYPT_E_INVALID_MSG_TYPE);
......
......@@ -1208,10 +1208,14 @@ static void test_decode_msg_get_param(void)
{
HCRYPTMSG msg;
BOOL ret;
DWORD size = 0;
msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL);
SetLastError(0xdeadbeef);
ret = CryptMsgGetParam(msg, CMSG_CONTENT_PARAM, 0, NULL, &size);
ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE,
"Expected CRYPT_E_INVALID_MSG_TYPE, got %x\n", GetLastError());
ret = CryptMsgUpdate(msg, dataContent, sizeof(dataContent), TRUE);
todo_wine
check_param("data content", msg, CMSG_CONTENT_PARAM, msgData,
sizeof(msgData));
CryptMsgClose(msg);
......
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