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
5e17fe9a
Commit
5e17fe9a
authored
Nov 02, 2010
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Nov 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: CertAddCertificateLinkToStore is not present on W98.
parent
16047ebc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
store.c
dlls/crypt32/tests/store.c
+20
-12
No files found.
dlls/crypt32/tests/store.c
View file @
5e17fe9a
...
...
@@ -102,6 +102,7 @@ static BOOL (WINAPI *pCertEnumSystemStore)(DWORD,void*,void*,PFN_CERT_ENUM_SYSTE
static
BOOL
(
WINAPI
*
pCertGetStoreProperty
)(
HCERTSTORE
,
DWORD
,
void
*
,
DWORD
*
);
static
void
(
WINAPI
*
pCertRemoveStoreFromCollection
)(
HCERTSTORE
,
HCERTSTORE
);
static
BOOL
(
WINAPI
*
pCertSetStoreProperty
)(
HCERTSTORE
,
DWORD
,
DWORD
,
const
void
*
);
static
BOOL
(
WINAPI
*
pCertAddCertificateLinkToStore
)(
HCERTSTORE
,
PCCERT_CONTEXT
,
DWORD
,
PCCERT_CONTEXT
*
);
static
void
testMemStore
(
void
)
{
...
...
@@ -633,7 +634,7 @@ static void testCollectionStore(void)
ok
(
ret
,
"CertAddEncodedCertificateToStore failed: %08x
\n
"
,
GetLastError
());
CertDeleteCertificateFromStore
(
context
);
CertAddStoreToCollection
(
collection
,
store1
,
p
CertAddStoreToCollection
(
collection
,
store1
,
CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG
,
0
);
ret
=
CertAddEncodedCertificateToStore
(
collection
,
X509_ASN_ENCODING
,
...
...
@@ -2189,26 +2190,32 @@ static void testAddCertificateLink(void)
WCHAR
filename1
[
MAX_PATH
],
filename2
[
MAX_PATH
];
HANDLE
file
;
if
(
!
pCertAddCertificateLinkToStore
)
{
win_skip
(
"CertAddCertificateLinkToStore not found
\n
"
);
return
;
}
if
(
0
)
{
/* Crashes, i.e. the store is dereferenced without checking. */
ret
=
CertAddCertificateLinkToStore
(
NULL
,
NULL
,
0
,
NULL
);
ret
=
p
CertAddCertificateLinkToStore
(
NULL
,
NULL
,
0
,
NULL
);
}
/* Adding a certificate link to a store requires a valid add disposition */
store1
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
SetLastError
(
0xdeadbeef
);
ret
=
CertAddCertificateLinkToStore
(
store1
,
NULL
,
0
,
NULL
);
ret
=
p
CertAddCertificateLinkToStore
(
store1
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
E_INVALIDARG
,
"expected E_INVALIDARG, got %08x
\n
"
,
GetLastError
());
source
=
CertCreateCertificateContext
(
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
));
SetLastError
(
0xdeadbeef
);
ret
=
CertAddCertificateLinkToStore
(
store1
,
source
,
0
,
NULL
);
ret
=
p
CertAddCertificateLinkToStore
(
store1
,
source
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
E_INVALIDARG
,
"expected E_INVALIDARG, got %08x
\n
"
,
GetLastError
());
ret
=
CertAddCertificateLinkToStore
(
store1
,
source
,
CERT_STORE_ADD_ALWAYS
,
ret
=
p
CertAddCertificateLinkToStore
(
store1
,
source
,
CERT_STORE_ADD_ALWAYS
,
NULL
);
ok
(
ret
,
"CertAddCertificateLinkToStore failed: %08x
\n
"
,
GetLastError
());
if
(
0
)
...
...
@@ -2216,14 +2223,14 @@ static void testAddCertificateLink(void)
/* Crashes, i.e. the source certificate is dereferenced without
* checking when a valid add disposition is given.
*/
ret
=
CertAddCertificateLinkToStore
(
store1
,
NULL
,
CERT_STORE_ADD_ALWAYS
,
ret
=
p
CertAddCertificateLinkToStore
(
store1
,
NULL
,
CERT_STORE_ADD_ALWAYS
,
NULL
);
}
CertCloseStore
(
store1
,
0
);
store1
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
ret
=
CertAddCertificateLinkToStore
(
store1
,
source
,
CERT_STORE_ADD_ALWAYS
,
ret
=
p
CertAddCertificateLinkToStore
(
store1
,
source
,
CERT_STORE_ADD_ALWAYS
,
&
linked
);
ok
(
ret
,
"CertAddCertificateLinkToStore failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
...
...
@@ -2295,7 +2302,7 @@ static void testAddCertificateLink(void)
/* Test adding a link to a memory store. */
store2
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
ret
=
CertAddCertificateLinkToStore
(
store2
,
source
,
CERT_STORE_ADD_ALWAYS
,
ret
=
p
CertAddCertificateLinkToStore
(
store2
,
source
,
CERT_STORE_ADD_ALWAYS
,
&
linked
);
ok
(
ret
,
"CertAddCertificateLinkToStore failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
...
...
@@ -2355,7 +2362,7 @@ static void testAddCertificateLink(void)
ok
(
store2
!=
NULL
,
"CertOpenStore failed: %08x
\n
"
,
GetLastError
());
CloseHandle
(
file
);
/* Test adding a link to a file store. */
ret
=
CertAddCertificateLinkToStore
(
store2
,
source
,
CERT_STORE_ADD_ALWAYS
,
ret
=
p
CertAddCertificateLinkToStore
(
store2
,
source
,
CERT_STORE_ADD_ALWAYS
,
&
linked
);
ok
(
ret
,
"CertAddCertificateLinkToStore failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
...
...
@@ -2397,7 +2404,7 @@ static void testAddCertificateLink(void)
source
=
CertCreateCertificateContext
(
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
));
SetLastError
(
0xdeadbeef
);
ret
=
CertAddCertificateLinkToStore
(
store1
,
source
,
CERT_STORE_ADD_ALWAYS
,
ret
=
p
CertAddCertificateLinkToStore
(
store1
,
source
,
CERT_STORE_ADD_ALWAYS
,
&
linked
);
ok
(
!
ret
&&
GetLastError
()
==
E_INVALIDARG
,
"expected E_INVALIDARG, got %08x
\n
"
,
GetLastError
());
...
...
@@ -2424,7 +2431,7 @@ static void testAddCertificateLink(void)
ok
(
store2
!=
NULL
,
"CertOpenStore failed: %08x
\n
"
,
GetLastError
());
CloseHandle
(
file
);
ret
=
CertAddCertificateLinkToStore
(
store2
,
source
,
CERT_STORE_ADD_ALWAYS
,
ret
=
p
CertAddCertificateLinkToStore
(
store2
,
source
,
CERT_STORE_ADD_ALWAYS
,
&
linked
);
ok
(
ret
,
"CertAddCertificateLinkToStore failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
...
...
@@ -2447,7 +2454,7 @@ static void testAddCertificateLink(void)
store2
=
CertOpenStore
(
CERT_STORE_PROV_SYSTEM_REGISTRY
,
0
,
0
,
CERT_SYSTEM_STORE_CURRENT_USER
,
WineTestW
);
ok
(
store2
!=
NULL
,
"CertOpenStore failed: %08x
\n
"
,
GetLastError
());
ret
=
CertAddCertificateLinkToStore
(
store2
,
source
,
CERT_STORE_ADD_ALWAYS
,
ret
=
p
CertAddCertificateLinkToStore
(
store2
,
source
,
CERT_STORE_ADD_ALWAYS
,
&
linked
);
ok
(
ret
,
"CertAddCertificateLinkToStore failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
...
...
@@ -2573,6 +2580,7 @@ START_TEST(store)
pCertGetStoreProperty
=
(
void
*
)
GetProcAddress
(
hdll
,
"CertGetStoreProperty"
);
pCertRemoveStoreFromCollection
=
(
void
*
)
GetProcAddress
(
hdll
,
"CertRemoveStoreFromCollection"
);
pCertSetStoreProperty
=
(
void
*
)
GetProcAddress
(
hdll
,
"CertSetStoreProperty"
);
pCertAddCertificateLinkToStore
=
(
void
*
)
GetProcAddress
(
hdll
,
"CertAddCertificateLinkToStore"
);
/* various combinations of CertOpenStore */
testMemStore
();
...
...
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