Bluetooth: Use the MEDIUM security level for pairings
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Fri, 2 Sep 2011 17:51:22 +0000 (14:51 -0300)
committerGustavo F. Padovan <padovan@profusion.mobi>
Wed, 21 Sep 2011 15:58:13 +0000 (12:58 -0300)
This lifts the requirement of 16 digits pin codes when pairing
with devices that do not support SSP when using the mgmt interface.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/mgmt.c

index 545f84dbae85cb9fdb579e5d7f0a3d779183a075..6493e807634f161329555e513b95c7c811072341 100644 (file)
@@ -1365,13 +1365,11 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len)
 
        hci_dev_lock_bh(hdev);
 
-       if (cp->io_cap == 0x03) {
-               sec_level = BT_SECURITY_MEDIUM;
+       sec_level = BT_SECURITY_MEDIUM;
+       if (cp->io_cap == 0x03)
                auth_type = HCI_AT_DEDICATED_BONDING;
-       } else {
-               sec_level = BT_SECURITY_HIGH;
+       else
                auth_type = HCI_AT_DEDICATED_BONDING_MITM;
-       }
 
        entry = hci_find_adv_entry(hdev, &cp->bdaddr);
        if (entry)