From e43805e4dd0ba77abc043970fd9f8ccd3c045e5a Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Sat, 4 Sep 2021 19:38:08 +0800 Subject: [PATCH] fix warnings without psk Signed-off-by: Jerry Yu --- library/ssl_tls13_server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c index 250bcb8c6dbe..98dbadc3f716 100644 --- a/library/ssl_tls13_server.c +++ b/library/ssl_tls13_server.c @@ -2262,13 +2262,15 @@ static int ssl_client_hello_parse( mbedtls_ssl_context* ssl, int ret; size_t i, j; size_t comp_len, sess_len; - size_t ciph_len, ext_len, ext_len_psk_ext = 0; + size_t ciph_len, ext_len; unsigned char *orig_buf, *end = buf + buflen; unsigned char *ciph_offset; unsigned char *p = NULL; unsigned char *ext = NULL; unsigned char *ext_psk_ptr = NULL; - +#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) + size_t ext_len_psk_ext = 0; +#endif const int* ciphersuites; const mbedtls_ssl_ciphersuite_t* ciphersuite_info;