-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
py/mpconfig: Enable CRYPTOLIB, HASHLIB_MD5, HASHLIB_SHA1 if SSL enabled. #17926
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
py/mpconfig: Enable CRYPTOLIB, HASHLIB_MD5, HASHLIB_SHA1 if SSL enabled. #17926
Conversation
Code size report:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17926 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22296 22296
=======================================
Hits 21937 21937
Misses 359 359 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Yay for standardisation!
#endif | ||
|
||
#ifndef MICROPY_PY_HASHLIB_SHA256 | ||
#define MICROPY_PY_HASHLIB_SHA256 (1) | ||
#endif | ||
|
||
#ifndef MICROPY_PY_CRYPTOLIB | ||
#define MICROPY_PY_CRYPTOLIB (0) | ||
#define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL) |
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 don't know if this is worth worrying about, but the default definition of MICROPY_PY_SSL
is lower down in the file than these lines.
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 think it should be fine? It's already the case for some other options (for better or worse), eg MICROPY_PY_SYS_SETTRACE
is used before the default definition.
This commit unifies the configuration of MICROPY_PY_CRYPTOLIB, MICROPY_PY_HASHLIB_MD5 and MICROPY_PY_HASHLIB_SHA1, so they are enabled by default if MICROPY_PY_SSL is enabled. This matches the existing configuration of most of the ports. With this change, all ports remain the same except: - reneses-ra now enables MICROPY_PY_CRYPTOLIB, MICROPY_PY_HASHLIB_MD5 and MICROPY_PY_HASHLIB_SHA1. - rp2 now enables MICROPY_PY_HASHLIB_MD5. Signed-off-by: Damien George <damien@micropython.org>
1ca9fb5
to
b5fcb33
Compare
Summary
This commit unifies the configuration of MICROPY_PY_CRYPTOLIB, MICROPY_PY_HASHLIB_MD5 and MICROPY_PY_HASHLIB_SHA1, so they are enabled by default if MICROPY_PY_SSL is enabled. This matches the existing configuration of most of the ports.
With this change, all ports remain the same except:
Testing
Builds will be tested by CI. Code size diff will tell the story.
Trade-offs and Alternatives
Could leave this up to the port, but IMO it's better to have the config unified so ports are more uniform in their configuration.