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

The validity period of the retry token and NEW_TOKEN #1769

Open
cyberspace61 opened this issue Oct 30, 2024 · 1 comment
Open

The validity period of the retry token and NEW_TOKEN #1769

cyberspace61 opened this issue Oct 30, 2024 · 1 comment

Comments

@cyberspace61
Copy link

https://github.com/private-octopus/picoquic/blob/c0f0313de4b8c35ea4f3193913674361a8b32692/picoquic/packet.c#L1277C1-L1281C6

Hello, I would like to ask why, when generating the retry token and NEW_TOKEN, the offsets PICOQUIC_TOKEN_DELAY_SHORT and PICOQUIC_TOKEN_DELAY_LONG are added in the calculation of the token validity period? This makes it seem that the validity period of the retry token is 2 minutes and 4 seconds, and the NEW_TOKEN is valid for 48 hours. However, in practical applications, wouldn't it be more appropriate to set the retry token's validity period to 4 seconds and the NEW_TOKEN's validity period to 24 hours?
Thank you very much for your help!

@huitema
Copy link
Collaborator

huitema commented Oct 30, 2024

Good catch. This looks like a bug.

The clean solution would be to rework the picoquic_prepare_retry_token API. It currently takes a "current time" parameter, it should also take a "desired duration" parameter. That "desired duration" should be set to either the SHORT or LONG constant in the calls, and we should not add another value in the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants