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
110f2c2c
Commit
110f2c2c
authored
Jan 12, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Jan 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Make tests run on some Win9x boxes again.
parent
dfa66db2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
+25
-12
object.c
dlls/crypt32/tests/object.c
+25
-12
No files found.
dlls/crypt32/tests/object.c
View file @
110f2c2c
...
...
@@ -26,6 +26,9 @@
#include "wine/test.h"
static
BOOL
(
WINAPI
*
pCryptQueryObject
)(
DWORD
,
const
void
*
,
DWORD
,
DWORD
,
DWORD
,
DWORD
*
,
DWORD
*
,
DWORD
*
,
HCERTSTORE
*
,
HCRYPTMSG
*
,
const
void
**
);
static
BYTE
bigCert
[]
=
{
0x30
,
0x7a
,
0x02
,
0x01
,
0x01
,
0x30
,
0x02
,
0x06
,
0x00
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x4a
,
0x75
,
...
...
@@ -128,12 +131,12 @@ static void test_query_object(void)
/* Test the usual invalid arguments */
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
0
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
ret
=
p
CryptQueryObject
(
0
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
E_INVALIDARG
,
"expected E_INVALIDARG, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
E_INVALIDARG
,
"expected E_INVALIDARG, got %08x
\n
"
,
GetLastError
());
...
...
@@ -141,7 +144,7 @@ static void test_query_object(void)
blob
.
pbData
=
bigCert
;
blob
.
cbData
=
sizeof
(
bigCert
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_ALL
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"CryptQueryObject failed: %08x
\n
"
,
GetLastError
());
...
...
@@ -149,19 +152,19 @@ static void test_query_object(void)
blob
.
pbData
=
(
BYTE
*
)
bigCertBase64
;
blob
.
cbData
=
sizeof
(
bigCertBase64
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_ALL
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"CryptQueryObject failed: %08x
\n
"
,
GetLastError
());
/* The same base64-encoded cert, restricting the format types */
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_BINARY
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_NO_MATCH
,
"expected CRYPT_E_NO_MATCH, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"CryptQueryObject failed: %08x
\n
"
,
GetLastError
());
...
...
@@ -169,7 +172,7 @@ static void test_query_object(void)
blob
.
pbData
=
(
BYTE
*
)
bigCertBase64W
;
blob
.
cbData
=
sizeof
(
bigCertBase64W
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_ALL
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_NO_MATCH
,
...
...
@@ -182,14 +185,14 @@ static void test_query_object(void)
blob
.
pbData
=
signedWithCertWithValidPubKeyContent
;
blob
.
cbData
=
sizeof
(
signedWithCertWithValidPubKeyContent
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_ALL
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"CryptQueryObject failed: %08x
\n
"
,
GetLastError
());
blob
.
pbData
=
(
BYTE
*
)
signedWithCertWithValidPubKeyContentBase64
;
blob
.
cbData
=
sizeof
(
signedWithCertWithValidPubKeyContentBase64
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_ALL
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"CryptQueryObject failed: %08x
\n
"
,
GetLastError
());
...
...
@@ -199,18 +202,18 @@ static void test_query_object(void)
blob
.
pbData
=
(
BYTE
*
)
signedWithCertWithValidPubKeyContentBase64W
;
blob
.
cbData
=
sizeof
(
signedWithCertWithValidPubKeyContentBase64W
);
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_ALL
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"CryptQueryObject failed: %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_BINARY
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_NO_MATCH
,
"expected CRYPT_E_NO_MATCH, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
ret
=
p
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"CryptQueryObject failed: %08x
\n
"
,
GetLastError
());
...
...
@@ -218,5 +221,15 @@ static void test_query_object(void)
START_TEST
(
object
)
{
HMODULE
mod
=
GetModuleHandleA
(
"crypt32.dll"
);
pCryptQueryObject
=
(
void
*
)
GetProcAddress
(
mod
,
"CryptQueryObject"
);
if
(
!
pCryptQueryObject
)
{
win_skip
(
"CryptQueryObject is not available
\n
"
);
return
;
}
test_query_object
();
}
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