crypt32(17/17): Implement getting content for data messages opened
to encode
Juan Lang
juan.lang at gmail.com
Thu Jun 28 19:34:35 CDT 2007
--Juan
-------------- next part --------------
From e07624bc4da6541956d5899e9ec8c889ffdc29cb Mon Sep 17 00:00:00 2001
From: Juan Lang <juanlang at juan.corp.google.com>
Date: Thu, 28 Jun 2007 17:19:45 -0700
Subject: [PATCH] Implement getting content for data messages opened to encode
---
dlls/crypt32/msg.c | 11 ++++++++++-
dlls/crypt32/tests/msg.c | 5 -----
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index 7a57c62..bd71add 100644
--- a/dlls/crypt32/msg.c
+++ b/dlls/crypt32/msg.c
@@ -119,8 +119,17 @@ static BOOL CDataEncodeMsg_GetParam(HCRY
switch (dwParamType)
{
case CMSG_CONTENT_PARAM:
- FIXME("stub\n");
+ {
+ CRYPT_CONTENT_INFO info;
+ char rsa_data[] = "1.2.840.113549.1.7.1";
+
+ info.pszObjId = rsa_data;
+ info.Content.cbData = msg->bare_content_len;
+ info.Content.pbData = msg->bare_content;
+ ret = CryptEncodeObject(X509_ASN_ENCODING, PKCS_CONTENT_INFO, &info,
+ pvData, pcbData);
break;
+ }
case CMSG_BARE_CONTENT_PARAM:
if (!pvData)
{
diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index da534da..16ab7f6 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -384,7 +384,6 @@ static void test_data_msg_get_param(void
/* Content and bare content are always gettable */
size = 0;
ret = CryptMsgGetParam(msg, CMSG_CONTENT_PARAM, 0, NULL, &size);
- todo_wine
ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError());
size = 0;
ret = CryptMsgGetParam(msg, CMSG_BARE_CONTENT_PARAM, 0, NULL, &size);
@@ -426,14 +425,12 @@ static void test_data_msg_encoding(void)
NULL);
check_param("data empty bare content", msg, CMSG_BARE_CONTENT_PARAM,
dataEmptyBareContent, sizeof(dataEmptyBareContent));
- todo_wine
check_param("data empty content", msg, CMSG_CONTENT_PARAM, dataEmptyContent,
sizeof(dataEmptyContent));
ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError());
check_param("data bare content", msg, CMSG_BARE_CONTENT_PARAM,
dataBareContent, sizeof(dataBareContent));
- todo_wine
check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent,
sizeof(dataContent));
CryptMsgClose(msg);
@@ -442,14 +439,12 @@ static void test_data_msg_encoding(void)
CMSG_DATA, NULL, NULL, NULL);
check_param("data empty bare content", msg, CMSG_BARE_CONTENT_PARAM,
dataEmptyBareContent, sizeof(dataEmptyBareContent));
- todo_wine
check_param("data empty content", msg, CMSG_CONTENT_PARAM, dataEmptyContent,
sizeof(dataEmptyContent));
ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError());
check_param("data bare content", msg, CMSG_BARE_CONTENT_PARAM,
dataBareContent, sizeof(dataBareContent));
- todo_wine
check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent,
sizeof(dataContent));
CryptMsgClose(msg);
--
1.4.1
More information about the wine-patches
mailing list