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
7e63f953
Commit
7e63f953
authored
Mar 12, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Move InternetQueryOption(INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT) to vtbl.
parent
ce6a2289
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
82 deletions
+63
-82
http.c
dlls/wininet/http.c
+63
-0
internet.c
dlls/wininet/internet.c
+0
-82
No files found.
dlls/wininet/http.c
View file @
7e63f953
...
...
@@ -55,6 +55,7 @@
#define NO_SHLWAPI_GDI
#include "shlwapi.h"
#include "sspi.h"
#include "wincrypt.h"
#include "internet.h"
#include "wine/debug.h"
...
...
@@ -1478,6 +1479,68 @@ static DWORD HTTPREQ_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b
return
ERROR_SUCCESS
;
}
}
case
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
:
{
PCCERT_CONTEXT
context
;
if
(
*
size
<
sizeof
(
INTERNET_CERTIFICATE_INFOW
))
{
*
size
=
sizeof
(
INTERNET_CERTIFICATE_INFOW
);
return
ERROR_INSUFFICIENT_BUFFER
;
}
context
=
(
PCCERT_CONTEXT
)
NETCON_GetCert
(
&
(
req
->
netConnection
));
if
(
context
)
{
INTERNET_CERTIFICATE_INFOW
*
info
=
(
INTERNET_CERTIFICATE_INFOW
*
)
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
*/
CertFreeCertificateContext
(
context
);
return
ERROR_SUCCESS
;
}
}
}
FIXME
(
"Not implemented option %d
\n
"
,
option
);
...
...
dlls/wininet/internet.c
View file @
7e63f953
...
...
@@ -59,7 +59,6 @@
#include "winerror.h"
#define NO_SHLWAPI_STREAM
#include "shlwapi.h"
#include "wincrypt.h"
#include "wine/exception.h"
...
...
@@ -2036,87 +2035,6 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
bSuccess
=
TRUE
;
break
;
case
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
:
if
(
!
lpwhh
)
{
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
*
lpdwBufferLength
<
sizeof
(
INTERNET_CERTIFICATE_INFOW
))
{
*
lpdwBufferLength
=
sizeof
(
INTERNET_CERTIFICATE_INFOW
);
INTERNET_SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
}
else
if
(
lpwhh
->
htype
==
WH_HHTTPREQ
)
{
LPWININETHTTPREQW
lpwhr
;
PCCERT_CONTEXT
context
;
lpwhr
=
(
LPWININETHTTPREQW
)
lpwhh
;
context
=
(
PCCERT_CONTEXT
)
NETCON_GetCert
(
&
(
lpwhr
->
netConnection
));
if
(
context
)
{
LPINTERNET_CERTIFICATE_INFOW
info
=
(
LPINTERNET_CERTIFICATE_INFOW
)
lpBuffer
;
DWORD
strLen
;
memset
(
info
,
0
,
sizeof
(
INTERNET_CERTIFICATE_INFOW
));
info
->
ftExpiry
=
context
->
pCertInfo
->
NotAfter
;
info
->
ftStart
=
context
->
pCertInfo
->
NotBefore
;
if
(
bIsUnicode
)
{
strLen
=
CertNameToStrW
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
info
->
lpszSubjectInfo
=
LocalAlloc
(
0
,
strLen
*
sizeof
(
WCHAR
));
if
(
info
->
lpszSubjectInfo
)
CertNameToStrW
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
info
->
lpszSubjectInfo
,
strLen
);
strLen
=
CertNameToStrW
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
info
->
lpszIssuerInfo
=
LocalAlloc
(
0
,
strLen
*
sizeof
(
WCHAR
));
if
(
info
->
lpszIssuerInfo
)
CertNameToStrW
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
info
->
lpszIssuerInfo
,
strLen
);
}
else
{
LPINTERNET_CERTIFICATE_INFOA
infoA
=
(
LPINTERNET_CERTIFICATE_INFOA
)
info
;
strLen
=
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
infoA
->
lpszSubjectInfo
=
LocalAlloc
(
0
,
strLen
);
if
(
infoA
->
lpszSubjectInfo
)
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Subject
,
CERT_SIMPLE_NAME_STR
,
infoA
->
lpszSubjectInfo
,
strLen
);
strLen
=
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
NULL
,
0
);
infoA
->
lpszIssuerInfo
=
LocalAlloc
(
0
,
strLen
);
if
(
infoA
->
lpszIssuerInfo
)
CertNameToStrA
(
context
->
dwCertEncodingType
,
&
context
->
pCertInfo
->
Issuer
,
CERT_SIMPLE_NAME_STR
,
infoA
->
lpszIssuerInfo
,
strLen
);
}
/*
* Contrary to MSDN, these do not appear to be set.
* lpszProtocolName
* lpszSignatureAlgName
* lpszEncryptionAlgName
* dwKeySize
*/
CertFreeCertificateContext
(
context
);
bSuccess
=
TRUE
;
}
}
break
;
case
INTERNET_OPTION_VERSION
:
{
TRACE
(
"INTERNET_OPTION_VERSION
\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