diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 779295739..eee0dadac 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -7440,10 +7440,9 @@ exit: defined(MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA_BASED_ON_USE_PSA) static tls_prf_fn ssl_tls12prf_from_cs( int ciphersuite_id ) { -#if defined(MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA_BASED_ON_USE_PSA) const mbedtls_ssl_ciphersuite_t * const ciphersuite_info = - mbedtls_ssl_ciphersuite_from_id( ciphersuite_id ); - + mbedtls_ssl_ciphersuite_from_id( ciphersuite_id ); +#if defined(MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA_BASED_ON_USE_PSA) if( ciphersuite_info != NULL && ciphersuite_info->mac == MBEDTLS_MD_SHA384 ) return( tls_prf_sha384 ); else diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index be474d473..9426a8264 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -2030,7 +2030,8 @@ int main( int argc, char *argv[] ) } #endif -#if defined(MBEDTLS_SSL_PROTO_TLS1_3) +#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \ + defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) if( opt.sig_algs != NULL ) mbedtls_ssl_conf_sig_algs( &conf, sig_alg_list ); #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */ diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 4f789d523..e3587a5b5 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -3234,7 +3234,8 @@ int main( int argc, char *argv[] ) } #endif -#if defined(MBEDTLS_SSL_PROTO_TLS1_3) +#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \ + defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) if( opt.sig_algs != NULL ) mbedtls_ssl_conf_sig_algs( &conf, sig_alg_list ); #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */ diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c index 920a473c6..ecb093e14 100644 --- a/programs/test/benchmark.c +++ b/programs/test/benchmark.c @@ -915,7 +915,8 @@ int main( int argc, char *argv[] ) } #endif -#if defined(MBEDTLS_HMAC_DRBG_C) +#if defined(MBEDTLS_HMAC_DRBG_C) && \ + ( defined(MBEDTLS_SHA1_C) || defined(MBEDTLS_SHA256_C) ) if( todo.hmac_drbg ) { mbedtls_hmac_drbg_context hmac_drbg; @@ -958,7 +959,7 @@ int main( int argc, char *argv[] ) #endif mbedtls_hmac_drbg_free( &hmac_drbg ); } -#endif +#endif /* MBEDTLS_HMAC_DRBG_C && ( MBEDTLS_SHA1_C || MBEDTLS_SHA256_C ) */ #if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_GENPRIME) if( todo.rsa )