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

Commit 7e6c3ef2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "SMP: Calculate LTK on BR SMP begin" am: dee4b28f

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1817719

Change-Id: I561c4f6ec354d882e75620be01cafbe8c5f7d79c
parents 52b098b5 dee4b28f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -910,6 +910,15 @@ 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 over BR/EDR should always be used with CTKD, so derive LTK from
   * LK before receiving keys */
  if ((p_cb->role == HCI_ROLE_CENTRAL &&
       (p_cb->local_i_key & SMP_SEC_KEY_TYPE_ENC)) ||
      (p_cb->role == HCI_ROLE_PERIPHERAL &&
       (p_cb->local_r_key & SMP_SEC_KEY_TYPE_ENC))) {
    smp_generate_ltk(p_cb, p_data);
  }

  SMP_TRACE_DEBUG(
      "%s rcvs upgrades: i_keys=0x%x r_keys=0x%x (i-initiator r-responder)",
      __func__, p_cb->local_i_key, p_cb->local_r_key);
+1 −1
Original line number Diff line number Diff line
@@ -530,7 +530,7 @@ static void smp_generate_ltk_cont(uint16_t div, tSMP_CB* p_cb) {
void smp_generate_ltk(tSMP_CB* p_cb, UNUSED_ATTR tSMP_INT_DATA* p_data) {
  SMP_TRACE_DEBUG("%s", __func__);

  if (smp_get_br_state() == SMP_BR_STATE_BOND_PENDING) {
  if (p_cb->smp_over_br) {
    smp_br_process_link_key(p_cb, NULL);
    return;
  } else if (p_cb->le_secure_connections_mode_is_used) {