Files
Thomas Cuyckens 924dd1d1ae [crypto] validate aHeader and KeyRef inputs in platform crypto APIs (#13303)
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.
2026-09-16 22:58:29 -07:00
..