@@ -837,6 +837,14 @@ void test_msg_auth_token_packet_too_small(void) {
837837 // Call with a small size to trigger the size check
838838 he_return_code_t res = he_handle_msg_auth (conn , empty_data , 4 );
839839 TEST_ASSERT_EQUAL (HE_ERR_PACKET_TOO_SMALL , res );
840+
841+ auth_message -> header .auth_type = HE_AUTH_TYPE_TOKEN ;
842+ // Fake buffer length
843+ auth_message -> token_length = ntohs (4 );
844+
845+ // Call with a small size to trigger the size check
846+ res = he_handle_msg_auth (conn , empty_data , sizeof (he_msg_auth_token_t ) + 2 );
847+ TEST_ASSERT_EQUAL (HE_ERR_PACKET_TOO_SMALL , res );
840848}
841849
842850void test_msg_auth_token_packet_invalid_length (void ) {
@@ -906,6 +914,14 @@ void test_msg_auth_buf_packet_too_small(void) {
906914 // Call with a small size to trigger the size check
907915 he_return_code_t res = he_handle_msg_auth (conn , empty_data , 4 );
908916 TEST_ASSERT_EQUAL (HE_ERR_PACKET_TOO_SMALL , res );
917+
918+ auth_message -> header .auth_type = HE_AUTH_TYPE_CB ;
919+ // Fake buffer length
920+ auth_message -> buffer_length = ntohs (4 );
921+
922+ // Call with a small size to trigger the size check
923+ res = he_handle_msg_auth (conn , empty_data , sizeof (he_msg_auth_buf_t ) + 2 );
924+ TEST_ASSERT_EQUAL (HE_ERR_PACKET_TOO_SMALL , res );
909925}
910926
911927void test_msg_auth_buf_packet_invalid_length (void ) {
0 commit comments