mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-30 15:32:41 +00:00
mesh: store NetKey in provisioning data
This commit is contained in:
parent
59988a1a07
commit
300c31f618
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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" */
|
||||
|
Loading…
x
Reference in New Issue
Block a user