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

Commit e1148580 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Revert "SMP: Avoid repeated csrk generation""

parents 1a3422f7 274aef9f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ static bool pts_test_send_authentication_complete_failure(tSMP_CB* p_cb) {
 * Function         smp_update_key_mask
 * Description      This function updates the key mask for sending or receiving.
 ******************************************************************************/
void smp_update_key_mask(tSMP_CB* p_cb, uint8_t key_type, bool recv) {
static void smp_update_key_mask(tSMP_CB* p_cb, uint8_t key_type, bool recv) {
  SMP_TRACE_DEBUG(
      "%s before update role=%d recv=%d local_i_key = %02x, local_r_key = %02x",
      __func__, p_cb->role, recv, p_cb->local_i_key, p_cb->local_r_key);
@@ -396,8 +396,6 @@ void smp_send_id_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
void smp_send_csrk_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  SMP_TRACE_DEBUG("%s", __func__);
  smp_update_key_mask(p_cb, SMP_SEC_KEY_TYPE_CSRK, false);
  p_cb->total_tx_unacked =
      p_cb->total_tx_unacked > 0 ? p_cb->total_tx_unacked - 1 : 0;

  if (smp_send_cmd(SMP_OPCODE_SIGN_INFO, p_cb)) {
    tBTM_LE_KEY_VALUE key = {
+0 −1
Original line number Diff line number Diff line
@@ -407,7 +407,6 @@ extern void smp_br_process_link_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data);
extern void smp_key_distribution_by_transport(tSMP_CB* p_cb,
                                              tSMP_INT_DATA* p_data);
extern void smp_br_pairing_complete(tSMP_CB* p_cb, tSMP_INT_DATA* p_data);
extern void smp_update_key_mask(tSMP_CB* p_cb, uint8_t key_type, bool recv);

/* smp_l2c */
extern void smp_l2cap_if_init(void);
+0 −2
Original line number Diff line number Diff line
@@ -194,14 +194,12 @@ void smp_generate_csrk(tSMP_CB* p_cb, UNUSED_ATTR tSMP_INT_DATA* p_data) {
  bool div_status;

  SMP_TRACE_DEBUG("smp_generate_csrk");
  smp_update_key_mask(p_cb, SMP_SEC_KEY_TYPE_CSRK, false);

  div_status = btm_get_local_div(p_cb->pairing_bda, &p_cb->div);
  if (div_status) {
    smp_compute_csrk(p_cb->div, p_cb);
  } else {
    SMP_TRACE_DEBUG("Generate DIV for CSRK");
    p_cb->total_tx_unacked++;
    btsnd_hcic_ble_rand(Bind(
        [](tSMP_CB* p_cb, BT_OCTET8 rand) {
          uint16_t div;