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
e1afe33a
Commit
e1afe33a
authored
May 23, 2006
by
Juan Lang
Committed by
Alexandre Julliard
May 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Test and fix a couple CertAddCertificateContextToStore corner cases.
parent
29a8dd47
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
store.c
dlls/crypt32/store.c
+11
-2
store.c
dlls/crypt32/tests/store.c
+22
-0
No files found.
dlls/crypt32/store.c
View file @
e1afe33a
...
...
@@ -2044,6 +2044,12 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
TRACE
(
"(%p, %p, %08lx, %p)
\n
"
,
hCertStore
,
pCertContext
,
dwAddDisposition
,
ppStoreContext
);
/* Weird case to pass a test */
if
(
dwAddDisposition
==
0
)
{
SetLastError
(
STATUS_ACCESS_VIOLATION
);
return
FALSE
;
}
if
(
dwAddDisposition
!=
CERT_STORE_ADD_ALWAYS
)
{
BYTE
hashToAdd
[
20
];
...
...
@@ -2095,8 +2101,11 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
if
(
toAdd
)
{
ret
=
store
->
certs
.
addContext
(
store
,
(
void
*
)
toAdd
,
(
void
*
)
existing
,
(
const
void
**
)
ppStoreContext
);
if
(
store
)
ret
=
store
->
certs
.
addContext
(
store
,
(
void
*
)
toAdd
,
(
void
*
)
existing
,
(
const
void
**
)
ppStoreContext
);
else
if
(
ppStoreContext
)
*
ppStoreContext
=
CertDuplicateCertificateContext
(
toAdd
);
CertFreeCertificateContext
(
toAdd
);
}
CertFreeCertificateContext
(
existing
);
...
...
dlls/crypt32/tests/store.c
View file @
e1afe33a
...
...
@@ -152,6 +152,28 @@ static void testAddCert(void)
PCCERT_CONTEXT
context
;
BOOL
ret
;
/* Weird--bad add disposition leads to an access violation in Windows.
*/
ret
=
CertAddEncodedCertificateToStore
(
0
,
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
),
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got %08lx
\n
"
,
GetLastError
());
ret
=
CertAddEncodedCertificateToStore
(
store
,
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
),
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got %08lx
\n
"
,
GetLastError
());
/* Weird--can add a cert to the NULL store (does this have special
* meaning?)
*/
context
=
NULL
;
ret
=
CertAddEncodedCertificateToStore
(
0
,
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
),
CERT_STORE_ADD_ALWAYS
,
&
context
);
ok
(
ret
,
"CertAddEncodedCertificateToStore failed: %08lx
\n
"
,
GetLastError
());
if
(
context
)
CertFreeCertificateContext
(
context
);
ret
=
CertAddEncodedCertificateToStore
(
store
,
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
),
CERT_STORE_ADD_ALWAYS
,
NULL
);
ok
(
ret
,
"CertAddEncodedCertificateToStore failed: %08lx
\n
"
,
...
...
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