-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Backport 1.3: More robust timing tests #1224
Conversation
The POSIX/Unix implementation of set_alarm did not set the alarmed flag when called with 0, which was inconsistent with what the documentation implied and with the Windows behavior.
get_timer with reset=1 is called both to initialize a timer object and to reset an already-initialized object. In an initial call, the content of the data structure is indeterminate, so the code should not read from it. This could crash if signed overflows trap, for example. As a consequence, on reset, we can't return the previously elapsed time as was previously done on Windows. Return 0 as was done on Unix.
Print some not-very-nice-looking but helpful diagnosis information if the timing selftest fails. Since the failures tend to be due to heavy system load that's hard to reproduce, this information is necessary to understand what's going on.
We don't need to test multiple delays in a self-test. Save 10s of busy-wait.
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.
I'm satisfied this is a faithful commit of the changes in the main branch that are relevant to 1.3.
CI failed due to a build failure on windows/mingw which is an issue in the CI, unrelated to this PR - not an issue for merging. |
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
Yes, sorry, sometimes when I open a tab on a github page it shows me an old version and I have to refresh even if I just opened the page, which is counter-intuitive. I guess that's what happened so I wasn't seeing your approval.
…________________________________
From: Mohammad Azim Khan <notifications@github.com>
Sent: 21 December 2017 16:36:50
To: ARMmbed/mbedtls
Cc: Manuel Pegourie-Gonnard; Review requested
Subject: Re: [ARMmbed/mbedtls] Backport 1.3: More robust timing tests (#1224)
Its reviewed & approved.
From: Manuel Pégourié-Gonnard [mailto:notifications@github.com]
Sent: 21 December 2017 15:25
To: ARMmbed/mbedtls <mbedtls@noreply.github.com>
Cc: Azim Khan <Azim.Khan@arm.com>; Mention <mention@noreply.github.com>
Subject: Re: [ARMmbed/mbedtls] Backport 1.3: More robust timing tests (#1224)
@mazimkhan<https://github.com/mazimkhan> : you reviewed the development and 2.1 branch but not this one, just making sure it's still on your radar :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1224 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AM5PEqyT_2r8C8Nx4keA9dfIYSs3QDy0ks5tCngwgaJpZM4RJAME>.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub<#1224 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AADs4O9bUJZ4lSe8ayHdUWXmX28vlz8Wks5tCnsRgaJpZM4RJAME>.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
|
This is a partial backport of #1136 . Included:
mbedtls_timing_get_timer
on Windows (internal ref: IOTSSL-1822)mbedtls_set_alarm(0)
on Unix/POSIX.I omitted the rest because 1.3 is on its way out and I don't think the rest of the original PR is worth it.
Internal ref: IOTSSL-1798