-
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 2.28: Fix builds with MBEDTLS_HAVE_TIME disabled and test #5563
Backport 2.28: Fix builds with MBEDTLS_HAVE_TIME disabled and test #5563
Conversation
053ff42
to
8896c8d
Compare
@d3zd3z @tom-cosgrove-arm Since you reviewed the main PR, will you review this backport as well? |
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.
Looks good to me.
My comments on #3624 pretty much apply here too |
Make it safe to import the config multiple times without having multiple definition errors. (This prevents errors in the fuzzers in a later patch.) Signed-off-by: Daniel Axtens <[email protected]>
MBEDTLS_HAVE_TIME is documented as: "System has time.h and time()." If that is not defined, do not attempt to include time.h. A particular problem is platform-time.h, which should only be included if MBEDTLS_HAVE_TIME is defined, which makes everything messier. Maybe it should be refactored to have the check inside the header. Signed-off-by: Daniel Axtens <[email protected]>
baremetal compiles should not include time.h, as MBEDTLS_HAVE_TIME is undefined. To test this, provide an overriding include directory that has a time.h which throws a meaningful error if included. Signed-off-by: Daniel Axtens <[email protected]>
Signed-off-by: Raoul Strackx <[email protected]> [dja: add some more fixes, tweak title] Signed-off-by: Daniel Axtens <[email protected]>
To be able to test utility programs for an absence of time.h, we need a baremetal config that is not crypto only. Add one. Signed-off-by: Daniel Axtens <[email protected]>
Allow programs/test/udp_proxy.c to build when MBEDTLS_HAVE_TIME is not defined. In this case, do not attempt to seed the pseudo-random number generator used to sometimes produce corrupt packets and other erroneous data. Signed-off-by: David Horstmann <[email protected]>
MBEDTLS_HAVE_TIME_ALT implies MBEDTLS_HAVE_TIME, so an extra check for MBEDTLS_HAVE_TIME is not needed. Signed-off-by: David Horstmann <[email protected]>
Change the new baremetal all.sh tests to use $PWD rather than calling pwd again directly. Signed-off-by: David Horstmann <[email protected]>
Signed-off-by: Andrzej Kurek <[email protected]>
Signed-off-by: Andrzej Kurek <[email protected]>
Signed-off-by: Andrzej Kurek <[email protected]>
Also move the self test implementation guards so that alternate implementations must provide their own. Signed-off-by: Andrzej Kurek <[email protected]>
Signed-off-by: Andrzej Kurek <[email protected]>
Signed-off-by: Andrzej Kurek <[email protected]>
Signed-off-by: Andrzej Kurek <[email protected]>
Signed-off-by: Andrzej Kurek <[email protected]>
8896c8d
to
478181d
Compare
Pulled new commits from the original PR.
|
@@ -527,4 +527,44 @@ int mbedtls_timing_self_test( int verbose ) | |||
|
|||
#endif /* MBEDTLS_SELF_TEST */ | |||
|
|||
#else | |||
volatile int mbedtls_timing_alarmed = 0; |
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.
Not really related to this particular change, but volatile is insufficient to make this code correct on non-strongly ordered SMP targets (e.g. Arm).
CI failures: 1 x Internal CI all passes |
Backport of #3624.
Fix builds that use
time.h
withoutMBEDTLS_HAVE_TIME
.Changes compared to the original:
programs/fuzz/common.h
usingconfig.h
directly instead ofbuild_info.h
;programs/test/query_config.c
uploaded.