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

Commit 0f51ca82 authored by Hui Peng's avatar Hui Peng Committed by Gerrit Code Review
Browse files

Merge "[Invisalign2] Minor improvements in smp" into main

parents cc89a6e2 d7426818
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -111,6 +111,10 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  tSMP_EVT_DATA cb_data;
  tBTM_STATUS callback_rc;
  uint8_t remote_lmp_version = 0;

  LOG_DEBUG("addr:%s event:%s", ADDRESS_TO_LOGGABLE_CSTR(p_cb->pairing_bda),
            smp_evt_to_text(p_cb->cb_evt).c_str());

  if (p_cb->p_callback && p_cb->cb_evt != 0) {
    switch (p_cb->cb_evt) {
      case SMP_IO_CAP_REQ_EVT:
@@ -165,7 +169,7 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
          p_cb->local_r_key = cb_data.io_req.resp_keys;

          if (!(p_cb->loc_auth_req & SMP_AUTH_BOND)) {
            LOG_INFO("Non bonding: No keys will be exchanged");
            LOG_DEBUG("Non bonding: No keys will be exchanged");
            p_cb->local_i_key = 0;
            p_cb->local_r_key = 0;
          }
@@ -186,9 +190,7 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {

          if (!BTM_ReadRemoteVersion(p_cb->pairing_bda, &remote_lmp_version,
                                     nullptr, nullptr)) {
            LOG_WARN(
                "SMP Unable to determine remote security authentication "
                "remote_lmp_version:%hu",
            LOG_WARN("SMP Unable to determine remote_lmp_version:%hu",
                     remote_lmp_version);
          }

+3 −6
Original line number Diff line number Diff line
@@ -266,8 +266,8 @@ void SMP_SecurityGrant(const RawAddress& bd_addr, tSMP_STATUS res) {
 *
 * Function         SMP_PasskeyReply
 *
 * Description      This function is called after Security Manager submitted
 *                  passkey request to the application.
 * Description      This function is called when the user replies
 *                  passkey after being requested.
 *
 * Parameters:      bd_addr - Address of the device for which passkey was
 *                            requested
@@ -295,12 +295,11 @@ void SMP_PasskeyReply(const RawAddress& bd_addr, uint8_t res,
  }

  if (passkey > BTM_MAX_PASSKEY_VAL || res != SMP_SUCCESS) {
    LOG_WARN("Wrong key len:%d or passkey entry fail", passkey);
    LOG_WARN("Invalid passkey value:%d or passkey entry fail", passkey);
    /* send pairing failure */
    tSMP_INT_DATA smp_int_data;
    smp_int_data.status = SMP_PASSKEY_ENTRY_FAIL;
    smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data);

  } else if (p_cb->selected_association_model ==
             SMP_MODEL_SEC_CONN_PASSKEY_ENT) {
    tSMP_INT_DATA smp_int_data;
@@ -309,8 +308,6 @@ void SMP_PasskeyReply(const RawAddress& bd_addr, uint8_t res,
  } else {
    smp_convert_string_to_tk(&p_cb->tk, passkey);
  }

  return;
}

/*******************************************************************************