From 147390c2093b0b010e9b53fbb984362148f26f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Wed, 22 Nov 2017 14:44:19 +0100 Subject: [PATCH] tests/ccm: add test for auth_data_len upper value Maximal supported value is 0xFEFF. --- tests/unittests/tests-crypto/tests-crypto-modes-ccm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unittests/tests-crypto/tests-crypto-modes-ccm.c b/tests/unittests/tests-crypto/tests-crypto-modes-ccm.c index 1fe20e7972..c9151d9ef5 100644 --- a/tests/unittests/tests-crypto/tests-crypto-modes-ccm.c +++ b/tests/unittests/tests-crypto/tests-crypto-modes-ccm.c @@ -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); }