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
880133d2
Commit
880133d2
authored
Dec 13, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Dec 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Store hostname for secure connection in its SSL context.
parent
1350e9d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
internet.h
dlls/wininet/internet.h
+1
-1
netconnection.c
dlls/wininet/netconnection.c
+9
-1
No files found.
dlls/wininet/internet.h
View file @
880133d2
...
...
@@ -427,7 +427,7 @@ DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain,
DWORD
NETCON_close
(
WININET_NETCONNECTION
*
connection
);
DWORD
NETCON_connect
(
WININET_NETCONNECTION
*
connection
,
const
struct
sockaddr
*
serv_addr
,
unsigned
int
addrlen
);
DWORD
NETCON_secure_connect
(
WININET_NETCONNECTION
*
connection
,
LP
C
WSTR
hostname
);
DWORD
NETCON_secure_connect
(
WININET_NETCONNECTION
*
connection
,
LPWSTR
hostname
);
DWORD
NETCON_send
(
WININET_NETCONNECTION
*
connection
,
const
void
*
msg
,
size_t
len
,
int
flags
,
int
*
sent
/* out */
);
DWORD
NETCON_recv
(
WININET_NETCONNECTION
*
connection
,
void
*
buf
,
size_t
len
,
int
flags
,
...
...
dlls/wininet/netconnection.c
View file @
880133d2
...
...
@@ -113,6 +113,7 @@ static void *OpenSSL_crypto_handle;
static
SSL_METHOD
*
meth
;
static
SSL_CTX
*
ctx
;
static
int
hostname_idx
;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
...
...
@@ -130,6 +131,8 @@ MAKE_FUNCPTR(SSL_shutdown);
MAKE_FUNCPTR
(
SSL_write
);
MAKE_FUNCPTR
(
SSL_read
);
MAKE_FUNCPTR
(
SSL_pending
);
MAKE_FUNCPTR
(
SSL_get_ex_new_index
);
MAKE_FUNCPTR
(
SSL_set_ex_data
);
MAKE_FUNCPTR
(
SSL_get_verify_result
);
MAKE_FUNCPTR
(
SSL_get_peer_certificate
);
MAKE_FUNCPTR
(
SSL_CTX_get_timeout
);
...
...
@@ -220,6 +223,8 @@ DWORD NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
DYNSSL
(
SSL_write
);
DYNSSL
(
SSL_read
);
DYNSSL
(
SSL_pending
);
DYNSSL
(
SSL_get_ex_new_index
);
DYNSSL
(
SSL_set_ex_data
);
DYNSSL
(
SSL_get_verify_result
);
DYNSSL
(
SSL_get_peer_certificate
);
DYNSSL
(
SSL_CTX_get_timeout
);
...
...
@@ -258,6 +263,8 @@ DWORD NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
LeaveCriticalSection
(
&
init_ssl_cs
);
return
ERROR_OUTOFMEMORY
;
}
hostname_idx
=
pSSL_get_ex_new_index
(
0
,
(
void
*
)
"hostname index"
,
NULL
,
NULL
,
NULL
);
pCRYPTO_set_id_callback
(
ssl_thread_id
);
ssl_locks
=
HeapAlloc
(
GetProcessHeap
(),
0
,
...
...
@@ -435,7 +442,7 @@ static BOOL check_hostname(X509 *cert, LPCWSTR hostname)
* NETCON_secure_connect
* Initiates a secure connection over an existing plaintext connection.
*/
DWORD
NETCON_secure_connect
(
WININET_NETCONNECTION
*
connection
,
LP
C
WSTR
hostname
)
DWORD
NETCON_secure_connect
(
WININET_NETCONNECTION
*
connection
,
LPWSTR
hostname
)
{
DWORD
res
=
ERROR_NOT_SUPPORTED
;
#ifdef SONAME_LIBSSL
...
...
@@ -473,6 +480,7 @@ DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname)
res
=
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
;
goto
fail
;
}
pSSL_set_ex_data
(
connection
->
ssl_s
,
hostname_idx
,
hostname
);
cert
=
pSSL_get_peer_certificate
(
connection
->
ssl_s
);
if
(
!
cert
)
{
...
...
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