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

Commit 6e878356 authored by Chris Manton's avatar Chris Manton Committed by Gerrit Code Review
Browse files

Merge changes Iea75ea47,Ic4394c1c,I9938e1ff,Ibb90b945,I9c2bf7e2, ... into main

* changes:
  [15/24] Canonical form tBTM_STATUS::BTM_INSUFFICIENT_ENCRYPT_KEY_SIZE
  [14/24] Canonical form tBTM_STATUS::BTM_ILLEGAL_VALUE
  [13/24] Canonical form tBTM_STATUS::BTM_ILLEGAL_ACTION
  [12/24] Canonical form tBTM_STATUS::BTM_FAILED_ON_SECURITY
  [11/24] Canonical form tBTM_STATUS::BTM_ERR_PROCESSING
  [10/24] Canonical form tBTM_STATUS::BTM_ERR_KEY_MISSING
parents 73579aa9 dc0c8c54
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1848,7 +1848,7 @@ private:
        if (BTM_IsEncrypted(p_data->enc_cmpl.remote_bda, BT_TRANSPORT_LE)) {
          encryption_status = tBTM_STATUS::BTM_SUCCESS;
        } else {
          encryption_status = BTM_FAILED_ON_SECURITY;
          encryption_status = tBTM_STATUS::BTM_FAILED_ON_SECURITY;
        }
        OnLeEncryptionComplete(p_data->enc_cmpl.remote_bda, encryption_status);
      } break;
@@ -1916,7 +1916,7 @@ private:

    log::info("Encryption required for {}. Request result: 0x{:02x}", device->addr, result);

    if (result == BTM_ERR_KEY_MISSING) {
    if (result == tBTM_STATUS::BTM_ERR_KEY_MISSING) {
      log::error("Link key unknown for {}, disconnect profile", device->addr);
      BTA_GATTC_Close(device->conn_id);
    }
+1 −1
Original line number Diff line number Diff line
@@ -879,7 +879,7 @@ TEST_F(CsisClientTest, test_disconnect_when_link_key_is_gone) {

  ON_CALL(btm_interface, BTM_IsEncrypted(test_address, _)).WillByDefault(DoAll(Return(false)));
  ON_CALL(btm_interface, SetEncryption(test_address, _, _, _, _))
          .WillByDefault(Return(BTM_ERR_KEY_MISSING));
          .WillByDefault(Return(tBTM_STATUS::BTM_ERR_KEY_MISSING));

  EXPECT_CALL(gatt_interface, Close(1));

+1 −1
Original line number Diff line number Diff line
@@ -1875,7 +1875,7 @@ private:

    log::info("Encryption required for {}. Request result: 0x{:02x}", device->addr, result);

    if (result == BTM_ERR_KEY_MISSING) {
    if (result == tBTM_STATUS::BTM_ERR_KEY_MISSING) {
      log::error("Link key unknown for {}, disconnect profile", device->addr);
      BTA_GATTC_Close(device->conn_id);
    }
+1 −1
Original line number Diff line number Diff line
@@ -1275,7 +1275,7 @@ TEST_F(HasClientTest, test_disconnect_when_link_key_is_gone) {

  ON_CALL(btm_interface, BTM_IsEncrypted(test_address, _)).WillByDefault(DoAll(Return(false)));
  ON_CALL(btm_interface, SetEncryption(test_address, _, _, _, _))
          .WillByDefault(Return(BTM_ERR_KEY_MISSING));
          .WillByDefault(Return(tBTM_STATUS::BTM_ERR_KEY_MISSING));

  auto test_conn_id = GetTestConnId(test_address);
  EXPECT_CALL(gatt_interface, Close(test_conn_id)).Times(1);
+3 −2
Original line number Diff line number Diff line
@@ -1011,7 +1011,7 @@ void bta_hh_security_cmpl(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* /* p_buf */)
      log::verbose("Starting service discovery");
      bta_hh_le_pri_service_discovery(p_cb);
    }
  } else if (p_cb->btm_status == BTM_ERR_KEY_MISSING) {
  } else if (p_cb->btm_status == tBTM_STATUS::BTM_ERR_KEY_MISSING) {
    log::error("Received encryption failed status:{} btm_status:{}",
               bta_hh_status_text(p_cb->status), btm_status_text(p_cb->btm_status));
    bta_hh_le_api_disc_act(p_cb);
@@ -1019,7 +1019,8 @@ void bta_hh_security_cmpl(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* /* p_buf */)
    log::error("Encryption failed status:{} btm_status:{}", bta_hh_status_text(p_cb->status),
               btm_status_text(p_cb->btm_status));
    if (!(p_cb->status == BTA_HH_ERR_SEC &&
          (p_cb->btm_status == BTM_ERR_PROCESSING || p_cb->btm_status == BTM_FAILED_ON_SECURITY ||
          (p_cb->btm_status == tBTM_STATUS::BTM_ERR_PROCESSING ||
           p_cb->btm_status == tBTM_STATUS::BTM_FAILED_ON_SECURITY ||
           p_cb->btm_status == BTM_WRONG_MODE))) {
      bta_hh_le_api_disc_act(p_cb);
    }
Loading