Skip to content

Commit 3597882

Browse files
committed
Update Zephyr to post-4.4.0
1 parent d0e413c commit 3597882

29 files changed

Lines changed: 84 additions & 42 deletions

File tree

lib/AnimatedGIF/gif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//
2424
#include "AnimatedGIF_circuitpy.h"
2525

26-
#ifdef HAL_ESP32_HAL_H_
26+
#ifndef memcpy_P
2727
#define memcpy_P memcpy
2828
#endif
2929

lib/mbedtls_config/crt_bundle.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,32 @@ static int crt_check_signature(mbedtls_x509_crt *child, const uint8_t *pub_key_b
7474
}
7575

7676

77+
#if MBEDTLS_VERSION_MAJOR < 4
7778
// Fast check to avoid expensive computations when not necessary
7879
if (!mbedtls_pk_can_do(&parent.pk, child->MBEDTLS_PRIVATE(sig_pk))) {
7980
LOGE(TAG, "Simple compare failed");
8081
ret = -1;
8182
goto cleanup;
8283
}
84+
#endif
8385

8486
md_info = mbedtls_md_info_from_type(child->MBEDTLS_PRIVATE(sig_md));
8587
if ((ret = mbedtls_md(md_info, child->tbs.p, child->tbs.len, hash)) != 0) {
8688
LOGE(TAG, "Internal mbedTLS error %X", ret);
8789
goto cleanup;
8890
}
8991

92+
#if MBEDTLS_VERSION_MAJOR >= 4
93+
if ((ret = mbedtls_pk_verify_ext(
94+
child->MBEDTLS_PRIVATE(sig_pk), &parent.pk,
95+
child->MBEDTLS_PRIVATE(sig_md), hash, mbedtls_md_get_size(md_info),
96+
child->MBEDTLS_PRIVATE(sig).p, child->MBEDTLS_PRIVATE(sig).len)) != 0) {
97+
#else
9098
if ((ret = mbedtls_pk_verify_ext(
9199
child->MBEDTLS_PRIVATE(sig_pk), child->MBEDTLS_PRIVATE(sig_opts), &parent.pk,
92100
child->MBEDTLS_PRIVATE(sig_md), hash, mbedtls_md_get_size(md_info),
93101
child->MBEDTLS_PRIVATE(sig).p, child->MBEDTLS_PRIVATE(sig).len)) != 0) {
102+
#endif
94103

95104
LOGE(TAG, "PK verify failed with error %X", ret);
96105
goto cleanup;

ports/zephyr-cp/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ endif
2323

2424
.PHONY: $(BUILD)/zephyr-cp/zephyr/zephyr.elf flash recover debug debug-jlink debugserver attach run run-sim clean menuconfig all clean-all sim clean-sim test fetch-port-submodules
2525

26+
export BSIM_COMPONENTS_PATH := $(CURDIR)/tools/bsim/components
27+
export BSIM_OUT_PATH := $(CURDIR)/tools/bsim
28+
2629
$(BUILD)/zephyr-cp/zephyr/zephyr.elf:
2730
python cptools/pre_zephyr_build_prep.py $(BOARD)
2831
west build -b $(BOARD) -d $(BUILD) $(WEST_SHIELD_ARGS) --sysbuild -- $(WEST_CMAKE_ARGS)

ports/zephyr-cp/boards/frdm_rw612.conf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,9 @@ CONFIG_NET_HOSTNAME="circuitpython"
1414

1515
CONFIG_MBEDTLS=y
1616
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
17-
CONFIG_MBEDTLS_RSA_C=y
18-
CONFIG_MBEDTLS_PKCS1_V15=y
19-
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED=y
17+
CONFIG_MBEDTLS_CIPHERSUITE_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256=y
2018
CONFIG_MBEDTLS_ENTROPY_C=y
21-
CONFIG_MBEDTLS_CIPHER_AES_ENABLED=y
2219
CONFIG_MBEDTLS_CTR_DRBG_C=y
23-
CONFIG_MBEDTLS_SHA1=y
24-
CONFIG_MBEDTLS_USE_PSA_CRYPTO=n
2520

2621
CONFIG_BT=y
2722
CONFIG_BT_PERIPHERAL=y

ports/zephyr-cp/boards/native/native_sim/autogen_board_info.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ sharpdisplay = true # Zephyr board has busio
9494
socketpool = true # Zephyr networking enabled
9595
spitarget = false
9696
ssl = false
97-
storage = true # Zephyr board has flash
97+
storage = true
9898
struct = true
9999
supervisor = true
100100
synthio = true # Zephyr board has audiobusio

ports/zephyr-cp/boards/native_sim.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ CONFIG_HEAP_MEM_POOL_SIZE=1024
3939
CONFIG_NET_LOG=y
4040

4141
CONFIG_MBEDTLS=y
42-
CONFIG_MBEDTLS_SHA1=y
43-
CONFIG_MBEDTLS_SHA256=y
42+
CONFIG_PSA_WANT_ALG_SHA_1=y
43+
CONFIG_PSA_WANT_ALG_SHA_256=y

ports/zephyr-cp/boards/nrf7002dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ CONFIG_NETWORKING=y
22
CONFIG_WIFI=y
33

44
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
5-
CONFIG_MBEDTLS_USE_PSA_CRYPTO=n
65

76
CONFIG_BT_DEVICE_APPEARANCE_DYNAMIC=y
87
CONFIG_BT_DEVICE_NAME_DYNAMIC=y

ports/zephyr-cp/boards/rpi_pico2_rp2350a_m33_w.conf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ CONFIG_NET_HOSTNAME="circuitpython"
1414

1515
CONFIG_MBEDTLS=y
1616
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
17-
CONFIG_MBEDTLS_RSA_C=y
18-
CONFIG_MBEDTLS_PKCS1_V15=y
19-
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED=y
17+
CONFIG_MBEDTLS_CIPHERSUITE_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256=y
2018
CONFIG_MBEDTLS_ENTROPY_C=y
21-
CONFIG_MBEDTLS_CIPHER_AES_ENABLED=y
2219
CONFIG_MBEDTLS_CTR_DRBG_C=y
23-
CONFIG_MBEDTLS_SHA1=y
24-
CONFIG_MBEDTLS_USE_PSA_CRYPTO=n

ports/zephyr-cp/boards/rpi_pico_rp2040_w.conf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,8 @@ CONFIG_NET_HOSTNAME="circuitpython"
1414

1515
CONFIG_MBEDTLS=y
1616
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
17-
CONFIG_MBEDTLS_RSA_C=y
18-
CONFIG_MBEDTLS_PKCS1_V15=y
19-
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED=y
17+
CONFIG_MBEDTLS_CIPHERSUITE_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256=y
2018
CONFIG_MBEDTLS_ENTROPY_C=y
21-
CONFIG_MBEDTLS_CIPHER_AES_ENABLED=y
2219
CONFIG_MBEDTLS_CTR_DRBG_C=y
23-
CONFIG_MBEDTLS_SHA1=y
24-
CONFIG_MBEDTLS_USE_PSA_CRYPTO=n
2520

2621
CONFIG_TEST_RANDOM_GENERATOR=y

ports/zephyr-cp/common-hal/busio/UART.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ mp_obj_t common_hal_busio_uart_construct_from_device(busio_uart_obj_t *self, con
2727

2828
// Internal helper for clearing buffer
2929
void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self);
30+
31+
// Zephyr-port-specific write-timeout accessors, used by usb_cdc/Serial.c.
32+
mp_float_t common_hal_busio_uart_get_write_timeout(busio_uart_obj_t *self);
33+
void common_hal_busio_uart_set_write_timeout(busio_uart_obj_t *self, mp_float_t write_timeout);

0 commit comments

Comments
 (0)