]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Bluetooth: Fix resetting remote authentication requirement after pairing
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 17 Jul 2014 12:14:50 +0000 (15:14 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 17 Jul 2014 12:28:09 +0000 (14:28 +0200)
When a new hci_conn object is created the remote SSP authentication
requirement is set to the invalid value 0xff to indicate that it is
unknown. Once pairing completes however the code was leaving it as-is.
In case a new pairing happens over the same connection it is important
that we reset the value back to unknown so that the pairing code doesn't
make false assumptions about the requirements.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_event.c

index 1bd4de7e74fc197a33226e9edd3667a3e4a74f6b..495d6d5c11467019001c8f51ff38923a09962330 100644 (file)
@@ -3870,6 +3870,9 @@ static void hci_simple_pair_complete_evt(struct hci_dev *hdev,
        if (!conn)
                goto unlock;
 
+       /* Reset the authentication requirement to unknown */
+       conn->remote_auth = 0xff;
+
        /* To avoid duplicate auth_failed events to user space we check
         * the HCI_CONN_AUTH_PEND flag which will be set if we
         * initiated the authentication. A traditional auth_complete