freeradius3: allow build without openssl engines

This applies a patch from upstream that avoids a call to ENGINE_cleanup
when the openssl library was built without engine support.

A workaround for a missing header check was used to silence a warning
about the implicit definition of RAND_load_file.  A proper fix has been
merged upstream as well.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
This commit is contained in:
Eneas U de Queiroz
2019-02-25 11:24:33 -03:00
parent b03892468a
commit f7db77282c
2 changed files with 32 additions and 1 deletions
@@ -0,0 +1,24 @@
From 0b17cf6e39064b008792811a6babf4cd75ac7744 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Mon, 25 Feb 2019 10:48:48 -0300
Subject: [PATCH] tls.c: allow build with no openssl engine support
This avoids an ENGINE_cleanup call if openssl was compiled without
engine support.
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
diff --git a/src/main/tls.c b/src/main/tls.c
index 73f0e3a3e8..9726953234 100644
--- a/src/main/tls.c
+++ b/src/main/tls.c
@@ -2743,7 +2743,9 @@ void tls_global_cleanup(void)
#elif OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
ERR_remove_thread_state(NULL);
#endif
+#ifndef OPENSSL_NO_ENGINE
ENGINE_cleanup();
+#endif
CONF_modules_unload(1);
ERR_free_strings();
EVP_cleanup();