diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/smp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 68e6f245581c..55c41de2f5a0 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -868,6 +868,14 @@ bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level) | |||
868 | if (sec_level == BT_SECURITY_LOW) | 868 | if (sec_level == BT_SECURITY_LOW) |
869 | return true; | 869 | return true; |
870 | 870 | ||
871 | /* If we're encrypted with an STK always claim insufficient | ||
872 | * security. This way we allow the connection to be re-encrypted | ||
873 | * with an LTK, even if the LTK provides the same level of | ||
874 | * security. | ||
875 | */ | ||
876 | if (test_bit(HCI_CONN_STK_ENCRYPT, &hcon->flags)) | ||
877 | return false; | ||
878 | |||
871 | if (hcon->sec_level >= sec_level) | 879 | if (hcon->sec_level >= sec_level) |
872 | return true; | 880 | return true; |
873 | 881 | ||