Skip to content

Commit 1bf90c6

Browse files
joerchannashif
authored andcommitted
Bluetooth: shell: Add only pairing failed and pairing complete callbacks
Add status only pairing failed callbacks (complete and failed) so that these handlers can be added without providing the ability for MITM pairing procedures. Signed-off-by: Joakim Andersson <[email protected]>
1 parent 00d8068 commit 1bf90c6

File tree

1 file changed

+10
-1
lines changed
  • subsys/bluetooth/shell

1 file changed

+10
-1
lines changed

subsys/bluetooth/shell/bt.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2653,6 +2653,13 @@ static struct bt_conn_auth_cb auth_cb_oob = {
26532653
.bond_deleted = bond_deleted,
26542654
};
26552655

2656+
static struct bt_conn_auth_cb auth_cb_status = {
2657+
.pairing_failed = auth_pairing_failed,
2658+
.pairing_complete = auth_pairing_complete,
2659+
#if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT)
2660+
.pairing_accept = pairing_accept,
2661+
#endif
2662+
};
26562663

26572664
static int cmd_auth(const struct shell *shell, size_t argc, char *argv[])
26582665
{
@@ -2670,6 +2677,8 @@ static int cmd_auth(const struct shell *shell, size_t argc, char *argv[])
26702677
err = bt_conn_auth_cb_register(&auth_cb_confirm);
26712678
} else if (!strcmp(argv[1], "oob")) {
26722679
err = bt_conn_auth_cb_register(&auth_cb_oob);
2680+
} else if (!strcmp(argv[1], "status")) {
2681+
err = bt_conn_auth_cb_register(&auth_cb_status);
26732682
} else if (!strcmp(argv[1], "none")) {
26742683
err = bt_conn_auth_cb_register(NULL);
26752684
} else {
@@ -3031,7 +3040,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds,
30313040
SHELL_CMD_ARG(connections, NULL, HELP_NONE, cmd_connections, 1, 0),
30323041
SHELL_CMD_ARG(auth, NULL,
30333042
"<method: all, input, display, yesno, confirm, "
3034-
"oob, none>",
3043+
"oob, status, none>",
30353044
cmd_auth, 2, 0),
30363045
SHELL_CMD_ARG(auth-cancel, NULL, HELP_NONE, cmd_auth_cancel, 1, 0),
30373046
SHELL_CMD_ARG(auth-passkey, NULL, "<passkey>", cmd_auth_passkey, 2, 0),

0 commit comments

Comments
 (0)