crypt32(19/25): Add tests for retrieving the content of a
non-finalized (detached) message
Juan Lang
juan.lang at gmail.com
Thu Jul 12 17:23:28 CDT 2007
--Juan
-------------- next part --------------
From ab84b08d813611158142b12c1f479a1ebe3fc733 Mon Sep 17 00:00:00 2001
From: Juan Lang <juanlang at juan.corp.google.com>
Date: Thu, 12 Jul 2007 14:57:20 -0700
Subject: [PATCH] Add tests for retrieving the content of a non-finalized (detached) message
---
dlls/crypt32/tests/msg.c | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index 03028e4..e1fcd7a 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -853,6 +853,15 @@ static const BYTE hashContent[] = {
0x07,0x01,0xa0,0x06,0x04,0x04,0x01,0x02,0x03,0x04,0x04,0x10,0x08,0xd6,0xc0,
0x5a,0x21,0x51,0x2a,0x79,0xa1,0xdf,0xeb,0x9d,0x2a,0x8f,0x26,0x2f };
+static const BYTE detachedHashNonFinalBareContent[] = {
+0x30,0x20,0x02,0x01,0x00,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
+0x02,0x05,0x05,0x00,0x30,0x0b,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
+0x07,0x01,0x04,0x00 };
+static const BYTE detachedHashNonFinalContent[] = {
+0x30,0x2f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x05,0xa0,0x22,
+0x30,0x20,0x02,0x01,0x00,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
+0x02,0x05,0x05,0x00,0x30,0x0b,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
+0x07,0x01,0x04,0x00 };
static const BYTE detachedHashBareContent[] = {
0x30,0x30,0x02,0x01,0x00,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x02,0x05,0x05,0x00,0x30,0x0b,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
@@ -920,9 +929,24 @@ static void test_hash_msg_encoding(void)
check_param("detached hash empty content", msg, CMSG_CONTENT_PARAM,
hashEmptyContent, sizeof(hashEmptyContent));
}
- ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
+ ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), FALSE);
ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError());
todo_wine {
+ check_param("detached hash not final bare content", msg,
+ CMSG_BARE_CONTENT_PARAM, detachedHashNonFinalBareContent,
+ sizeof(detachedHashNonFinalBareContent));
+ check_param("detached hash not final content", msg, CMSG_CONTENT_PARAM,
+ detachedHashNonFinalContent, sizeof(detachedHashNonFinalContent));
+ }
+ ret = CryptMsgUpdate(msg, NULL, 0, TRUE);
+ ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError());
+ todo_wine {
+ check_param("detached hash bare content", msg, CMSG_BARE_CONTENT_PARAM,
+ detachedHashBareContent, sizeof(detachedHashBareContent));
+ check_param("detached hash content", msg, CMSG_CONTENT_PARAM,
+ detachedHashContent, sizeof(detachedHashContent));
+ }
+ todo_wine {
check_param("detached hash bare content", msg, CMSG_BARE_CONTENT_PARAM,
detachedHashBareContent, sizeof(detachedHashBareContent));
check_param("detached hash content", msg, CMSG_CONTENT_PARAM,
--
1.4.1
More information about the wine-patches
mailing list