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
32466b3a
Commit
32466b3a
authored
Sep 08, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Sep 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Test verifying the signature of a detached signed message.
parent
b7d26dc9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
msg.c
dlls/crypt32/tests/msg.c
+31
-0
No files found.
dlls/crypt32/tests/msg.c
View file @
32466b3a
...
...
@@ -2841,6 +2841,37 @@ static void test_msg_control(void)
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_VERIFY_SIGNATURE
,
&
certInfo
);
ok
(
ret
,
"CryptMsgControl failed: %08x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
/* Test verifying signature of a detached signed message */
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
CMSG_DETACHED_FLAG
,
0
,
0
,
NULL
,
NULL
);
ret
=
CryptMsgUpdate
(
msg
,
detachedSignedContent
,
sizeof
(
detachedSignedContent
),
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
/* Can't verify the sig without having updated the data */
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_VERIFY_SIGNATURE
,
&
certInfo
);
ok
(
!
ret
&&
GetLastError
()
==
NTE_BAD_SIGNATURE
,
"expected NTE_BAD_SIGNATURE, got %08x
\n
"
,
GetLastError
());
/* Now that the signature's been checked, can't do the final update */
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
);
/* Updating with the detached portion of the message and the data of the
* the message allows the sig to be verified.
*/
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
CMSG_DETACHED_FLAG
,
0
,
0
,
NULL
,
NULL
);
ret
=
CryptMsgUpdate
(
msg
,
detachedSignedContent
,
sizeof
(
detachedSignedContent
),
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_VERIFY_SIGNATURE
,
&
certInfo
);
ok
(
ret
,
"CryptMsgControl failed: %08x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
}
/* win9x has much less parameter checks and will crash on many tests
...
...
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