Skip to content

Commit 100287d

Browse files
joerchancarlescufi
authored andcommitted
Bluetooth: controller: Fix bug in LL encryption.
Fix bug in LL encryption procedure, controller was using the wrong pointer to connection state. Function event_enc_prep is called from slave_event_prepare, where _radio.curr_conn has not been assigned yet. The connection ended up sending LL_START_ENC_RSP unencrypted, resulting in disconnect on the peer side with reason MIC failure. Signed-off-by: Joakim Andersson <[email protected]>
1 parent dffe78b commit 100287d

File tree

1 file changed

+5
-5
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+5
-5
lines changed

subsys/bluetooth/controller/ll_sw/ctrl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7467,11 +7467,11 @@ static inline void event_enc_prep(struct connection *conn)
74677467

74687468
#if !defined(CONFIG_BT_CTLR_FAST_ENC)
74697469
} else {
7470-
start_enc_rsp_send(_radio.conn_curr, pdu_ctrl_tx);
7470+
start_enc_rsp_send(conn, pdu_ctrl_tx);
74717471

74727472
/* resume data packet rx and tx */
7473-
_radio.conn_curr->pause_rx = 0;
7474-
_radio.conn_curr->pause_tx = 0;
7473+
conn->pause_rx = 0;
7474+
conn->pause_tx = 0;
74757475
#endif /* !CONFIG_BT_CTLR_FAST_ENC */
74767476

74777477
}
@@ -9961,10 +9961,10 @@ static u8_t feature_rsp_send(struct connection *conn,
99619961

99629962
/* AND the feature set to get Feature USED */
99639963
req = &pdu_data_rx->llctrl.feature_req;
9964-
_radio.conn_curr->llcp_features &= feat_get(&req->features[0]);
9964+
conn->llcp_features &= feat_get(&req->features[0]);
99659965

99669966
/* features exchanged */
9967-
_radio.conn_curr->common.fex_valid = 1U;
9967+
conn->common.fex_valid = 1U;
99689968

99699969
/* Enqueue feature response */
99709970
pdu_ctrl_tx = (void *)node_tx->pdu_data;

0 commit comments

Comments
 (0)