blob: 543c99fb2a9caa844dbd074f991235ba456acefd [file] [log] [blame]
From 8ae238f0f628c0e8823314ed4f03928659af6b4d Mon Sep 17 00:00:00 2001
From: Mattias Nissler <mnissler@chromium.org>
Date: Mon, 13 Jan 2020 12:32:03 +0100
Subject: [PATCH] [PATCH] Fixes for OpenSSL 1.1.1 build
Small fixes to fix building against OpenSSL 1.1.1:
1) Remove dso.h include as it has been removed from OpenSSL 1.1.1 and
nothing in the code references anything from this file.
2) Include rand.h for RAND_OpenSSL declaration and use it in place of
RAND_SSLeay, which is no longer present in OpenSSL 1.1.1.
---
src/hw_pkcs11.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/src/hw_pkcs11.c
+++ b/src/hw_pkcs11.c
@@ -65,7 +65,7 @@
#include <openssl/crypto.h>
#include <openssl/objects.h>
#include <openssl/engine.h>
-#include <openssl/dso.h>
+#include <openssl/rand.h>
#ifndef ENGINE_CMD_BASE
#error did not get engine.h
#endif
@@ -188,7 +188,11 @@ static int bind_helper(ENGINE * e)
#ifndef OPENSSL_NO_DH
!ENGINE_set_DH(e, DH_get_default_method()) ||
#endif
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
!ENGINE_set_RAND(e, RAND_SSLeay()) ||
+#else
+ !ENGINE_set_RAND(e, RAND_OpenSSL()) ||
+#endif
#if 0
!ENGINE_set_BN_mod_exp(e, BN_mod_exp) ||
#endif
--
2.24.1