]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
mbedtls: remove 'protocols' array from backend when ALPN is not used
authorMAntoniak <47522782+MAntoniak@users.noreply.github.com>
Fri, 1 Apr 2022 11:43:10 +0000 (13:43 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 1 Apr 2022 11:43:11 +0000 (13:43 +0200)
Closes #8663

lib/vtls/mbedtls.c

index 659fed4e386e3a8b9db0a4912ac23f799059cb18..c96219711aa4fc9055c03ed19d981979bed6087f 100644 (file)
 #include "curl_memory.h"
 #include "memdebug.h"
 
+/* ALPN for http2 */
+#ifdef USE_HTTP2
+#  undef HAS_ALPN
+#  ifdef MBEDTLS_SSL_ALPN
+#    define HAS_ALPN
+#  endif
+#endif
+
 struct ssl_backend_data {
   mbedtls_ctr_drbg_context ctr_drbg;
   mbedtls_entropy_context entropy;
@@ -82,7 +90,9 @@ struct ssl_backend_data {
 #endif
   mbedtls_pk_context pk;
   mbedtls_ssl_config config;
+#ifdef HAS_ALPN
   const char *protocols[3];
+#endif
 };
 
 /* apply threading? */
@@ -144,14 +154,6 @@ static void mbed_debug(void *context, int level, const char *f_name,
 #else
 #endif
 
-/* ALPN for http2 */
-#ifdef USE_HTTP2
-#  undef HAS_ALPN
-#  ifdef MBEDTLS_SSL_ALPN
-#    define HAS_ALPN
-#  endif
-#endif
-
 /*
  *  profile
  */