summaryrefslogtreecommitdiff
path: root/mesh/crypto.c
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2019-11-27 13:39:39 -0800
committerBrian Gix <brian.gix@intel.com>2019-11-28 13:49:59 -0800
commitf246d31a775233578a7c4b721757e9fa9a49f69c (patch)
treed654ae9691b82bd528001d9aa3e8a09adb6657bc /mesh/crypto.c
parent100dfc45018878ef0b5d66316687fb6d4318c4ac (diff)
downloadbluez-f246d31a775233578a7c4b721757e9fa9a49f69c.tar.gz
mesh: Friendship clean-up and rewrite
Friendship support re-written such that it can now support multiple nodes (on multiple mesh networks) as friends to remote Low Power Nodes (LPNs). Validated to properly respond to Friend Requests when enabled, and a hard coded Friend Queue size of 32 (FRND_CACHE_MAX).
Diffstat (limited to 'mesh/crypto.c')
-rw-r--r--mesh/crypto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesh/crypto.c b/mesh/crypto.c
index 15ee6739d..8ea906ac9 100644
--- a/mesh/crypto.c
+++ b/mesh/crypto.c
@@ -699,7 +699,7 @@ bool mesh_crypto_packet_parse(const uint8_t *packet, uint8_t packet_len,
uint16_t this_dst;
bool is_segmented;
- if (packet_len < 14)
+ if (packet_len < 10)
return false;
this_dst = l_get_be16(packet + 7);
@@ -730,7 +730,7 @@ bool mesh_crypto_packet_parse(const uint8_t *packet, uint8_t packet_len,
uint8_t this_opcode = packet[9] & OPCODE_MASK;
if (cookie)
- *cookie = l_get_be32(packet + 9);
+ *cookie = l_get_be32(packet + 2) ^ packet[6];
if (opcode)
*opcode = this_opcode;