From f3eccb154c32213860cd6226fd42c5006920f2ff Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Wed, 23 Aug 2023 13:37:06 +1000 Subject: [PATCH] py/mpconfig: Enable SSL finalizers if finalizers are enabled. The rp2 port was enabling SSL and had finalizers enabled via the "extra features" level, but missed explicitly enabling `MICROPY_PY_SSL_FINALISER` (like esp32, stm32, and mimxrt did). This commit makes `MICROPY_PY_SSL_FINALISER` default to enabled if finalizers are enabled, and removes the explicit setting of this for esp32, stm32, mimxrt (because they all use the "extra features" level). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared --- ports/esp32/mpconfigport.h | 1 - ports/mimxrt/mpconfigport.h | 2 -- ports/stm32/mpconfigport.h | 1 - py/mpconfig.h | 2 +- 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h index 55035b5f86..ae73e02e41 100644 --- a/ports/esp32/mpconfigport.h +++ b/ports/esp32/mpconfigport.h @@ -139,7 +139,6 @@ #define MICROPY_HW_SOFTSPI_MAX_BAUDRATE (esp_rom_get_cpu_ticks_per_us() * 1000000 / 200) // roughly #define MICROPY_PY_SSL (1) #define MICROPY_SSL_MBEDTLS (1) -#define MICROPY_PY_SSL_FINALISER (1) #define MICROPY_PY_WEBSOCKET (1) #define MICROPY_PY_WEBREPL (1) #define MICROPY_PY_ONEWIRE (1) diff --git a/ports/mimxrt/mpconfigport.h b/ports/mimxrt/mpconfigport.h index 52054c5d4d..cd69151ed8 100644 --- a/ports/mimxrt/mpconfigport.h +++ b/ports/mimxrt/mpconfigport.h @@ -67,7 +67,6 @@ uint32_t trng_random_u32(void); // Extended modules #define MICROPY_EPOCH_IS_1970 (1) -#define MICROPY_PY_SSL_FINALISER (MICROPY_PY_SSL) #define MICROPY_PY_TIME_GMTIME_LOCALTIME_MKTIME (1) #define MICROPY_PY_TIME_TIME_TIME_NS (1) #define MICROPY_PY_TIME_INCLUDEFILE "ports/mimxrt/modtime.c" @@ -110,7 +109,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_SSL_FINALISER (MICROPY_PY_SSL) // #define MICROPY_PY_HASHLIB_MD5 (MICROPY_PY_SSL) #define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL) // #define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL) diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h index 37165b1589..2d2d81486b 100644 --- a/ports/stm32/mpconfigport.h +++ b/ports/stm32/mpconfigport.h @@ -92,7 +92,6 @@ #endif // extended modules -#define MICROPY_PY_SSL_FINALISER (MICROPY_PY_SSL) #define MICROPY_PY_HASHLIB_MD5 (MICROPY_PY_SSL) #define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL) #define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL) diff --git a/py/mpconfig.h b/py/mpconfig.h index 46c62913cc..433d6e50de 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1718,7 +1718,7 @@ typedef double mp_float_t; // Whether to add finaliser code to ssl objects #ifndef MICROPY_PY_SSL_FINALISER -#define MICROPY_PY_SSL_FINALISER (0) +#define MICROPY_PY_SSL_FINALISER (MICROPY_ENABLE_FINALISER) #endif #ifndef MICROPY_PY_WEBSOCKET