Cumulative patch from commit 594516b4c28a94ca686b17f1e463dfd6712b75a7

594516b Use monotonic clock for relative time for eloop if available
461e3eb Fix and work around some MinGW compilation issues
81cbc04 Fix compiler warning for OpenSSL without HAVE_OCSP
68d628a hostapd: Fix interface enabling/disabling and DFS
1cba9be STA: Cancel sched_scan while initiating wps_reassoc
215a02f Add Wi-Fi Direct to the build configuration example
ca9c14f dbus_new: Add documentation for D-Bus TDLS methods
6fc4848 P2P: Short scan wait to speed up the group re-invocation
93a06fe Fix QoS Map Configure frame use

Change-Id: Id76002ca7fa742b6533e7e592ffd3867886dc50e
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index b98d662..eeaf859 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -1141,6 +1141,7 @@
 }
 
 
+#ifndef CONFIG_NATIVE_WINDOWS
 static int domain_suffix_match(const u8 *val, size_t len, const char *match)
 {
 	size_t i, match_len;
@@ -1170,10 +1171,15 @@
 	wpa_printf(MSG_DEBUG, "TLS: Reject due to incomplete label match");
 	return 0;
 }
+#endif /* CONFIG_NATIVE_WINDOWS */
 
 
 static int tls_match_suffix(X509 *cert, const char *match)
 {
+#ifdef CONFIG_NATIVE_WINDOWS
+	/* wincrypt.h has conflicting X509_NAME definition */
+	return -1;
+#else /* CONFIG_NATIVE_WINDOWS */
 	GENERAL_NAME *gen;
 	void *ext;
 	int i;
@@ -1229,6 +1235,7 @@
 
 	wpa_printf(MSG_DEBUG, "TLS: No CommonName suffix match found");
 	return 0;
+#endif /* CONFIG_NATIVE_WINDOWS */
 }
 
 
@@ -3065,7 +3072,6 @@
 {
 	int ret;
 	unsigned long err;
-	SSL_CTX *ssl_ctx = tls_ctx;
 
 	if (conn == NULL)
 		return -1;
@@ -3138,6 +3144,7 @@
 
 #ifdef HAVE_OCSP
 	if (params->flags & TLS_CONN_REQUEST_OCSP) {
+		SSL_CTX *ssl_ctx = tls_ctx;
 		SSL_set_tlsext_status_type(conn->ssl, TLSEXT_STATUSTYPE_ocsp);
 		SSL_CTX_set_tlsext_status_cb(ssl_ctx, ocsp_resp_cb);
 		SSL_CTX_set_tlsext_status_arg(ssl_ctx, conn);