Fix compiler warning

Fix a compiler warning when MBEDTLS_SHA512_C isn't defined.
This commit is contained in:
Jarno Lamsa 2019-08-21 15:30:44 +03:00
parent 8c51b7cd94
commit b7b486cfd1

View File

@ -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 );
}