Bluetooth: Fix redundant encryption request for reauthentication
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 11 Apr 2014 19:02:32 +0000 (12:02 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 9 Jun 2014 12:29:02 +0000 (13:29 +0100)
commit4d313a79b6b59a640aab2d0f5629b51d332a183c
treeef87492c0081290dc610cebe0b35d6b20ea59d26
parent98077594d9f33566c0681c0944fdcaed3e113ad0
Bluetooth: Fix redundant encryption request for reauthentication

commit 09da1f3463eb81d59685df723b1c5950b7570340 upstream.

When we're performing reauthentication (in order to elevate the
security level from an unauthenticated key to an authenticated one) we
do not need to issue any encryption command once authentication
completes. Since the trigger for the encryption HCI command is the
ENCRYPT_PEND flag this flag should not be set in this scenario.
Instead, the REAUTH_PEND flag takes care of all necessary steps for
reauthentication.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
[bwh: Backported to 3.2:
 - Adjust context
 - s/conn->flags/conn->pend/]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/bluetooth/hci_conn.c