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

Commit 8106c85b authored by Gopi Sakshihally Bhuthaiah (xWF)'s avatar Gopi Sakshihally Bhuthaiah (xWF) Committed by Gerrit Code Review
Browse files

Merge "Fix 0 key size for LE link" into main

parents b0fb1e4d 72327c55
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3226,6 +3226,11 @@ void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status, uint8_t encr_en

  if (transport == BT_TRANSPORT_LE) {
    key_size = p_dev_rec->sec_rec.ble_keys.key_size;
    if (key_size == 0 && status == HCI_SUCCESS && encr_enable == HCI_ENCRYPT_MODE_ON) {
      /* Only case when key size is 0 during successfull encryption is pairing - for this case look
       * up the key size */
      key_size = SMP_GetPendingPairingKeySize();
    }
  }

  log::debug(
+9 −0
Original line number Diff line number Diff line
@@ -200,6 +200,15 @@ void SMP_ClearLocScOobData();
 ******************************************************************************/
void SMP_SirkConfirmDeviceReply(const RawAddress& bd_addr, uint8_t res);

/*******************************************************************************
 *
 * Function         SMP_SirkConfirmDeviceReply
 *
 * Description      Returns the key size of peinding LE pairing
 *
 ******************************************************************************/
uint16_t SMP_GetPendingPairingKeySize();

// Called when LTK request is received from controller.
bool smp_proc_ltk_request(const RawAddress& bda);

+5 −0
Original line number Diff line number Diff line
@@ -525,3 +525,8 @@ void SMP_SirkConfirmDeviceReply(const RawAddress& bd_addr, uint8_t res) {
    smp_sm_event(p_cb, SMP_SIRK_DEVICE_VALID_EVT, &smp_int_data);
  }
}

uint16_t SMP_GetPendingPairingKeySize() {
  tSMP_CB* p_cb = &smp_cb;
  return p_cb->loc_enc_size;
}
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -69,3 +69,8 @@ void SMP_ClearLocScOobData() { inc_func_call_count(__func__); }
void SMP_SirkConfirmDeviceReply(const RawAddress& /* bd_addr */, uint8_t /* res */) {
  inc_func_call_count(__func__);
}

uint16_t SMP_GetPendingPairingKeySize() {
  inc_func_call_count(__func__);
  return 0;
}
 No newline at end of file