Skip to content
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

tls-client: Check certificate verification flags to exclude time failures #109

Merged

Conversation

andresag01
Copy link

@andresag01 andresag01 commented Aug 2, 2017

This patch is necessary when the
MBEDTLS_HAVE_TIME_DATE functionality is enabled because the Real-Time
Clock needs to be manually set to the correct time, which is not a
trivial task in this example code. The idea here is to configure the certificate verification function to filter out date/time failures during the TLS handshake.

NOTES:

  • @sbutcher-arm: This PR fixes the tls-client example when this mbed OS PR is merged.

@simonbutcher
Copy link
Contributor

@k-stachowiak - Can you please test this PR, review it and approve it if possible?


int ret = -1;
#if HELLO_HTTPS_CLIENT_DEBUG_LEVEL > 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mazimkhan / @andresag01 - Will changing what's displayed as debug impact the CI, which uses text output to validate the example?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not change what is displayed on the terminal unless the HELLO_HTTPS_CLIENT_DEBUG_LEVEL macro is > 0 (which I think isnt by default). In fact, the changes in the placing of the macro is to ensure this happens. Note that in the past the sslVerify function cas not configured unless HELLO_HTTPS_CLIENT_DEBUG_LEVEL> 0. However, now it is because we need it to clear the timing flags. Hence, I had to put extra macro checks around the printing code in sslVerify() to prevent it from printing by default.

cc @k-stachowiak: I think this answers your question as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this change does not modify the prints that appear in mbed-os-example-tls/tests/tls-client.log then this will not impact the CI. Any additional prints are ignored.

@simonbutcher simonbutcher requested review from AndrzejKurek and removed request for yanesca August 24, 2018 11:26
Copy link
Contributor

@k-stachowiak k-stachowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this PR on a K64F device using armcc and the ARM's gcc compilers (can't test against IAR in my setup), ane it works. I am not sure about the purpose of adding the second #if guard, but I can see that @sbutcher-arm has already asked about it so I'll approve the rest of the PR assuming the #if issue will be addressed in Simon's review.

@mazimkhan
Copy link

retest

2 similar comments
@mazimkhan
Copy link

retest

@mazimkhan
Copy link

retest

@mazimkhan
Copy link

@andresag01
Copy link
Author

@RonEld @sbutcher-arm: I think we have the necessary approvals and the relevant CI tests seem to pass. Can we add the 'ready for merge' tag?

@simonbutcher simonbutcher merged commit e9d2d66 into ARMmbed:master Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants