Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5436a1da authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

LE Enhanced Connection Complete: Check address types

Only pass identity addresses to btm_identity_addr_to_random_pseudo.
Only pass random addresses into btm_ble_resolve_random_addr.

Test: bond twice to device using non-resolvable address
Change-Id: I5931e5bc89449ea4ae9b873aedfd7bbcdeef2e01
parent c7188511
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1922,11 +1922,15 @@ void btm_ble_conn_complete(uint8_t* p, UNUSED_ATTR uint16_t evt_len,

#if (BLE_PRIVACY_SPT == TRUE)
    peer_addr_type = bda_type;

    if (peer_addr_type & BLE_ADDR_TYPE_ID_BIT) {
      match = btm_identity_addr_to_random_pseudo(&bda, &bda_type, true);
    }

    /* possiblly receive connection complete with resolvable random while
       the device has been paired */
    if (!match && BTM_BLE_IS_RESOLVE_BDA(bda)) {
    if (!match && peer_addr_type == BLE_ADDR_RANDOM &&
        BTM_BLE_IS_RESOLVE_BDA(bda)) {
      tBTM_SEC_DEV_REC* match_rec = btm_ble_resolve_random_addr(bda);
      if (match_rec) {
        LOG_INFO(LOG_TAG, "%s matched and resolved random address", __func__);