diff --git a/tests/cbmc/proofs/s2n_stuffer_peek_check_for_str/s2n_stuffer_peek_check_for_str_harness.c b/tests/cbmc/proofs/s2n_stuffer_peek_check_for_str/s2n_stuffer_peek_check_for_str_harness.c index 77a1ab329d4..07de8a3fe93 100644 --- a/tests/cbmc/proofs/s2n_stuffer_peek_check_for_str/s2n_stuffer_peek_check_for_str_harness.c +++ b/tests/cbmc/proofs/s2n_stuffer_peek_check_for_str/s2n_stuffer_peek_check_for_str_harness.c @@ -37,7 +37,7 @@ void s2n_stuffer_peek_check_for_str_harness() size_t expected_length = (expected != NULL) ? strlen(expected) : 0; if (expected_length > 0 && s2n_stuffer_peek_check_for_str(stuffer, expected) == S2N_SUCCESS) { uint8_t *actual = stuffer->blob.data + stuffer->read_cursor; - assert(!memcmp(actual, expected, expected_length)); + assert(s2n_constant_time_equals(actual, (uint8_t *) expected, expected_length)); } assert_stuffer_equivalence(stuffer, &old_stuffer, &old_byte_from_stuffer); assert(s2n_result_is_ok(s2n_stuffer_validate(stuffer))); diff --git a/tests/cbmc/proofs/s2n_stuffer_read_expected_str/s2n_stuffer_read_expected_str_harness.c b/tests/cbmc/proofs/s2n_stuffer_read_expected_str/s2n_stuffer_read_expected_str_harness.c index 076da691da5..3a6b73caa42 100644 --- a/tests/cbmc/proofs/s2n_stuffer_read_expected_str/s2n_stuffer_read_expected_str_harness.c +++ b/tests/cbmc/proofs/s2n_stuffer_read_expected_str/s2n_stuffer_read_expected_str_harness.c @@ -37,7 +37,7 @@ void s2n_stuffer_read_expected_str_harness() size_t expected_length = (expected != NULL) ? strlen(expected) : 0; if (expected_length > 0 && s2n_stuffer_read_expected_str(stuffer, expected) == S2N_SUCCESS) { uint8_t *actual = stuffer->blob.data + stuffer->read_cursor - expected_length; - assert(!memcmp(actual, expected, expected_length)); + assert(s2n_constant_time_equals(actual, (uint8_t *) expected, expected_length)); assert(stuffer->read_cursor == old_stuffer.read_cursor + expected_length); } else { assert(stuffer->read_cursor == old_stuffer.read_cursor);