Loading system/gd/cert/py_security.py +3 −2 Original line number Diff line number Diff line Loading @@ -53,11 +53,12 @@ class PySecurity(Closable): self._device.security.CreateBond( common.BluetoothAddressWithType(address=common.BluetoothAddress(address=address), type=type)) def remove_bond(self, address_with_type): def remove_bond(self, address, type): """ Removes bond from stack under test """ self._device.security.RemoveBond(address_with_type) self._device.security.RemoveBond( common.BluetoothAddressWithType(address=common.BluetoothAddress(address=address), type=type)) def set_io_capabilities(self, io_capabilities): """ Loading system/gd/security/cert/security_test.py +37 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,43 @@ class SecurityTest(GdBaseTestClass): expected_init_bond_event=BondMsgType.DEVICE_BONDED, expected_resp_bond_event=None) # no_input_no_output + no_input_no_output is JustWorks no confirmation def test_dut_initiated_no_input_no_output_no_input_no_output_twice(self): # Arrange self.dut_security.set_io_capabilities(IoCapabilities.NO_INPUT_NO_OUTPUT) self.dut_security.set_authentication_requirements(AuthenticationRequirements.DEDICATED_BONDING_MITM_PROTECTION) self.dut_security.set_oob_data(OobDataPresent.NOT_PRESENT) self.cert_security.set_io_capabilities(IoCapabilities.NO_INPUT_NO_OUTPUT) self.cert_security.set_authentication_requirements(AuthenticationRequirements.DEDICATED_BONDING_MITM_PROTECTION) self.cert_security.set_oob_data(OobDataPresent.NOT_PRESENT) # Act and Assert self._run_ssp_numeric_comparison( initiator=self.dut_security, responder=self.cert_security, init_ui_response=True, resp_ui_response=True, expected_init_ui_event=None, expected_resp_ui_event=None, expected_init_bond_event=BondMsgType.DEVICE_BONDED, expected_resp_bond_event=None) self.dut_security.remove_bond(self.cert.address, common.BluetoothAddressTypeEnum.PUBLIC_DEVICE_ADDRESS) # Give time for ACL to disconnect time.sleep(1) # Act and Assert self._run_ssp_numeric_comparison( initiator=self.dut_security, responder=self.cert_security, init_ui_response=True, resp_ui_response=True, expected_init_ui_event=None, expected_resp_ui_event=None, expected_init_bond_event=BondMsgType.DEVICE_BONDED, expected_resp_bond_event=None) ## Other permutations #def xtest_dut_initiated_display_only_display_only_local_user_deny(self) Loading system/gd/security/channel/security_manager_channel.cc +0 −4 Original line number Diff line number Diff line Loading @@ -55,8 +55,6 @@ void SecurityManagerChannel::Release(hci::Address address) { return; } entry->second->Release(); entry->second.reset(); link_map_.erase(entry); } void SecurityManagerChannel::Disconnect(hci::Address address) { Loading @@ -66,8 +64,6 @@ void SecurityManagerChannel::Disconnect(hci::Address address) { return; } entry->second->Disconnect(); entry->second.reset(); link_map_.erase(entry); } void SecurityManagerChannel::OnCommandComplete(hci::CommandCompleteView packet) { Loading Loading
system/gd/cert/py_security.py +3 −2 Original line number Diff line number Diff line Loading @@ -53,11 +53,12 @@ class PySecurity(Closable): self._device.security.CreateBond( common.BluetoothAddressWithType(address=common.BluetoothAddress(address=address), type=type)) def remove_bond(self, address_with_type): def remove_bond(self, address, type): """ Removes bond from stack under test """ self._device.security.RemoveBond(address_with_type) self._device.security.RemoveBond( common.BluetoothAddressWithType(address=common.BluetoothAddress(address=address), type=type)) def set_io_capabilities(self, io_capabilities): """ Loading
system/gd/security/cert/security_test.py +37 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,43 @@ class SecurityTest(GdBaseTestClass): expected_init_bond_event=BondMsgType.DEVICE_BONDED, expected_resp_bond_event=None) # no_input_no_output + no_input_no_output is JustWorks no confirmation def test_dut_initiated_no_input_no_output_no_input_no_output_twice(self): # Arrange self.dut_security.set_io_capabilities(IoCapabilities.NO_INPUT_NO_OUTPUT) self.dut_security.set_authentication_requirements(AuthenticationRequirements.DEDICATED_BONDING_MITM_PROTECTION) self.dut_security.set_oob_data(OobDataPresent.NOT_PRESENT) self.cert_security.set_io_capabilities(IoCapabilities.NO_INPUT_NO_OUTPUT) self.cert_security.set_authentication_requirements(AuthenticationRequirements.DEDICATED_BONDING_MITM_PROTECTION) self.cert_security.set_oob_data(OobDataPresent.NOT_PRESENT) # Act and Assert self._run_ssp_numeric_comparison( initiator=self.dut_security, responder=self.cert_security, init_ui_response=True, resp_ui_response=True, expected_init_ui_event=None, expected_resp_ui_event=None, expected_init_bond_event=BondMsgType.DEVICE_BONDED, expected_resp_bond_event=None) self.dut_security.remove_bond(self.cert.address, common.BluetoothAddressTypeEnum.PUBLIC_DEVICE_ADDRESS) # Give time for ACL to disconnect time.sleep(1) # Act and Assert self._run_ssp_numeric_comparison( initiator=self.dut_security, responder=self.cert_security, init_ui_response=True, resp_ui_response=True, expected_init_ui_event=None, expected_resp_ui_event=None, expected_init_bond_event=BondMsgType.DEVICE_BONDED, expected_resp_bond_event=None) ## Other permutations #def xtest_dut_initiated_display_only_display_only_local_user_deny(self) Loading
system/gd/security/channel/security_manager_channel.cc +0 −4 Original line number Diff line number Diff line Loading @@ -55,8 +55,6 @@ void SecurityManagerChannel::Release(hci::Address address) { return; } entry->second->Release(); entry->second.reset(); link_map_.erase(entry); } void SecurityManagerChannel::Disconnect(hci::Address address) { Loading @@ -66,8 +64,6 @@ void SecurityManagerChannel::Disconnect(hci::Address address) { return; } entry->second->Disconnect(); entry->second.reset(); link_map_.erase(entry); } void SecurityManagerChannel::OnCommandComplete(hci::CommandCompleteView packet) { Loading