Skip to content

Verifying TTL is ambiguous regarding nanosecond handling #24

Open

Description

@samdfonseca

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions