Skip to content

Commit

Permalink
tests/ccm: add test for auth_data_len upper value
Browse files Browse the repository at this point in the history
Maximal supported value is 0xFEFF.

(cherry picked from commit 147390c)
  • Loading branch information
cladmi committed Nov 12, 2018
1 parent 75623d6 commit c947815
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/unittests/tests-crypto/tests-crypto-modes-ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ static void test_crypto_modes_ccm_check_len(void)

ret = _test_ccm_len(cipher_decrypt_ccm, 8, einput, 16, 0);
TEST_ASSERT_MESSAGE(ret > 0, "Decryption : failed with valid input_len");

/* ccm library does not support auth_data_len > 0xFEFF */
ret = _test_ccm_len(cipher_encrypt_ccm, 2, NULL, 0, 0xFEFF + 1);
TEST_ASSERT_EQUAL_INT(-1, ret);
}


Expand Down

0 comments on commit c947815

Please sign in to comment.