Remove duplicated parameter check in CAMELLIA module

This commit is contained in:
Hanno Becker 2018-12-13 15:53:41 +00:00
parent e939de7247
commit ff62f44ad7
2 changed files with 0 additions and 11 deletions

View File

@ -355,7 +355,6 @@ int mbedtls_camellia_setkey_enc( mbedtls_camellia_context *ctx,
uint32_t TK[20]; uint32_t TK[20];
CAMELLIA_VALIDATE_RET( ctx != NULL ); CAMELLIA_VALIDATE_RET( ctx != NULL );
CAMELLIA_VALIDATE_RET( key != NULL ); CAMELLIA_VALIDATE_RET( key != NULL );
CAMELLIA_VALIDATE_RET( keybits == 128 || keybits == 192 || keybits == 256 );
RK = ctx->rk; RK = ctx->rk;
@ -462,7 +461,6 @@ int mbedtls_camellia_setkey_dec( mbedtls_camellia_context *ctx,
uint32_t *SK; uint32_t *SK;
CAMELLIA_VALIDATE_RET( ctx != NULL ); CAMELLIA_VALIDATE_RET( ctx != NULL );
CAMELLIA_VALIDATE_RET( key != NULL ); CAMELLIA_VALIDATE_RET( key != NULL );
CAMELLIA_VALIDATE_RET( keybits == 128 || keybits == 192 || keybits == 256 );
mbedtls_camellia_init( &cty ); mbedtls_camellia_init( &cty );

View File

@ -13,7 +13,6 @@ void camellia_invalid_param( )
mbedtls_camellia_context ctx; mbedtls_camellia_context ctx;
unsigned char buf[16] = { 0 }; unsigned char buf[16] = { 0 };
const size_t valid_keybits = 128; const size_t valid_keybits = 128;
const size_t invalid_keybits = 42;
const int invalid_mode = 42; const int invalid_mode = 42;
const int valid_mode = MBEDTLS_CAMELLIA_ENCRYPT; const int valid_mode = MBEDTLS_CAMELLIA_ENCRYPT;
size_t off; size_t off;
@ -30,10 +29,6 @@ void camellia_invalid_param( )
mbedtls_camellia_setkey_enc( &ctx, mbedtls_camellia_setkey_enc( &ctx,
NULL, NULL,
valid_keybits ) ); valid_keybits ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA,
mbedtls_camellia_setkey_enc( &ctx,
buf,
invalid_keybits ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA, TEST_INVALID_PARAM_RET( MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA,
mbedtls_camellia_setkey_dec( NULL, mbedtls_camellia_setkey_dec( NULL,
@ -43,10 +38,6 @@ void camellia_invalid_param( )
mbedtls_camellia_setkey_dec( &ctx, mbedtls_camellia_setkey_dec( &ctx,
NULL, NULL,
valid_keybits ) ); valid_keybits ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA,
mbedtls_camellia_setkey_dec( &ctx,
buf,
invalid_keybits ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA, TEST_INVALID_PARAM_RET( MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA,
mbedtls_camellia_crypt_ecb( NULL, mbedtls_camellia_crypt_ecb( NULL,