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
8777a834
Commit
8777a834
authored
Dec 11, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Dec 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Support wide character base64-encoded PKCS messages in CryptQueryObject.
parent
a104479d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
object.c
dlls/crypt32/object.c
+40
-0
object.c
dlls/crypt32/tests/object.c
+0
-2
No files found.
dlls/crypt32/object.c
View file @
8777a834
...
...
@@ -517,6 +517,46 @@ static BOOL CRYPT_QueryMessageObject(DWORD dwObjectType, const void *pvObject,
else
ret
=
FALSE
;
}
if
(
!
ret
&&
!
(
blob
->
cbData
%
sizeof
(
WCHAR
)))
{
CRYPT_DATA_BLOB
decoded
;
LPWSTR
str
=
(
LPWSTR
)
blob
->
pbData
;
DWORD
strLen
=
blob
->
cbData
/
sizeof
(
WCHAR
);
/* Try again, assuming the input string is UTF-16 base64 */
while
(
strLen
&&
!
str
[
strLen
-
1
])
strLen
--
;
ret
=
CryptStringToBinaryW
(
str
,
strLen
,
CRYPT_STRING_BASE64_ANY
,
NULL
,
&
decoded
.
cbData
,
NULL
,
NULL
);
if
(
ret
)
{
decoded
.
pbData
=
CryptMemAlloc
(
decoded
.
cbData
);
if
(
decoded
.
pbData
)
{
ret
=
CryptStringToBinaryW
(
str
,
strLen
,
CRYPT_STRING_BASE64_ANY
,
decoded
.
pbData
,
&
decoded
.
cbData
,
NULL
,
NULL
);
if
(
ret
)
{
/* Try it first as a signed message */
if
(
dwExpectedContentTypeFlags
&
CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED
)
ret
=
CRYPT_QuerySignedMessage
(
&
decoded
,
pdwMsgAndCertEncodingType
,
pdwContentType
,
&
msg
);
/* Failing that, try as an unsigned message */
if
(
!
ret
&&
(
dwExpectedContentTypeFlags
&
CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED
))
ret
=
CRYPT_QueryUnsignedMessage
(
&
decoded
,
pdwMsgAndCertEncodingType
,
pdwContentType
,
&
msg
);
if
(
ret
)
formatType
=
CERT_QUERY_FORMAT_BASE64_ENCODED
;
}
CryptMemFree
(
decoded
.
pbData
);
}
else
ret
=
FALSE
;
}
}
}
if
(
ret
)
{
...
...
dlls/crypt32/tests/object.c
View file @
8777a834
...
...
@@ -202,7 +202,6 @@ static void test_query_object(void)
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_ALL
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
ret
,
"CryptQueryObject failed: %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
...
...
@@ -214,7 +213,6 @@ static void test_query_object(void)
ret
=
CryptQueryObject
(
CERT_QUERY_OBJECT_BLOB
,
&
blob
,
CERT_QUERY_CONTENT_FLAG_ALL
,
CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
ret
,
"CryptQueryObject failed: %08x
\n
"
,
GetLastError
());
}
...
...
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