mesh: store NetKey in provisioning data

This commit is contained in:
Matthias Ringwald 2019-04-24 11:06:24 +02:00
parent 59988a1a07
commit 300c31f618
4 changed files with 9 additions and 4 deletions

View File

@ -125,7 +125,7 @@ void mesh_network_key_list_add_from_provisioning_data(const mesh_provisioning_da
memset(network_key, 0, sizeof(mesh_network_key_t));
// NetKey
// memcpy(network_key->net_key, provisioning_data, net_key);
memcpy(network_key->net_key, provisioning_data->net_key, 16);
// IdentityKey
// memcpy(network_key->identity_key, provisioning_data->identity_key, 16);

View File

@ -125,14 +125,15 @@ typedef enum {
} mesh_identification_type_t;
typedef struct {
uint8_t network_key[16];
uint8_t device_key[16];
uint8_t flags;
uint32_t iv_index;
uint16_t unicast_address;
// net_key and derived data
uint8_t net_key[16];
// k1
uint8_t identity_key[16];
uint8_t identity_key[16];
uint8_t beacon_key[16];
// k2
uint8_t nid;

View File

@ -941,3 +941,6 @@ const uint8_t * provisioning_device_data_get_encryption_key(void){
const uint8_t * provisioning_device_data_get_privacy_key(void){
return network_key.privacy_key;
}
const uint8_t * provisioning_device_data_get_net_key(void){
return network_key.net_key;
}

View File

@ -118,6 +118,7 @@ const uint8_t * provisioning_device_data_get_network_id(void);
uint32_t provisioning_device_data_get_iv_index(void);
const uint8_t * provisioning_device_data_get_beacon_key(void);
const uint8_t * provisioning_device_data_get_identity_key(void);
const uint8_t * provisioning_device_data_get_net_key(void);
#ifdef __cplusplus
} /* end of extern "C" */