summaryrefslogtreecommitdiff
path: root/contrib/vcpkg-ports/pkcs11-helper/0001-nmake-openssl-1.1.1-support.patch
blob: d1942a988e9d0281b5fd5b9300ffb1837532c24d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
From 324026ce179468fcea348e59259dbc5456438ead Mon Sep 17 00:00:00 2001
From: Lev Stipakov <lev@openvpn.net>
Date: Fri, 14 May 2021 14:35:53 +0300
Subject: [PATCH] nmake: openssl 1.1.1 support

Starting from version 1.1.1, OpenSSL includes routines
like RSA_meth_xxx and DSA_meth_xxx. pkcs11-helper includes
implementation of those routines. That code is compiled if
they're missing from OpenSSL.

nmake build uses pre-generated config-w32-vc.h, which lacks
defines which indicate that OpenSSL includes above routines,
which causes pkcs11's own implementaion to be compiled. However,
pkcs11-helper implementation is not compatible with OpenSSL 1.1.1 -
for example, it takes size of opaque struct RSA_METHOD, which
has become internal in OpenSSL.

This adds necessary defines to config header used by nmake build
so that pkcs11-helper code, which is not compatible with OpenSSL 1.1.1,
is not compiled.

Also libeay is changed to libcrypto.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
---
 config-w32-vc.h.in  | 33 +++++++++++++++++++++++++++++++++
 lib/Makefile.w32-vc |  4 ++--
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/config-w32-vc.h b/config-w32-vc.h
index 6346f02..102b2e3 100644
--- a/config-w32-vc.h
+++ b/config-w32-vc.h
@@ -185,3 +185,36 @@
 #if _MSC_VER >= 1400
 #define HAVE_CPP_VARARG_MACRO_ISO 1
 #endif
+
+/* Define to 1 if you have the `RSA_meth_dup' function. */
+#define HAVE_RSA_METH_DUP 1
+
+/* Define to 1 if you have the `RSA_meth_free' function. */
+#define HAVE_RSA_METH_FREE 1
+
+/* Define to 1 if you have the `RSA_meth_set1_name' function. */
+#define HAVE_RSA_METH_SET1_NAME 1
+
+/* Define to 1 if you have the `RSA_meth_set_flags' function. */
+#define HAVE_RSA_METH_SET_FLAGS 1
+
+/* Define to 1 if you have the `RSA_meth_set_priv_dec' function. */
+#define HAVE_RSA_METH_SET_PRIV_DEC 1
+
+/* Define to 1 if you have the `RSA_meth_set_priv_enc' function. */
+#define HAVE_RSA_METH_SET_PRIV_ENC 1
+
+/* Define to 1 if you have the `DSA_meth_dup' function. */
+#define HAVE_DSA_METH_DUP 1
+
+/* Define to 1 if you have the `DSA_meth_free' function. */
+#define HAVE_DSA_METH_FREE 1
+
+/* Define to 1 if you have the `DSA_meth_set1_name' function. */
+#define HAVE_DSA_METH_SET1_NAME 1
+
+/* Define to 1 if you have the `DSA_meth_set_sign' function. */
+#define HAVE_DSA_METH_SET_SIGN 1
+
+/* Define to 1 if you have the `DSA_SIG_set0' function. */
+#define HAVE_DSA_SIG_SET0 1
diff --git a/lib/Makefile.w32-vc b/lib/Makefile.w32-vc
index 2edab39..b2ac746 100644
--- a/lib/Makefile.w32-vc
+++ b/lib/Makefile.w32-vc
@@ -60,9 +60,9 @@ OPENSSL_HOME = ..\..\openssl-0.9.8a
 !endif
 
 !ifdef OPENSSL
-OPENSSL_STATIC = libeay32.lib
+OPENSSL_STATIC = libcrypto.lib
 #OPENSSL_STATIC = libeay32sd.lib
-OPENSSL_DYNAMIC = libeay32.lib
+OPENSSL_DYNAMIC = libcrypto.lib
 #OPENSSL_DYNAMIC = libeay32d.lib
 
 OPENSSL_INC=$(OPENSSL_HOME)\include
-- 
2.23.0.windows.1