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

Commit 91e0391c authored by Bhakthavatsala Raghavendra's avatar Bhakthavatsala Raghavendra
Browse files

Trigger security procedure on l2cap connection request from remote

Bug: 372305844
Bug: 376278485
Flag: com.android.bluetooth.flags.trigger_sec_proc_on_inc_access_req
Test: mmm packages/module/Bluetooth

Change-Id: I45aad0c9ce79f22a170aeafc23e19e0017535628
parent a8eeda6c
Loading
Loading
Loading
Loading
+20 −15
Original line number Diff line number Diff line
@@ -1566,6 +1566,8 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr,
            "enc: x{:x}",
            p_dev_rec->sec_rec.sec_flags & BTM_SEC_AUTHENTICATED,
            p_dev_rec->sec_rec.sec_flags & BTM_SEC_ENCRYPTED);

    if (!com::android::bluetooth::flags::trigger_sec_proc_on_inc_access_req()) {
      /* SM4, but we do not know for sure which level of security we need.
       * as long as we have a link key, it's OK */
      if ((0 == (p_dev_rec->sec_rec.sec_flags & BTM_SEC_AUTHENTICATED)) ||
@@ -1583,6 +1585,9 @@ tBTM_STATUS btm_sec_l2cap_access_req_by_requirement(const RawAddress& bd_addr,

        return tBTM_STATUS::BTM_SUCCESS;
      }
    } else {
       log::debug("force fallthrough to trigger sec proceudure");
    }
  }

  p_dev_rec->sec_rec.p_callback = p_callback;