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

Commit 3dc86e76 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "legacy: Remove unused le set encryption" am: ba3d80cb am: a6e69dfc

parents 23a2901c a6e69dfc
Loading
Loading
Loading
Loading
+0 −28
Original line number Original line Diff line number Diff line
@@ -429,34 +429,6 @@ void btsnd_hcic_ble_read_remote_feat(uint16_t handle) {
  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
}
}


/* security management commands */
void btsnd_hcic_ble_encrypt(uint8_t* key, uint8_t key_len, uint8_t* plain_text,
                            uint8_t pt_len, void* p_cmd_cplt_cback) {
  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
  uint8_t* pp = (uint8_t*)(p + 1);

  p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_ENCRYPT;
  p->offset = sizeof(void*);

  *((void**)pp) =
      p_cmd_cplt_cback; /* Store command complete callback in buffer */
  pp += sizeof(void*);  /* Skip over callback pointer */

  UINT16_TO_STREAM(pp, HCI_BLE_ENCRYPT);
  UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BLE_ENCRYPT);

  memset(pp, 0, HCIC_PARAM_SIZE_BLE_ENCRYPT);

  if (key_len > HCIC_BLE_ENCRYPT_KEY_SIZE) key_len = HCIC_BLE_ENCRYPT_KEY_SIZE;
  if (pt_len > HCIC_BLE_ENCRYPT_KEY_SIZE) pt_len = HCIC_BLE_ENCRYPT_KEY_SIZE;

  ARRAY_TO_STREAM(pp, key, key_len);
  pp += (HCIC_BLE_ENCRYPT_KEY_SIZE - key_len);
  ARRAY_TO_STREAM(pp, plain_text, pt_len);

  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
}

void btsnd_hcic_ble_rand(base::Callback<void(BT_OCTET8)> cb) {
void btsnd_hcic_ble_rand(base::Callback<void(BT_OCTET8)> cb) {
  btu_hcif_send_cmd_with_cb(FROM_HERE, HCI_BLE_RAND, nullptr, 0,
  btu_hcif_send_cmd_with_cb(FROM_HERE, HCI_BLE_RAND, nullptr, 0,
                            base::Bind(
                            base::Bind(
+0 −4
Original line number Original line Diff line number Diff line
@@ -427,10 +427,6 @@ extern void btsnd_hcic_ble_read_chnl_map(uint16_t handle);


extern void btsnd_hcic_ble_read_remote_feat(uint16_t handle);
extern void btsnd_hcic_ble_read_remote_feat(uint16_t handle);


extern void btsnd_hcic_ble_encrypt(uint8_t* key, uint8_t key_len,
                                   uint8_t* plain_text, uint8_t pt_len,
                                   void* p_cmd_cplt_cback);

extern void btsnd_hcic_ble_rand(base::Callback<void(BT_OCTET8)> cb);
extern void btsnd_hcic_ble_rand(base::Callback<void(BT_OCTET8)> cb);


extern void btsnd_hcic_ble_start_enc(uint16_t handle,
extern void btsnd_hcic_ble_start_enc(uint16_t handle,
+0 −7
Original line number Original line Diff line number Diff line
@@ -55,7 +55,6 @@ struct btsnd_hcic_ble_clear_acceptlist btsnd_hcic_ble_clear_acceptlist;
struct btsnd_hcic_ble_clear_resolving_list btsnd_hcic_ble_clear_resolving_list;
struct btsnd_hcic_ble_clear_resolving_list btsnd_hcic_ble_clear_resolving_list;
struct btsnd_hcic_ble_create_conn_cancel btsnd_hcic_ble_create_conn_cancel;
struct btsnd_hcic_ble_create_conn_cancel btsnd_hcic_ble_create_conn_cancel;
struct btsnd_hcic_ble_create_ll_conn btsnd_hcic_ble_create_ll_conn;
struct btsnd_hcic_ble_create_ll_conn btsnd_hcic_ble_create_ll_conn;
struct btsnd_hcic_ble_encrypt btsnd_hcic_ble_encrypt;
struct btsnd_hcic_ble_enh_rx_test btsnd_hcic_ble_enh_rx_test;
struct btsnd_hcic_ble_enh_rx_test btsnd_hcic_ble_enh_rx_test;
struct btsnd_hcic_ble_enh_tx_test btsnd_hcic_ble_enh_tx_test;
struct btsnd_hcic_ble_enh_tx_test btsnd_hcic_ble_enh_tx_test;
struct btsnd_hcic_ble_ext_create_conn btsnd_hcic_ble_ext_create_conn;
struct btsnd_hcic_ble_ext_create_conn btsnd_hcic_ble_ext_create_conn;
@@ -231,12 +230,6 @@ void btsnd_hcic_ble_create_ll_conn(uint16_t scan_int, uint16_t scan_win,
      addr_type_own, conn_int_min, conn_int_max, conn_latency, conn_timeout,
      addr_type_own, conn_int_min, conn_int_max, conn_latency, conn_timeout,
      min_ce_len, max_ce_len);
      min_ce_len, max_ce_len);
}
}
void btsnd_hcic_ble_encrypt(uint8_t* key, uint8_t key_len, uint8_t* plain_text,
                            uint8_t pt_len, void* p_cmd_cplt_cback) {
  mock_function_count_map[__func__]++;
  test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_encrypt(
      key, key_len, plain_text, pt_len, p_cmd_cplt_cback);
}
void btsnd_hcic_ble_enh_rx_test(uint8_t rx_chan, uint8_t phy,
void btsnd_hcic_ble_enh_rx_test(uint8_t rx_chan, uint8_t phy,
                                uint8_t mod_index) {
                                uint8_t mod_index) {
  mock_function_count_map[__func__]++;
  mock_function_count_map[__func__]++;
+0 −15
Original line number Original line Diff line number Diff line
@@ -255,21 +255,6 @@ struct btsnd_hcic_ble_create_ll_conn {
};
};
extern struct btsnd_hcic_ble_create_ll_conn btsnd_hcic_ble_create_ll_conn;
extern struct btsnd_hcic_ble_create_ll_conn btsnd_hcic_ble_create_ll_conn;


// Name: btsnd_hcic_ble_encrypt
// Params: uint8_t* key, uint8_t key_len, uint8_t* plain_text, uint8_t pt_len,
// void* p_cmd_cplt_cback Return: void
struct btsnd_hcic_ble_encrypt {
  std::function<void(uint8_t* key, uint8_t key_len, uint8_t* plain_text,
                     uint8_t pt_len, void* p_cmd_cplt_cback)>
      body{[](uint8_t* key, uint8_t key_len, uint8_t* plain_text,
              uint8_t pt_len, void* p_cmd_cplt_cback) {}};
  void operator()(uint8_t* key, uint8_t key_len, uint8_t* plain_text,
                  uint8_t pt_len, void* p_cmd_cplt_cback) {
    body(key, key_len, plain_text, pt_len, p_cmd_cplt_cback);
  };
};
extern struct btsnd_hcic_ble_encrypt btsnd_hcic_ble_encrypt;

// Name: btsnd_hcic_ble_enh_rx_test
// Name: btsnd_hcic_ble_enh_rx_test
// Params: uint8_t rx_chan, uint8_t phy, uint8_t mod_index
// Params: uint8_t rx_chan, uint8_t phy, uint8_t mod_index
// Return: void
// Return: void