mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-11-10 14:30:33 +00:00
mesh: Check LPN credentials before establishment
While the friend node considers the friendship established as soon as it sends the friendship offer, the LPN only considers the friendship established once it receives the first update after its poll. This update is encrypted with the friendship credentials, which aren't available, as they're protected by an if (lpn_established()) check. Changes the check to lpn_waiting_update(), which makes the LPN check its friendship credentials only when it's expecting a response to a poll message. This is the only time the friend will send messages encrypted with the friendship credentials. This is port of 040b027e00545326919d323ab1d5272fc8517eb7
This commit is contained in:
committed by
Łukasz Rymanowski
parent
4ccfa1ce03
commit
5642a14a50
@@ -593,7 +593,7 @@ bool bt_mesh_net_cred_find(struct bt_mesh_net_rx *rx, struct os_mbuf *in,
|
||||
BT_DBG("");
|
||||
|
||||
#if MYNEWT_VAL(BLE_MESH_LOW_POWER)
|
||||
if (bt_mesh_lpn_established()) {
|
||||
if (bt_mesh_lpn_waiting_update()) {
|
||||
rx->sub = bt_mesh.lpn.sub;
|
||||
|
||||
for (j = 0; j < ARRAY_SIZE(bt_mesh.lpn.cred); j++) {
|
||||
|
||||
Reference in New Issue
Block a user