OSDN Git Service

Save reversed BR/EDR link key derived from LE LTK
authorIHLHO KIM <ih0923.kim@samsung.com>
Tue, 5 Nov 2019 08:56:24 +0000 (08:56 +0000)
committerJakub Pawlowski <jpawlowski@google.com>
Fri, 13 Mar 2020 16:27:49 +0000 (17:27 +0100)
Authentication is failed between Android Q and Android P or earlier when derived link key is used.

Repro steps:
1. Try to LE connect & pair(LE secure connection) with Android P device from Android Q device
2. Try to connect PAN from Android Q device to Android P device
3. Connection failed

This issue is caused by the following change.
https://android.googlesource.com/platform/system/bt/+/ae57211e7c6ef25788369052817403e30cc9f06f

This fix just reverts removed line from the previous change.
Bug: 143940249
Change-Id: I5d18cdd76b6c436dad010caf514ab0d78997f091

stack/smp/smp_keys.cc

index a4df795..a372ba4 100644 (file)
@@ -987,7 +987,8 @@ bool smp_calculate_link_key_from_long_term_key(tSMP_CB* p_cb) {
 
   link_key_type += BTM_LTK_DERIVED_LKEY_OFFSET;
 
-  Octet16 notif_link_key = link_key;
+  Octet16 notif_link_key;
+  std::reverse_copy(link_key.begin(), link_key.end(), notif_link_key.begin());
   btm_sec_link_key_notification(bda_for_lk, notif_link_key, link_key_type);
 
   SMP_TRACE_EVENT("%s is completed", __func__);