summaryrefslogtreecommitdiff
path: root/mesh/appkey.h
diff options
context:
space:
mode:
authorMichaƂ Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>2019-10-03 13:07:47 -0700
committerBrian Gix <brian.gix@intel.com>2019-10-03 13:10:16 -0700
commit37bbe30c92a729a4f819fde349443ce07a23cf93 (patch)
treeafdd2ba86be3406af21de2c60e03a87da3e6d6d9 /mesh/appkey.h
parent45beec16bd26c246eb1378344be7e4a23abd5937 (diff)
downloadbluez-37bbe30c92a729a4f819fde349443ce07a23cf93.tar.gz
mesh: Align appkey_packet_decrypt with dev and virt variants.
Move appkey_packet_decrypt to mesh/model, rename it to app_packet_decrypt, make it private and change arguments to be aligned with other decryption functions. Also, simplify the implementation using an inline loop, removing the need of mod_decrypt struct.
Diffstat (limited to 'mesh/appkey.h')
-rw-r--r--mesh/appkey.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesh/appkey.h b/mesh/appkey.h
index 4c135580a..b3e548071 100644
--- a/mesh/appkey.h
+++ b/mesh/appkey.h
@@ -20,19 +20,19 @@
/* TODO: get this number from configuration */
#define MAX_APP_KEYS 32
+struct mesh_app_key;
+
bool appkey_key_init(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,
uint8_t *key_value, uint8_t *new_key_value);
void appkey_key_free(void *data);
-int appkey_packet_decrypt(struct mesh_net *net, bool szmict, uint32_t seq,
- uint32_t iv_index, uint16_t src, uint16_t dst,
- uint8_t *virt, uint16_t virt_size,
- uint8_t key_id, const uint8_t *data,
- uint16_t data_size, uint8_t *out);
bool appkey_msg_in_replay_cache(struct mesh_net *net, uint16_t idx,
uint16_t src, uint16_t crpl, uint32_t seq,
uint32_t iv_index);
const uint8_t *appkey_get_key(struct mesh_net *net, uint16_t app_idx,
uint8_t *key_id);
+int appkey_get_key_idx(struct mesh_app_key *app_key,
+ const uint8_t **key, uint8_t *key_aid,
+ const uint8_t **new_key, uint8_t *new_key_aid);
bool appkey_have_key(struct mesh_net *net, uint16_t app_idx);
uint16_t appkey_net_idx(struct mesh_net *net, uint16_t app_idx);
int appkey_key_add(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,