static CONF_SECTION *default_feature_cs; //!< Default configuration section to add features to.
static CONF_SECTION *default_version_cs; //!< Default configuration section to add features to.
+#include <freeradius-devel/tls/openssl_user_macros.h>
+
#ifdef HAVE_OPENSSL_CRYPTO_H
# include <openssl/crypto.h>
# include <openssl/opensslv.h>
*/
int ssl_check_consistency(void)
{
+#if OPENSSL_VERSION_NUMBER >= 0x10101000L
+ unsigned long ssl_linked;
+
+ ssl_linked = OpenSSL_version_num();
+#else
long ssl_linked;
ssl_linked = SSLeay();
+#endif
/*
* Major and minor versions mismatch, that's bad.
return buffer;
}
-/** Return the linked SSL version number as a string
- *
- * @return pointer to a static buffer containing the version string.
- */
-char const *ssl_version_num(void)
-{
- long ssl_linked;
-
- ssl_linked = SSLeay();
- return ssl_version_by_num((uint32_t)ssl_linked);
-}
-
/** Convert two openssl version numbers into a range string
*
* @note Not thread safe.
return buffer;
}
+# if OPENSSL_VERSION_NUMBER >= 0x10101000L
+/** Return the linked SSL version number as a string
+ *
+ * @return pointer to a static buffer containing the version string.
+ */
+char const *ssl_version_num(void)
+{
+ unsigned long ssl_linked;
+
+ ssl_linked = OpenSSL_version_num();
+ return ssl_version_by_num((uint32_t)ssl_linked);
+}
+
+/** Print the current linked version of Openssl
+ *
+ * Print the currently linked version of the OpenSSL library.
+ *
+ * @note Not thread safe.
+ * @return pointer to a static buffer containing libssl version information.
+ */
+char const *ssl_version(void)
+{
+ static char buffer[256];
+
+ unsigned long v = OpenSSL_version_num();
+
+ snprintf(buffer, sizeof(buffer), "%s 0x%.8lx (%s)",
+ OpenSSL_version(OPENSSL_VERSION), /* Not all builds include a useful version number */
+ v,
+ ssl_version_by_num(v));
+
+ return buffer;
+}
+# else
+/** Return the linked SSL version number as a string
+ *
+ * @return pointer to a static buffer containing the version string.
+ */
+char const *ssl_version_num(void)
+{
+ long ssl_linked;
+
+ ssl_linked = SSLeay();
+ return ssl_version_by_num((uint32_t)ssl_linked);
+}
+
/** Print the current linked version of Openssl
*
* Print the currently linked version of the OpenSSL library.
{
static char buffer[256];
- uint32_t v = SSLeay();
+ long v = SSLeay();
snprintf(buffer, sizeof(buffer), "%s 0x%.8x (%s)",
SSLeay_version(SSLEAY_VERSION), /* Not all builds include a useful version number */
return buffer;
}
-# else
+# endif
+#else
int ssl_check_consistency(void) {
return 0;
}
CONF_PAIR *cp;
if (DEBUG_ENABLED3) {
-#ifdef WITH_TLS
+#if defined(WITH_TLS) && (OPENSSL_VERSION_NUMBER < 0x30000000L)
ENGINE *engine;
char const *engine_id;
#endif
if (max < len) max = len;
}
-#ifdef WITH_TLS
+#if defined(WITH_TLS) && (OPENSSL_VERSION_NUMBER < 0x30000000L)
for (engine = ENGINE_get_first();
engine;
engine = ENGINE_get_next(engine)) {
talloc_free(features);
talloc_free(versions);
-#ifdef WITH_TLS
+#if defined(WITH_TLS) && (OPENSSL_VERSION_NUMBER < 0x30000000L)
DEBUG3("OpenSSL engines:");
for (engine = ENGINE_get_first();
engine;