From 81d7b12b1c536bfdee7f9d7bfb26e5ab9766b6fe Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:17:22 +0200 Subject: [PATCH] [curl] fix build (#39854) --- ports/curl/fix-mbedtls.patch | 37 ++++++++++++++++++++++++++++++++++++ ports/curl/portfile.cmake | 1 + ports/curl/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/c-/curl.json | 5 +++++ 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 ports/curl/fix-mbedtls.patch diff --git a/ports/curl/fix-mbedtls.patch b/ports/curl/fix-mbedtls.patch new file mode 100644 index 0000000000..637ddea02a --- /dev/null +++ b/ports/curl/fix-mbedtls.patch @@ -0,0 +1,37 @@ +diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c +index ec0b10dd9a9f88..98a4ea01b1830b 100644 +--- a/lib/vtls/mbedtls.c ++++ b/lib/vtls/mbedtls.c +@@ -902,8 +902,6 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) + (struct mbed_ssl_backend_data *)connssl->backend; + struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); + const mbedtls_x509_crt *peercert; +- char cipher_str[64]; +- uint16_t cipher_id; + #ifndef CURL_DISABLE_PROXY + const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf)? + data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]: +@@ -932,11 +930,18 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) + return CURLE_SSL_CONNECT_ERROR; + } + +- cipher_id = (uint16_t) +- mbedtls_ssl_get_ciphersuite_id_from_ssl(&backend->ssl); +- mbed_cipher_suite_get_str(cipher_id, cipher_str, sizeof(cipher_str), true); +- infof(data, "mbedTLS: Handshake complete, cipher is %s", cipher_str); +- ++#if MBEDTLS_VERSION_NUMBER >= 0x03020000 ++ { ++ char cipher_str[64]; ++ uint16_t cipher_id; ++ cipher_id = (uint16_t) ++ mbedtls_ssl_get_ciphersuite_id_from_ssl(&backend->ssl); ++ mbed_cipher_suite_get_str(cipher_id, cipher_str, sizeof(cipher_str), true); ++ infof(data, "mbedTLS: Handshake complete, cipher is %s", cipher_str); ++ } ++#else ++ infof(data, "mbedTLS: Handshake complete"); ++#endif + ret = mbedtls_ssl_get_verify_result(&backend->ssl); + + if(!conn_config->verifyhost) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index b60d39c818..41c7761eb0 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_from_github( export-components.patch dependencies.patch cmake-config.patch + fix-mbedtls.patch # From https://github.com/curl/curl/commit/0c4b4c1e93c8e869af230090f32346fdfd548f21 ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/curl/vcpkg.json b/ports/curl/vcpkg.json index 339bf8983d..0ac78267c9 100644 --- a/ports/curl/vcpkg.json +++ b/ports/curl/vcpkg.json @@ -1,7 +1,7 @@ { "name": "curl", "version": "8.8.0", - "port-version": 3, + "port-version": 4, "description": "A library for transferring data with URLs", "homepage": "https://curl.se/", "license": "curl AND ISC AND BSD-3-Clause", diff --git a/versions/baseline.json b/versions/baseline.json index 80e1533021..703732c3bc 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2102,7 +2102,7 @@ }, "curl": { "baseline": "8.8.0", - "port-version": 3 + "port-version": 4 }, "curlpp": { "baseline": "2018-06-15", diff --git a/versions/c-/curl.json b/versions/c-/curl.json index 3455c01f6e..1a69f58855 100644 --- a/versions/c-/curl.json +++ b/versions/c-/curl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5d79bcc154132c187557e076a5bf5e0f5736dd6a", + "version": "8.8.0", + "port-version": 4 + }, { "git-tree": "2924ae75a54112be27209863ebe3d343da7541ba", "version": "8.8.0",