* [PATCH] Bluetooth: SMP: Check the key size against le_min_key_size
@ 2026-11-22 15:33 Simon Mikuda
2026-11-22 17:28 ` bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-22 15:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz
The minimum LE encryption key size can be raised through the
le_min_key_size debugfs entry, but pairing still checks the peer's
maximum key size against SMP_MIN_ENC_KEY_SIZE, so the setting has no
effect and a shorter key is accepted.
Check against le_min_key_size. PTS test GAP/SEC/SEM/BI-10-C needs the
minimum raised this way.
Fixes: b1f663c91c9d ("Bluetooth: Add debugfs support for min LE encryption key size")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
net/bluetooth/smp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 2538096cae06..3d914da84d6f 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -714,7 +714,7 @@ static u8 check_enc_key_size(struct l2cap_conn *conn, __u8 max_key_size)
return SMP_ENC_KEY_SIZE;
if (max_key_size > hdev->le_max_key_size ||
- max_key_size < SMP_MIN_ENC_KEY_SIZE)
+ max_key_size < hdev->le_min_key_size)
return SMP_ENC_KEY_SIZE;
smp->enc_key_size = max_key_size;
base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-22 17:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 15:33 [PATCH] Bluetooth: SMP: Check the key size against le_min_key_size Simon Mikuda
2026-11-22 17:28 ` bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox