aboutsummaryrefslogtreecommitdiffstats
path: root/community/softhsm/74b06622cdcf4b104349f5803adca9443dce3abb.patch
blob: 96c44de4987682ff993de134b9cf315131361176 (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
89
From e69657101cb219820d7d94d2df4e08815f83d28b Mon Sep 17 00:00:00 2001
From: Peter Wu <peter@lekensteyn.nl>
Date: Wed, 12 Dec 2018 21:47:23 +0100
Subject: [PATCH] Issue #435: Fix botan build without EDDSA

Loading libsofthsm2.so (built on Ubuntu 14.04 with botan) failed with:

    ERROR: Could not load the PKCS#11 library/module: src/lib/libsofthsm2.so: undefined symbol: _ZN17BotanEDPrivateKeyD1Ev

Fixes #435 (a regression in 2.5.0 due to commit 2751555).
---
 src/lib/crypto/BotanEDKeyPair.cpp  | 2 ++
 src/lib/crypto/BotanEDKeyPair.h    | 2 ++
 src/lib/crypto/BotanEDPrivateKey.h | 2 ++
 src/lib/crypto/BotanEDPublicKey.h  | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/src/lib/crypto/BotanEDKeyPair.cpp b/src/lib/crypto/BotanEDKeyPair.cpp
index 3be3fa5e..3e967e55 100644
--- a/src/lib/crypto/BotanEDKeyPair.cpp
+++ b/src/lib/crypto/BotanEDKeyPair.cpp
@@ -31,6 +31,7 @@
  *****************************************************************************/
 
 #include "config.h"
+#ifdef WITH_EDDSA
 #include "log.h"
 #include "BotanEDKeyPair.h"
 
@@ -67,3 +68,4 @@ const PrivateKey* BotanEDKeyPair::getConstPrivateKey() const
 {
 	return &privKey;
 }
+#endif
diff --git a/src/lib/crypto/BotanEDKeyPair.h b/src/lib/crypto/BotanEDKeyPair.h
index 02d6a4c5..4f2cffee 100644
--- a/src/lib/crypto/BotanEDKeyPair.h
+++ b/src/lib/crypto/BotanEDKeyPair.h
@@ -34,6 +34,7 @@
 #define _SOFTHSM_V2_BOTANEDKEYPAIR_H
 
 #include "config.h"
+#ifdef WITH_EDDSA
 #include "AsymmetricKeyPair.h"
 #include "BotanEDPublicKey.h"
 #include "BotanEDPrivateKey.h"
@@ -62,5 +63,6 @@ class BotanEDKeyPair : public AsymmetricKeyPair
 	// The private key
 	BotanEDPrivateKey privKey;
 };
+#endif
 #endif // !_SOFTHSM_V2_BOTANEDKEYPAIR_H
 
diff --git a/src/lib/crypto/BotanEDPrivateKey.h b/src/lib/crypto/BotanEDPrivateKey.h
index d71f6c07..ac236bb8 100644
--- a/src/lib/crypto/BotanEDPrivateKey.h
+++ b/src/lib/crypto/BotanEDPrivateKey.h
@@ -34,6 +34,7 @@
 #define _SOFTHSM_V2_BOTANEDPRIVATEKEY_H
 
 #include "config.h"
+#ifdef WITH_EDDSA
 #include "EDPrivateKey.h"
 #include <botan/pk_keys.h>
 
@@ -82,4 +83,5 @@ class BotanEDPrivateKey : public EDPrivateKey
 	// Create the Botan representation of the key
 	void createBotanKey();
 };
+#endif
 #endif // !_SOFTHSM_V2_BOTANEDPRIVATEKEY_H
diff --git a/src/lib/crypto/BotanEDPublicKey.h b/src/lib/crypto/BotanEDPublicKey.h
index fce34a5f..15e6d458 100644
--- a/src/lib/crypto/BotanEDPublicKey.h
+++ b/src/lib/crypto/BotanEDPublicKey.h
@@ -34,6 +34,7 @@
 #define _SOFTHSM_V2_BOTANEDPUBLICKEY_H
 
 #include "config.h"
+#ifdef WITH_EDDSA
 #include "EDPublicKey.h"
 #include <botan/pk_keys.h>
 
@@ -74,4 +75,5 @@ class BotanEDPublicKey : public EDPublicKey
 	// Create the Botan representation of the key
 	void createBotanKey();
 };
+#endif
 #endif // !_SOFTHSM_V2_BOTANEDPUBLICKEY_H