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

Version check MbedTLS instead of introducing a new define when initializing PSA Crypto API #516

Merged
merged 1 commit into from
May 8, 2024

Conversation

teejusb
Copy link
Contributor

@teejusb teejusb commented May 8, 2024

This PR removes the define introduced in #514, in favor of just version checking the MbedTLS (defined here). I think this implementation is more portable as any projects dependent on this change can get it immediately when updating their MbedTLS library, instead of manually adding in a new define.


Details

It looks like brew updated their mbedtls version 2 months ago as per this link.

This update happened on March 28th, while the last IXWebSocket update before this changed happened one day earlier on March 27th.

Since there hadn't been any updates to this repo after March 28th, the GitHub action was not run. And since the failing test uses brew install mbedtls here, it is now getting version 3.6.0, instead of 3.5.2. I think this implies that even without the changes in #514, the runner would have started to fail on the next PR.

Interestingly, and also unknowingly, the changes in #514 were created to address exactly this issue :) The changes in my project to enable IXWebSocket to use that PR can be found here.

@teejusb teejusb changed the title Set IXWEBSOCKET_MBEDTLS_USE_PSA_CRYPTO for testing Version check MbedTLS instead of introducing a new define May 8, 2024
@teejusb teejusb changed the title Version check MbedTLS instead of introducing a new define Version check MbedTLS instead of introducing a new define when initializing PSA Crypto API May 8, 2024
@teejusb teejusb marked this pull request as ready for review May 8, 2024 16:23
#if defined(IXWEBSOCKET_MBEDTLS_USE_PSA_CRYPTO)
psa_crypto_init();
#endif
if (MBEDTLS_VERSION_MAJOR >= 3 && MBEDTLS_VERSION_MINOR >= 6 && MBEDTLS_VERSION_PATCH >= 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can also add guards for MBEDTLS_VERSION_MAJOR etc if you'd like. I figured this would be a safe assumption so I opted to leave them out.

@bsergean bsergean merged commit c27f5a9 into machinezone:master May 8, 2024
7 checks passed
@bsergean
Copy link
Collaborator

bsergean commented May 8, 2024

thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants