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

Commit dcf0c688 authored by Xin Li's avatar Xin Li
Browse files

DO NOT MERGE - Merge RQ1A.201205.011

Bug: 172690556
Merged-In: I0e8cdb9a00184f62d11fb06bc30f07b2a35bc49e
Change-Id: I7e1304fd99ee313360006f5b9a897de289d3ce2f
parents 49778961 455a3992
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -116,9 +116,11 @@ void sdp_server_handle_client_req(tCONN_CB* p_ccb, BT_HDR* p_msg) {

  if (p_req + sizeof(pdu_id) + sizeof(trans_num) > p_req_end) {
    android_errorWriteLog(0x534e4554, "69384124");
    android_errorWriteLog(0x534e4554, "169342531");
    trans_num = 0;
    sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX,
                            SDP_TEXT_BAD_HEADER);
    return;
  }

  /* The first byte in the message is the pdu type */
@@ -129,8 +131,10 @@ void sdp_server_handle_client_req(tCONN_CB* p_ccb, BT_HDR* p_msg) {

  if (p_req + sizeof(param_len) > p_req_end) {
    android_errorWriteLog(0x534e4554, "69384124");
    android_errorWriteLog(0x534e4554, "169342531");
    sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX,
                            SDP_TEXT_BAD_HEADER);
    return;
  }

  BE_STREAM_TO_UINT16(param_len, p_req);
+11 −1
Original line number Diff line number Diff line
@@ -1258,7 +1258,17 @@ void smp_key_distribution(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
    /* state check to prevent re-entrant */
    if (smp_get_state() == SMP_STATE_BOND_PENDING) {
      if (p_cb->derive_lk) {
        tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(p_cb->pairing_bda);
        if (!(p_dev_rec->sec_flags & BTM_SEC_LE_LINK_KEY_AUTHED) &&
            (p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_AUTHED)) {
          SMP_TRACE_DEBUG(
              "%s BR key is higher security than existing LE keys, don't "
              "derive LK from LTK",
              __func__);
          android_errorWriteLog(0x534e4554, "158854097");
        } else {
          smp_derive_link_key_from_long_term_key(p_cb, NULL);
        }
        p_cb->derive_lk = false;
      }