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 uint32 issue with initial PN #1662

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion picoquic/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int picoquic_screen_initial_packet(
* is not decrypted yet.
*/
if (picoquic_verify_retry_token(quic, addr_from, current_time,
&is_new_token, &original_cnxid, &ph->dest_cnx_id, UINT64_MAX,
&is_new_token, &original_cnxid, &ph->dest_cnx_id, UINT32_MAX,
ph->token_bytes, ph->token_length, 1) == 0) {
has_good_token = 1;
}
Expand Down
4 changes: 2 additions & 2 deletions picoquic/tls_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2910,9 +2910,9 @@ int picoquic_verify_retry_token(picoquic_quic_t* quic, const struct sockaddr * a
/* Invalid token, too old */
ret = -1;
}
/* If the PN value is not yet decrypted, setting it to UINT64_MAX
/* If the PN value is not yet decrypted, setting it to UINT32_MAX
* bypasses the verification */
else if (initial_pn != UINT64_MAX && odcid->id_len > 0 && token_pn >= initial_pn) {
else if (initial_pn != UINT32_MAX && odcid->id_len > 0 && token_pn >= initial_pn) {
/* Invalid PN number */
ret = -1;
}
Expand Down
Loading