mirror of
https://github.com/espressif/openthread.git
synced 2026-09-19 15:40:07 +00:00
Reject a null `aHeader` combined with non-zero `mHeaderLength` in `otPlatCryptoAesCcmProcessOneShot()`, in both the mbedtls and PSA backends. Add `otPlatCryptoIsKeyRefValid()` so each crypto backend can define what KeyRef values it accepts, and use it in the default PSA backend at every entry point that takes a KeyRef (import/export/destroy/ has-key, AES, HMAC, HKDF, ECDSA) instead of relying solely on the underlying PSA library to reject a bad handle. Make the "invalid KeyRef" sentinel backend-configurable via the new `OPENTHREAD_CONFIG_CRYPTO_INVALID_KEY_REF`, defaulting to `PSA_KEY_ID_NULL` (0), so a backend other than the default PSA one can reserve a different value as invalid without a generic core header depending on any one backend's implementation file.