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

Commit 7b41aff5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Prevent create connection for anonymous address" am: 7874c08a am:...

Merge "Prevent create connection for anonymous address" am: 7874c08a am: f225a1be am: a9a19c7e am: 5ce83bdd am: f75edbc6

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2085444



Change-Id: Ic787e3528859fa71ae171703d7e980524b181900
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ccbc8682 f75edbc6
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -2768,6 +2768,15 @@ bool acl_create_le_connection_with_id(uint8_t id, const RawAddress& bd_addr) {
    gatt_find_in_device_record(bd_addr, &address_with_type);
    gatt_find_in_device_record(bd_addr, &address_with_type);
    LOG_DEBUG("Creating le direct connection to:%s",
    LOG_DEBUG("Creating le direct connection to:%s",
              PRIVATE_ADDRESS(address_with_type));
              PRIVATE_ADDRESS(address_with_type));

    if (address_with_type.type == BLE_ADDR_ANONYMOUS) {
      LOG_WARN(
          "Creating le direct connection to:%s, address type 'anonymous' is "
          "invalid",
          PRIVATE_ADDRESS(address_with_type));
      return false;
    }

    bluetooth::shim::ACL_AcceptLeConnectionFrom(address_with_type,
    bluetooth::shim::ACL_AcceptLeConnectionFrom(address_with_type,
                                                /* is_direct */ true);
                                                /* is_direct */ true);
    return true;
    return true;