Fix AES-OFB support for errors, tests and self-test

Adds error handling into mbedtls_aes_crypt_ofb for AES errors, a self-test
for the OFB mode using NIST SP 800-38A test vectors and adds a check to
potential return errors in setting the AES encryption key in the OFB test
suite.
This commit is contained in:
Simon Butcher 2018-04-29 00:43:47 +01:00
parent 7487c5b2c8
commit ad4e4938d1
3 changed files with 139 additions and 5 deletions

View file

@ -316,7 +316,7 @@ void aes_encrypt_ofb( int fragment_size, char *hex_key_string,
iv_len = unhexify( iv_str, hex_iv_string );
in_buffer_len = unhexify( src_str, hex_src_string );
mbedtls_aes_setkey_enc( &ctx, key_str, key_len * 8 );
TEST_ASSERT( mbedtls_aes_setkey_enc( &ctx, key_str, key_len * 8 ) == 0 );
src_str_next = src_str;
while( in_buffer_len > 0 )