Skip to content

Commit 31ed762

Browse files
KKopyscinskicarlescufi
authored andcommitted
[nrf fromtree] bluetooth/smp: reject pairing in SC Only mode if ...
insufficient keysize This is required for GAP/SEC/SEM/BI-09-C and GAP/SEC/SEM/BI-10-C to pass signed-off-by: Krzysztof Kopyściński <[email protected]> (cherry picked from commit 4c8605b) Signed-off-by: Joakim Andersson <[email protected]>
1 parent 1e8e1a8 commit 31ed762

File tree

1 file changed

+9
-2
lines changed
  • subsys/bluetooth/host

1 file changed

+9
-2
lines changed

subsys/bluetooth/host/smp.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,9 +2699,16 @@ static uint8_t get_auth(struct bt_conn *conn, uint8_t auth)
26992699

27002700
static uint8_t remote_sec_level_reachable(struct bt_smp *smp)
27012701
{
2702-
struct bt_conn *conn = smp->chan.chan.conn;
2702+
bt_security_t sec = smp->chan.chan.conn->required_sec_level;
27032703

2704-
switch (conn->required_sec_level) {
2704+
if (IS_ENABLED(CONFIG_BT_SMP_SC_ONLY)) {
2705+
sec = BT_SECURITY_L4;
2706+
}
2707+
if (IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY)) {
2708+
sec = BT_SECURITY_L3;
2709+
}
2710+
2711+
switch (sec) {
27052712
case BT_SECURITY_L1:
27062713
case BT_SECURITY_L2:
27072714
return 0;

0 commit comments

Comments
 (0)