Skip to content

Commit 9abe273

Browse files
committed
mbedtls: move to shared-module
this enables the implementation to be shared among ports.
1 parent 00824ad commit 9abe273

File tree

21 files changed

+31
-15
lines changed

21 files changed

+31
-15
lines changed

ports/raspberrypi/boards/cytron_edu_pico_w/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CIRCUITPY__EVE = 1
1212

1313
CIRCUITPY_CYW43 = 1
1414
CIRCUITPY_SSL = 1
15-
CIRCUITPY_SSL_MBEDTLS = 1
1615
CIRCUITPY_HASHLIB = 1
1716
CIRCUITPY_WEB_WORKFLOW = 1
1817
CIRCUITPY_MDNS = 1

ports/raspberrypi/boards/pajenicko_picopad/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ CIRCUITPY__EVE = 1
1717

1818
CIRCUITPY_CYW43 = 1
1919
CIRCUITPY_SSL = 1
20-
CIRCUITPY_SSL_MBEDTLS = 1
2120
CIRCUITPY_HASHLIB = 1
2221
CIRCUITPY_WEB_WORKFLOW = 1
2322
CIRCUITPY_MDNS = 1

ports/raspberrypi/boards/pimoroni_badger2040w/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ CIRCUITPY__EVE = 1
1313

1414
CIRCUITPY_CYW43 = 1
1515
CIRCUITPY_SSL = 1
16-
CIRCUITPY_SSL_MBEDTLS = 1
1716
CIRCUITPY_HASHLIB = 1
1817
CIRCUITPY_WEB_WORKFLOW = 1
1918
CIRCUITPY_MDNS = 1

ports/raspberrypi/boards/pimoroni_inky_frame_5_7/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CIRCUITPY__EVE = 1
1212

1313
CIRCUITPY_CYW43 = 1
1414
CIRCUITPY_SSL = 1
15-
CIRCUITPY_SSL_MBEDTLS = 1
1615
CIRCUITPY_HASHLIB = 1
1716
CIRCUITPY_WEB_WORKFLOW = 1
1817
CIRCUITPY_MDNS = 1

ports/raspberrypi/boards/pimoroni_inky_frame_7_3/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CIRCUITPY__EVE = 1
1212

1313
CIRCUITPY_CYW43 = 1
1414
CIRCUITPY_SSL = 1
15-
CIRCUITPY_SSL_MBEDTLS = 1
1615
CIRCUITPY_HASHLIB = 1
1716
CIRCUITPY_WEB_WORKFLOW = 1
1817
CIRCUITPY_MDNS = 1

ports/raspberrypi/boards/pimoroni_pico_dv_base_w/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CIRCUITPY__EVE = 1
1212

1313
CIRCUITPY_CYW43 = 1
1414
CIRCUITPY_SSL = 1
15-
CIRCUITPY_SSL_MBEDTLS = 1
1615
CIRCUITPY_HASHLIB = 1
1716
CIRCUITPY_WEB_WORKFLOW = 1
1817
CIRCUITPY_MDNS = 1

ports/raspberrypi/boards/pimoroni_plasma2040w/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CIRCUITPY__EVE = 1
1212

1313
CIRCUITPY_CYW43 = 1
1414
CIRCUITPY_SSL = 1
15-
CIRCUITPY_SSL_MBEDTLS = 1
1615
CIRCUITPY_HASHLIB = 1
1716
CIRCUITPY_WEB_WORKFLOW = 1
1817
CIRCUITPY_MDNS = 1

ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CIRCUITPY__EVE = 1
1212

1313
CIRCUITPY_CYW43 = 1
1414
CIRCUITPY_SSL = 1
15-
CIRCUITPY_SSL_MBEDTLS = 1
1615
CIRCUITPY_HASHLIB = 1
1716
CIRCUITPY_WEB_WORKFLOW = 1
1817
CIRCUITPY_MDNS = 1

ports/raspberrypi/mpconfigport.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1
5858

5959
# Usually lots of flash space available
6060
CIRCUITPY_MESSAGE_COMPRESSION_LEVEL ?= 1
61+
62+
# (ssl is selectively enabled but it's always the mbedtls implementation)
63+
CIRCUITPY_SSL_MBEDTLS = 1

ports/raspberrypi/supervisor/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#include "shared-bindings/pwmio/PWMOut.h"
4343

4444
#if CIRCUITPY_SSL
45-
#include "common-hal/ssl/__init__.h"
45+
#include "shared-module/ssl/__init__.h"
4646
#endif
4747

4848
#if CIRCUITPY_WIFI

py/circuitpy_defns.mk

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,6 @@ SRC_COMMON_HAL_ALL = \
516516
socketpool/__init__.c \
517517
socketpool/SocketPool.c \
518518
socketpool/Socket.c \
519-
ssl/__init__.c \
520-
ssl/SSLContext.c \
521-
ssl/SSLSocket.c \
522519
supervisor/Runtime.c \
523520
supervisor/__init__.c \
524521
usb_host/__init__.c \
@@ -730,6 +727,18 @@ SRC_SHARED_MODULE_ALL += \
730727
touchio/__init__.c
731728
endif
732729

730+
ifeq ($(CIRCUITPY_SSL_MBEDTLS),0)
731+
SRC_COMMON_HAL_ALL += \
732+
ssl/__init__.c \
733+
ssl/SSLContext.c \
734+
ssl/SSLSocket.c
735+
else
736+
SRC_SHARED_MODULE_ALL += \
737+
ssl/__init__.c \
738+
ssl/SSLContext.c \
739+
ssl/SSLSocket.c
740+
endif
741+
733742
# If supporting _bleio via HCI, make devices/ble_hci/common-hal/_bleio be includable,
734743
# and use C source files in devices/ble_hci/common-hal.
735744
ifeq ($(CIRCUITPY_BLEIO_HCI),1)

py/makeversionhdr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def make_version_header(repo_path, filename):
119119
#define MICROPY_VERSION_STRING "%s"
120120
// Combined version as a 32-bit number for convenience
121121
#define MICROPY_VERSION (MICROPY_VERSION_MAJOR << 16 | MICROPY_VERSION_MINOR << 8 | MICROPY_VERSION_MICRO)
122-
#define MICROPY_FULL_VERSION_INFO "Adafruit CircuitPython " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME
122+
#define MICROPY_FULL_VERSION_INFO "Adafruit CircuitPython " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_BANNER_MACHINE
123123
""" % (
124124
git_tag,
125125
git_hash,

shared-bindings/ssl/SSLContext.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLCONTEXT_H
2828
#define MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLCONTEXT_H
2929

30+
#if CIRCUITPY_SSL_MBEDTLS
31+
#include "shared-module/ssl/SSLContext.h"
32+
#else
3033
#include "common-hal/ssl/SSLContext.h"
34+
#endif
3135

3236
#include "shared-bindings/socketpool/Socket.h"
3337
#include "shared-bindings/ssl/SSLSocket.h"

shared-bindings/ssl/SSLSocket.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLSOCKET_H
2828
#define MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLSOCKET_H
2929

30+
#if CIRCUITPY_SSL_MBEDTLS
31+
#include "shared-module/ssl/SSLSocket.h"
32+
#else
3033
#include "common-hal/ssl/SSLSocket.h"
34+
#endif
3135

3236
extern const mp_obj_type_t ssl_sslsocket_type;
3337

shared-bindings/ssl/__init__.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SSL___INIT___H
2828
#define MICROPY_INCLUDED_SHARED_BINDINGS_SSL___INIT___H
2929

30+
#if CIRCUITPY_SSL_MBEDTLS
31+
#include "shared-module/ssl/SSLContext.h"
32+
#else
3033
#include "common-hal/ssl/SSLContext.h"
34+
#endif
3135

3236
void common_hal_ssl_create_default_context(ssl_sslcontext_obj_t *self);
3337

ports/raspberrypi/common-hal/ssl/SSLSocket.h renamed to shared-module/ssl/SSLSocket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#include "py/obj.h"
3131

32-
#include "common-hal/ssl/SSLContext.h"
32+
#include "shared-module/ssl/SSLContext.h"
3333
#include "common-hal/socketpool/Socket.h"
3434

3535
#include "mbedtls/platform.h"

ports/raspberrypi/common-hal/ssl/__init__.c renamed to shared-module/ssl/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* THE SOFTWARE.
2626
*/
2727

28-
#include "common-hal/ssl/__init__.h"
28+
#include "shared-module/ssl/__init__.h"
2929
#include "shared-bindings/ssl/__init__.h"
3030
#include "shared-bindings/ssl/SSLContext.h"
3131
#include "lib/mbedtls_config/crt_bundle.h"

0 commit comments

Comments
 (0)