Skip to content

[SL-UP] Upgrade mbedTLS 3.x to 4.x - #1196

Open
Ricardo Casallas (rcasallas-silabs) wants to merge 1 commit into
release_2.10-1.6.1from
feature/mbedtls4
Open

Ricardo Casallas (rcasallas-silabs) wants to merge 1 commit into
release_2.10-1.6.1from
feature/mbedtls4

Conversation

@rcasallas-silabs

Copy link
Copy Markdown
Contributor

Summary

Upgrade mbedTLS support from 3.x to 4.x:

  • Build paths updated
  • Crypto function updated

Related issues

Testing

  • Lighting-app built and commission with MG24, MG26, Six301 and Si907

@rcasallas-silabs
Ricardo Casallas (rcasallas-silabs) force-pushed the feature/mbedtls4 branch 2 times, most recently from 3db32ec to df97526 Compare September 17, 2026 14:57
@rcasallas-silabs Ricardo Casallas (rcasallas-silabs) changed the title mbedTLS 4.x: WORK IN PROGRESS. Upgrade mbedTLS 3.x ot 4.x Sep 17, 2026
@rcasallas-silabs Ricardo Casallas (rcasallas-silabs) changed the title Upgrade mbedTLS 3.x ot 4.x Upgrade mbedTLS 3.x to 4.x Sep 21, 2026
@rcasallas-silabs
Ricardo Casallas (rcasallas-silabs) force-pushed the feature/mbedtls4 branch 7 times, most recently from bd1957e to f4f5f73 Compare September 28, 2026 14:52
@rcasallas-silabs
Ricardo Casallas (rcasallas-silabs) force-pushed the feature/mbedtls4 branch 3 times, most recently from 8e177c7 to 80479d2 Compare October 5, 2026 19:44
@rcasallas-silabs
Ricardo Casallas (rcasallas-silabs) force-pushed the feature/mbedtls4 branch 4 times, most recently from e99074d to 6fc6e37 Compare October 8, 2026 16:22
Comment thread examples/platform/silabs/mmic/matter_cert_issuer.cpp Dismissed
@rcasallas-silabs
Ricardo Casallas (rcasallas-silabs) force-pushed the feature/mbedtls4 branch 2 times, most recently from 37c9bff to 00d6f7a Compare October 8, 2026 21:18
@rcasallas-silabs
Ricardo Casallas (rcasallas-silabs) changed the base branch from main to release_2.10-1.6.1 October 8, 2026 21:23
@rcasallas-silabs
Ricardo Casallas (rcasallas-silabs) force-pushed the feature/mbedtls4 branch 6 times, most recently from 573ed22 to 11f297c Compare October 14, 2026 11:18
@rcasallas-silabs Ricardo Casallas (rcasallas-silabs) changed the title Upgrade mbedTLS 3.x to 4.x [SL-ONLY] Upgrade mbedTLS 3.x to 4.x Oct 14, 2026
@silabs-matter-ci-bot silabs-matter-ci-bot Bot added the sl-only This TAG indicates that this commit is a silabs-specific commit that cannot be upstreamed to CSA. label Oct 14, 2026
@rcasallas-silabs
Ricardo Casallas (rcasallas-silabs) force-pushed the feature/mbedtls4 branch 5 times, most recently from 555036e to 61c45e3 Compare October 16, 2026 14:01
@rcasallas-silabs Ricardo Casallas (rcasallas-silabs) changed the title [SL-ONLY] Upgrade mbedTLS 3.x to 4.x [SL-UP] Upgrade mbedTLS 3.x to 4.x Oct 16, 2026
@silabs-matter-ci-bot silabs-matter-ci-bot Bot added sl-up This TAG indicates that this commit needs to be upstreamed to CSA before its next release. and removed sl-only This TAG indicates that this commit is a silabs-specific commit that cannot be upstreamed to CSA. labels Oct 16, 2026
@cursor

cursor Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

PR Summary

High Risk
Touches commissioning crypto, DAC provisioning, certificate parsing, OTA decryption, and OpenThread link-layer security across EFR32 and SiWx917.

Overview
Upgrades Silicon Labs Matter builds to mbedTLS 4 and the split TF-PSA-Crypto layout: GN/SDK wiring now compiles crypto from mbedtls/mbedtls plus tf-psa-crypto, switches PSA config to TF_PSA_CRYPTO_CONFIG_FILE, and retargets Simplicity SDK paths (e.g. OpenThread under thread/ and openthread_forks, lwIP under network_stack).

Platform crypto is updated for mbedTLS 4 API breaks: legacy symbols move behind MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS and mbedtls/private/*; HKDF is reimplemented where mbedtls_hkdf was removed; X.509/CSR public-key export uses PSA (mbedtls_pk_import_into_psa / mbedtls_pk_write_pubkey_psa); psa_open_key is replaced with attribute checks or direct destroy; provisioning and OTA paths use PSA keygen/signing and PSA AES-CTR instead of direct mbed APIs where required.

SiWx917 tinycrypt builds add siwx917_psa_tinycrypt_stubs.c so PK/X.509 can call a minimal PSA surface without the full TF-PSA core. Series 3 (simg301) adds simg301-clang.ld for the new flash/RAM/NVM layout. OpenThread on EFR32 picks up updated platform MAC/security sources from the SDK.

Reviewed by Cursor Bugbot for commit d812eaf. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d812eaf. Configure here.

psa_cipher_finish(&operation, block.data() + output_len, block.size() - output_len, &final_len);
psa_destroy_key(key_id);


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OTA decrypt ignores cipher finish errors

High Severity

Decrypt never checks psa_cipher_finish and always returns success while advancing mIVOffset. PSA CTR can leave the last bytes in finish, and a failed finish must be aborted. Encrypted OTA can then apply a corrupt image or decrypt later chunks with a wrong counter. The same path also runs AES-CTR in place, unlike the working PSA decrypt helper that uses a separate output buffer.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d812eaf. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sl-up This TAG indicates that this commit needs to be upstreamed to CSA before its next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants