Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
05499a41
Commit
05499a41
authored
Sep 02, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Sep 03, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix several failing tests in win9x.
parent
12330b43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
11 deletions
+29
-11
message.c
dlls/crypt32/tests/message.c
+29
-11
No files found.
dlls/crypt32/tests/message.c
View file @
05499a41
...
@@ -59,13 +59,15 @@ static void test_msg_get_signer_count(void)
...
@@ -59,13 +59,15 @@ static void test_msg_get_signer_count(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
NULL
,
0
);
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
NULL
,
0
);
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
GetLastError
()
==
CRYPT_E_ASN1_EOD
,
ok
(
GetLastError
()
==
CRYPT_E_ASN1_EOD
||
GetLastError
()
==
OSS_BAD_ARG
,
/* win9x */
"Expected CRYPT_E_ASN1_EOD, got %08x
\n
"
,
GetLastError
());
"Expected CRYPT_E_ASN1_EOD, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
dataEmptyBareContent
,
sizeof
(
dataEmptyBareContent
));
dataEmptyBareContent
,
sizeof
(
dataEmptyBareContent
));
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
,
ok
(
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
||
GetLastError
()
==
OSS_PDU_MISMATCH
,
/* win9x */
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
...
@@ -77,11 +79,14 @@ static void test_msg_get_signer_count(void)
...
@@ -77,11 +79,14 @@ static void test_msg_get_signer_count(void)
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
signedEmptyBareContent
,
sizeof
(
signedEmptyBareContent
));
signedEmptyBareContent
,
sizeof
(
signedEmptyBareContent
));
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
,
ok
(
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
||
GetLastError
()
==
OSS_DATA_ERROR
,
/* win9x */
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
signedEmptyContent
,
sizeof
(
signedEmptyContent
));
signedEmptyContent
,
sizeof
(
signedEmptyContent
));
ok
(
count
==
1
,
"Expected 1, got %d
\n
"
,
count
);
ok
(
count
==
1
||
broken
(
count
==
-
1
),
/* win9x */
"Expected 1, got %d
\n
"
,
count
);
}
}
static
BYTE
detachedHashContent
[]
=
{
static
BYTE
detachedHashContent
[]
=
{
...
@@ -121,7 +126,9 @@ static void test_verify_detached_message_hash(void)
...
@@ -121,7 +126,9 @@ static void test_verify_detached_message_hash(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptVerifyDetachedMessageHash
(
&
para
,
NULL
,
0
,
0
,
NULL
,
NULL
,
NULL
,
ret
=
CryptVerifyDetachedMessageHash
(
&
para
,
NULL
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_ASN1_EOD
,
ok
(
!
ret
&&
(
GetLastError
()
==
CRYPT_E_ASN1_EOD
||
GetLastError
()
==
OSS_BAD_ARG
),
/* win9x */
"expected CRYPT_E_ASN1_EOD, got %08x
\n
"
,
GetLastError
());
"expected CRYPT_E_ASN1_EOD, got %08x
\n
"
,
GetLastError
());
para
.
dwMsgEncodingType
=
X509_ASN_ENCODING
;
para
.
dwMsgEncodingType
=
X509_ASN_ENCODING
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -133,7 +140,9 @@ static void test_verify_detached_message_hash(void)
...
@@ -133,7 +140,9 @@ static void test_verify_detached_message_hash(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptVerifyDetachedMessageHash
(
&
para
,
NULL
,
0
,
0
,
NULL
,
NULL
,
NULL
,
ret
=
CryptVerifyDetachedMessageHash
(
&
para
,
NULL
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_ASN1_EOD
,
ok
(
!
ret
&&
(
GetLastError
()
==
CRYPT_E_ASN1_EOD
||
GetLastError
()
==
OSS_BAD_ARG
),
/* win9x */
"expected CRYPT_E_ASN1_EOD, got %08x
\n
"
,
GetLastError
());
"expected CRYPT_E_ASN1_EOD, got %08x
\n
"
,
GetLastError
());
/* Curiously, passing no data to hash succeeds.. */
/* Curiously, passing no data to hash succeeds.. */
ret
=
CryptVerifyDetachedMessageHash
(
&
para
,
detachedHashContent
,
ret
=
CryptVerifyDetachedMessageHash
(
&
para
,
detachedHashContent
,
...
@@ -282,7 +291,9 @@ static void test_verify_message_signature(void)
...
@@ -282,7 +291,9 @@ static void test_verify_message_signature(void)
para
.
cbSize
=
sizeof
(
para
);
para
.
cbSize
=
sizeof
(
para
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_ASN1_EOD
,
ok
(
!
ret
&&
(
GetLastError
()
==
CRYPT_E_ASN1_EOD
||
GetLastError
()
==
OSS_BAD_ARG
),
/* win9x */
"Expected CRYPT_E_ASN1_EOD, got %08x
\n
"
,
GetLastError
());
"Expected CRYPT_E_ASN1_EOD, got %08x
\n
"
,
GetLastError
());
/* Check whether cert is set on error */
/* Check whether cert is set on error */
cert
=
(
PCCERT_CONTEXT
)
0xdeadbeef
;
cert
=
(
PCCERT_CONTEXT
)
0xdeadbeef
;
...
@@ -296,7 +307,8 @@ static void test_verify_message_signature(void)
...
@@ -296,7 +307,8 @@ static void test_verify_message_signature(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
dataEmptyBareContent
,
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
dataEmptyBareContent
,
sizeof
(
dataEmptyBareContent
),
NULL
,
0
,
NULL
);
sizeof
(
dataEmptyBareContent
),
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
,
ok
(
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
||
GetLastError
()
==
OSS_PDU_MISMATCH
,
/* win9x */
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
dataEmptyContent
,
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
dataEmptyContent
,
...
@@ -306,17 +318,23 @@ static void test_verify_message_signature(void)
...
@@ -306,17 +318,23 @@ static void test_verify_message_signature(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
signedEmptyBareContent
,
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
signedEmptyBareContent
,
sizeof
(
signedEmptyBareContent
),
NULL
,
0
,
NULL
);
sizeof
(
signedEmptyBareContent
),
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
,
ok
(
!
ret
&&
(
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
||
GetLastError
()
==
OSS_DATA_ERROR
),
/* win9x */
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
signedEmptyContent
,
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
signedEmptyContent
,
sizeof
(
signedEmptyContent
),
NULL
,
0
,
NULL
);
sizeof
(
signedEmptyContent
),
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_NOT_FOUND
,
ok
(
!
ret
&&
(
GetLastError
()
==
CRYPT_E_NOT_FOUND
||
GetLastError
()
==
OSS_DATA_ERROR
),
/* win9x */
"Expected CRYPT_E_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
"Expected CRYPT_E_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
signedContent
,
ret
=
CryptVerifyMessageSignature
(
&
para
,
0
,
signedContent
,
sizeof
(
signedContent
),
NULL
,
0
,
NULL
);
sizeof
(
signedContent
),
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_NOT_FOUND
,
ok
(
!
ret
&&
(
GetLastError
()
==
CRYPT_E_NOT_FOUND
||
GetLastError
()
==
OSS_DATA_ERROR
),
/* win9x */
"Expected CRYPT_E_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
"Expected CRYPT_E_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
/* FIXME: Windows fails with CRYPT_E_NOT_FOUND for these messages, but
/* FIXME: Windows fails with CRYPT_E_NOT_FOUND for these messages, but
* their signer certs have invalid public keys that fail to decode. In
* their signer certs have invalid public keys that fail to decode. In
...
...
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