From c06104c62ac5383f0b9220bc776e735bea3c43a5 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 13 Jul 2017 13:00:26 +0200 Subject: [PATCH] winhttp: Store security_flags in request_t instead of netconn_t. Signed-off-by: Jacek Caban Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/winhttp/net.c | 4 ++-- dlls/winhttp/request.c | 2 +- dlls/winhttp/session.c | 4 ++-- dlls/winhttp/winhttp_private.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 1cabec0cb9c..8f8c42555c2 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -410,7 +410,7 @@ BOOL netconn_connect( netconn_t *conn, const struct sockaddr *sockaddr, unsigned return ret; } -BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname ) +BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname, DWORD security_flags ) { SecBuffer out_buf = {0, SECBUFFER_TOKEN, NULL}, in_bufs[2] = {{0, SECBUFFER_TOKEN}, {0, SECBUFFER_EMPTY}}; SecBufferDesc out_desc = {SECBUFFER_VERSION, 1, &out_buf}, in_desc = {SECBUFFER_VERSION, 2, in_bufs}; @@ -510,7 +510,7 @@ BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname ) status = QueryContextAttributesW(&ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (void*)&cert); if(status == SEC_E_OK) { - res = netconn_verify_cert(cert, hostname, conn->security_flags); + res = netconn_verify_cert(cert, hostname, security_flags); CertFreeCertificateContext(cert); if(res != ERROR_SUCCESS) { WARN("cert verify failed: %u\n", res); diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index bcfc7b11091..b0f83a7f7a3 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -1048,7 +1048,7 @@ static BOOL open_connection( request_t *request ) return FALSE; } } - if (!netconn_secure_connect( &request->netconn, connect->hostname )) + if (!netconn_secure_connect( &request->netconn, connect->hostname, request->security_flags )) { netconn_close( &request->netconn ); heap_free( addressW ); diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 514a56daa9f..46c98dca615 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -721,7 +721,7 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf flags = 0; if (hdr->flags & WINHTTP_FLAG_SECURE) flags |= SECURITY_FLAG_SECURE; - flags |= request->netconn.security_flags; + flags |= request->security_flags; bits = netconn_get_cipher_strength( &request->netconn ); if (bits >= 128) flags |= SECURITY_FLAG_STRENGTH_STRONG; @@ -951,7 +951,7 @@ static BOOL request_set_option( object_header_t *hdr, DWORD option, LPVOID buffe set_last_error( ERROR_INVALID_PARAMETER ); return FALSE; } - request->netconn.security_flags = flags; + request->security_flags = flags; return TRUE; } case WINHTTP_OPTION_RESOLVE_TIMEOUT: diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 46c2aaa02dd..53a9a7accfc 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -139,7 +139,6 @@ typedef struct char *peek_msg; char *peek_msg_mem; size_t peek_len; - DWORD security_flags; } netconn_t; typedef struct @@ -192,6 +191,7 @@ typedef struct void *optional; DWORD optional_len; netconn_t netconn; + DWORD security_flags; int resolve_timeout; int connect_timeout; int send_timeout; @@ -290,7 +290,7 @@ void netconn_unload( void ) DECLSPEC_HIDDEN; ULONG netconn_query_data_available( netconn_t * ) DECLSPEC_HIDDEN; BOOL netconn_recv( netconn_t *, void *, size_t, int, int * ) DECLSPEC_HIDDEN; BOOL netconn_resolve( WCHAR *, INTERNET_PORT, struct sockaddr *, socklen_t *, int ) DECLSPEC_HIDDEN; -BOOL netconn_secure_connect( netconn_t *, WCHAR * ) DECLSPEC_HIDDEN; +BOOL netconn_secure_connect( netconn_t *, WCHAR *, DWORD ) DECLSPEC_HIDDEN; BOOL netconn_send( netconn_t *, const void *, size_t, int * ) DECLSPEC_HIDDEN; DWORD netconn_set_timeout( netconn_t *, BOOL, int ) DECLSPEC_HIDDEN; const void *netconn_get_certificate( netconn_t * ) DECLSPEC_HIDDEN;