Bluetooth: Mesh: Add OOB Public Key support for provisionee role

This commit allows an unprovisioned device to exchange its public key
using out-of-band techology (see MeshPRFv1.0.1, table 5.19 and section
5.4.2.3).

For in-band public key exchange, the mesh stack uses HCI commands to
generate public and private keys, and DH key. This, however, doesn't
work for OOB public key exchange since there is no command to generate
DH key with a private key provided by an application. Therefore, this
commit adds direct usage of TinyCrypto into the mesh stack for DH key
generation for OOB public key support.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
Pavel Vasilyev 2021-06-09 11:01:57 +02:00 committed by Anas Nashif
commit 0335d5fb01
5 changed files with 123 additions and 22 deletions

View file

@ -105,6 +105,23 @@ struct bt_mesh_prov {
/** Out of Band information field. */
bt_mesh_prov_oob_info_t oob_info;
/** Pointer to Public Key in big-endian for OOB public key type support.
*
* Remember to enable @option{CONFIG_BT_MESH_PROV_OOB_PUBLIC_KEY}
* when initializing this parameter.
*
* Must be used together with @ref bt_mesh_prov::private_key_be.
*/
const uint8_t *public_key_be;
/** Pointer to Private Key in big-endian for OOB public key type support.
*
* Remember to enable @option{CONFIG_BT_MESH_PROV_OOB_PUBLIC_KEY}
* when initializing this parameter.
*
* Must be used together with @ref bt_mesh_prov::public_key_be.
*/
const uint8_t *private_key_be;
/** Static OOB value */
const uint8_t *static_val;
/** Static OOB value length */