diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 03028e4bdd3..e1fcd7ab2cd 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,