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

Verifying TTL is ambiguous regarding nanosecond handling #24

Open
samdfonseca opened this issue Apr 24, 2019 · 0 comments
Open

Verifying TTL is ambiguous regarding nanosecond handling #24

samdfonseca opened this issue Apr 24, 2019 · 0 comments

Comments

@samdfonseca
Copy link

The spec's instructions for verifying token TTL doesn't explain how to handle nanoseconds.

If the user has specified a maximum age (or "time-to-live") for the token, ensure the recorded timestamp is not too far in the past.

This results in difference between implementations. For example, fernet-go uses time.Time.After, which checks equality down to the nanosecond level, while Python's cryptography.fernet truncates nanoseconds from the now timestamp before comparing. This means that a token may fail verification in one implementation, but pass in the other.

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

1 participant