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
afc7a798
Commit
afc7a798
authored
Nov 21, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Nov 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement CryptFormatObject for the Netscape string OIDs.
parent
d8f2e16c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
object.c
dlls/crypt32/object.c
+44
-0
No files found.
dlls/crypt32/object.c
View file @
afc7a798
...
...
@@ -2253,6 +2253,42 @@ static BOOL WINAPI CRYPT_FormatSpcFinancialCriteria(DWORD dwCertEncodingType,
return
ret
;
}
static
BOOL
WINAPI
CRYPT_FormatUnicodeString
(
DWORD
dwCertEncodingType
,
DWORD
dwFormatType
,
DWORD
dwFormatStrType
,
void
*
pFormatStruct
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
void
*
pbFormat
,
DWORD
*
pcbFormat
)
{
CERT_NAME_VALUE
*
value
;
DWORD
size
;
BOOL
ret
;
if
(
!
cbEncoded
)
{
SetLastError
(
E_INVALIDARG
);
return
FALSE
;
}
if
((
ret
=
CryptDecodeObjectEx
(
dwCertEncodingType
,
X509_UNICODE_ANY_STRING
,
pbEncoded
,
cbEncoded
,
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
value
,
&
size
)))
{
if
(
!
pbFormat
)
*
pcbFormat
=
value
->
Value
.
cbData
;
else
if
(
*
pcbFormat
<
value
->
Value
.
cbData
)
{
*
pcbFormat
=
value
->
Value
.
cbData
;
SetLastError
(
ERROR_MORE_DATA
);
ret
=
FALSE
;
}
else
{
LPWSTR
str
=
pbFormat
;
*
pcbFormat
=
value
->
Value
.
cbData
;
strcpyW
(
str
,
(
LPWSTR
)
value
->
Value
.
pbData
);
}
}
return
ret
;
}
typedef
BOOL
(
WINAPI
*
CryptFormatObjectFunc
)(
DWORD
,
DWORD
,
DWORD
,
void
*
,
LPCSTR
,
const
BYTE
*
,
DWORD
,
void
*
,
DWORD
*
);
...
...
@@ -2318,6 +2354,14 @@ static CryptFormatObjectFunc CRYPT_GetBuiltinFormatFunction(DWORD encodingType,
format
=
CRYPT_FormatEnhancedKeyUsage
;
else
if
(
!
strcmp
(
lpszStructType
,
szOID_NETSCAPE_CERT_TYPE
))
format
=
CRYPT_FormatNetscapeCertType
;
else
if
(
!
strcmp
(
lpszStructType
,
szOID_NETSCAPE_BASE_URL
)
||
!
strcmp
(
lpszStructType
,
szOID_NETSCAPE_REVOCATION_URL
)
||
!
strcmp
(
lpszStructType
,
szOID_NETSCAPE_CA_REVOCATION_URL
)
||
!
strcmp
(
lpszStructType
,
szOID_NETSCAPE_CERT_RENEWAL_URL
)
||
!
strcmp
(
lpszStructType
,
szOID_NETSCAPE_CA_POLICY_URL
)
||
!
strcmp
(
lpszStructType
,
szOID_NETSCAPE_SSL_SERVER_NAME
)
||
!
strcmp
(
lpszStructType
,
szOID_NETSCAPE_COMMENT
))
format
=
CRYPT_FormatUnicodeString
;
else
if
(
!
strcmp
(
lpszStructType
,
SPC_FINANCIAL_CRITERIA_OBJID
))
format
=
CRYPT_FormatSpcFinancialCriteria
;
return
format
;
...
...
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