Juan Lang : crypt32: Add tests for retrieving the content of a non-finalized (detached) message .

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jul 13 08:30:27 CDT 2007


Module: wine
Branch: master
Commit: 880507d9069365317a2b7fc7435e8907b3af911f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=880507d9069365317a2b7fc7435e8907b3af911f

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Jul 12 14:57:20 2007 -0700

crypt32: 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,




More information about the wine-cvs mailing list