From b7b486cfd1d591ab8eb984bb95d7b823a37555c9 Mon Sep 17 00:00:00 2001 From: Jarno Lamsa Date: Wed, 21 Aug 2019 15:30:44 +0300 Subject: [PATCH] Fix compiler warning Fix a compiler warning when MBEDTLS_SHA512_C isn't defined. --- library/ssl_tls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index c60c5f7ed..99d306533 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -11638,12 +11638,14 @@ typedef int (*tls_prf_fn)( const unsigned char *secret, size_t slen, unsigned char *dstbuf, size_t dlen ); static tls_prf_fn ssl_tls12prf_from_cs( int ciphersuite_id ) { +#if defined(MBEDTLS_SHA512_C) const mbedtls_ssl_ciphersuite_t * const ciphersuite_info = mbedtls_ssl_ciphersuite_from_id( ciphersuite_id ); -#if defined(MBEDTLS_SHA512_C) if( ciphersuite_info->mac == MBEDTLS_MD_SHA384 ) return( tls_prf_sha384 ); +#else + (void) ciphersuite_id; #endif return( tls_prf_sha256 ); }