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
..
2023-06-28 08:54:23 -07:00

OpenThread Simulation on POSIX

This directory contains example platform drivers for simulation on POSIX.

Build Examples

$ cd <path-to-openthread>
$ mkdir build && cd build
$ cmake -GNinja -DOT_PLATFORM=simulation ..
$ ninja

After a successful build, the elf files are found in:

  • <path-to-openthread>/build/examples/apps/cli
  • <path-to-openthread>/build/examples/apps/ncp

Interact

  1. Spawn the process:
$ cd <path-to-openthread>/build/simulation/examples/apps/cli
$ ./ot-cli-ftd 1
  1. Type help for list of commands.
> help
help
channel
childtimeout
contextreusedelay
extaddr
extpanid
ipaddr
keysequence
leaderweight
mode
netdata register
networkidtimeout
networkkey
networkname
panid
ping
prefix
releaserouterid
rloc16
route
routerupgradethreshold
scan
start
state
stop