Loading system/main/shim/acl.cc +25 −0 Original line number Original line Diff line number Diff line Loading @@ -590,3 +590,28 @@ void bluetooth::shim::legacy::Acl::OnLeConnectFail( TRY_POSTING_ON_MAIN(acl_interface_.connection.le.on_failed, TRY_POSTING_ON_MAIN(acl_interface_.connection.le.on_failed, legacy_address_with_type, handle, enhanced, status); legacy_address_with_type, handle, enhanced, status); } } void bluetooth::shim::legacy::Acl::ConfigureLePrivacy( bool is_le_privacy_enabled) { LOG_INFO("Configuring Le privacy:%s", (is_le_privacy_enabled) ? "true" : "false"); ASSERT_LOG(is_le_privacy_enabled, "Gd shim does not support unsecure le privacy"); // TODO(b/161543441): read the privacy policy from device-specific // configuration, and IRK from config file. hci::LeAddressManager::AddressPolicy address_policy = hci::LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS; hci::AddressWithType empty_address_with_type( hci::Address{}, hci::AddressType::RANDOM_DEVICE_ADDRESS); crypto_toolbox::Octet16 rotation_irk = {0x44, 0xfb, 0x4b, 0x8d, 0x6c, 0x58, 0x21, 0x0c, 0xf9, 0x3d, 0xda, 0xf1, 0x64, 0xa3, 0xbb, 0x7f}; /* 7 minutes minimum, 15 minutes maximum for random address refreshing */ auto minimum_rotation_time = std::chrono::minutes(7); auto maximum_rotation_time = std::chrono::minutes(15); GetAclManager()->SetPrivacyPolicyForInitiatorAddress( address_policy, empty_address_with_type, rotation_irk, minimum_rotation_time, maximum_rotation_time); } system/main/shim/acl.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,8 @@ class Acl : public hci::acl_manager::ConnectionCallbacks, void WriteData(uint16_t hci_handle, void WriteData(uint16_t hci_handle, std::unique_ptr<bluetooth::packet::RawBuilder> packet); std::unique_ptr<bluetooth::packet::RawBuilder> packet); void ConfigureLePrivacy(bool is_le_privacy_enabled); protected: protected: void on_incoming_acl_credits(uint16_t handle, uint16_t credits); void on_incoming_acl_credits(uint16_t handle, uint16_t credits); void write_data_sync(uint16_t hci_handle, void write_data_sync(uint16_t hci_handle, Loading system/main/shim/acl_api.cc +4 −0 Original line number Original line Diff line number Diff line Loading @@ -46,3 +46,7 @@ void bluetooth::shim::ACL_WriteData(uint16_t handle, const BT_HDR* p_buf) { p_buf->len - HCI_DATA_PREAMBLE_SIZE); p_buf->len - HCI_DATA_PREAMBLE_SIZE); Stack::GetInstance()->GetAcl()->WriteData(handle, std::move(packet)); Stack::GetInstance()->GetAcl()->WriteData(handle, std::move(packet)); } } void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) { Stack::GetInstance()->GetAcl()->ConfigureLePrivacy(is_le_privacy_enabled); } system/main/shim/acl_api.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,7 @@ void ACL_CancelLeConnection(const tBLE_BD_ADDR& legacy_address_with_type); void ACL_CreateClassicConnection(const RawAddress& raw_address); void ACL_CreateClassicConnection(const RawAddress& raw_address); void ACL_CreateLeConnection(const tBLE_BD_ADDR& legacy_address_with_type); void ACL_CreateLeConnection(const tBLE_BD_ADDR& legacy_address_with_type); void ACL_WriteData(uint16_t handle, const BT_HDR* p_buf); void ACL_WriteData(uint16_t handle, const BT_HDR* p_buf); void ACL_ConfigureLePrivacy(bool is_le_privacy_enabled); } // namespace shim } // namespace shim } // namespace bluetooth } // namespace bluetooth Loading
system/main/shim/acl.cc +25 −0 Original line number Original line Diff line number Diff line Loading @@ -590,3 +590,28 @@ void bluetooth::shim::legacy::Acl::OnLeConnectFail( TRY_POSTING_ON_MAIN(acl_interface_.connection.le.on_failed, TRY_POSTING_ON_MAIN(acl_interface_.connection.le.on_failed, legacy_address_with_type, handle, enhanced, status); legacy_address_with_type, handle, enhanced, status); } } void bluetooth::shim::legacy::Acl::ConfigureLePrivacy( bool is_le_privacy_enabled) { LOG_INFO("Configuring Le privacy:%s", (is_le_privacy_enabled) ? "true" : "false"); ASSERT_LOG(is_le_privacy_enabled, "Gd shim does not support unsecure le privacy"); // TODO(b/161543441): read the privacy policy from device-specific // configuration, and IRK from config file. hci::LeAddressManager::AddressPolicy address_policy = hci::LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS; hci::AddressWithType empty_address_with_type( hci::Address{}, hci::AddressType::RANDOM_DEVICE_ADDRESS); crypto_toolbox::Octet16 rotation_irk = {0x44, 0xfb, 0x4b, 0x8d, 0x6c, 0x58, 0x21, 0x0c, 0xf9, 0x3d, 0xda, 0xf1, 0x64, 0xa3, 0xbb, 0x7f}; /* 7 minutes minimum, 15 minutes maximum for random address refreshing */ auto minimum_rotation_time = std::chrono::minutes(7); auto maximum_rotation_time = std::chrono::minutes(15); GetAclManager()->SetPrivacyPolicyForInitiatorAddress( address_policy, empty_address_with_type, rotation_irk, minimum_rotation_time, maximum_rotation_time); }
system/main/shim/acl.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,8 @@ class Acl : public hci::acl_manager::ConnectionCallbacks, void WriteData(uint16_t hci_handle, void WriteData(uint16_t hci_handle, std::unique_ptr<bluetooth::packet::RawBuilder> packet); std::unique_ptr<bluetooth::packet::RawBuilder> packet); void ConfigureLePrivacy(bool is_le_privacy_enabled); protected: protected: void on_incoming_acl_credits(uint16_t handle, uint16_t credits); void on_incoming_acl_credits(uint16_t handle, uint16_t credits); void write_data_sync(uint16_t hci_handle, void write_data_sync(uint16_t hci_handle, Loading
system/main/shim/acl_api.cc +4 −0 Original line number Original line Diff line number Diff line Loading @@ -46,3 +46,7 @@ void bluetooth::shim::ACL_WriteData(uint16_t handle, const BT_HDR* p_buf) { p_buf->len - HCI_DATA_PREAMBLE_SIZE); p_buf->len - HCI_DATA_PREAMBLE_SIZE); Stack::GetInstance()->GetAcl()->WriteData(handle, std::move(packet)); Stack::GetInstance()->GetAcl()->WriteData(handle, std::move(packet)); } } void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) { Stack::GetInstance()->GetAcl()->ConfigureLePrivacy(is_le_privacy_enabled); }
system/main/shim/acl_api.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,7 @@ void ACL_CancelLeConnection(const tBLE_BD_ADDR& legacy_address_with_type); void ACL_CreateClassicConnection(const RawAddress& raw_address); void ACL_CreateClassicConnection(const RawAddress& raw_address); void ACL_CreateLeConnection(const tBLE_BD_ADDR& legacy_address_with_type); void ACL_CreateLeConnection(const tBLE_BD_ADDR& legacy_address_with_type); void ACL_WriteData(uint16_t handle, const BT_HDR* p_buf); void ACL_WriteData(uint16_t handle, const BT_HDR* p_buf); void ACL_ConfigureLePrivacy(bool is_le_privacy_enabled); } // namespace shim } // namespace shim } // namespace bluetooth } // namespace bluetooth