Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9db120d0
Commit
9db120d0
authored
Aug 20, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Aug 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Add tests for verifying the hash of a detached hash message.
parent
fd75c21c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
msg.c
dlls/crypt32/tests/msg.c
+47
-0
No files found.
dlls/crypt32/tests/msg.c
View file @
9db120d0
...
@@ -2675,6 +2675,53 @@ static void test_msg_control(void)
...
@@ -2675,6 +2675,53 @@ static void test_msg_control(void)
"Expected CRYPT_E_INVALID_MSG_TYPE, got %08x
\n
"
,
GetLastError
());
"Expected CRYPT_E_INVALID_MSG_TYPE, got %08x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
CryptMsgClose
(
msg
);
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
CMSG_DETACHED_FLAG
,
0
,
0
,
NULL
,
NULL
);
/* Can't verify the hash of a detached message before it's been updated. */
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_VERIFY_HASH
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_INVALID_MSG_TYPE
,
"Expected CRYPT_E_INVALID_MSG_TYPE, got %08x
\n
"
,
GetLastError
());
ret
=
CryptMsgUpdate
(
msg
,
detachedHashContent
,
sizeof
(
detachedHashContent
),
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
/* Still can't verify the hash of a detached message with the content
* of the detached hash given..
*/
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_VERIFY_HASH
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_HASH_VALUE
,
"Expected CRYPT_E_HASH_VALUE, got %08x
\n
"
,
GetLastError
());
/* and giving the content of the message after attempting to verify the
* hash fails.
*/
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
NTE_BAD_HASH_STATE
,
"Expected NTE_BAD_HASH_STATE, got %08x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
/* Finally, verifying the hash of a detached message in the correct order:
* 1. Update with the detached hash message
* 2. Update with the content of the message
* 3. Verifying the hash of the message
* succeeds.
*/
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
CMSG_DETACHED_FLAG
,
0
,
0
,
NULL
,
NULL
);
ret
=
CryptMsgUpdate
(
msg
,
detachedHashContent
,
sizeof
(
detachedHashContent
),
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_VERIFY_HASH
,
NULL
);
todo_wine
ok
(
ret
,
"CryptMsgControl failed: %08x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_SIGNED
,
0
,
NULL
,
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_SIGNED
,
0
,
NULL
,
NULL
);
NULL
);
/* Can't verify the hash of a signed message */
/* Can't verify the hash of a signed message */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment