Commit 46a747ac authored by Dominik Charousset's avatar Dominik Charousset

Merge pull request #1310

parents 4a313dd6 50db4fe6
...@@ -25,6 +25,8 @@ is based on [Keep a Changelog](https://keepachangelog.com). ...@@ -25,6 +25,8 @@ is based on [Keep a Changelog](https://keepachangelog.com).
- Passing a response promise to a run-delayed continuation could result in a - Passing a response promise to a run-delayed continuation could result in a
heap-use-after-free if the actor terminates before the action runs. The heap-use-after-free if the actor terminates before the action runs. The
destructor of the promise now checks for this case. destructor of the promise now checks for this case.
- Fix OpenSSL 3.0 warnings when building the OpenSSL module by switching to
newer EC-curve API.
### Changed ### Changed
......
...@@ -139,8 +139,8 @@ rw_state session::do_some(int (*f)(SSL*, void*, int), size_t& result, void* buf, ...@@ -139,8 +139,8 @@ rw_state session::do_some(int (*f)(SSL*, void*, int), size_t& result, void* buf,
return handle_ssl_result(ret) ? rw_state::success : rw_state::failure; return handle_ssl_result(ret) ? rw_state::success : rw_state::failure;
} }
rw_state rw_state session::read_some(size_t& result, native_socket, void* buf,
session::read_some(size_t& result, native_socket, void* buf, size_t len) { size_t len) {
CAF_LOG_TRACE(CAF_ARG(len)); CAF_LOG_TRACE(CAF_ARG(len));
return do_some(SSL_read, result, buf, len, "read_some"); return do_some(SSL_read, result, buf, len, "read_some");
} }
...@@ -231,6 +231,7 @@ SSL_CTX* session::create_ssl_context() { ...@@ -231,6 +231,7 @@ SSL_CTX* session::create_ssl_context() {
#if defined(CAF_SSL_HAS_ECDH_AUTO) && (OPENSSL_VERSION_NUMBER < 0x10100000L) #if defined(CAF_SSL_HAS_ECDH_AUTO) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
SSL_CTX_set_ecdh_auto(ctx, 1); SSL_CTX_set_ecdh_auto(ctx, 1);
#else #else
# if OPENSSL_VERSION_NUMBER < 0x10101000L
auto ecdh = EC_KEY_new_by_curve_name(NID_secp384r1); auto ecdh = EC_KEY_new_by_curve_name(NID_secp384r1);
if (!ecdh) if (!ecdh)
CAF_RAISE_ERROR("cannot get ECDH curve"); CAF_RAISE_ERROR("cannot get ECDH curve");
...@@ -238,6 +239,9 @@ SSL_CTX* session::create_ssl_context() { ...@@ -238,6 +239,9 @@ SSL_CTX* session::create_ssl_context() {
SSL_CTX_set_tmp_ecdh(ctx, ecdh); SSL_CTX_set_tmp_ecdh(ctx, ecdh);
EC_KEY_free(ecdh); EC_KEY_free(ecdh);
CAF_POP_WARNINGS CAF_POP_WARNINGS
# else /* OPENSSL_VERSION_NUMBER < 0x10101000L */
SSL_CTX_set1_groups_list(ctx, "P-384");
# endif /* OPENSSL_VERSION_NUMBER < 0x10101000L */
#endif #endif
#ifdef CAF_SSL_HAS_SECURITY_LEVEL #ifdef CAF_SSL_HAS_SECURITY_LEVEL
const char* cipher = "AECDH-AES256-SHA@SECLEVEL=0"; const char* cipher = "AECDH-AES256-SHA@SECLEVEL=0";
...@@ -280,8 +284,8 @@ bool session::handle_ssl_result(int ret) { ...@@ -280,8 +284,8 @@ bool session::handle_ssl_result(int ret) {
} }
} }
session_ptr session_ptr make_session(actor_system& sys, native_socket fd,
make_session(actor_system& sys, native_socket fd, bool from_accepted_socket) { bool from_accepted_socket) {
session_ptr ptr{new session(sys)}; session_ptr ptr{new session(sys)};
if (!ptr->init()) if (!ptr->init())
return nullptr; return nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment