summaryrefslogtreecommitdiffstats
path: root/recipes-support/libp11/files/0001-Workaround-for-a-buggy-version-of-openssl-1.0.2m.patch
blob: 0538eff87fb4c4b9ff3faf61623d5b41a9e80e55 (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
From ccab5ce63dd5d3dbb4bd02998d21d34407e550f2 Mon Sep 17 00:00:00 2001
From: Anton Gerasimov <anton.gerasimov@here.com>
Date: Fri, 19 Jan 2018 12:44:27 +0100
Subject: [PATCH] Workaround for a buggy version of openssl (1.0.2m)

---
 src/p11_pkey.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/p11_pkey.c b/src/p11_pkey.c
index 45d5ad3..75625e6 100644
--- a/src/p11_pkey.c
+++ b/src/p11_pkey.c
@@ -139,8 +139,14 @@ static void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src)
 
 #endif
 
-#if OPENSSL_VERSION_NUMBER < 0x100020d0L || defined(LIBRESSL_VERSION_NUMBER)
-static void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth,
+#if OPENSSL_VERSION_NUMBER <= 0x100020e0L || defined(LIBRESSL_VERSION_NUMBER)
+
+#  if (OPENSSL_VERSION_NUMBER & 0xFFFFFFF0) == 0x100020d0L
+#    undef EVP_PKEY_meth_get_sign
+#    undef EVP_PKEY_meth_get_decrypt
+#  endif
+
+void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth,
 		int (**psign_init) (EVP_PKEY_CTX *ctx),
 		int (**psign) (EVP_PKEY_CTX *ctx,
 			unsigned char *sig, size_t *siglen,
@@ -152,7 +158,7 @@ static void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth,
 		*psign = pmeth->sign;
 }
 
-static void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth,
+void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth,
 		int (**pdecrypt_init) (EVP_PKEY_CTX *ctx),
 		int (**pdecrypt) (EVP_PKEY_CTX *ctx,
 			unsigned char *out,
-- 
2.15.1