From e1ee758b61a1332014ee47855f9d75645aec3ace Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 16 Mar 2022 14:43:05 +0100 Subject: [PATCH] fix warning when compiling against OpenSSL 3.0.x `ERR_func_error_string()` has been deprecated. Signed-off-by: Steffen Jaeckel --- src/tls_openssl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/tls_openssl.c b/src/tls_openssl.c index aae0a71..9fcfb91 100644 --- a/src/tls_openssl.c +++ b/src/tls_openssl.c @@ -48,6 +48,12 @@ #endif #endif +#if OPENSSL_VERSION_NUMBER < 0x30000000L +#define STROPHE_ERR_func_error_string(e) ERR_func_error_string(e) +#else +#define STROPHE_ERR_func_error_string(e) "" +#endif + #if OPENSSL_VERSION_NUMBER < 0x10100000L static const unsigned char *ASN1_STRING_get0_data(ASN1_STRING *asn1) { @@ -891,9 +897,9 @@ static void _tls_log_error(xmpp_ctx_t *ctx) do { e = ERR_get_error(); if (e != 0) { - strophe_debug(ctx, "tls", "error:%08X:%s:%s:%s", e, - ERR_lib_error_string(e), ERR_func_error_string(e), - ERR_reason_error_string(e)); + strophe_debug( + ctx, "tls", "error:%08X:%s:%s:%s", e, ERR_lib_error_string(e), + STROPHE_ERR_func_error_string(e), ERR_reason_error_string(e)); } } while (e != 0); }