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

Commit b91ea48a authored by johnshamoon's avatar johnshamoon Committed by android-build-merger
Browse files

Merge "smp: Fix long SMP_Trace_* log messages"

am: 7ea74cea

Change-Id: I82fd49362c33c23d973767af2005e841d4b3cafb
parents f1e0559d 7ea74cea
Loading
Loading
Loading
Loading
+38 −42
Original line number Original line Diff line number Diff line
@@ -154,8 +154,8 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
          }
          }


          SMP_TRACE_WARNING(
          SMP_TRACE_WARNING(
              "rcvd auth_req: 0x%02x, io_cap: %d \
              "rcvd auth_req: 0x%02x, io_cap: %d "
                        loc_oob_flag: %d loc_enc_size: %d,"
              "loc_oob_flag: %d loc_enc_size: %d, "
              "local_i_key: 0x%02x, local_r_key: 0x%02x",
              "local_i_key: 0x%02x, local_r_key: 0x%02x",
              p_cb->loc_auth_req, p_cb->local_io_capability, p_cb->loc_oob_flag,
              p_cb->loc_auth_req, p_cb->local_io_capability, p_cb->loc_oob_flag,
              p_cb->loc_enc_size, p_cb->local_i_key, p_cb->local_r_key);
              p_cb->loc_enc_size, p_cb->local_i_key, p_cb->local_r_key);
@@ -193,8 +193,8 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
          p_cb->local_r_key &= ~SMP_SEC_KEY_TYPE_LK;
          p_cb->local_r_key &= ~SMP_SEC_KEY_TYPE_LK;


          SMP_TRACE_WARNING(
          SMP_TRACE_WARNING(
              "for SMP over BR max_key_size: 0x%02x,\
              "for SMP over BR max_key_size: 0x%02x, local_i_key: 0x%02x, "
                        local_i_key: 0x%02x, local_r_key: 0x%02x, p_cb->loc_auth_req: 0x%02x",
              "local_r_key: 0x%02x, p_cb->loc_auth_req: 0x%02x",
              p_cb->loc_enc_size, p_cb->local_i_key, p_cb->local_r_key,
              p_cb->loc_enc_size, p_cb->local_i_key, p_cb->local_r_key,
              p_cb->loc_auth_req);
              p_cb->loc_auth_req);


@@ -209,7 +209,7 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
    smp_sm_event(p_cb, SMP_DISCARD_SEC_REQ_EVT, NULL);
    smp_sm_event(p_cb, SMP_DISCARD_SEC_REQ_EVT, NULL);
  }
  }


  SMP_TRACE_DEBUG("%s return", __func__);
  SMP_TRACE_DEBUG("%s: return", __func__);
}
}


/*******************************************************************************
/*******************************************************************************
@@ -220,7 +220,7 @@ void smp_send_pair_fail(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  p_cb->status = *(uint8_t*)p_data;
  p_cb->status = *(uint8_t*)p_data;
  p_cb->failure = *(uint8_t*)p_data;
  p_cb->failure = *(uint8_t*)p_data;


  SMP_TRACE_DEBUG("%s status=%d failure=%d ", __func__, p_cb->status,
  SMP_TRACE_DEBUG("%s: status=%d failure=%d ", __func__, p_cb->status,
                  p_cb->failure);
                  p_cb->failure);


  if (p_cb->status <= SMP_MAX_FAIL_RSN_PER_SPEC &&
  if (p_cb->status <= SMP_MAX_FAIL_RSN_PER_SPEC &&
@@ -333,7 +333,7 @@ void smp_send_keypress_notification(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
void smp_send_enc_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
void smp_send_enc_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  tBTM_LE_LENC_KEYS le_key;
  tBTM_LE_LENC_KEYS le_key;


  SMP_TRACE_DEBUG("%s p_cb->loc_enc_size = %d", __func__, p_cb->loc_enc_size);
  SMP_TRACE_DEBUG("%s: p_cb->loc_enc_size = %d", __func__, p_cb->loc_enc_size);
  smp_update_key_mask(p_cb, SMP_SEC_KEY_TYPE_ENC, false);
  smp_update_key_mask(p_cb, SMP_SEC_KEY_TYPE_ENC, false);


  smp_send_cmd(SMP_OPCODE_ENCRYPT_INFO, p_cb);
  smp_send_cmd(SMP_OPCODE_ENCRYPT_INFO, p_cb);
@@ -415,17 +415,17 @@ void smp_proc_sec_req(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  tBTM_BLE_SEC_REQ_ACT sec_req_act;
  tBTM_BLE_SEC_REQ_ACT sec_req_act;
  uint8_t reason;
  uint8_t reason;


  SMP_TRACE_DEBUG("%s auth_req=0x%x", __func__, auth_req);
  SMP_TRACE_DEBUG("%s: auth_req=0x%x", __func__, auth_req);


  p_cb->cb_evt = 0;
  p_cb->cb_evt = 0;


  btm_ble_link_sec_check(p_cb->pairing_bda, auth_req, &sec_req_act);
  btm_ble_link_sec_check(p_cb->pairing_bda, auth_req, &sec_req_act);


  SMP_TRACE_DEBUG("%s sec_req_act=0x%x", __func__, sec_req_act);
  SMP_TRACE_DEBUG("%s: sec_req_act=0x%x", __func__, sec_req_act);


  switch (sec_req_act) {
  switch (sec_req_act) {
    case BTM_BLE_SEC_REQ_ACT_ENCRYPT:
    case BTM_BLE_SEC_REQ_ACT_ENCRYPT:
      SMP_TRACE_DEBUG("%s BTM_BLE_SEC_REQ_ACT_ENCRYPT", __func__);
      SMP_TRACE_DEBUG("%s: BTM_BLE_SEC_REQ_ACT_ENCRYPT", __func__);
      smp_sm_event(p_cb, SMP_ENC_REQ_EVT, NULL);
      smp_sm_event(p_cb, SMP_ENC_REQ_EVT, NULL);
      break;
      break;


@@ -535,7 +535,7 @@ void smp_proc_pair_cmd(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
           (p_cb->selected_association_model ==
           (p_cb->selected_association_model ==
            SMP_MODEL_SEC_CONN_JUSTWORKS))) {
            SMP_MODEL_SEC_CONN_JUSTWORKS))) {
        SMP_TRACE_ERROR(
        SMP_TRACE_ERROR(
            "%s pairing failed - slave requires secure connection only mode",
            "%s: pairing failed - slave requires secure connection only mode",
            __func__);
            __func__);
        reason = SMP_PAIR_AUTH_FAIL;
        reason = SMP_PAIR_AUTH_FAIL;
        smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
        smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
@@ -556,8 +556,8 @@ void smp_proc_pair_cmd(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
        (!(p_cb->le_secure_connections_mode_is_used) ||
        (!(p_cb->le_secure_connections_mode_is_used) ||
         (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_JUSTWORKS))) {
         (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_JUSTWORKS))) {
      SMP_TRACE_ERROR(
      SMP_TRACE_ERROR(
          "Master requires secure connection only mode \
          "Master requires secure connection only mode "
                but it can't be provided -> Master fails pairing");
          "but it can't be provided -> Master fails pairing");
      reason = SMP_PAIR_AUTH_FAIL;
      reason = SMP_PAIR_AUTH_FAIL;
      smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
      smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
      return;
      return;
@@ -772,8 +772,8 @@ void smp_br_process_pairing_command(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
    p_dev_rec->new_encryption_key_is_p256 = false;
    p_dev_rec->new_encryption_key_is_p256 = false;
    /* shortcut to skip Security Grant step */
    /* shortcut to skip Security Grant step */
    p_cb->cb_evt = SMP_BR_KEYS_REQ_EVT;
    p_cb->cb_evt = SMP_BR_KEYS_REQ_EVT;
  } else /* Master receives pairing response */
  } else {
  {
    /* Master receives pairing response */
    SMP_TRACE_DEBUG(
    SMP_TRACE_DEBUG(
        "%s master rcvs valid PAIRING RESPONSE."
        "%s master rcvs valid PAIRING RESPONSE."
        " Supposed to move to key distribution phase. ",
        " Supposed to move to key distribution phase. ",
@@ -795,9 +795,8 @@ void smp_br_process_security_grant(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  SMP_TRACE_DEBUG("%s", __func__);
  SMP_TRACE_DEBUG("%s", __func__);
  if (res != SMP_SUCCESS) {
  if (res != SMP_SUCCESS) {
    smp_br_state_machine_event(p_cb, SMP_BR_AUTH_CMPL_EVT, p_data);
    smp_br_state_machine_event(p_cb, SMP_BR_AUTH_CMPL_EVT, p_data);
  } else /*otherwise, start pairing */
  } else {
  {
    /* otherwise, start pairing; send IO request callback */
    /* send IO request callback */
    p_cb->cb_evt = SMP_BR_KEYS_REQ_EVT;
    p_cb->cb_evt = SMP_BR_KEYS_REQ_EVT;
  }
  }
}
}
@@ -810,9 +809,7 @@ void smp_br_process_security_grant(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
void smp_br_check_authorization_request(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
void smp_br_check_authorization_request(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  uint8_t reason = SMP_SUCCESS;
  uint8_t reason = SMP_SUCCESS;


  SMP_TRACE_DEBUG(
  SMP_TRACE_DEBUG("%s rcvs i_keys=0x%x r_keys=0x%x (i-initiator r-responder)",
      "%s rcvs i_keys=0x%x r_keys=0x%x "
      "(i-initiator r-responder)",
                  __func__, p_cb->local_i_key, p_cb->local_r_key);
                  __func__, p_cb->local_i_key, p_cb->local_r_key);


  /* In LE SC mode LK field is ignored when BR/EDR transport is used */
  /* In LE SC mode LK field is ignored when BR/EDR transport is used */
@@ -833,8 +830,7 @@ void smp_br_check_authorization_request(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  SMP_TRACE_DEBUG("%s: use h7 = %d", __func__, p_cb->key_derivation_h7_used);
  SMP_TRACE_DEBUG("%s: use h7 = %d", __func__, p_cb->key_derivation_h7_used);


  SMP_TRACE_DEBUG(
  SMP_TRACE_DEBUG(
      "%s rcvs upgrades: i_keys=0x%x r_keys=0x%x "
      "%s rcvs upgrades: i_keys=0x%x r_keys=0x%x (i-initiator r-responder)",
      "(i-initiator r-responder)",
      __func__, p_cb->local_i_key, p_cb->local_r_key);
      __func__, p_cb->local_i_key, p_cb->local_r_key);


  if (/*((p_cb->peer_auth_req & SMP_AUTH_BOND) ||
  if (/*((p_cb->peer_auth_req & SMP_AUTH_BOND) ||
@@ -967,9 +963,12 @@ void smp_proc_srk_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {


  /* save CSRK to security record */
  /* save CSRK to security record */
  le_key.sec_level = p_cb->sec_level;
  le_key.sec_level = p_cb->sec_level;
  maybe_non_aligned_memcpy(le_key.csrk, p_data,

                           BT_OCTET16_LEN);    /* get peer CSRK */
  /* get peer CSRK */
  le_key.counter = 0;                          /* initialize the peer counter */
  maybe_non_aligned_memcpy(le_key.csrk, p_data, BT_OCTET16_LEN);

  /* initialize the peer counter */
  le_key.counter = 0;


  if ((p_cb->peer_auth_req & SMP_AUTH_BOND) &&
  if ((p_cb->peer_auth_req & SMP_AUTH_BOND) &&
      (p_cb->loc_auth_req & SMP_AUTH_BOND))
      (p_cb->loc_auth_req & SMP_AUTH_BOND))
@@ -1075,8 +1074,7 @@ void smp_check_auth_req(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  uint8_t reason = enc_enable ? SMP_SUCCESS : SMP_ENC_FAIL;
  uint8_t reason = enc_enable ? SMP_SUCCESS : SMP_ENC_FAIL;


  SMP_TRACE_DEBUG(
  SMP_TRACE_DEBUG(
      "%s rcvs enc_enable=%d i_keys=0x%x r_keys=0x%x "
      "%s rcvs enc_enable=%d i_keys=0x%x r_keys=0x%x (i-initiator r-responder)",
      "(i-initiator r-responder)",
      __func__, enc_enable, p_cb->local_i_key, p_cb->local_r_key);
      __func__, enc_enable, p_cb->local_i_key, p_cb->local_r_key);
  if (enc_enable == 1) {
  if (enc_enable == 1) {
    if (p_cb->le_secure_connections_mode_is_used) {
    if (p_cb->le_secure_connections_mode_is_used) {
@@ -1103,8 +1101,7 @@ void smp_check_auth_req(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
      p_cb->local_r_key &= ~SMP_SEC_KEY_TYPE_LK;
      p_cb->local_r_key &= ~SMP_SEC_KEY_TYPE_LK;
    }
    }
    SMP_TRACE_DEBUG(
    SMP_TRACE_DEBUG(
        "%s rcvs upgrades: i_keys=0x%x r_keys=0x%x "
        "%s rcvs upgrades: i_keys=0x%x r_keys=0x%x (i-initiator r-responder)",
        "(i-initiator r-responder)",
        __func__, p_cb->local_i_key, p_cb->local_r_key);
        __func__, p_cb->local_i_key, p_cb->local_r_key);


    if (/*((p_cb->peer_auth_req & SMP_AUTH_BOND) ||
    if (/*((p_cb->peer_auth_req & SMP_AUTH_BOND) ||
@@ -1302,8 +1299,8 @@ void smp_process_io_response(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
        (!(p_cb->le_secure_connections_mode_is_used) ||
        (!(p_cb->le_secure_connections_mode_is_used) ||
         (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_JUSTWORKS))) {
         (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_JUSTWORKS))) {
      SMP_TRACE_ERROR(
      SMP_TRACE_ERROR(
          "Slave requires secure connection only mode \
          "Slave requires secure connection only mode "
                              but it can't be provided -> Slave fails pairing");
          "but it can't be provided -> Slave fails pairing");
      smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
      smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
      return;
      return;
    }
    }
@@ -1482,8 +1479,8 @@ void smp_process_local_nonce(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
          /* slave commitment is already received, send local nonce, wait for
          /* slave commitment is already received, send local nonce, wait for
           * remote nonce*/
           * remote nonce*/
          SMP_TRACE_DEBUG(
          SMP_TRACE_DEBUG(
              "master in assoc mode = %d \
              "master in assoc mode = %d "
                    already rcvd slave commitment - race condition",
              "already rcvd slave commitment - race condition",
              p_cb->selected_association_model);
              p_cb->selected_association_model);
          p_cb->flags &= ~SMP_PAIR_FLAG_HAVE_PEER_COMM;
          p_cb->flags &= ~SMP_PAIR_FLAG_HAVE_PEER_COMM;
          smp_send_rand(p_cb, NULL);
          smp_send_rand(p_cb, NULL);
@@ -1838,12 +1835,11 @@ void smp_set_local_oob_random_commitment(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
void smp_link_encrypted(BD_ADDR bda, uint8_t encr_enable) {
void smp_link_encrypted(BD_ADDR bda, uint8_t encr_enable) {
  tSMP_CB* p_cb = &smp_cb;
  tSMP_CB* p_cb = &smp_cb;


  SMP_TRACE_DEBUG("%s encr_enable=%d", __func__, encr_enable);
  SMP_TRACE_DEBUG("%s: encr_enable=%d", __func__, encr_enable);


  if (memcmp(&smp_cb.pairing_bda[0], bda, BD_ADDR_LEN) == 0) {
  if (memcmp(&smp_cb.pairing_bda[0], bda, BD_ADDR_LEN) == 0) {
    /* encryption completed with STK, remmeber the key size now, could be
    /* encryption completed with STK, remember the key size now, could be
    * overwite
     * overwritten when key exchange happens                                 */
    *  when key exchange happens                                        */
    if (p_cb->loc_enc_size != 0 && encr_enable) {
    if (p_cb->loc_enc_size != 0 && encr_enable) {
      /* update the link encryption key size if a SMP pairing just performed */
      /* update the link encryption key size if a SMP pairing just performed */
      btm_ble_update_sec_key_size(bda, p_cb->loc_enc_size);
      btm_ble_update_sec_key_size(bda, p_cb->loc_enc_size);
@@ -1954,7 +1950,7 @@ void smp_derive_link_key_from_long_term_key(tSMP_CB* p_cb,
 *
 *
 * Description      This function is called to process BR/EDR LK:
 * Description      This function is called to process BR/EDR LK:
 *                  - to derive SMP LTK from BR/EDR LK;
 *                  - to derive SMP LTK from BR/EDR LK;
*8                  - to save SMP LTK.
 *                  - to save SMP LTK.
 *
 *
 * Returns          void
 * Returns          void
 *
 *
@@ -1964,7 +1960,7 @@ void smp_br_process_link_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {


  SMP_TRACE_DEBUG("%s", __func__);
  SMP_TRACE_DEBUG("%s", __func__);
  if (!smp_calculate_long_term_key_from_link_key(p_cb)) {
  if (!smp_calculate_long_term_key_from_link_key(p_cb)) {
    SMP_TRACE_ERROR("%s failed", __func__);
    SMP_TRACE_ERROR("%s: failed", __func__);
    smp_sm_event(p_cb, SMP_BR_AUTH_CMPL_EVT, &status);
    smp_sm_event(p_cb, SMP_BR_AUTH_CMPL_EVT, &status);
    return;
    return;
  }
  }
+4 −4
Original line number Original line Diff line number Diff line
@@ -886,8 +886,8 @@ void smp_calculate_local_commitment(tSMP_CB* p_cb) {
    case SMP_MODEL_SEC_CONN_NUM_COMP:
    case SMP_MODEL_SEC_CONN_NUM_COMP:
      if (p_cb->role == HCI_ROLE_MASTER)
      if (p_cb->role == HCI_ROLE_MASTER)
        SMP_TRACE_WARNING(
        SMP_TRACE_WARNING(
            "local commitment calc on master is not expected \
            "local commitment calc on master is not expected "
                                    for Just Works/Numeric Comparison models");
            "for Just Works/Numeric Comparison models");
      smp_calculate_f4(p_cb->loc_publ_key.x, p_cb->peer_publ_key.x, p_cb->rand,
      smp_calculate_f4(p_cb->loc_publ_key.x, p_cb->peer_publ_key.x, p_cb->rand,
                       0, p_cb->commitment);
                       0, p_cb->commitment);
      break;
      break;
@@ -933,8 +933,8 @@ void smp_calculate_peer_commitment(tSMP_CB* p_cb, BT_OCTET16 output_buf) {
    case SMP_MODEL_SEC_CONN_NUM_COMP:
    case SMP_MODEL_SEC_CONN_NUM_COMP:
      if (p_cb->role == HCI_ROLE_SLAVE)
      if (p_cb->role == HCI_ROLE_SLAVE)
        SMP_TRACE_WARNING(
        SMP_TRACE_WARNING(
            "peer commitment calc on slave is not expected \
            "peer commitment calc on slave is not expected "
                for Just Works/Numeric Comparison models");
            "for Just Works/Numeric Comparison models");
      smp_calculate_f4(p_cb->peer_publ_key.x, p_cb->loc_publ_key.x, p_cb->rrand,
      smp_calculate_f4(p_cb->peer_publ_key.x, p_cb->loc_publ_key.x, p_cb->rrand,
                       0, output_buf);
                       0, output_buf);
      break;
      break;
+12 −12
Original line number Original line Diff line number Diff line
@@ -995,8 +995,8 @@ bool smp_command_has_valid_fixed_length(tSMP_CB* p_cb) {


  if (p_cb->rcvd_cmd_len != smp_cmd_size_per_spec[cmd_code]) {
  if (p_cb->rcvd_cmd_len != smp_cmd_size_per_spec[cmd_code]) {
    SMP_TRACE_WARNING(
    SMP_TRACE_WARNING(
        "Rcvd from the peer cmd 0x%02x with invalid length\
        "Rcvd from the peer cmd 0x%02x with invalid length "
            0x%02x (per spec the length is 0x%02x).",
        "0x%02x (per spec the length is 0x%02x).",
        cmd_code, p_cb->rcvd_cmd_len, smp_cmd_size_per_spec[cmd_code]);
        cmd_code, p_cb->rcvd_cmd_len, smp_cmd_size_per_spec[cmd_code]);
    return false;
    return false;
  }
  }
@@ -1030,24 +1030,24 @@ bool smp_pairing_request_response_parameters_are_valid(tSMP_CB* p_cb) {


  if (io_caps >= BTM_IO_CAP_MAX) {
  if (io_caps >= BTM_IO_CAP_MAX) {
    SMP_TRACE_WARNING(
    SMP_TRACE_WARNING(
        "Rcvd from the peer cmd 0x%02x with IO Capabilty \
        "Rcvd from the peer cmd 0x%02x with IO Capability "
            value (0x%02x) out of range).",
        "value (0x%02x) out of range).",
        p_cb->rcvd_cmd_code, io_caps);
        p_cb->rcvd_cmd_code, io_caps);
    return false;
    return false;
  }
  }


  if (!((oob_flag == SMP_OOB_NONE) || (oob_flag == SMP_OOB_PRESENT))) {
  if (!((oob_flag == SMP_OOB_NONE) || (oob_flag == SMP_OOB_PRESENT))) {
    SMP_TRACE_WARNING(
    SMP_TRACE_WARNING(
        "Rcvd from the peer cmd 0x%02x with OOB data flag value \
        "Rcvd from the peer cmd 0x%02x with OOB data flag value "
            (0x%02x) out of range).",
        "(0x%02x) out of range).",
        p_cb->rcvd_cmd_code, oob_flag);
        p_cb->rcvd_cmd_code, oob_flag);
    return false;
    return false;
  }
  }


  if (!((bond_flag == SMP_AUTH_NO_BOND) || (bond_flag == SMP_AUTH_BOND))) {
  if (!((bond_flag == SMP_AUTH_NO_BOND) || (bond_flag == SMP_AUTH_BOND))) {
    SMP_TRACE_WARNING(
    SMP_TRACE_WARNING(
        "Rcvd from the peer cmd 0x%02x with Bonding_Flags value (0x%02x)\
        "Rcvd from the peer cmd 0x%02x with Bonding_Flags value (0x%02x) "
                           out of range).",
        "out of range).",
        p_cb->rcvd_cmd_code, bond_flag);
        p_cb->rcvd_cmd_code, bond_flag);
    return false;
    return false;
  }
  }
@@ -1055,8 +1055,8 @@ bool smp_pairing_request_response_parameters_are_valid(tSMP_CB* p_cb) {
  if ((enc_size < SMP_ENCR_KEY_SIZE_MIN) ||
  if ((enc_size < SMP_ENCR_KEY_SIZE_MIN) ||
      (enc_size > SMP_ENCR_KEY_SIZE_MAX)) {
      (enc_size > SMP_ENCR_KEY_SIZE_MAX)) {
    SMP_TRACE_WARNING(
    SMP_TRACE_WARNING(
        "Rcvd from the peer cmd 0x%02x with Maximum Encryption \
        "Rcvd from the peer cmd 0x%02x with Maximum Encryption "
            Key value (0x%02x) out of range).",
        "Key value (0x%02x) out of range).",
        p_cb->rcvd_cmd_code, enc_size);
        p_cb->rcvd_cmd_code, enc_size);
    return false;
    return false;
  }
  }
@@ -1080,8 +1080,8 @@ bool smp_pairing_keypress_notification_is_valid(tSMP_CB* p_cb) {


  if (keypress_notification >= BTM_SP_KEY_OUT_OF_RANGE) {
  if (keypress_notification >= BTM_SP_KEY_OUT_OF_RANGE) {
    SMP_TRACE_WARNING(
    SMP_TRACE_WARNING(
        "Rcvd from the peer cmd 0x%02x with Pairing Keypress \
        "Rcvd from the peer cmd 0x%02x with Pairing Keypress "
            Notification value (0x%02x) out of range).",
        "Notification value (0x%02x) out of range).",
        p_cb->rcvd_cmd_code, keypress_notification);
        p_cb->rcvd_cmd_code, keypress_notification);
    return false;
    return false;
  }
  }