Skip to content

Commit 1cca273

Browse files
author
Benno Evers
committed
Fix includes as well
1 parent 445d3aa commit 1cca273

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

libcaf_openssl/src/openssl/session.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
#include "caf/openssl/session.hpp"
66

77
#include <optional>
8+
9+
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
810
#include <openssl/decoder.h>
11+
#endif
912

1013
CAF_PUSH_WARNINGS
1114
#include <openssl/err.h>
@@ -277,7 +280,7 @@ SSL_CTX* session::create_ssl_context() {
277280
SSL_CTX_set_default_passwd_cb_userdata(ctx, this);
278281
}
279282
if (auto var = pem_string_from_envvar(cfg.openssl_key)) {
280-
#if OPENSSL_VERSION_NUMBER < 0x10101000L
283+
#if OPENSSL_VERSION_NUMBER < 0x30000000L
281284
// BIO_new_mem_buf just creates a read-only view, so we don't need
282285
// to free it afterwards.
283286
kbio = BIO_new_mem_buf(var->data(), -1);
@@ -290,7 +293,7 @@ SSL_CTX* session::create_ssl_context() {
290293
if (rsa != NULL)
291294
CAF_RAISE_CAF_RAISE_ERROR("invalid private key");
292295
SSL_CTX_use_RSAPrivateKey(ctx, rsa);
293-
#else /* OPENSSL_VERSION_NUMBER < 0x10101000L */
296+
#else /* OPENSSL_VERSION_NUMBER < 0x30000000L */
294297
EVP_PKEY *pkey = nullptr;
295298
const char *format = "PEM"; // NULL for any format
296299
const char *structure = nullptr; // Any structure
@@ -311,7 +314,7 @@ SSL_CTX* session::create_ssl_context() {
311314
// Use the private key.
312315
SSL_CTX_use_PrivateKey(ctx, pkey);
313316
OSSL_DECODER_CTX_free(dctx);
314-
#endif /* OPENSSL_VERSION_NUMBER < 0x10101000L */
317+
#endif /* OPENSSL_VERSION_NUMBER < 0x30000000L */
315318
}
316319
else if (!cfg.openssl_key.empty()
317320
&& SSL_CTX_use_PrivateKey_file(ctx, cfg.openssl_key.c_str(),

0 commit comments

Comments
 (0)