Skip to content

Commit

Permalink
Address PR and CI concerns:
Browse files Browse the repository at this point in the history
* Change memcmp in CBMC harnesses
  • Loading branch information
Boquan Fang committed Aug 15, 2024
1 parent ac6f580 commit 12f4ff8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 12f4ff8

Please sign in to comment.