aboutsummaryrefslogtreecommitdiff
path: root/patches/windows_headers.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/windows_headers.patch')
-rw-r--r--patches/windows_headers.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/patches/windows_headers.patch b/patches/windows_headers.patch
new file mode 100644
index 0000000..f6b799c
--- /dev/null
+++ b/patches/windows_headers.patch
@@ -0,0 +1,100 @@
1diff -urN include/openssl.orig/dtls1.h include/openssl/dtls1.h
2--- include/openssl.orig/dtls1.h Mon Sep 21 21:45:45 2015
3+++ include/openssl/dtls1.h Mon Sep 21 21:58:56 2015
4@@ -60,7 +60,11 @@
5 #ifndef HEADER_DTLS1_H
6 #define HEADER_DTLS1_H
7
8+#if defined(_WIN32)
9+#include <winsock2.h>
10+#else
11 #include <sys/time.h>
12+#endif
13
14 #include <stdio.h>
15 #include <stdlib.h>
16diff -urN include/openssl.orig/opensslconf.h include/openssl/opensslconf.h
17--- include/openssl.orig/opensslconf.h Mon Sep 21 21:45:45 2015
18+++ include/openssl/opensslconf.h Mon Sep 21 21:56:13 2015
19@@ -1,6 +1,10 @@
20 #include <openssl/opensslfeatures.h>
21 /* crypto/opensslconf.h.in */
22
23+#if defined(_MSC_VER) && !defined(__attribute__)
24+#define __attribute__(a)
25+#endif
26+
27 /* Generate 80386 code? */
28 #undef I386_ONLY
29
30diff -urN include/openssl.orig/ossl_typ.h include/openssl/ossl_typ.h
31--- include/openssl.orig/ossl_typ.h Mon Sep 21 21:45:45 2015
32+++ include/openssl/ossl_typ.h Mon Sep 21 21:56:22 2015
33@@ -100,6 +100,22 @@
34 typedef struct ASN1_ITEM_st ASN1_ITEM;
35 typedef struct asn1_pctx_st ASN1_PCTX;
36
37+#if defined(_WIN32) && defined(__WINCRYPT_H__)
38+#ifndef LIBRESSL_INTERNAL
39+#ifdef _MSC_VER
40+#pragma message("Warning, overriding WinCrypt defines")
41+#else
42+#warning overriding WinCrypt defines
43+#endif
44+#endif
45+#undef X509_NAME
46+#undef X509_CERT_PAIR
47+#undef X509_EXTENSIONS
48+#undef OCSP_REQUEST
49+#undef OCSP_RESPONSE
50+#undef PKCS7_ISSUER_AND_SERIAL
51+#endif
52+
53 #ifdef BIGNUM
54 #undef BIGNUM
55 #endif
56diff -urN include/openssl.orig/pkcs7.h include/openssl/pkcs7.h
57--- include/openssl.orig/pkcs7.h Mon Sep 21 21:45:45 2015
58+++ include/openssl/pkcs7.h Mon Sep 21 21:56:29 2015
59@@ -69,6 +69,18 @@
60 extern "C" {
61 #endif
62
63+#if defined(_WIN32) && defined(__WINCRYPT_H__)
64+#ifndef LIBRESSL_INTERNAL
65+#ifdef _MSC_VER
66+#pragma message("Warning, overriding WinCrypt defines")
67+#else
68+#warning overriding WinCrypt defines
69+#endif
70+#endif
71+#undef PKCS7_ISSUER_AND_SERIAL
72+#undef PKCS7_SIGNER_INFO
73+#endif
74+
75 /*
76 Encryption_ID DES-CBC
77 Digest_ID MD5
78diff -urN include/openssl.orig/x509.h include/openssl/x509.h
79--- include/openssl.orig/x509.h Mon Sep 21 21:45:45 2015
80+++ include/openssl/x509.h Mon Sep 21 21:56:35 2015
81@@ -112,6 +112,19 @@
82 extern "C" {
83 #endif
84
85+#if defined(_WIN32)
86+#ifndef LIBRESSL_INTERNAL
87+#ifdef _MSC_VER
88+#pragma message("Warning, overriding WinCrypt defines")
89+#else
90+#warning overriding WinCrypt defines
91+#endif
92+#endif
93+#undef X509_NAME
94+#undef X509_CERT_PAIR
95+#undef X509_EXTENSIONS
96+#endif
97+
98 #define X509_FILETYPE_PEM 1
99 #define X509_FILETYPE_ASN1 2
100 #define X509_FILETYPE_DEFAULT 3