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
5e6490a8
Commit
5e6490a8
authored
Dec 09, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptnet: Add support for base64 encoded certificates, CRLs and CTLs in CryptRetrieveObjectByUrl.
parent
7eddb864
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
5 deletions
+44
-5
cryptnet_main.c
dlls/cryptnet/cryptnet_main.c
+44
-5
No files found.
dlls/cryptnet/cryptnet_main.c
View file @
5e6490a8
...
...
@@ -1184,10 +1184,27 @@ static BOOL WINAPI CRYPT_CreateBlob(LPCSTR pszObjectOid,
typedef
BOOL
(
WINAPI
*
AddContextToStore
)(
HCERTSTORE
hCertStore
,
const
void
*
pContext
,
DWORD
dwAddDisposition
,
const
void
**
ppStoreContext
);
static
BOOL
decode_base64_blob
(
const
CRYPT_DATA_BLOB
*
in
,
CRYPT_DATA_BLOB
*
out
)
{
BOOL
ret
;
DWORD
len
=
in
->
cbData
;
while
(
len
&&
!
in
->
pbData
[
len
-
1
])
len
--
;
if
(
!
CryptStringToBinaryA
(
(
char
*
)
in
->
pbData
,
len
,
CRYPT_STRING_BASE64_ANY
,
NULL
,
&
out
->
cbData
,
NULL
,
NULL
))
return
FALSE
;
if
(
!
(
out
->
pbData
=
CryptMemAlloc
(
out
->
cbData
)))
return
FALSE
;
ret
=
CryptStringToBinaryA
(
(
char
*
)
in
->
pbData
,
len
,
CRYPT_STRING_BASE64_ANY
,
out
->
pbData
,
&
out
->
cbData
,
NULL
,
NULL
);
if
(
!
ret
)
CryptMemFree
(
out
->
pbData
);
return
ret
;
}
static
BOOL
CRYPT_CreateContext
(
const
CRYPT_BLOB_ARRAY
*
pObject
,
DWORD
dwExpectedContentTypeFlags
,
AddContextToStore
addFunc
,
void
**
ppvContext
)
{
BOOL
ret
=
TRUE
;
CRYPT_DATA_BLOB
blob
;
if
(
!
pObject
->
cBlob
)
{
...
...
@@ -1197,9 +1214,20 @@ static BOOL CRYPT_CreateContext(const CRYPT_BLOB_ARRAY *pObject,
}
else
if
(
pObject
->
cBlob
==
1
)
{
if
(
!
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
pObject
->
rgBlob
[
0
],
dwExpectedContentTypeFlags
,
CERT_QUERY_FORMAT_FLAG_BINARY
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
(
const
void
**
)
ppvContext
))
if
(
decode_base64_blob
(
&
pObject
->
rgBlob
[
0
],
&
blob
))
{
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
dwExpectedContentTypeFlags
,
CERT_QUERY_FORMAT_FLAG_BINARY
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
(
const
void
**
)
ppvContext
);
CryptMemFree
(
blob
.
pbData
);
}
else
{
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
pObject
->
rgBlob
[
0
],
dwExpectedContentTypeFlags
,
CERT_QUERY_FORMAT_FLAG_BINARY
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
(
const
void
**
)
ppvContext
);
}
if
(
!
ret
)
{
SetLastError
(
CRYPT_E_NO_MATCH
);
ret
=
FALSE
;
...
...
@@ -1217,10 +1245,21 @@ static BOOL CRYPT_CreateContext(const CRYPT_BLOB_ARRAY *pObject,
for
(
i
=
0
;
i
<
pObject
->
cBlob
;
i
++
)
{
if
(
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
if
(
decode_base64_blob
(
&
pObject
->
rgBlob
[
i
],
&
blob
))
{
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
dwExpectedContentTypeFlags
,
CERT_QUERY_FORMAT_FLAG_BINARY
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
&
context
);
CryptMemFree
(
blob
.
pbData
);
}
else
{
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
pObject
->
rgBlob
[
i
],
dwExpectedContentTypeFlags
,
CERT_QUERY_FORMAT_FLAG_BINARY
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
&
context
))
NULL
,
&
context
);
}
if
(
ret
)
{
if
(
!
addFunc
(
store
,
context
,
CERT_STORE_ADD_ALWAYS
,
NULL
))
ret
=
FALSE
;
...
...
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