system/bt
Revision | d79424ada68d23868d415a7542ef0ad90bb9faf2 (tree) |
---|---|
Zeit | 2019-09-20 02:01:12 |
Autor | Ugo Yu <ugoyu@goog...> |
Commiter | Max Spector |
DO NOT MERGE Store BLE keys using the address from the ble_auth_cmpl_evt
Reading the peer address from btif_dm_ble_auth_cmpl_evt, instead
of using the value from the pairing control block in
btif_dm_save_ble_bonding_keys, ensures that BLE keys are stored with
the correct address.
Bug: 133234174
Bug: 79703832
Test: 1. Initiate crosskey pairing from BLE
Change-Id: I18b4a1d8e2cdcd6dd4a300f1dc9e6d3892a3baff
(cherry picked from commit 0d95651e8b22b1012f1ee103e4a0b8665a0c17d4)
(cherry picked from commit b2334f05895e9926666904c41f13821210cbd6e9)
@@ -100,7 +100,7 @@ void btif_dm_load_ble_local_keys(void); | ||
100 | 100 | void btif_dm_get_ble_local_keys(tBTA_DM_BLE_LOCAL_KEY_MASK* p_key_mask, |
101 | 101 | BT_OCTET16 er, |
102 | 102 | tBTA_BLE_LOCAL_ID_KEYS* p_id_keys); |
103 | -void btif_dm_save_ble_bonding_keys(void); | |
103 | +void btif_dm_save_ble_bonding_keys(RawAddress& bd_addr); | |
104 | 104 | void btif_dm_remove_ble_bonding_keys(void); |
105 | 105 | void btif_dm_ble_sec_req_evt(tBTA_DM_BLE_SEC_REQ* p_ble_req); |
106 | 106 |
@@ -2857,7 +2857,7 @@ static void btif_dm_ble_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) { | ||
2857 | 2857 | btif_storage_remove_bonded_device(&bdaddr); |
2858 | 2858 | state = BT_BOND_STATE_NONE; |
2859 | 2859 | } else { |
2860 | - btif_dm_save_ble_bonding_keys(); | |
2860 | + btif_dm_save_ble_bonding_keys(bdaddr); | |
2861 | 2861 | BTA_GATTC_Refresh(bd_addr); |
2862 | 2862 | btif_dm_get_remote_services_by_transport(&bd_addr, GATT_TRANSPORT_LE); |
2863 | 2863 | } |
@@ -2930,11 +2930,9 @@ void btif_dm_get_ble_local_keys(tBTA_DM_BLE_LOCAL_KEY_MASK* p_key_mask, | ||
2930 | 2930 | BTIF_TRACE_DEBUG("%s *p_key_mask=0x%02x", __func__, *p_key_mask); |
2931 | 2931 | } |
2932 | 2932 | |
2933 | -void btif_dm_save_ble_bonding_keys(void) { | |
2933 | +void btif_dm_save_ble_bonding_keys(RawAddress& bd_addr) { | |
2934 | 2934 | BTIF_TRACE_DEBUG("%s", __func__); |
2935 | 2935 | |
2936 | - RawAddress bd_addr = pairing_cb.bd_addr; | |
2937 | - | |
2938 | 2936 | if (pairing_cb.ble.is_penc_key_rcvd) { |
2939 | 2937 | btif_storage_add_ble_bonding_key( |
2940 | 2938 | &bd_addr, (uint8_t*)&pairing_cb.ble.penc_key, BTIF_DM_LE_KEY_PENC, |