Bluetooth: SMP: Give security changed when rejecting LTK
Give the security changed callback when the peripheral initiated security request and peer attempted to encrypt the connection but no LTK match was found. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
545f090d8b
commit
05354129e7
3 changed files with 19 additions and 0 deletions
|
@ -3248,6 +3248,7 @@ static void le_ltk_request(struct net_buf *buf)
|
|||
#endif /* !CONFIG_BT_SMP_SC_PAIR_ONLY */
|
||||
|
||||
le_ltk_neg_reply(evt->handle);
|
||||
bt_smp_keys_reject(conn);
|
||||
|
||||
done:
|
||||
bt_conn_unref(conn);
|
||||
|
|
|
@ -5000,6 +5000,23 @@ bool bt_smp_keys_check(struct bt_conn *conn)
|
|||
return true;
|
||||
}
|
||||
|
||||
void bt_smp_keys_reject(struct bt_conn *conn)
|
||||
{
|
||||
struct bt_smp *smp;
|
||||
|
||||
smp = smp_chan_get(conn);
|
||||
if (!smp) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ)) {
|
||||
bt_conn_security_changed(smp->chan.chan.conn,
|
||||
BT_SECURITY_ERR_PIN_OR_KEY_MISSING);
|
||||
}
|
||||
|
||||
smp_reset(smp);
|
||||
}
|
||||
|
||||
static int bt_smp_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -128,6 +128,7 @@ int bt_smp_send_security_req(struct bt_conn *conn);
|
|||
void bt_smp_update_keys(struct bt_conn *conn);
|
||||
bool bt_smp_get_tk(struct bt_conn *conn, u8_t *tk);
|
||||
bool bt_smp_keys_check(struct bt_conn *conn);
|
||||
void bt_smp_keys_reject(struct bt_conn *conn);
|
||||
|
||||
int bt_smp_br_send_pairing_req(struct bt_conn *conn);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue