nimble/ll: Fix encryption pause

Patch: 479eceb5 nimble/ll: Fix handling LL_PAUSE_ENC_REQ
was incorrect because the intention was to handle LL_PAUSE_ENC_RSP as a
slave there. This patch fixes this but if moves handling it into
ble_ll_ctrl.c.

This fix regression on LL/SEC/SLA/BV-02-C
This commit is contained in:
Łukasz Rymanowski
2019-01-17 13:12:10 -08:00
parent ac5752cc19
commit 6a93c415c2
2 changed files with 6 additions and 6 deletions
-6
View File
@@ -3989,12 +3989,6 @@ chk_rx_terminate_ind:
} else {
/* A slave always replies */
reply = 1;
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_ENCRYPTION)
if (is_ctrl && (opcode == BLE_LL_CTRL_PAUSE_ENC_REQ)
&& (rx_pyld_len == (1 + BLE_LL_CTRL_PAUSE_ENC_REQ_LEN))) {
connsm->enc_data.enc_state = CONN_ENC_S_PAUSED;
}
#endif
}
}
+6
View File
@@ -1359,6 +1359,12 @@ ble_ll_ctrl_rx_pause_enc_rsp(struct ble_ll_conn_sm *connsm)
if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
rc = BLE_LL_CTRL_PAUSE_ENC_RSP;
} else if (connsm->enc_data.enc_state == CONN_ENC_S_PAUSE_ENC_RSP_WAIT) {
/* Master sends back unencrypted LL_PAUSE_ENC_RSP.
* From this moment encryption is paused.
*/
rc = BLE_ERR_MAX;
connsm->enc_data.enc_state = CONN_ENC_S_PAUSED;
} else {
rc = BLE_LL_CTRL_UNKNOWN_RSP;
}