Juan Lang : wininet: Set cipher strength bits when querying INTERNET_OPTION_SECURITY_FLAGS.

Alexandre Julliard julliard at winehq.org
Fri Oct 1 11:38:47 CDT 2010


Module: wine
Branch: master
Commit: 948173b7f4604a831a44fe2e8c760e98c4b1595c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=948173b7f4604a831a44fe2e8c760e98c4b1595c

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Sep 30 13:33:47 2010 -0700

wininet: Set cipher strength bits when querying INTERNET_OPTION_SECURITY_FLAGS.

---

 dlls/wininet/http.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index a15977a..98765d9 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1690,19 +1690,26 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
 
     case INTERNET_OPTION_SECURITY_FLAGS:
     {
-        http_session_t *lpwhs;
-        lpwhs = req->lpHttpSession;
+        http_session_t *lpwhs = req->lpHttpSession;
+        DWORD flags;
+        int bits;
 
         if (*size < sizeof(ULONG))
             return ERROR_INSUFFICIENT_BUFFER;
 
         *size = sizeof(DWORD);
+        flags = 0;
         if (lpwhs->hdr.dwFlags & INTERNET_FLAG_SECURE)
-            *(DWORD*)buffer = SECURITY_FLAG_SECURE;
+            flags |= SECURITY_FLAG_SECURE;
+        flags |= req->netConnection.security_flags;
+        bits = NETCON_GetCipherStrength(&req->netConnection);
+        if (bits >= 128)
+            flags |= SECURITY_FLAG_STRENGTH_STRONG;
+        else if (bits >= 56)
+            flags |= SECURITY_FLAG_STRENGTH_MEDIUM;
         else
-            *(DWORD*)buffer = 0;
-        *(DWORD *)buffer |= req->netConnection.security_flags;
-        /* FIXME: set connection cipher strength (SECURITY_FLAG_STRENGTH_*) */
+            flags |= SECURITY_FLAG_STRENGTH_WEAK;
+        *(DWORD *)buffer = flags;
         return ERROR_SUCCESS;
     }
 




More information about the wine-cvs mailing list