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
be5db33c
Commit
be5db33c
authored
Jul 24, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jul 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptnet/tests: Make the tests usable on win9x.
parent
335dec27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
9 deletions
+40
-9
cryptnet.c
dlls/cryptnet/tests/cryptnet.c
+40
-9
No files found.
dlls/cryptnet/tests/cryptnet.c
View file @
be5db33c
...
...
@@ -263,10 +263,11 @@ static void test_retrieveObjectByUrl(void)
FILETIME
ft
=
{
0
};
SetLastError
(
0xdeadbeef
);
ret
=
CryptRetrieveObjectByUrlA
(
NULL
,
NULL
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %08x
\n
"
,
GetLastError
());
ret
=
CryptRetrieveObjectByUrlA
(
NULL
,
NULL
,
0
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
E_INVALIDARG
),
"got 0x%x/%u (expected ERROR_INVALID_PARAMETER or E_INVALIDARG)
\n
"
,
GetLastError
(),
GetLastError
());
make_tmp_file
(
tmpfile
);
ptr
=
strchr
(
tmpfile
,
':'
);
...
...
@@ -305,9 +306,21 @@ static void test_retrieveObjectByUrl(void)
SetLastError
(
0xdeadbeef
);
ret
=
CryptRetrieveObjectByUrlA
(
url
,
CONTEXT_OID_CRL
,
0
,
0
,
(
void
**
)
&
crl
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_NO_MATCH
,
"Expected CRYPT_E_NO_MATCH, got %08x
\n
"
,
GetLastError
());
ok
(
crl
==
NULL
,
"Expected CRL to be NULL
\n
"
);
/* vista: ERROR_NOT_SUPPORTED, w2k3,XP, newer w2k: CRYPT_E_NO_MATCH,
95: OSS_DATA_ERROR */
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_NOT_SUPPORTED
||
GetLastError
()
==
CRYPT_E_NO_MATCH
||
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
||
GetLastError
()
==
OSS_DATA_ERROR
),
"got 0x%x/%u (expected CRYPT_E_NO_MATCH or CRYPT_E_ASN1_BADTAG or "
"OSS_DATA_ERROR)
\n
"
,
GetLastError
(),
GetLastError
());
/* only newer versions of cryptnet do the cleanup */
if
(
!
ret
&&
GetLastError
()
!=
CRYPT_E_ASN1_BADTAG
&&
GetLastError
()
!=
OSS_DATA_ERROR
)
{
ok
(
crl
==
NULL
,
"Expected CRL to be NULL
\n
"
);
}
if
(
crl
&&
crl
!=
(
PCCRL_CONTEXT
)
0xdeadbeef
)
CertFreeCRLContext
(
crl
);
store
=
(
HCERTSTORE
)
0xdeadbeef
;
...
...
@@ -328,20 +341,38 @@ static void test_retrieveObjectByUrl(void)
CertCloseStore
(
store
,
0
);
}
/* Are file URLs cached? */
cert
=
(
PCCERT_CONTEXT
)
0xdeadbeef
;
ret
=
CryptRetrieveObjectByUrlA
(
url
,
CONTEXT_OID_CERTIFICATE
,
CRYPT_CACHE_ONLY_RETRIEVAL
,
0
,
(
void
**
)
&
cert
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"CryptRetrieveObjectByUrlA failed: %08x
\n
"
,
GetLastError
());
if
(
cert
&&
cert
!=
(
PCCERT_CONTEXT
)
0xdeadbeef
)
CertFreeCertificateContext
(
cert
);
cert
=
(
PCCERT_CONTEXT
)
0xdeadbeef
;
ret
=
CryptRetrieveObjectByUrlA
(
url
,
CONTEXT_OID_CERTIFICATE
,
0
,
0
,
(
void
**
)
&
cert
,
NULL
,
NULL
,
NULL
,
&
aux
);
ok
(
ret
,
"CryptRetrieveObjectByUrlA failed: %08x
\n
"
,
GetLastError
());
/* w2k: success, 9x: fail with E_INVALIDARG */
ok
(
ret
||
(
GetLastError
()
==
E_INVALIDARG
),
"got %u with 0x%x/%u (expected '!=0' or '0' with E_INVALIDARG)
\n
"
,
ret
,
GetLastError
(),
GetLastError
());
if
(
cert
&&
cert
!=
(
PCCERT_CONTEXT
)
0xdeadbeef
)
CertFreeCertificateContext
(
cert
);
cert
=
(
PCCERT_CONTEXT
)
0xdeadbeef
;
aux
.
cbSize
=
sizeof
(
aux
);
ret
=
CryptRetrieveObjectByUrlA
(
url
,
CONTEXT_OID_CERTIFICATE
,
0
,
0
,
(
void
**
)
&
cert
,
NULL
,
NULL
,
NULL
,
&
aux
);
ok
(
ret
,
"CryptRetrieveObjectByUrlA failed: %08x
\n
"
,
GetLastError
());
/* w2k: success, 9x: fail with E_INVALIDARG */
ok
(
ret
||
(
GetLastError
()
==
E_INVALIDARG
),
"got %u with 0x%x/%u (expected '!=0' or '0' with E_INVALIDARG)
\n
"
,
ret
,
GetLastError
(),
GetLastError
());
if
(
!
ret
)
{
/* no more tests useful */
DeleteFileA
(
tmpfile
);
skip
(
"no usable CertificateContext
\n
"
);
return
;
}
aux
.
pLastSyncTime
=
&
ft
;
ret
=
CryptRetrieveObjectByUrlA
(
url
,
CONTEXT_OID_CERTIFICATE
,
0
,
0
,
(
void
**
)
&
cert
,
NULL
,
NULL
,
NULL
,
&
aux
);
...
...
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