winhttp: Store security_flags in request_t instead of netconn_t.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-07-13 13:00:26 +02:00 committed by Alexandre Julliard
parent 44ee3bf85a
commit c06104c62a
4 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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 );

View File

@ -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:

View File

@ -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;