-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add milliseconds platform time function #6891
Add milliseconds platform time function #6891
Conversation
From RFC8446, the unit of ticket age is million seconds Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
We provide windows and posix implementation for it. With MBEDTLS_PLATFORM_MS_TIME_ALT, user can provide their own implementation. Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
294829a
to
3825749
Compare
e609641
to
fec8ff2
Compare
There's a potential race condition with calling time(NULL) after GetSystemTime(). See https://learn.microsoft.com/en-us/archive/msdn-magazine/2004/march/implementing-a-high-resolution-time-provider-for-windows Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
fec8ff2
to
947fd3d
Compare
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
b381988
to
eb30684
Compare
Internal CI pass and OpenCI report docker build fail |
Now, CI passed |
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
49ba576
to
041c8c1
Compare
We need a non-settable source to avoid security issues. Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
884a8b0
to
02d6840
Compare
@tom-cosgrove-arm , I just re-write the commit history due to the CI fails. Sorry for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Removed |
`GetSystemTimeAsFileTime` returns 100 nano seconds elapsed time, not 100 micro seconds. Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
@tom-cosgrove-arm , just fix windows fail. Please re-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@daverodgman and @gilles-peskine-arm are either of you two reviewing this, or should I add |
I will TAL |
I'm not reviewing. |
Description
fix #6623.
This PR provide milliseconds platform time function to resolve ticket age issue.
The time unit of ticket age is milliseconds and the unit in current code is seconds. That causes client age is bigger that server age, it is identified as replay attack. For a final solution, we need milliseconds function.
mbedtls_ms_time
is used in #6788 , that has been verified.Gatekeeper checklist