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
0f57425a
Commit
0f57425a
authored
Oct 21, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Clone CRL context instead of using link in CertAddCRLContextToStore.
parent
4d97b323
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
9 deletions
+52
-9
crl.c
dlls/crypt32/crl.c
+32
-7
store.c
dlls/crypt32/store.c
+1
-1
crl.c
dlls/crypt32/tests/crl.c
+19
-1
No files found.
dlls/crypt32/crl.c
View file @
0f57425a
...
...
@@ -37,19 +37,44 @@ static void CRL_free(context_t *context)
LocalFree
(
crl
->
ctx
.
pCrlInfo
);
}
static
const
context_vtbl_t
crl_vtbl
;
static
context_t
*
CRL_clone
(
context_t
*
context
,
WINECRYPT_CERTSTORE
*
store
,
BOOL
use_link
)
{
crl_t
*
crl
;
if
(
!
use_link
)
{
FIXME
(
"Only links supported
\n
"
);
return
NULL
;
if
(
use_link
)
{
crl
=
(
crl_t
*
)
Context_CreateLinkContext
(
sizeof
(
CRL_CONTEXT
),
context
,
store
);
if
(
!
crl
)
return
NULL
;
}
else
{
const
crl_t
*
cloned
=
(
const
crl_t
*
)
context
;
void
*
new_context
;
DWORD
size
=
0
;
BOOL
res
;
new_context
=
Context_CreateDataContext
(
sizeof
(
CRL_CONTEXT
),
&
crl_vtbl
,
store
);
if
(
!
new_context
)
return
NULL
;
crl
=
crl_from_ptr
(
new_context
);
Context_CopyProperties
(
&
crl
->
ctx
,
&
cloned
->
ctx
);
crl
->
ctx
.
dwCertEncodingType
=
cloned
->
ctx
.
dwCertEncodingType
;
crl
->
ctx
.
pbCrlEncoded
=
CryptMemAlloc
(
cloned
->
ctx
.
cbCrlEncoded
);
memcpy
(
crl
->
ctx
.
pbCrlEncoded
,
cloned
->
ctx
.
pbCrlEncoded
,
cloned
->
ctx
.
cbCrlEncoded
);
crl
->
ctx
.
cbCrlEncoded
=
cloned
->
ctx
.
cbCrlEncoded
;
/* FIXME: We don't need to decode the object here, we could just clone crl info. */
res
=
CryptDecodeObjectEx
(
crl
->
ctx
.
dwCertEncodingType
,
X509_CERT_CRL_TO_BE_SIGNED
,
crl
->
ctx
.
pbCrlEncoded
,
crl
->
ctx
.
cbCrlEncoded
,
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
crl
->
ctx
.
pCrlInfo
,
&
size
);
if
(
!
res
)
{
CertFreeCRLContext
(
&
crl
->
ctx
);
return
NULL
;
}
}
crl
=
(
crl_t
*
)
Context_CreateLinkContext
(
sizeof
(
CRL_CONTEXT
),
context
,
store
);
if
(
!
crl
)
return
NULL
;
crl
->
ctx
.
hCertStore
=
store
;
return
&
crl
->
base
;
}
...
...
dlls/crypt32/store.c
View file @
0f57425a
...
...
@@ -1074,7 +1074,7 @@ BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore,
if
(
store
)
{
context_t
*
ret_context
;
ret
=
store
->
vtbl
->
crls
.
addContext
(
store
,
context_from_ptr
(
toAdd
),
existing
?
context_from_ptr
(
existing
)
:
NULL
,
ppStoreContext
?
&
ret_context
:
NULL
,
TRU
E
);
existing
?
context_from_ptr
(
existing
)
:
NULL
,
ppStoreContext
?
&
ret_context
:
NULL
,
FALS
E
);
if
(
ret
&&
ppStoreContext
)
*
ppStoreContext
=
context_ptr
(
ret_context
);
}
else
if
(
ppStoreContext
)
{
...
...
dlls/crypt32/tests/crl.c
View file @
0f57425a
...
...
@@ -144,7 +144,7 @@ static void testAddCRL(void)
{
HCERTSTORE
store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
PCCRL_CONTEXT
context
;
PCCRL_CONTEXT
context
,
context2
;
BOOL
ret
;
DWORD
GLE
;
...
...
@@ -229,6 +229,24 @@ static void testAddCRL(void)
ok
(
ret
,
"CertAddEncodedCRLToStore failed: %08x
\n
"
,
GetLastError
());
CertCloseStore
(
store
,
0
);
store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
ok
(
store
!=
NULL
,
"CertOpenStore failed
\n
"
);
context
=
CertCreateCRLContext
(
X509_ASN_ENCODING
,
CRL
,
sizeof
(
CRL
));
ok
(
context
!=
NULL
,
"CertCreateCRLContext failed
\n
"
);
ret
=
CertAddCRLContextToStore
(
store
,
context
,
CERT_STORE_ADD_NEW
,
&
context2
);
ok
(
ret
,
"CertAddCRLContextToStore failed
\n
"
);
ok
(
context2
!=
NULL
&&
context2
!=
context
,
"unexpected context2
\n
"
);
ok
(
context
->
pbCrlEncoded
!=
context2
->
pbCrlEncoded
,
"Unexpected pbCrlEncoded
\n
"
);
ok
(
context
->
cbCrlEncoded
==
context2
->
cbCrlEncoded
,
"Unexpected cbCrlEncoded
\n
"
);
ok
(
context
->
pCrlInfo
!=
context2
->
pCrlInfo
,
"Unexpected pCrlInfo
\n
"
);
CertFreeCRLContext
(
context2
);
CertFreeCRLContext
(
context
);
CertCloseStore
(
store
,
0
);
}
static
const
BYTE
v1CRLWithIssuerAndEntry
[]
=
{
0x30
,
0x44
,
0x30
,
0x02
,
0x06
,
...
...
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