mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/ccm: check output buffer size
Add static test to verify output buffer is big enough for testing.
This commit is contained in:
parent
a83a1a80e5
commit
30202f9de7
@ -100,6 +100,9 @@ static void test_encrypt_op(uint8_t* key, uint8_t key_len,
|
||||
int len, err, cmp;
|
||||
size_t len_encoding = nonce_and_len_encoding_size - nonce_len;
|
||||
|
||||
TEST_ASSERT_MESSAGE(sizeof(data) >= output_expected_len,
|
||||
"Output buffer too small");
|
||||
|
||||
err = cipher_init(&cipher, CIPHER_AES_128, key, key_len);
|
||||
TEST_ASSERT_EQUAL_INT(1, err);
|
||||
|
||||
@ -126,6 +129,9 @@ static void test_decrypt_op(uint8_t* key, uint8_t key_len,
|
||||
int len, err, cmp;
|
||||
size_t len_encoding = nonce_and_len_encoding_size - nonce_len;
|
||||
|
||||
TEST_ASSERT_MESSAGE(sizeof(data) >= output_expected_len,
|
||||
"Output buffer too small");
|
||||
|
||||
err = cipher_init(&cipher, CIPHER_AES_128, key, key_len);
|
||||
TEST_ASSERT_EQUAL_INT(1, err);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user