From f3dd75d8a4da66da467a6e026ec8c1a5ee8339b8 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 25 May 2012 16:35:12 +0200 Subject: [PATCH] wininet: Set SECURITY_FLAG_STRENGTH_* flags in NETCONN_secure_connect. --- dlls/wininet/http.c | 11 ++--------- dlls/wininet/netconnection.c | 9 +++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 1943e912562..50f77df20fa 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -1999,16 +1999,9 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe *size = sizeof(DWORD); flags = req->netconn ? req->netconn->security_flags : req->security_flags | req->server->security_flags; - if(req->netconn) { - int bits = NETCON_GetCipherStrength(req->netconn); - if (bits >= 128) - flags |= SECURITY_FLAG_STRENGTH_STRONG; - else if (bits >= 56) - flags |= SECURITY_FLAG_STRENGTH_MEDIUM; - else - flags |= SECURITY_FLAG_STRENGTH_WEAK; - } *(DWORD *)buffer = flags; + + TRACE("INTERNET_OPTION_SECURITY_FLAGS %x\n", flags); return ERROR_SUCCESS; } diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index ac9f347699d..66e1734549f 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -688,6 +688,7 @@ DWORD NETCON_secure_connect(netconn_t *connection) DWORD res = ERROR_NOT_SUPPORTED; #ifdef SONAME_LIBSSL void *ssl_s; + int bits; /* can't connect if we are already connected */ if (connection->ssl_s) @@ -730,7 +731,15 @@ DWORD NETCON_secure_connect(netconn_t *connection) connection->ssl_s = ssl_s; + bits = NETCON_GetCipherStrength(connection); + if (bits >= 128) + connection->security_flags |= SECURITY_FLAG_STRENGTH_STRONG; + else if (bits >= 56) + connection->security_flags |= SECURITY_FLAG_STRENGTH_MEDIUM; + else + connection->security_flags |= SECURITY_FLAG_STRENGTH_WEAK; connection->security_flags |= SECURITY_FLAG_SECURE; + connection->server->security_flags = connection->security_flags; return ERROR_SUCCESS;