Bluetooth: Fix missing encryption refresh on Security Request
authorSzymon Janc <szymon.janc@codecoup.pl>
Mon, 26 Feb 2018 14:41:53 +0000 (15:41 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 20 Mar 2020 05:12:09 +0000 (14:12 +0900)
commit78075b7bcae16a7e2a430a2e5d274c8a3d0eed21
tree35b82880a15af483b37a7d53d46a2f13fa8d3e38
parent653a1b3111dd3516abd9a03683e8c5b30a82d60e
Bluetooth: Fix missing encryption refresh on Security Request

commit 64e759f58f128730b97a3c3a26d283c075ad7c86 upstream.

If Security Request is received on connection that is already encrypted
with sufficient security master should perform encryption key refresh
procedure instead of just ignoring Slave Security Request
(Core Spec 5.0 Vol 3 Part H 2.4.6).

> ACL Data RX: Handle 3585 flags 0x02 dlen 6
      SMP: Security Request (0x0b) len 1
        Authentication requirement: Bonding, No MITM, SC, No Keypresses (0x09)
< HCI Command: LE Start Encryption (0x08|0x0019) plen 28
        Handle: 3585
        Random number: 0x0000000000000000
        Encrypted diversifier: 0x0000
        Long term key: 44264272a5c426a9e868f034cf0e69f3
> HCI Event: Command Status (0x0f) plen 4
      LE Start Encryption (0x08|0x0019) ncmd 1
        Status: Success (0x00)
> HCI Event: Encryption Key Refresh Complete (0x30) plen 3
        Status: Success (0x00)
        Handle: 3585

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[dh79.pyun: apply mainline stable linux-4.9.y commit 24382a60331d to handle BT issue]
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Change-Id: Ifb94f389253d8515bcc4676fffcfd73c09f1242c
net/bluetooth/smp.c