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
8b088357
Commit
8b088357
authored
Jan 20, 2006
by
Aric Stewart
Committed by
Alexandre Julliard
Jan 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT work.
Beginning of framework to implement handling of InternetQueryOption for INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT.
parent
1a08ae5b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
0 deletions
+89
-0
Makefile.in
dlls/wininet/Makefile.in
+1
-0
internet.c
dlls/wininet/internet.c
+36
-0
internet.h
dlls/wininet/internet.h
+1
-0
netconnection.c
dlls/wininet/netconnection.c
+51
-0
No files found.
dlls/wininet/Makefile.in
View file @
8b088357
...
...
@@ -6,6 +6,7 @@ VPATH = @srcdir@
MODULE
=
wininet.dll
IMPORTLIB
=
libwininet.
$(IMPLIBEXT)
IMPORTS
=
mpr shlwapi shell32 user32 advapi32 kernel32 ntdll
DELAYIMPORTS
=
crypt32
EXTRALIBS
=
$(LIBUNICODE)
@SOCKETLIBS@
C_SRCS
=
\
...
...
dlls/wininet/internet.c
View file @
8b088357
...
...
@@ -66,6 +66,7 @@
#include "resource.h"
#include "wine/unicode.h"
#include "wincrypt.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wininet
);
...
...
@@ -2242,6 +2243,41 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
FIXME
(
"INTERNET_OPTION_SECURITY_FLAGS: Stub
\n
"
);
break
;
case
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
:
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
;
memset
(
info
,
0
,
sizeof
(
INTERNET_CERTIFICATE_INFOW
));
info
->
ftExpiry
=
context
->
pCertInfo
->
NotAfter
;
info
->
ftStart
=
context
->
pCertInfo
->
NotBefore
;
/*
* CertNameToStr implement requred for
* lpszSubjectInfo
* lpszIssuerInfo
*
* also need to set:
* lpszProtocolName
* lpszSignatureAlgName
* lpszEncryptionAlgName
* dwKeySize
*/
CertFreeCertificateContext
(
context
);
bSuccess
=
TRUE
;
}
}
break
;
default:
FIXME
(
"Stub! %ld
\n
"
,
dwOption
);
break
;
...
...
dlls/wininet/internet.h
View file @
8b088357
...
...
@@ -480,6 +480,7 @@ BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len,
BOOL
NETCON_recv
(
WININET_NETCONNECTION
*
connection
,
void
*
buf
,
size_t
len
,
int
flags
,
int
*
recvd
/* out */
);
BOOL
NETCON_getNextLine
(
WININET_NETCONNECTION
*
connection
,
LPSTR
lpszBuffer
,
LPDWORD
dwBuffer
);
LPCVOID
NETCON_GetCert
(
WININET_NETCONNECTION
*
connection
);
extern
void
URLCacheContainers_CreateDefaults
(
void
);
extern
void
URLCacheContainers_DeleteAll
(
void
);
...
...
dlls/wininet/netconnection.c
View file @
8b088357
...
...
@@ -52,6 +52,7 @@
#include "wine/debug.h"
#include "internet.h"
#include "wincrypt.h"
#define RESPONSE_TIMEOUT 30
/* FROM internet.c */
...
...
@@ -100,6 +101,7 @@ MAKE_FUNCPTR(SSL_get_peer_certificate);
MAKE_FUNCPTR
(
SSL_CTX_get_timeout
);
MAKE_FUNCPTR
(
SSL_CTX_set_timeout
);
MAKE_FUNCPTR
(
SSL_CTX_set_default_verify_paths
);
MAKE_FUNCPTR
(
i2d_X509
);
/* OpenSSL's libcrypto functions that we use */
MAKE_FUNCPTR
(
BIO_new_fp
);
...
...
@@ -162,6 +164,7 @@ void NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
DYNSSL
(
SSL_CTX_get_timeout
);
DYNSSL
(
SSL_CTX_set_timeout
);
DYNSSL
(
SSL_CTX_set_default_verify_paths
);
DYNSSL
(
i2d_X509
);
#undef DYNSSL
#define DYNCRYPTO(x) \
...
...
@@ -658,3 +661,51 @@ BOOL NETCON_getNextLine(WININET_NETCONNECTION *connection, LPSTR lpszBuffer, LPD
#endif
}
}
LPCVOID
NETCON_GetCert
(
WININET_NETCONNECTION
*
connection
)
{
#if defined HAVE_OPENSSL_SSL_H && defined HAVE_OPENSSL_ERR_H
X509
*
cert
;
unsigned
char
*
buffer
,
*
p
;
INT
len
;
BOOL
malloced
=
FALSE
;
LPCVOID
r
=
NULL
;
if
(
!
connection
->
useSSL
)
return
NULL
;
cert
=
pSSL_get_peer_certificate
(
connection
->
ssl_s
);
p
=
NULL
;
len
=
pi2d_X509
(
cert
,
&
p
);
/*
* SSL 0.9.7 and above malloc the buffer if it is null.
* however earlier version do not and so we would need to alloc the buffer.
*
* see the i2d_X509 man page for more details.
*/
if
(
!
p
)
{
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
p
=
buffer
;
len
=
pi2d_X509
(
cert
,
&
p
);
}
else
{
buffer
=
p
;
malloced
=
TRUE
;
}
r
=
CertCreateCertificateContext
(
X509_ASN_ENCODING
,
buffer
,
len
);
if
(
malloced
)
free
(
buffer
);
else
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
return
r
;
#else
return
NULL
;
#endif
}
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