Juan Lang : winhttp: Set cipher strength bits when querying WINHTTP_OPTION_SECURITY_FLAGS.

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


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Sep 29 10:36:00 2010 -0700

winhttp: Set cipher strength bits when querying WINHTTP_OPTION_SECURITY_FLAGS.

---

 dlls/winhttp/session.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c
index ef4ef08..5c13abd 100644
--- a/dlls/winhttp/session.c
+++ b/dlls/winhttp/session.c
@@ -580,6 +580,7 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf
     case WINHTTP_OPTION_SECURITY_FLAGS:
     {
         DWORD flags;
+        int bits;
 
         if (!buffer || *buflen < sizeof(flags))
         {
@@ -591,7 +592,13 @@ 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;
-        /* FIXME: set connection cipher strength (SECURITY_FLAG_STRENGTH_*) */
+        bits = netconn_get_cipher_strength( &request->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;
         *buflen = sizeof(flags);
         return TRUE;




More information about the wine-cvs mailing list