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
51eee4e7
Commit
51eee4e7
authored
Nov 22, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Nov 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptnet: Improve CryptGetObjectUrl stub for URL_OID_CERTIFICATE_ISSUER.
parent
850ea2a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
6 deletions
+98
-6
cryptnet_main.c
dlls/cryptnet/cryptnet_main.c
+98
-6
No files found.
dlls/cryptnet/cryptnet_main.c
View file @
51eee4e7
...
...
@@ -120,16 +120,108 @@ static const char *url_oid_to_str(LPCSTR oid)
typedef
BOOL
(
WINAPI
*
UrlDllGetObjectUrlFunc
)(
LPCSTR
,
LPVOID
,
DWORD
,
PCRYPT_URL_ARRAY
,
DWORD
*
,
PCRYPT_URL_INFO
,
DWORD
*
,
LPVOID
);
static
LPWSTR
name_value_to_str
(
CERT_NAME_BLOB
*
name
)
{
DWORD
len
=
CertNameToStrW
(
X509_ASN_ENCODING
,
name
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
LPWSTR
str
=
NULL
;
if
(
len
)
{
str
=
CryptMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
str
)
CertNameToStrW
(
X509_ASN_ENCODING
,
name
,
CERT_SIMPLE_NAME_STR
,
str
,
len
);
}
return
str
;
}
static
void
dump_alt_name_entry
(
CERT_ALT_NAME_ENTRY
*
entry
)
{
LPWSTR
str
;
switch
(
entry
->
dwAltNameChoice
)
{
case
CERT_ALT_NAME_OTHER_NAME
:
TRACE
(
"CERT_ALT_NAME_OTHER_NAME, oid = %s
\n
"
,
debugstr_a
(
entry
->
u
.
pOtherName
->
pszObjId
));
break
;
case
CERT_ALT_NAME_RFC822_NAME
:
TRACE
(
"CERT_ALT_NAME_RFC822_NAME: %s
\n
"
,
debugstr_w
(
entry
->
u
.
pwszRfc822Name
));
break
;
case
CERT_ALT_NAME_DNS_NAME
:
TRACE
(
"CERT_ALT_NAME_DNS_NAME: %s
\n
"
,
debugstr_w
(
entry
->
u
.
pwszDNSName
));
break
;
case
CERT_ALT_NAME_DIRECTORY_NAME
:
str
=
name_value_to_str
(
&
entry
->
u
.
DirectoryName
);
TRACE
(
"CERT_ALT_NAME_DIRECTORY_NAME: %s
\n
"
,
debugstr_w
(
str
));
CryptMemFree
(
str
);
break
;
case
CERT_ALT_NAME_URL
:
TRACE
(
"CERT_ALT_NAME_URL: %s
\n
"
,
debugstr_w
(
entry
->
u
.
pwszURL
));
break
;
case
CERT_ALT_NAME_IP_ADDRESS
:
TRACE
(
"CERT_ALT_NAME_IP_ADDRESS: %d bytes
\n
"
,
entry
->
u
.
IPAddress
.
cbData
);
break
;
case
CERT_ALT_NAME_REGISTERED_ID
:
TRACE
(
"CERT_ALT_NAME_REGISTERED_ID: %s
\n
"
,
debugstr_a
(
entry
->
u
.
pszRegisteredID
));
break
;
default:
TRACE
(
"dwAltNameChoice = %d
\n
"
,
entry
->
dwAltNameChoice
);
}
}
static
BOOL
WINAPI
CRYPT_GetUrlFromCertificateIssuer
(
LPCSTR
pszUrlOid
,
LPVOID
pvPara
,
DWORD
dwFlags
,
PCRYPT_URL_ARRAY
pUrlArray
,
DWORD
*
pcbUrlArray
,
PCRYPT_URL_INFO
pUrlInfo
,
DWORD
*
pcbUrlInfo
,
LPVOID
pvReserved
)
{
/* FIXME: This depends on the AIA (authority info access) extension being
* supported in crypt32.
*/
FIXME
(
"
\n
"
);
SetLastError
(
CRYPT_E_NOT_FOUND
);
return
FALSE
;
PCCERT_CONTEXT
cert
=
pvPara
;
PCERT_EXTENSION
ext
;
BOOL
ret
=
FALSE
;
/* The only applicable flag is CRYPT_GET_URL_FROM_EXTENSION */
if
(
dwFlags
&&
!
(
dwFlags
&
CRYPT_GET_URL_FROM_EXTENSION
))
{
SetLastError
(
CRYPT_E_NOT_FOUND
);
return
FALSE
;
}
if
((
ext
=
CertFindExtension
(
szOID_AUTHORITY_INFO_ACCESS
,
cert
->
pCertInfo
->
cExtension
,
cert
->
pCertInfo
->
rgExtension
)))
{
CERT_AUTHORITY_INFO_ACCESS
*
aia
;
DWORD
size
;
ret
=
CryptDecodeObjectEx
(
X509_ASN_ENCODING
,
X509_AUTHORITY_INFO_ACCESS
,
ext
->
Value
.
pbData
,
ext
->
Value
.
cbData
,
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
aia
,
&
size
);
if
(
ret
)
{
DWORD
i
;
TRACE
(
"%d access descriptions:
\n
"
,
aia
->
cAccDescr
);
for
(
i
=
0
;
i
<
aia
->
cAccDescr
;
i
++
)
{
if
(
!
strcmp
(
aia
->
rgAccDescr
[
i
].
pszAccessMethod
,
szOID_PKIX_OCSP
))
TRACE
(
"OCSP:
\n
"
);
else
if
(
!
strcmp
(
aia
->
rgAccDescr
[
i
].
pszAccessMethod
,
szOID_PKIX_CA_ISSUERS
))
TRACE
(
"CA issuers:
\n
"
);
dump_alt_name_entry
(
&
aia
->
rgAccDescr
[
i
].
AccessLocation
);
}
LocalFree
(
aia
);
FIXME
(
"authority info access unsupported
\n
"
);
SetLastError
(
CRYPT_E_NOT_FOUND
);
ret
=
FALSE
;
}
}
else
SetLastError
(
CRYPT_E_NOT_FOUND
);
return
ret
;
}
static
BOOL
WINAPI
CRYPT_GetUrlFromCertificateCRLDistPoint
(
LPCSTR
pszUrlOid
,
...
...
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