Skip to content

Commit 4f7e0d8

Browse files
authored
mbedTLS fix for cURL 8.8.0 (#3398)
1 parent d365a62 commit 4f7e0d8

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

vendor/curl/lib/config-linux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@
869869
/* #undef USE_MANUAL */
870870

871871
/* if mbedTLS is enabled */
872-
/* #undef USE_MBEDTLS */
872+
#define USE_MBEDTLS 1
873873

874874
/* if msh3 is in use */
875875
/* #undef USE_MSH3 */

vendor/curl/lib/config-macos.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@
869869
/* #undef USE_MANUAL */
870870

871871
/* if mbedTLS is enabled */
872-
/* #undef USE_MBEDTLS */
872+
#define USE_MBEDTLS 1
873873

874874
/* if msh3 is in use */
875875
/* #undef USE_MSH3 */

vendor/curl/lib/vtls/mbedtls.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,6 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
902902
(struct mbed_ssl_backend_data *)connssl->backend;
903903
struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
904904
const mbedtls_x509_crt *peercert;
905-
char cipher_str[64];
906-
uint16_t cipher_id;
907905
#ifndef CURL_DISABLE_PROXY
908906
const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf)?
909907
data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]:
@@ -932,11 +930,18 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
932930
return CURLE_SSL_CONNECT_ERROR;
933931
}
934932

935-
cipher_id = (uint16_t)
936-
mbedtls_ssl_get_ciphersuite_id_from_ssl(&backend->ssl);
937-
mbed_cipher_suite_get_str(cipher_id, cipher_str, sizeof(cipher_str), true);
938-
infof(data, "mbedTLS: Handshake complete, cipher is %s", cipher_str);
939-
933+
#if MBEDTLS_VERSION_NUMBER >= 0x03020000
934+
{
935+
char cipher_str[64];
936+
uint16_t cipher_id;
937+
cipher_id = (uint16_t)
938+
mbedtls_ssl_get_ciphersuite_id_from_ssl(&backend->ssl);
939+
mbed_cipher_suite_get_str(cipher_id, cipher_str, sizeof(cipher_str), true);
940+
infof(data, "mbedTLS: Handshake complete, cipher is %s", cipher_str);
941+
}
942+
#else
943+
infof(data, "mbedTLS: Handshake complete");
944+
#endif
940945
ret = mbedtls_ssl_get_verify_result(&backend->ssl);
941946

942947
if(!conn_config->verifyhost)
@@ -1506,4 +1511,4 @@ const struct Curl_ssl Curl_ssl_mbedtls = {
15061511
mbed_send, /* send data to encrypt */
15071512
};
15081513

1509-
#endif /* USE_MBEDTLS */
1514+
#endif /* USE_MBEDTLS */

vendor/curl/premake5.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ project "curl"
3232
defines { "USE_SCHANNEL", "USE_WINDOWS_SSPI", "USE_WIN32_IDN" }
3333
links { "crypt32", "Normaliz" }
3434

35+
filter { "system:not windows" }
36+
defines { "USE_MBEDTLS" }
37+
3538
filter { "system:linux or bsd or macosx" }
3639
defines { "CURL_HIDDEN_SYMBOLS" }
3740

0 commit comments

Comments
 (0)