1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Remove redundant null check

mbedtls_cipher_info_get_xxx has well-defined behavior on NULL, so no need to
check first.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2021-07-19 17:38:09 +02:00
parent e720dbe177
commit ce9e3a92fe

View File

@ -138,8 +138,6 @@ int mbedtls_ssl_ticket_setup( mbedtls_ssl_ticket_context *ctx,
ctx->ticket_lifetime = lifetime; ctx->ticket_lifetime = lifetime;
cipher_info = mbedtls_cipher_info_from_type( cipher); cipher_info = mbedtls_cipher_info_from_type( cipher);
if( cipher_info == NULL )
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
if( mbedtls_cipher_info_get_mode( cipher_info ) != MBEDTLS_MODE_GCM && if( mbedtls_cipher_info_get_mode( cipher_info ) != MBEDTLS_MODE_GCM &&
mbedtls_cipher_info_get_mode( cipher_info ) != MBEDTLS_MODE_CCM ) mbedtls_cipher_info_get_mode( cipher_info ) != MBEDTLS_MODE_CCM )