security/softhsm2: Fix build with non-base openSSL

PR:		233777
Submitted by:	Sergey Akhmatov
Approved by:	Jaap Akkerhuis (maintainer)
This commit is contained in:
Niclas Zeising
2019-07-02 20:45:36 +00:00
parent 2bc14230cf
commit fe39dad807
2 changed files with 15 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
PORTNAME= softhsm
PORTVERSION= 2.5.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://dist.opendnssec.org/source/ \
http://dist.opendnssec.org/source/testing/
@@ -48,7 +48,7 @@ MIGRATE_CONFIGURE_WITH= migrate
CRYP_BOTAN_CONFIGURE_ON= --with-crypto-backend=botan
CRYP_BOTAN_LIB_DEPENDS= libbotan-1.10.so:security/botan110
CRYP_OPEN_CONFIGURE_ON= --with-crypto-backend=openssl
CRYP_OPEN_CONFIGURE_ON= --with-crypto-backend=openssl --with-openssl=${OPENSSLBASE}
.include <bsd.port.options.mk>

View File

@@ -0,0 +1,13 @@
--- src/lib/crypto/OSSLCryptoFactory.cpp.orig 2019-07-02 17:52:44 UTC
+++ src/lib/crypto/OSSLCryptoFactory.cpp
@@ -141,8 +141,10 @@ OSSLCryptoFactory::OSSLCryptoFactory()
// Initialise OpenSSL
OpenSSL_add_all_algorithms();
+#if !( OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) )
// Make sure RDRAND is loaded first
ENGINE_load_rdrand();
+#endif
// Locate the engine
rdrand_engine = ENGINE_by_id("rdrand");
// Use RDRAND if available