From f4cfa4c86ddd6f3ac7804f3f8bbf230e5521115d Mon Sep 17 00:00:00 2001 From: sxjkl <390530071@qq.com> Date: Wed, 10 Sep 2025 11:19:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=BB=84=E8=93=9D=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5d2f6cb46cceacd31316a8f0fcfa84474b7be2da --- lib/vtls/openssl.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index ed4eefc01..93e87a569 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -30,6 +30,7 @@ #include "curl_setup.h" #if defined(USE_OPENHITLS) + #include "curl/curl.h" #include "vtls.h" #include "vtls_int.h" @@ -54,6 +55,18 @@ #define hitls_ssl_backend_data ossl_ctx +#if defined(USE_OPENHITLS) +#define CHECK_VERSION_CALL(f) \ +do { \ + if (data->set.ssl.primary.version >= CURL_SSLVERSION_TLCPv1_1 && data->set.ssl.primary.version < CURL_SSLVERSION_LAST) { \ + printf("%s:%d OPENHITLS CALL\n", __func__, __LINE__); \ + return Curl_ssl_hitls.f; \ + } \ +} while(0) +#else +#define CHECK_VERSION_CALL(f) +#endif + static int hitls_init(void) { int32_t ret = BSL_GLOBAL_Init(); @@ -5629,11 +5642,7 @@ static ssize_t ossl_recv(struct Curl_cfilter *cf, size_t buffersize, /* max amount to read */ CURLcode *curlcode) { -#if defined(USE_OPENHITLS) - if (data->set.ssl.primary.version == CURL_SSLVERSION_TLCPv1_1) { - return Curl_ssl_hitls.recv_plain(cf, data, buf, buffersize, curlcode); - } -#endif + CHECK_VERSION_CALL(recv_plain(cf, data, buf, buffersize, curlcode)); char error_buffer[256]; unsigned long sslerror; ssize_t nread; -- Gitee From 28c51cd4355425847a51b608b3a27c3c6785d727 Mon Sep 17 00:00:00 2001 From: panjie Date: Wed, 10 Sep 2025 14:36:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"=E9=BB=84=E8=93=9D=E5=90=8C?= =?UTF-8?q?=E6=AD=A5"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f4cfa4c86ddd6f3ac7804f3f8bbf230e5521115d. --- lib/vtls/openssl.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 93e87a569..ed4eefc01 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -30,7 +30,6 @@ #include "curl_setup.h" #if defined(USE_OPENHITLS) - #include "curl/curl.h" #include "vtls.h" #include "vtls_int.h" @@ -55,18 +54,6 @@ #define hitls_ssl_backend_data ossl_ctx -#if defined(USE_OPENHITLS) -#define CHECK_VERSION_CALL(f) \ -do { \ - if (data->set.ssl.primary.version >= CURL_SSLVERSION_TLCPv1_1 && data->set.ssl.primary.version < CURL_SSLVERSION_LAST) { \ - printf("%s:%d OPENHITLS CALL\n", __func__, __LINE__); \ - return Curl_ssl_hitls.f; \ - } \ -} while(0) -#else -#define CHECK_VERSION_CALL(f) -#endif - static int hitls_init(void) { int32_t ret = BSL_GLOBAL_Init(); @@ -5642,7 +5629,11 @@ static ssize_t ossl_recv(struct Curl_cfilter *cf, size_t buffersize, /* max amount to read */ CURLcode *curlcode) { - CHECK_VERSION_CALL(recv_plain(cf, data, buf, buffersize, curlcode)); +#if defined(USE_OPENHITLS) + if (data->set.ssl.primary.version == CURL_SSLVERSION_TLCPv1_1) { + return Curl_ssl_hitls.recv_plain(cf, data, buf, buffersize, curlcode); + } +#endif char error_buffer[256]; unsigned long sslerror; ssize_t nread; -- Gitee From b5362c4270a85a49f2c3816775db29344522ce8c Mon Sep 17 00:00:00 2001 From: panjie Date: Wed, 10 Sep 2025 14:39:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=BB=84=E8=93=9D=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: panjie Change-Id: I1951f9b2736ad293a20dcfd3b3745043e157b245 --- lib/vtls/openssl.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index ed4eefc01..2469640b4 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -577,6 +577,18 @@ const struct Curl_ssl Curl_ssl_hitls = { #endif /* USE_OPENHITLS */ +#if defined(USE_OPENHITLS) +#define CHECK_VERSION_CALL(f) \ +do { \ + if (data->set.ssl.primary.version >= CURL_SSLVERSION_TLCPv1_1 && data->set.ssl.primary.version < CURL_SSLVERSION_LAST) { \ + printf("%s:%d OPENHITLS CALL\n", __func__, __LINE__); \ + return Curl_ssl_hitls.f; \ + } \ +} while(0) +#else +#define CHECK_VERSION_CALL(f) +#endif + #if defined(USE_QUICHE) || defined(USE_OPENSSL) #include @@ -5629,11 +5641,7 @@ static ssize_t ossl_recv(struct Curl_cfilter *cf, size_t buffersize, /* max amount to read */ CURLcode *curlcode) { -#if defined(USE_OPENHITLS) - if (data->set.ssl.primary.version == CURL_SSLVERSION_TLCPv1_1) { - return Curl_ssl_hitls.recv_plain(cf, data, buf, buffersize, curlcode); - } -#endif + CHECK_VERSION_CALL(recv_plain(cf, data, buf, buffersize, curlcode)); char error_buffer[256]; unsigned long sslerror; ssize_t nread; -- Gitee