You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2022/04/13 12:30:59 UTC
[mynewt-nimble] branch master updated: nimble/sm: Ensure bonded flag is set in sm_result on new pair & bond.
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 327d9326 nimble/sm: Ensure bonded flag is set in sm_result on new pair & bond.
327d9326 is described below
commit 327d9326e6b8da0f240de4262956d274f6b95b55
Author: Andrew Leech <an...@planetinnovation.com.au>
AuthorDate: Mon Oct 11 10:36:38 2021 +1100
nimble/sm: Ensure bonded flag is set in sm_result on new pair & bond.
The bonded flag was not set on new connection in ble_gap_enc_event()
---
nimble/host/src/ble_sm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c
index c63af408..5489551a 100644
--- a/nimble/host/src/ble_sm.c
+++ b/nimble/host/src/ble_sm.c
@@ -2041,14 +2041,16 @@ ble_sm_key_exch_success(struct ble_sm_proc *proc, struct ble_sm_result *res)
/* The procedure is now complete. Update connection bonded state and
* terminate procedure.
*/
+ int bonded = !!(proc->flags & BLE_SM_PROC_F_BONDING);
ble_sm_update_sec_state(proc->conn_handle, 1,
!!(proc->flags & BLE_SM_PROC_F_AUTHENTICATED),
- !!(proc->flags & BLE_SM_PROC_F_BONDING),
+ bonded,
proc->key_size);
proc->state = BLE_SM_PROC_STATE_NONE;
res->app_status = 0;
res->enc_cb = 1;
+ res->bonded = bonded;
}
static void