mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-27 01:36:59 +01:00
Add parameter validation for AES-OFB
This commit is contained in:
parent
1677cca54b
commit
8e41eb7187
3 changed files with 32 additions and 1 deletions
|
|
@ -516,6 +516,24 @@ void aes_check_params( )
|
|||
MBEDTLS_AES_ENCRYPT, 16,
|
||||
out, in, NULL ) );
|
||||
#endif /* MBEDTLS_CIPHER_MODE_CFB */
|
||||
|
||||
#if defined(MBEDTLS_CIPHER_MODE_OFB)
|
||||
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
|
||||
mbedtls_aes_crypt_ofb( NULL, 16,
|
||||
&size, out, in, out ) );
|
||||
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
|
||||
mbedtls_aes_crypt_ofb( &aes_ctx, 16,
|
||||
NULL, out, in, out ) );
|
||||
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
|
||||
mbedtls_aes_crypt_ofb( &aes_ctx, 16,
|
||||
&size, NULL, in, out ) );
|
||||
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
|
||||
mbedtls_aes_crypt_ofb( &aes_ctx, 16,
|
||||
&size, out, NULL, out ) );
|
||||
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
|
||||
mbedtls_aes_crypt_ofb( &aes_ctx, 16,
|
||||
&size, out, in, NULL ) );
|
||||
#endif /* MBEDTLS_CIPHER_MODE_OFB */
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue