tests/ccm: add test for auth_data_len upper value

Maximal supported value is 0xFEFF.
This commit is contained in:
Gaëtan Harter 2017-11-22 14:44:19 +01:00
parent 3fd8276c37
commit 147390c209
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -246,6 +246,10 @@ static void test_crypto_modes_ccm_check_len(void)
ret = _test_ccm_len(cipher_decrypt_ccm, 8, einput, 16, 0); ret = _test_ccm_len(cipher_decrypt_ccm, 8, einput, 16, 0);
TEST_ASSERT_MESSAGE(ret > 0, "Decryption : failed with valid input_len"); 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);
} }