Skip to content

Commit

Permalink
Fix uint32 issue with initial PN
Browse files Browse the repository at this point in the history
  • Loading branch information
huitema committed Mar 26, 2024
1 parent 4b49e9a commit b661fa9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit b661fa9

Please sign in to comment.