Module: wine Branch: master Commit: aa99cf8ec04801945f4c11f880f6fe64ec6c9dc8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=aa99cf8ec04801945f4c11f880...
Author: Juan Lang juan.lang@gmail.com Date: Mon Jul 9 10:56:20 2007 -0700
crypt32: Test that inner content OID is ignored for data messages.
---
dlls/crypt32/tests/msg.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 96489bc..d67767f 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -429,7 +429,6 @@ static void test_data_msg_get_param(void) ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, NULL, &size); ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %x\n", GetLastError()); - CryptMsgClose(msg); }
@@ -446,6 +445,7 @@ static void test_data_msg_encoding(void) { HCRYPTMSG msg; BOOL ret; + static char oid[] = "1.2.3";
msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL, NULL); @@ -474,6 +474,20 @@ static void test_data_msg_encoding(void) check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent, sizeof(dataContent)); CryptMsgClose(msg); + /* The inner OID is apparently ignored */ + msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, oid, + NULL); + check_param("data bogus oid bare content", msg, CMSG_BARE_CONTENT_PARAM, + dataEmptyBareContent, sizeof(dataEmptyBareContent)); + check_param("data bogus oid 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)); + check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent, + sizeof(dataContent)); + CryptMsgClose(msg); }
static void test_data_msg(void)