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
19e63d90
Commit
19e63d90
authored
Jul 23, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Jul 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Add tests for opening non-detached signed messages, and clarify detached open.
parent
d11ddebc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
msg.c
dlls/crypt32/tests/msg.c
+24
-4
No files found.
dlls/crypt32/tests/msg.c
View file @
19e63d90
...
...
@@ -1110,10 +1110,10 @@ static void test_signed_msg_update(void)
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
CMSG_DETACHED_FLAG
,
CMSG_SIGNED
,
&
signInfo
,
NULL
,
NULL
);
ok
(
msg
!=
NULL
,
"CryptMsgOpenToEncode failed: %x
\n
"
,
GetLastError
());
/* CMSG_SIGNED allows non-final updates. */
/*
Detached
CMSG_SIGNED allows non-final updates. */
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
FALSE
);
ok
(
ret
,
"CryptMsgUpdate failed: %x
\n
"
,
GetLastError
());
/* CMSG_SIGNED also allows non-final updates with no data. */
/*
Detached
CMSG_SIGNED also allows non-final updates with no data. */
ret
=
CryptMsgUpdate
(
msg
,
NULL
,
0
,
FALSE
);
ok
(
ret
,
"CryptMsgUpdate failed: %x
\n
"
,
GetLastError
());
/* The final update requires a private key in the hCryptProv, in order to
...
...
@@ -1139,10 +1139,10 @@ static void test_signed_msg_update(void)
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
CMSG_DETACHED_FLAG
,
CMSG_SIGNED
,
&
signInfo
,
NULL
,
NULL
);
ok
(
msg
!=
NULL
,
"CryptMsgOpenToEncode failed: %x
\n
"
,
GetLastError
());
/* CMSG_SIGNED allows non-final updates. */
/*
Detached
CMSG_SIGNED allows non-final updates. */
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
FALSE
);
ok
(
ret
,
"CryptMsgUpdate failed: %x
\n
"
,
GetLastError
());
/* CMSG_SIGNED also allows non-final updates with no data. */
/*
Detached
CMSG_SIGNED also allows non-final updates with no data. */
ret
=
CryptMsgUpdate
(
msg
,
NULL
,
0
,
FALSE
);
ok
(
ret
,
"CryptMsgUpdate failed: %x
\n
"
,
GetLastError
());
/* Now that the private key exists, the final update can succeed (even
...
...
@@ -1161,6 +1161,26 @@ static void test_signed_msg_update(void)
"Expected CRYPT_E_MSG_ERROR, got %x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_SIGNED
,
&
signInfo
,
NULL
,
NULL
);
ok
(
msg
!=
NULL
,
"CryptMsgOpenToEncode failed: %x
\n
"
,
GetLastError
());
/* Non-detached messages don't allow non-final updates.. */
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
FALSE
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_MSG_ERROR
,
"Expected CRYPT_E_MSG_ERROR, got %x
\n
"
,
GetLastError
());
/* but they do allow final ones. */
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_SIGNED
,
&
signInfo
,
NULL
,
NULL
);
ok
(
msg
!=
NULL
,
"CryptMsgOpenToEncode failed: %x
\n
"
,
GetLastError
());
/* They also allow final updates with no data. */
ret
=
CryptMsgUpdate
(
msg
,
NULL
,
0
,
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
CryptDestroyKey
(
key
);
CryptReleaseContext
(
signer
.
hCryptProv
,
0
);
CryptAcquireContextW
(
&
signer
.
hCryptProv
,
cspNameW
,
NULL
,
PROV_RSA_FULL
,
...
...
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