Skip to content

Commit 4c32c86

Browse files
committed
bluetooth: host: Add support for SMP error code 0x0f
This error code informs that peer device rejected key during keys distribution phase. Signed-off-by: Szymon Janc <[email protected]>
1 parent 59648f9 commit 4c32c86

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

include/bluetooth/conn.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,9 @@ enum bt_security_err {
751751
/** Invalid parameters. */
752752
BT_SECURITY_ERR_INVALID_PARAM,
753753

754+
/** Distributed Key Rejected */
755+
BT_SECURITY_ERR_KEY_REJECTED,
756+
754757
/** Pairing failed but the exact reason could not be specified. */
755758
BT_SECURITY_ERR_UNSPECIFIED,
756759
};

subsys/bluetooth/host/smp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ static enum bt_security_err security_err_get(uint8_t smp_err)
430430
return BT_SECURITY_ERR_PAIR_NOT_ALLOWED;
431431
case BT_SMP_ERR_INVALID_PARAMS:
432432
return BT_SECURITY_ERR_INVALID_PARAM;
433+
case BT_SMP_ERR_KEY_REJECTED:
434+
return BT_SECURITY_ERR_KEY_REJECTED;
433435
case BT_SMP_ERR_UNSPECIFIED:
434436
default:
435437
return BT_SECURITY_ERR_UNSPECIFIED;

subsys/bluetooth/host/smp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct bt_smp_hdr {
2727
#define BT_SMP_ERR_NUMERIC_COMP_FAILED 0x0c
2828
#define BT_SMP_ERR_BREDR_PAIRING_IN_PROGRESS 0x0d
2929
#define BT_SMP_ERR_CROSS_TRANSP_NOT_ALLOWED 0x0e
30+
#define BT_SMP_ERR_KEY_REJECTED 0x0f
3031

3132
#define BT_SMP_IO_DISPLAY_ONLY 0x00
3233
#define BT_SMP_IO_DISPLAY_YESNO 0x01

0 commit comments

Comments
 (0)