OSDN Git Service

SMP: Update device type as BLE while deriving LTK from LK
authorNitin Shivpure <nshivpur@codeaurora.org>
Tue, 13 Mar 2018 06:31:48 +0000 (12:01 +0530)
committerJakub Pawlowski <jpawlowski@google.com>
Wed, 14 Mar 2018 23:52:02 +0000 (23:52 +0000)
Usecase:
1) Install the same system version and CtsVerifier.apk on 2 DUT's
2) Pair both DUT's using BT Settings Menu.
3) On DUT execute  Bluetooth Test -> Bluetooth LE Secure Server Test ->
   Bluetooth LE Sever Test.
4) On remote device execute Bluetooth Test-> Bluetooth LE Secure Client
   Test -> Bluetooth LE Client Test

Expected Result:
All test cases can be passed.

Observed Result:
All test cases cannot be passed.

Root Cause:
DUT supports secure connection & LE privacy and during BR/EDR pairing LTK is
derived from LK, but device type is not updated and is still BR/EDR instead of LE.
Later when Gatt server starts advertisement with random address so while creating
LE connection from gatt client to gatt server, gatt client is not able to resolve
random address due to incorrect device type, It re-initiate LE paring with
gatt server.

Fix:
Updating device type as BLE while deriving LTK from LK.

Test: CTS test case can pass with above steps.

Fixes: 74728232
Change-Id: I1f2c5b54d17a58615f7c2ceb954e54619b165489

stack/smp/smp_act.cc

index 10f5172..dc45690 100644 (file)
@@ -2004,6 +2004,14 @@ void smp_br_process_link_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
     return;
   }
 
+  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(p_cb->pairing_bda);
+  if (p_dev_rec) {
+    SMP_TRACE_DEBUG("%s: dev_type = %d ", __func__, p_dev_rec->device_type);
+    p_dev_rec->device_type |= BT_DEVICE_TYPE_BLE;
+  } else {
+    SMP_TRACE_ERROR("%s failed to find Security Record", __func__);
+  }
+
   SMP_TRACE_DEBUG("%s: LTK derivation from LK successfully completed",
                   __func__);
   smp_save_secure_connections_long_term_key(p_cb);