From 013276b99be7c85a272a01a18690f5f53ce091bc Mon Sep 17 00:00:00 2001 From: Stefan Hristozov Date: Mon, 20 May 2024 11:11:24 +0200 Subject: [PATCH] fix buffer size --- src/edhoc/initiator.c | 3 ++- test/main.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/edhoc/initiator.c b/src/edhoc/initiator.c index fc6692c..c54bb26 100644 --- a/src/edhoc/initiator.c +++ b/src/edhoc/initiator.c @@ -210,7 +210,8 @@ static enum err msg3_only_gen(const struct edhoc_initiator_context *c, c->id_cred_i.len + AS_BSTR_SIZE(SIG_OR_MAC_SIZE) + c->ead_3.len); BYTE_ARRAY_NEW(ciphertext, CIPHERTEXT3_SIZE, - AS_BSTR_SIZE(plaintext.len)); + AS_BSTR_SIZE(plaintext.len) + + get_aead_mac_len(rc->suite.edhoc_aead)); /*calculate Signature_or_MAC_3*/ BYTE_ARRAY_NEW(sign_or_mac_3, SIG_OR_MAC_SIZE, SIG_OR_MAC_SIZE); TRY(signature_or_mac(GENERATE, static_dh_i, &rc->suite, &c->sk_i, diff --git a/test/main.c b/test/main.c index fda71e0..099877e 100644 --- a/test/main.c +++ b/test/main.c @@ -63,7 +63,7 @@ // in order to execute only a specific tes set this macro to a specific // test macro and comment out EXECUTE_ALL_TESTS -#define EXECUTE_ONLY_TEST TEST_INITIATOR_RESPONDER_INTERACTION1 +#define EXECUTE_ONLY_TEST TEST_EDHOC_INITIATOR_X509_X5T_RFC9529 /** * @brief This function allows to skip a given test if only one other test