freebsd-ports/security/softhsm2/files/patch-src_lib_crypto_OSSLCryptoFactory.cpp
Niclas Zeising fe39dad807 security/softhsm2: Fix build with non-base openSSL
PR:		233777
Submitted by:	Sergey Akhmatov
Approved by:	Jaap Akkerhuis (maintainer)
2019-07-02 20:45:36 +00:00

13 lines
476 B
C++

--- 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