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

Commit 157acb72 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Classic GAP_ConnOpen: Use L2cap to enforce security

Instead of using btm_sec_mx_access_request() to enforce security, let
L2cap enforce security for us through btm_sec_l2cap_access_req().

Note: Classic user L2cap channel (GAP_ConnOpen) API is not exposed.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ib848edb444d866eb70de9d7cf185ee8d45c71667
parent 7695bae2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -836,8 +836,8 @@ static void gap_connect_cfm(uint16_t l2cap_cid, uint16_t result) {
  /* initiate security process, if needed */
  if ((p_ccb->con_flags & GAP_CCB_FLAGS_SEC_DONE) == 0 &&
      p_ccb->transport != BT_TRANSPORT_LE) {
    btm_sec_mx_access_request(p_ccb->rem_dev_address, p_ccb->psm, true, 0, 0,
                              &gap_sec_check_complete, p_ccb);
    // Assume security check is done by L2cap
    gap_sec_check_complete(nullptr, BT_TRANSPORT_BR_EDR, p_ccb, BTM_SUCCESS);
  }

  /* If the connection response contains success status, then */