From efcab260718f62a59f8dc7736cf38ceec2800b53 Mon Sep 17 00:00:00 2001 From: Eddy Ashton Date: Tue, 4 Feb 2025 12:32:54 +0000 Subject: [PATCH] Load OpenSSL error strings (#6800) --- src/crypto/openssl/openssl_wrappers.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/crypto/openssl/openssl_wrappers.h b/src/crypto/openssl/openssl_wrappers.h index 6cbd71c35435..8580555087d7 100644 --- a/src/crypto/openssl/openssl_wrappers.h +++ b/src/crypto/openssl/openssl_wrappers.h @@ -44,7 +44,10 @@ namespace ccf::crypto if (ec) { std::string err(256, '\0'); + ERR_load_crypto_strings(); + SSL_load_error_strings(); ERR_error_string_n((unsigned long)ec, err.data(), err.size()); + ERR_free_strings(); // Remove any trailing NULs before returning err.resize(std::strlen(err.c_str())); return err;