38 #ifndef NRF_MESH_PROV_H__ 39 #define NRF_MESH_PROV_H__ 45 #include "nrf_mesh_config_prov.h" 46 #include "nrf_mesh_prov_types.h" 47 #include "nrf_mesh_prov_events.h" 48 #include "nrf_mesh_prov_bearer.h" 49 #include "nrf_mesh_assert.h" 71 #define NRF_MESH_PROV_OOB_CAPS_DEFAULT(NUM_ELEMENTS) \ 72 {NUM_ELEMENTS, NRF_MESH_PROV_ALGORITHM_FIPS_P256EC, 0, NRF_MESH_PROV_OOB_STATIC_TYPE_SUPPORTED, 0, 0, 0, 0} 158 prov_bearer_t * p_prov_bearer);
176 uint16_t oob_info_sources,
177 uint32_t bearer_types);
216 const uint8_t * p_target_uuid,
299 const uint8_t * p_data,
uint8_t confirmation_inputs[PROV_CONFIRMATION_INPUT_LEN]
Confirmation inputs, used to calculate the confirmation key.
#define PROV_SALT_LEN
Length of Salt value.
uint32_t nrf_mesh_prov_listen(nrf_mesh_prov_ctx_t *p_ctx, const char *URI, uint16_t oob_info_sources, uint32_t bearer_types)
Listens for an incoming provisioning link.
bool pubkey_oob
Uses out-of-band public key.
uint8_t peer_random[PROV_RANDOM_LEN]
Random number for the peer node.
#define NRF_MESH_PROV_PUBKEY_SIZE
Size of the elliptic curve public key.
#define NRF_MESH_KEY_SIZE
Size (in octets) of an encryption key.
uint8_t data_nonce[PROV_NONCE_LEN]
Provisioning data nonce.
uint32_t nrf_mesh_prov_provision(nrf_mesh_prov_ctx_t *p_ctx, const uint8_t *p_target_uuid, uint8_t attention_duration_s, const nrf_mesh_prov_provisioning_data_t *p_data, nrf_mesh_prov_bearer_type_t bearer)
Provisions a device.
uint8_t auth_value[PROV_AUTH_LEN]
Authentication value.
uint8_t node_random[PROV_RANDOM_LEN]
Random number for the current node.
static uint32_t nrf_mesh_prov_oob_number_provide(nrf_mesh_prov_ctx_t *p_ctx, uint32_t number)
Provides out-of-band authentication number to the provisioning stack.
uint32_t nrf_mesh_prov_auth_data_provide(nrf_mesh_prov_ctx_t *p_ctx, const uint8_t *p_data, uint8_t size)
Provides out-of-band authentication data input to the provisioning stack.
nrf_mesh_prov_state_t state
Provisioning state machine state.
#define PROV_NONCE_LEN
Length of Nonce.
nrf_mesh_prov_evt_handler_cb_t event_handler
Application event handler callback function.
nrf_mesh_prov_oob_caps_t capabilities
Node OOB and authentication capabilities.
prov_bearer_t * p_active_bearer
Pointer to the currently active bearer (valid when )
nrf_mesh_prov_role_t role
Provisioning role, provisioner or provisionee.
uint8_t session_key[NRF_MESH_KEY_SIZE]
Provisioning session key.
uint32_t nrf_mesh_prov_shared_secret_provide(nrf_mesh_prov_ctx_t *p_ctx, const uint8_t *p_shared)
Provides the shared secret to the provisioning stack after running a requested ECDH calculation...
#define PROV_RANDOM_LEN
Length of Random value.
nrf_mesh_prov_failure_code_t failure_code
Error code sent with the previous provisioning failed packet.
uint8_t oob_size
Size of the chosen OOB authentication data.
void nrf_mesh_prov_scan_stop(void)
Stops the scanning for unprovisioned devices (if started).
Common provisioning context forward declaration.
#define PROV_CONFIRMATION_INPUT_LEN
Combined length of confirmation inputs: provisioning invite, capabilities and start PDUs...
#define PROV_AUTH_LEN
Length of Auth value.
uint32_t nrf_mesh_prov_listen_stop(nrf_mesh_prov_ctx_t *p_ctx)
Stops listening for an incoming provisioning link.
list_node_t * p_bearers
Bearer linked list head pointer.
nrf_mesh_prov_failure_code_t
Provisioning failure codes.
nrf_mesh_prov_role_t
Provisioning role.
uint8_t device_key[NRF_MESH_KEY_SIZE]
Node device key.
void(* nrf_mesh_prov_evt_handler_cb_t)(const nrf_mesh_prov_evt_t *p_evt)
Provisioning event handler callback type.
uint32_t nrf_mesh_prov_generate_keys(uint8_t *p_public, uint8_t *p_private)
Generates a valid keypair for use with the provisioning cryptography.
uint8_t peer_public_key[NRF_MESH_PROV_PUBKEY_SIZE]
Public key of the peer node.
#define PROV_CONFIRMATION_LEN
Length of Confirmation value.
uint32_t nrf_mesh_prov_pubkey_provide(nrf_mesh_prov_ctx_t *p_ctx, const uint8_t *p_key)
Provides a public key to the provisioner if the provisionee has exposed it out-of-band.
nrf_mesh_prov_oob_method_t
Out-of-band authentication methods for provisioning.
Provisioning authentication capabilities.
uint32_t nrf_mesh_prov_bearer_add(nrf_mesh_prov_ctx_t *p_ctx, prov_bearer_t *p_prov_bearer)
Adds a new bearer to the provisioning context structure.
nrf_mesh_prov_state_t
Provisioning state machine states.
#define NRF_MESH_PROV_ECDHSECRET_SIZE
Size of the elliptic curve secret key.
const uint8_t * p_public_key
Public key of this node.
uint8_t shared_secret[NRF_MESH_PROV_ECDHSECRET_SIZE]
ECDH shared secret: P-256(private key, peer public key).
uint32_t nrf_mesh_prov_scan_start(nrf_mesh_prov_evt_handler_cb_t event_handler)
Starts the scanning for unprovisioned devices.
Provisioning data to transmit to a device.
uint32_t nrf_mesh_prov_oob_use(nrf_mesh_prov_ctx_t *p_ctx, nrf_mesh_prov_oob_method_t method, uint8_t action, uint8_t size)
Selects which out-of-band authentication method to use.
nrf_mesh_prov_bearer_type_t
Provisioning bearer types.
uint32_t supported_bearers
Supported bearer types bitfield, nrf_mesh_prov_bearer_type_t.
uint32_t nrf_mesh_prov_init(nrf_mesh_prov_ctx_t *p_ctx, const uint8_t *p_public_key, const uint8_t *p_private_key, const nrf_mesh_prov_oob_caps_t *p_caps, nrf_mesh_prov_evt_handler_cb_t event_handler)
Initializes the provisioning context structure.
uint8_t peer_confirmation[PROV_CONFIRMATION_LEN]
Confirmation value for the peer node.
nrf_mesh_prov_provisioning_data_t data
Provisioning data to send to the provisionee or received from the provisioner.
uint8_t confirmation_salt[PROV_SALT_LEN]
Confirmation salt value.
nrf_mesh_prov_oob_method_t oob_method
Chosen OOB authentication method.
#define NRF_MESH_PROV_BEARER_COUNT
Number of supported bearers.
uint8_t oob_action
Chosen OOB action.
#define NRF_MESH_STATIC_ASSERT(...)
Compile-time assertion.
const uint8_t * p_private_key
Private key of this node.
uint8_t attention_duration_s
Time in seconds during which the device will identify itself using any means it can.