mirror of
https://github.com/espressif/openthread.git
synced 2026-11-13 09:51:02 +00:00
Enable `MBEDTLS_HKDF_C` in `third_party/mbedtls/mbedtls-config.h` and update `otPlatCryptoHkdfExtract()` and `otPlatCryptoHkdfExpand()` to use `mbedtls_hkdf_extract()` and `mbedtls_hkdf_expand()` when `MBEDTLS_HKDF_C` is defined, while keeping the `HmacSha256`-based implementation as a `#else` fallback for custom Mbed TLS configs. Also validate HKDF arguments, including the RFC 5869 output length limit. Update `otPlatCryptoEcdsaGetPublicKey()` to export the uncompressed P-256 public key via `mbedtls_ecp_write_public_key()` on Mbed TLS 3.6 and later instead of accessing private `mbedtls_ecp_point` fields directly, while retaining the `< 3.6` fallback. Expand `test_hkdf_sha256` and `test_ecdsa` unit test coverage for empty inputs, repeated expansion, RFC 5869 output bounds, and invalid inputs.