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
56ebc04a
Commit
56ebc04a
authored
Sep 30, 2010
by
Juan Lang
Committed by
Alexandre Julliard
Oct 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Returned certificate strings are always ASCII.
parent
86732e04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
48 deletions
+17
-48
http.c
dlls/wininet/http.c
+17
-44
http.c
dlls/wininet/tests/http.c
+0
-4
No files found.
dlls/wininet/http.c
View file @
56ebc04a
...
...
@@ -1820,60 +1820,33 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
case
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
:
{
PCCERT_CONTEXT
context
;
if
(
*
size
<
sizeof
(
INTERNET_CERTIFICATE_INFO
W
))
{
*
size
=
sizeof
(
INTERNET_CERTIFICATE_INFO
W
);
if
(
*
size
<
sizeof
(
INTERNET_CERTIFICATE_INFO
A
))
{
*
size
=
sizeof
(
INTERNET_CERTIFICATE_INFO
A
);
return
ERROR_INSUFFICIENT_BUFFER
;
}
context
=
(
PCCERT_CONTEXT
)
NETCON_GetCert
(
&
(
req
->
netConnection
));
if
(
context
)
{
INTERNET_CERTIFICATE_INFO
W
*
info
=
(
INTERNET_CERTIFICATE_INFOW
*
)
buffer
;
INTERNET_CERTIFICATE_INFO
A
*
info
=
(
INTERNET_CERTIFICATE_INFOA
*
)
buffer
;
DWORD
len
;
memset
(
info
,
0
,
sizeof
(
INTERNET_CERTIFICATE_INFOW
));
info
->
ftExpiry
=
context
->
pCertInfo
->
NotAfter
;
info
->
ftStart
=
context
->
pCertInfo
->
NotBefore
;
if
(
unicode
)
{
len
=
CertNameToStrW
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
info
->
lpszSubjectInfo
=
LocalAlloc
(
0
,
len
*
sizeof
(
WCHAR
));
if
(
info
->
lpszSubjectInfo
)
CertNameToStrW
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
info
->
lpszSubjectInfo
,
len
);
len
=
CertNameToStrW
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
info
->
lpszIssuerInfo
=
LocalAlloc
(
0
,
len
*
sizeof
(
WCHAR
));
if
(
info
->
lpszIssuerInfo
)
CertNameToStrW
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
info
->
lpszIssuerInfo
,
len
);
}
else
{
INTERNET_CERTIFICATE_INFOA
*
infoA
=
(
INTERNET_CERTIFICATE_INFOA
*
)
info
;
len
=
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
infoA
->
lpszSubjectInfo
=
LocalAlloc
(
0
,
len
);
if
(
infoA
->
lpszSubjectInfo
)
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
infoA
->
lpszSubjectInfo
,
len
);
len
=
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
infoA
->
lpszIssuerInfo
=
LocalAlloc
(
0
,
len
);
if
(
infoA
->
lpszIssuerInfo
)
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
infoA
->
lpszIssuerInfo
,
len
);
}
/*
* Contrary to MSDN, these do not appear to be set.
* lpszProtocolName
* lpszSignatureAlgName
* lpszEncryptionAlgName
* dwKeySize
*/
len
=
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
info
->
lpszSubjectInfo
=
LocalAlloc
(
0
,
len
);
if
(
info
->
lpszSubjectInfo
)
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
info
->
lpszSubjectInfo
,
len
);
len
=
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
info
->
lpszIssuerInfo
=
LocalAlloc
(
0
,
len
);
if
(
info
->
lpszIssuerInfo
)
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
info
->
lpszIssuerInfo
,
len
);
CertFreeCertificateContext
(
context
);
return
ERROR_SUCCESS
;
}
...
...
dlls/wininet/tests/http.c
View file @
56ebc04a
...
...
@@ -2693,11 +2693,9 @@ static void test_secure_connection(void)
ok
(
ret
,
"InternetQueryOption failed: %d
\n
"
,
GetLastError
());
if
(
ret
)
{
todo_wine
ok
(
certificate_structA
->
lpszSubjectInfo
&&
strlen
(
certificate_structA
->
lpszSubjectInfo
)
>
1
,
"expected a non-empty subject name
\n
"
);
todo_wine
ok
(
certificate_structA
->
lpszIssuerInfo
&&
strlen
(
certificate_structA
->
lpszIssuerInfo
)
>
1
,
"expected a non-empty issuer name
\n
"
);
...
...
@@ -2726,11 +2724,9 @@ static void test_secure_connection(void)
ok
(
ret
,
"InternetQueryOption failed: %d
\n
"
,
GetLastError
());
if
(
ret
)
{
todo_wine
ok
(
certificate_structA
->
lpszSubjectInfo
&&
strlen
(
certificate_structA
->
lpszSubjectInfo
)
>
1
,
"expected a non-empty subject name
\n
"
);
todo_wine
ok
(
certificate_structA
->
lpszIssuerInfo
&&
strlen
(
certificate_structA
->
lpszIssuerInfo
)
>
1
,
"expected a non-empty issuer name
\n
"
);
...
...
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