py/mpconfig: Enable CRYPTOLIB, HASHLIB_MD5, HASHLIB_SHA1 if SSL enabled.

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>
This commit is contained in:
Damien George 2025-08-15 12:56:16 +10:00
parent 989abae12c
commit b5fcb33eaa
10 changed files with 5 additions and 32 deletions

View file

@ -112,9 +112,6 @@
// Extended modules
#define MICROPY_EPOCH_IS_1970 (1)
#define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL)
#define MICROPY_PY_HASHLIB_MD5 (MICROPY_PY_SSL)
#define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL)
#define MICROPY_PY_OS_INCLUDEFILE "ports/alif/modos.c"
#define MICROPY_PY_OS_DUPTERM (1)
#define MICROPY_PY_OS_SEP (1)

View file

@ -105,10 +105,6 @@
#define MICROPY_BLUETOOTH_NIMBLE (1)
#define MICROPY_BLUETOOTH_NIMBLE_BINDINGS_ONLY (1)
#endif
#define MICROPY_PY_HASHLIB_MD5 (1)
#define MICROPY_PY_HASHLIB_SHA1 (1)
#define MICROPY_PY_HASHLIB_SHA256 (1)
#define MICROPY_PY_CRYPTOLIB (1)
#define MICROPY_PY_RANDOM_SEED_INIT_FUNC (esp_random())
#define MICROPY_PY_OS_INCLUDEFILE "ports/esp32/modos.c"
#define MICROPY_PY_OS_DUPTERM (1)

View file

@ -12,8 +12,6 @@
#define MICROPY_READER_VFS (MICROPY_VFS)
#define MICROPY_VFS (1)
#define MICROPY_PY_CRYPTOLIB (1)
#elif defined(MICROPY_ESP8266_1M)
#define MICROPY_HW_BOARD_NAME "ESP module (1M)"
@ -28,9 +26,6 @@
#define MICROPY_READER_VFS (MICROPY_VFS)
#define MICROPY_VFS (1)
#define MICROPY_PY_CRYPTOLIB (1)
#elif defined(MICROPY_ESP8266_512K)
#define MICROPY_HW_BOARD_NAME "ESP module (512K)"
@ -45,6 +40,7 @@
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
#define MICROPY_PY_ASYNCIO (0)
#define MICROPY_PY_RE_SUB (0)
#define MICROPY_PY_CRYPTOLIB (0)
#define MICROPY_PY_FRAMEBUF (0)
#endif

View file

@ -56,6 +56,7 @@
#define MICROPY_REPL_EVENT_DRIVEN (0)
#define MICROPY_USE_INTERNAL_ERRNO (1)
#define MICROPY_PY_BUILTINS_HELP_TEXT esp_help_text
#define MICROPY_PY_HASHLIB_MD5 (0)
#define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL && MICROPY_SSL_AXTLS)
#define MICROPY_PY_RANDOM_SEED_INIT_FUNC (*WDEV_HWRNG)
#define MICROPY_PY_TIME_GMTIME_LOCALTIME_MKTIME (1)

View file

@ -145,9 +145,6 @@ uint32_t trng_random_u32(void);
#define MICROPY_PY_WEBSOCKET (MICROPY_PY_LWIP)
#define MICROPY_PY_WEBREPL (MICROPY_PY_LWIP)
#define MICROPY_PY_LWIP_SOCK_RAW (MICROPY_PY_LWIP)
#define MICROPY_PY_HASHLIB_MD5 (MICROPY_PY_SSL)
#define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL)
#define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL)
#ifndef MICROPY_PY_NETWORK_PPP_LWIP
#define MICROPY_PY_NETWORK_PPP_LWIP (MICROPY_PY_LWIP)
#endif

View file

@ -10,9 +10,6 @@
// Enable networking.
#define MICROPY_PY_NETWORK (1)
// Enable MD5 hash.
#define MICROPY_PY_HASHLIB_MD5 (1)
// Disable internal error numbers.
#define MICROPY_USE_INTERNAL_ERRNO (0)

View file

@ -150,8 +150,6 @@
#define MICROPY_PY_OS_URANDOM (1)
#define MICROPY_PY_RE_MATCH_GROUPS (1)
#define MICROPY_PY_RE_MATCH_SPAN_START_END (1)
#define MICROPY_PY_HASHLIB_SHA1 (1)
#define MICROPY_PY_CRYPTOLIB (1)
#define MICROPY_PY_TIME_GMTIME_LOCALTIME_MKTIME (1)
#define MICROPY_PY_TIME_TIME_TIME_NS (1)
#define MICROPY_PY_TIME_INCLUDEFILE "ports/rp2/modtime.c"

View file

@ -97,9 +97,6 @@
#endif
// extended modules
#define MICROPY_PY_HASHLIB_MD5 (MICROPY_PY_SSL)
#define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL)
#define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL)
#define MICROPY_PY_OS_INCLUDEFILE "ports/stm32/modos.c"
#define MICROPY_PY_OS_DUPTERM (3)
#define MICROPY_PY_OS_DUPTERM_BUILTIN_STREAM (1)

View file

@ -104,12 +104,6 @@
#define MICROPY_PY_TIME_CUSTOM_SLEEP (1)
#define MICROPY_PY_TIME_INCLUDEFILE "ports/unix/modtime.c"
#if MICROPY_PY_SSL
#define MICROPY_PY_HASHLIB_MD5 (1)
#define MICROPY_PY_HASHLIB_SHA1 (1)
#define MICROPY_PY_CRYPTOLIB (1)
#endif
// The "select" module is enabled by default, but disable select.select().
#define MICROPY_PY_SELECT_POSIX_OPTIMISATIONS (1)
#define MICROPY_PY_SELECT_SELECT (0)

View file

@ -1860,11 +1860,11 @@ typedef time_t mp_timestamp_t;
#endif
#ifndef MICROPY_PY_HASHLIB_MD5
#define MICROPY_PY_HASHLIB_MD5 (0)
#define MICROPY_PY_HASHLIB_MD5 (MICROPY_PY_SSL)
#endif
#ifndef MICROPY_PY_HASHLIB_SHA1
#define MICROPY_PY_HASHLIB_SHA1 (0)
#define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL)
#endif
#ifndef MICROPY_PY_HASHLIB_SHA256
@ -1872,7 +1872,7 @@ typedef time_t mp_timestamp_t;
#endif
#ifndef MICROPY_PY_CRYPTOLIB
#define MICROPY_PY_CRYPTOLIB (0)
#define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL)
#endif
// Depends on MICROPY_PY_CRYPTOLIB