aboutsummaryrefslogtreecommitdiffstats
path: root/security/pkcs11-helper/files/patch-lib_pkcs11h-openssl.c
blob: 99db16701bc0d077703c75126c84acf3557c94b8 (plain) (blame)
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
--- lib/pkcs11h-openssl.c.orig	2022-04-07 17:01:01 UTC
+++ lib/pkcs11h-openssl.c
@@ -235,9 +235,13 @@ DSA_meth_free (DSA_METHOD *meth)
 static int
 DSA_meth_set1_name (DSA_METHOD *meth, const char *name)
 {
+#if (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x30500000L)
+	return 0;
+#else
 	CK_RV rv;
 	rv = _pkcs11h_mem_strdup ((void *)&meth->name, name);
 	return rv == CKR_OK ? 1 : 0;
+#endif
 }
 #endif
 
@@ -330,7 +334,7 @@ static struct {
 #endif
 } __openssl_methods;
 
-#if OPENSSL_VERSION_NUMBER < 0x10100001L
+#if OPENSSL_VERSION_NUMBER < 0x10100001L || defined(LIBRESSL_VERSION_NUMBER)
 static
 int
 __pkcs11h_openssl_ex_data_dup (
@@ -341,12 +345,22 @@ __pkcs11h_openssl_ex_data_dup (
 	long argl,
 	void *argp
 ) {
-#else
+#elif OPENSSL_VERSION_NUMBER < 0x30000000L
 int
 __pkcs11h_openssl_ex_data_dup (
 	CRYPTO_EX_DATA *to,
 	const CRYPTO_EX_DATA *from,
 	void *from_d,
+	int idx,
+	long argl,
+	void *argp
+) {
+#else
+int
+__pkcs11h_openssl_ex_data_dup (
+	CRYPTO_EX_DATA *to,
+	const CRYPTO_EX_DATA *from,
+	void **from_d,
 	int idx,
 	long argl,
 	void *argp