Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

cut-off timestamp after second part (10th digit) #298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KOREAN139
Copy link

as time.Now().Unix() returns timestamp with 10 digits,
which records to second unit, we need to cut smaller than
second unit (milisecond, nanosecond) to compare timestamps
with integer comparison.

before this PR, integer comparison with iat, exp, nbf and now
can make a correct result under assumption that iat, exp, nbf
is 10-digits timestamp (which smallest unit is second).
if iat, exp, nbf has more digits, now is always smaller than
these timestamps, and so always make incorrect verify results.

so i added simple function func cutOff which cuts timestamp
to have first 10-digits only, to satisfy that assumption.

as time.Now().Unix() returns timestamp with 10 digits,
which records to second unit, we need to cut smaller than
second unit (milisecond, nanosecond) to compare timestamps
with integer comparison.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant