Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Removing new usage of memcmp #4657

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tls/s2n_resume.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,8 @@ int s2n_encrypt_session_ticket(struct s2n_connection *conn, struct s2n_stuffer *

/* Ensure we never encrypt with a zero-filled key */
uint8_t zero_block[S2N_AES256_KEY_LEN] = { 0 };
POSIX_ENSURE(memcmp(key->aes_key, zero_block, S2N_AES256_KEY_LEN) != 0, S2N_ERR_KEY_CHECK);

POSIX_ENSURE(s2n_constant_time_equals(key->aes_key, zero_block, S2N_AES256_KEY_LEN) != 1,
S2N_ERR_KEY_CHECK);
maddeleine marked this conversation as resolved.
Show resolved Hide resolved
POSIX_GUARD(s2n_stuffer_init(&aad, &aad_blob));
POSIX_GUARD(s2n_stuffer_write_bytes(&aad, key->implicit_aad, S2N_TICKET_AAD_IMPLICIT_LEN));
POSIX_GUARD(s2n_stuffer_write_bytes(&aad, key->key_name, S2N_TICKET_KEY_NAME_LEN));
Expand Down
Loading