diff --git a/tests/suites/test_suite_chachapoly.function b/tests/suites/test_suite_chachapoly.function index bdea57b8f2..670160b2fd 100644 --- a/tests/suites/test_suite_chachapoly.function +++ b/tests/suites/test_suite_chachapoly.function @@ -84,6 +84,7 @@ void chachapoly_update_too_long() unsigned char input[65] = { 0 }; unsigned char output[65] = { 0 }; mbedtls_chachapoly_context ctx; + size_t i; mbedtls_chachapoly_init(&ctx); @@ -93,8 +94,12 @@ void chachapoly_update_too_long() /* Force the next update to be too long without processing a huge buffer. */ ctx.chacha20_ctx.state[12] = UINT32_MAX; + memset(output, 0x2a, sizeof(output)); TEST_EQUAL(mbedtls_chachapoly_update(&ctx, sizeof(input), input, output), MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA); + for (i = 0; i < sizeof(output); i++) { + TEST_EQUAL(output[i], 0x2a); + } exit: mbedtls_chachapoly_free(&ctx);