From c71a30036d5523078fd85685db2c91acb5557bfb Mon Sep 17 00:00:00 2001 From: Jannis Achstetter Date: Sun, 29 Mar 2026 14:10:05 +0200 Subject: [PATCH 1/2] fix: Add missing block_cipher.c to pico_mbedtls --- src/rp2_common/pico_mbedtls/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rp2_common/pico_mbedtls/CMakeLists.txt b/src/rp2_common/pico_mbedtls/CMakeLists.txt index 60c9991eb..570b00a6c 100644 --- a/src/rp2_common/pico_mbedtls/CMakeLists.txt +++ b/src/rp2_common/pico_mbedtls/CMakeLists.txt @@ -37,6 +37,7 @@ if (EXISTS ${PICO_MBEDTLS_PATH}/${MBEDTLS_TEST_PATH}) asn1write.c base64.c bignum.c + block_cipher.c camellia.c ccm.c chacha20.c From 14ce78e50de8a1652ce80bb103337a40860e7ee7 Mon Sep 17 00:00:00 2001 From: Jannis Achstetter Date: Mon, 30 Mar 2026 13:31:05 +0200 Subject: [PATCH 2/2] feat: mbedtls: Only include block_cipher.c if it exists (v3.6.0 onwards) --- src/rp2_common/pico_mbedtls/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rp2_common/pico_mbedtls/CMakeLists.txt b/src/rp2_common/pico_mbedtls/CMakeLists.txt index 570b00a6c..2a9d63711 100644 --- a/src/rp2_common/pico_mbedtls/CMakeLists.txt +++ b/src/rp2_common/pico_mbedtls/CMakeLists.txt @@ -37,7 +37,6 @@ if (EXISTS ${PICO_MBEDTLS_PATH}/${MBEDTLS_TEST_PATH}) asn1write.c base64.c bignum.c - block_cipher.c camellia.c ccm.c chacha20.c @@ -122,6 +121,14 @@ if (EXISTS ${PICO_MBEDTLS_PATH}/${MBEDTLS_TEST_PATH}) sha3.c ) endif() + + # block_cipher.c was only added with v3.6.0. Support versions without it as well + if (EXISTS ${PICO_MBEDTLS_PATH}/library/block_cipher.c) + list(APPEND src_crypto + block_cipher.c + ) + endif() + list(TRANSFORM src_crypto PREPEND ${PICO_MBEDTLS_PATH}/library/) set(src_crypto ${src_crypto} PARENT_SCOPE) endfunction()