Undef OCSP_REQUEST, X509_NAME and OCSP_RESPONSE

prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/mingw/include/wincrypt.h
define all as constants, but ocsp.h use them as type/function names

Change-Id: I580b55a36575c1b19df6e7f3adaf90e7c345e46f
diff --git a/crypto/ocsp/ocsp.h b/crypto/ocsp/ocsp.h
index 31e4574..f14e9f7 100644
--- a/crypto/ocsp/ocsp.h
+++ b/crypto/ocsp/ocsp.h
@@ -90,6 +90,13 @@
 #define OCSP_RESPID_KEY			0x400
 #define OCSP_NOTIME			0x800
 
+#ifdef OPENSSL_SYS_WIN32
+  /* Under Win32 these are defined in wincrypt.h */
+#undef OCSP_REQUEST
+#undef X509_NAME
+#undef OCSP_RESPONSE
+#endif
+
 /*   CertID ::= SEQUENCE {
  *       hashAlgorithm            AlgorithmIdentifier,
  *       issuerNameHash     OCTET STRING, -- Hash of Issuer's DN
diff --git a/include/openssl/ocsp.h b/include/openssl/ocsp.h
index 31e4574..f14e9f7 100644
--- a/include/openssl/ocsp.h
+++ b/include/openssl/ocsp.h
@@ -90,6 +90,13 @@
 #define OCSP_RESPID_KEY			0x400
 #define OCSP_NOTIME			0x800
 
+#ifdef OPENSSL_SYS_WIN32
+  /* Under Win32 these are defined in wincrypt.h */
+#undef OCSP_REQUEST
+#undef X509_NAME
+#undef OCSP_RESPONSE
+#endif
+
 /*   CertID ::= SEQUENCE {
  *       hashAlgorithm            AlgorithmIdentifier,
  *       issuerNameHash     OCTET STRING, -- Hash of Issuer's DN
diff --git a/openssl.config b/openssl.config
index 75d9cc9..478f823 100644
--- a/openssl.config
+++ b/openssl.config
@@ -1084,6 +1084,7 @@
 cbc_record_splitting.patch \
 dsa_nonce.patch \
 ecdhe_psk.patch \
+wincrypt.patch \
 "
 
 source ./openssl.trusty.config
diff --git a/patches/wincrypt.patch b/patches/wincrypt.patch
new file mode 100644
index 0000000..fe28901
--- /dev/null
+++ b/patches/wincrypt.patch
@@ -0,0 +1,34 @@
+From e7d931119b81d514d8f0645b5453ec16c441b3db Mon Sep 17 00:00:00 2001
+From: Andrew Hsieh <[email protected]>
+Date: Wed, 7 May 2014 20:01:28 +0800
+Subject: [PATCH] Undef OCSP_REQUEST, X509_NAME and OCSP_RESPONSE
+
+prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/mingw/include/wincrypt.h
+define all as constants, but ocsp.h use them as type/function names
+
+Change-Id: I580b55a36575c1b19df6e7f3adaf90e7c345e46f
+---
+ crypto/ocsp/ocsp.h     | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/crypto/ocsp/ocsp.h b/crypto/ocsp/ocsp.h
+index 31e4574..f14e9f7 100644
+--- a/crypto/ocsp/ocsp.h
++++ b/crypto/ocsp/ocsp.h
+@@ -90,6 +90,13 @@ extern "C" {
+ #define OCSP_RESPID_KEY			0x400
+ #define OCSP_NOTIME			0x800
+ 
++#ifdef OPENSSL_SYS_WIN32
++  /* Under Win32 these are defined in wincrypt.h */
++#undef OCSP_REQUEST
++#undef X509_NAME
++#undef OCSP_RESPONSE
++#endif
++
+ /*   CertID ::= SEQUENCE {
+  *       hashAlgorithm            AlgorithmIdentifier,
+  *       issuerNameHash     OCTET STRING, -- Hash of Issuer's DN
+-- 
+1.9.1.423.g4596e3a
+