You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/06/15 02:27:34 UTC
[12/50] [abbrv] incubator-mynewt-core git commit: BLE Host -
initiator tx key exch if no keys rx.
BLE Host - initiator tx key exch if no keys rx.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/0fea9781
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/0fea9781
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/0fea9781
Branch: refs/heads/develop
Commit: 0fea97810e84002b1ee1ec5b31cdbd88ac3e6e97
Parents: 830149e
Author: Christopher Collins <cc...@apache.org>
Authored: Wed Jun 8 15:04:26 2016 +0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Jun 14 19:23:35 2016 -0700
----------------------------------------------------------------------
net/nimble/host/src/ble_sm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0fea9781/net/nimble/host/src/ble_sm.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_sm.c b/net/nimble/host/src/ble_sm.c
index ade4702..27863a1 100644
--- a/net/nimble/host/src/ble_sm.c
+++ b/net/nimble/host/src/ble_sm.c
@@ -992,7 +992,9 @@ ble_sm_enc_change_rx(struct hci_encrypt_change *evt)
proc->state = BLE_SM_PROC_STATE_KEY_EXCH;
/* The responder sends its keys first. */
- if (!(proc->flags & BLE_SM_PROC_F_INITIATOR)) {
+ if (!(proc->flags & BLE_SM_PROC_F_INITIATOR) ||
+ proc->rx_key_flags == 0) {
+
res.execute = 1;
}
} else {
@@ -1174,7 +1176,7 @@ ble_sm_ltk_restore_exec(struct ble_sm_proc *proc, struct ble_sm_result *res,
res->app_status = BLE_HS_ENOENT;
}
-
+
if (res->app_status == 0) {
proc->state = BLE_SM_PROC_STATE_ENC_RESTORE;
}