winhttp: Support setting security flags on request handles.

Hans Leidekker hans at codeweavers.com
Fri May 14 08:36:39 CDT 2010


---
 dlls/winhttp/session.c         |   21 ++++++++++++++++++++-
 dlls/winhttp/winhttp_private.h |    1 +
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c
index 82da721..5557250 100644
--- a/dlls/winhttp/session.c
+++ b/dlls/winhttp/session.c
@@ -723,8 +723,27 @@ static BOOL request_set_option( object_header_t *hdr, DWORD option, LPVOID buffe
         return TRUE;
     }
     case WINHTTP_OPTION_SECURITY_FLAGS:
-        FIXME("WINHTTP_OPTION_SECURITY_FLAGS unimplemented (%08x)\n", *(DWORD *)buffer);
+    {
+        DWORD flags;
+
+        if (buflen < sizeof(DWORD))
+        {
+            set_last_error( ERROR_INSUFFICIENT_BUFFER );
+            return FALSE;
+        }
+        flags = *(DWORD *)buffer;
+        TRACE("0x%x\n", flags);
+        if (!(flags & (SECURITY_FLAG_IGNORE_CERT_CN_INVALID   |
+                       SECURITY_FLAG_IGNORE_CERT_DATE_INVALID |
+                       SECURITY_FLAG_IGNORE_UNKNOWN_CA        |
+                       SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE)))
+        {
+            set_last_error( ERROR_INVALID_PARAMETER );
+            return FALSE;
+        }
+        request->security_flags = flags;
         return TRUE;
+    }
     case WINHTTP_OPTION_RESOLVE_TIMEOUT:
         request->resolve_timeout = *(DWORD *)buffer;
         return TRUE;
diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h
index abf5f8a..43961fe 100644
--- a/dlls/winhttp/winhttp_private.h
+++ b/dlls/winhttp/winhttp_private.h
@@ -155,6 +155,7 @@ typedef struct
     DWORD content_read;   /* bytes read so far */
     header_t *headers;
     DWORD num_headers;
+    DWORD security_flags;
 } request_t;
 
 typedef struct _task_header_t task_header_t;
-- 
1.7.0.4






More information about the wine-patches mailing list