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
676d5db6
Commit
676d5db6
authored
Nov 23, 2010
by
Alexander Morozov
Committed by
Alexandre Julliard
Nov 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Fix test failures on WinME and some NT4.
parent
113c6145
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
28 deletions
+47
-28
msg.c
dlls/crypt32/tests/msg.c
+47
-28
No files found.
dlls/crypt32/tests/msg.c
View file @
676d5db6
...
@@ -2159,7 +2159,9 @@ static void test_enveloped_msg_update(void)
...
@@ -2159,7 +2159,9 @@ static void test_enveloped_msg_update(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
todo_wine
todo_wine
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
||
broken
(
!
ret
&&
GetLastError
()
==
NTE_PERM
),
/* some NT4 */
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgUpdate
(
msg
,
NULL
,
0
,
TRUE
);
ret
=
CryptMsgUpdate
(
msg
,
NULL
,
0
,
TRUE
);
todo_wine
todo_wine
...
@@ -2204,7 +2206,9 @@ static void test_enveloped_msg_update(void)
...
@@ -2204,7 +2206,9 @@ static void test_enveloped_msg_update(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
todo_wine
todo_wine
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
||
broken
(
!
ret
&&
GetLastError
()
==
NTE_PERM
),
/* some NT4 */
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
CryptMsgClose
(
msg
);
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -2242,7 +2246,9 @@ static void test_enveloped_msg_update(void)
...
@@ -2242,7 +2246,9 @@ static void test_enveloped_msg_update(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
todo_wine
todo_wine
ok
(
ret
,
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
||
broken
(
!
ret
&&
GetLastError
()
==
NTE_PERM
),
/* some NT4 */
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
CryptMsgClose
(
msg
);
CryptMsgClose
(
msg
);
}
}
}
}
...
@@ -2863,7 +2869,7 @@ static void test_decode_msg_get_param(void)
...
@@ -2863,7 +2869,7 @@ static void test_decode_msg_get_param(void)
{
{
HCRYPTMSG
msg
;
HCRYPTMSG
msg
;
HCRYPTPROV
hCryptProv
;
HCRYPTPROV
hCryptProv
;
HCRYPTKEY
key
;
HCRYPTKEY
key
=
0
;
BOOL
ret
;
BOOL
ret
;
DWORD
size
=
0
,
value
;
DWORD
size
=
0
,
value
;
LPBYTE
buf
;
LPBYTE
buf
;
...
@@ -3099,27 +3105,34 @@ static void test_decode_msg_get_param(void)
...
@@ -3099,27 +3105,34 @@ static void test_decode_msg_get_param(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptImportKey
(
hCryptProv
,
publicPrivateKeyPair
,
ret
=
CryptImportKey
(
hCryptProv
,
publicPrivateKeyPair
,
sizeof
(
publicPrivateKeyPair
),
0
,
0
,
&
key
);
sizeof
(
publicPrivateKeyPair
),
0
,
0
,
&
key
);
ok
(
ret
,
"CryptImportKey failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
||
broken
(
!
ret
&&
GetLastError
()
==
NTE_PERM
),
/* WinME and some NT4 */
"CryptImportKey failed: %08x
\n
"
,
GetLastError
());
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
0
,
0
,
NULL
,
NULL
);
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
0
,
0
,
NULL
,
NULL
);
CryptMsgUpdate
(
msg
,
envelopedMessage
,
sizeof
(
envelopedMessage
),
TRUE
);
CryptMsgUpdate
(
msg
,
envelopedMessage
,
sizeof
(
envelopedMessage
),
TRUE
);
todo_wine
todo_wine
check_param
(
"enveloped message before decrypting"
,
msg
,
CMSG_CONTENT_PARAM
,
check_param
(
"enveloped message before decrypting"
,
msg
,
CMSG_CONTENT_PARAM
,
envelopedMessage
+
sizeof
(
envelopedMessage
)
-
4
,
4
);
envelopedMessage
+
sizeof
(
envelopedMessage
)
-
4
,
4
);
decryptPara
.
hCryptProv
=
hCryptProv
;
if
(
key
)
SetLastError
(
0xdeadbeef
);
{
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_DECRYPT
,
&
decryptPara
);
decryptPara
.
hCryptProv
=
hCryptProv
;
todo_wine
SetLastError
(
0xdeadbeef
);
ok
(
ret
,
"CryptMsgControl failed: %08x
\n
"
,
GetLastError
());
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_DECRYPT
,
&
decryptPara
);
decryptPara
.
hCryptProv
=
0
;
todo_wine
SetLastError
(
0xdeadbeef
);
ok
(
ret
,
"CryptMsgControl failed: %08x
\n
"
,
GetLastError
());
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_DECRYPT
,
&
decryptPara
);
decryptPara
.
hCryptProv
=
0
;
todo_wine
SetLastError
(
0xdeadbeef
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_ALREADY_DECRYPTED
,
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_DECRYPT
,
&
decryptPara
);
"expected CRYPT_E_ALREADY_DECRYPTED, got %08x
\n
"
,
GetLastError
());
todo_wine
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_ALREADY_DECRYPTED
,
check_param
(
"enveloped message"
,
msg
,
CMSG_CONTENT_PARAM
,
msgData
,
"expected CRYPT_E_ALREADY_DECRYPTED, got %08x
\n
"
,
GetLastError
());
sizeof
(
msgData
));
todo_wine
check_param
(
"enveloped message"
,
msg
,
CMSG_CONTENT_PARAM
,
msgData
,
sizeof
(
msgData
));
}
else
win_skip
(
"failed to import a key, skipping tests
\n
"
);
CryptMsgClose
(
msg
);
CryptMsgClose
(
msg
);
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_ENVELOPED
,
0
,
NULL
,
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_ENVELOPED
,
0
,
NULL
,
...
@@ -3130,17 +3143,23 @@ static void test_decode_msg_get_param(void)
...
@@ -3130,17 +3143,23 @@ static void test_decode_msg_get_param(void)
check_param
(
"enveloped bare message before decrypting"
,
msg
,
check_param
(
"enveloped bare message before decrypting"
,
msg
,
CMSG_CONTENT_PARAM
,
envelopedBareMessage
+
CMSG_CONTENT_PARAM
,
envelopedBareMessage
+
sizeof
(
envelopedBareMessage
)
-
4
,
4
);
sizeof
(
envelopedBareMessage
)
-
4
,
4
);
decryptPara
.
hCryptProv
=
hCryptProv
;
if
(
key
)
SetLastError
(
0xdeadbeef
);
{
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_DECRYPT
,
&
decryptPara
);
decryptPara
.
hCryptProv
=
hCryptProv
;
todo_wine
SetLastError
(
0xdeadbeef
);
ok
(
ret
,
"CryptMsgControl failed: %08x
\n
"
,
GetLastError
());
ret
=
CryptMsgControl
(
msg
,
0
,
CMSG_CTRL_DECRYPT
,
&
decryptPara
);
todo_wine
todo_wine
check_param
(
"enveloped bare message"
,
msg
,
CMSG_CONTENT_PARAM
,
msgData
,
ok
(
ret
,
"CryptMsgControl failed: %08x
\n
"
,
GetLastError
());
sizeof
(
msgData
));
todo_wine
check_param
(
"enveloped bare message"
,
msg
,
CMSG_CONTENT_PARAM
,
msgData
,
sizeof
(
msgData
));
}
else
win_skip
(
"failed to import a key, skipping tests
\n
"
);
CryptMsgClose
(
msg
);
CryptMsgClose
(
msg
);
CryptDestroyKey
(
key
);
if
(
key
)
CryptDestroyKey
(
key
);
CryptReleaseContext
(
hCryptProv
,
0
);
CryptReleaseContext
(
hCryptProv
,
0
);
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
0
,
0
,
NULL
,
NULL
);
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
0
,
0
,
NULL
,
NULL
);
...
...
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