mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-22 23:51:00 +00:00
Merge remote-tracking branch 'origin/pr/2519' into mbedtls-2.7
* origin/pr/2519: Fix errors in AEAD test function
This commit is contained in:
commit
f3df5b8552
|
@ -25,6 +25,9 @@ Bugfix
|
|||
Junhwan Park, #2106.
|
||||
* Fix 1-byte buffer overflow in mbedtls_mpi_write_string() when
|
||||
used with negative inputs. Found by Guido Vranken in #2404.
|
||||
* Fix bugs in the AEAD test suite which would be exposed by ciphers which
|
||||
either used both encrypt and decrypt key schedules, or which perform padding.
|
||||
GCM and CCM were not affected. Fixed by Jack Lloyd.
|
||||
|
||||
Changes
|
||||
* Return from various debugging routines immediately if the
|
||||
|
|
|
@ -627,6 +627,9 @@ void auth_crypt_tv( int cipher_id, char *hex_key, char *hex_iv,
|
|||
TEST_ASSERT( memcmp( output, clear, clear_len ) == 0 );
|
||||
|
||||
/* then encrypt the clear and make sure we get the same ciphertext and tag */
|
||||
TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx, key, 8 * key_len,
|
||||
MBEDTLS_ENCRYPT ) );
|
||||
|
||||
memset( output, 0xFF, sizeof( output ) );
|
||||
outlen = 0;
|
||||
|
||||
|
@ -635,8 +638,8 @@ void auth_crypt_tv( int cipher_id, char *hex_key, char *hex_iv,
|
|||
my_tag, tag_len );
|
||||
TEST_ASSERT( ret == 0 );
|
||||
|
||||
TEST_ASSERT( outlen == clear_len );
|
||||
TEST_ASSERT( memcmp( output, cipher, clear_len ) == 0 );
|
||||
TEST_ASSERT( outlen == cipher_len );
|
||||
TEST_ASSERT( memcmp( output, cipher, cipher_len ) == 0 );
|
||||
TEST_ASSERT( memcmp( my_tag, tag, tag_len ) == 0 );
|
||||
|
||||
/* make sure we didn't overwrite */
|
||||
|
|
Loading…
Reference in a new issue