Loading system/gd/security/cert/security_test.py +21 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,27 @@ class SecurityTest(GdBaseTestClass): expected_init_bond_event=BondMsgType.DEVICE_BONDED, expected_resp_bond_event=None) # display_yes_no + display_yes_no is JustWorks no confirmation def test_dut_initiated_display_yes_no_display_yes_no_init_reject(self): # Arrange self.dut_security.set_io_capabilities(IoCapabilities.DISPLAY_YES_NO_IO_CAP) 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.DISPLAY_YES_NO_IO_CAP) 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=False, resp_ui_response=True, expected_init_ui_event=UiMsgType.DISPLAY_YES_NO_WITH_VALUE, expected_resp_ui_event=None, expected_init_bond_event=BondMsgType.DEVICE_BOND_FAILED, expected_resp_bond_event=None) # no_input_no_output + display_yes_no is JustWorks no confirmation def test_dut_initiated_no_input_no_output_display_yes_no(self): # Arrange Loading system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +11 −5 Original line number Diff line number Diff line Loading @@ -1318,16 +1318,16 @@ ErrorCode LinkLayerController::UserConfirmationRequestReply( security_manager_.AuthenticationRequestFinished(); ScheduleTask(milliseconds(5), [this, peer, key_vec]() { send_event_(bluetooth::hci::LinkKeyNotificationBuilder::Create( peer, key_vec, bluetooth::hci::KeyType::AUTHENTICATED_P256)); }); ScheduleTask(milliseconds(5), [this, peer]() { send_event_(bluetooth::hci::SimplePairingCompleteBuilder::Create( ErrorCode::SUCCESS, peer)); }); ScheduleTask(milliseconds(5), [this, peer, key_vec]() { send_event_(bluetooth::hci::LinkKeyNotificationBuilder::Create( peer, key_vec, bluetooth::hci::KeyType::AUTHENTICATED_P256)); }); ScheduleTask(milliseconds(15), [this, peer]() { AuthenticateRemoteStage2(peer); }); return ErrorCode::SUCCESS; Loading @@ -1338,6 +1338,12 @@ ErrorCode LinkLayerController::UserConfirmationRequestNegativeReply( if (security_manager_.GetAuthenticationAddress() != peer) { return ErrorCode::AUTHENTICATION_FAILURE; } ScheduleTask(milliseconds(5), [this, peer]() { send_event_(bluetooth::hci::SimplePairingCompleteBuilder::Create( ErrorCode::AUTHENTICATION_FAILURE, peer)); }); return ErrorCode::SUCCESS; } Loading Loading
system/gd/security/cert/security_test.py +21 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,27 @@ class SecurityTest(GdBaseTestClass): expected_init_bond_event=BondMsgType.DEVICE_BONDED, expected_resp_bond_event=None) # display_yes_no + display_yes_no is JustWorks no confirmation def test_dut_initiated_display_yes_no_display_yes_no_init_reject(self): # Arrange self.dut_security.set_io_capabilities(IoCapabilities.DISPLAY_YES_NO_IO_CAP) 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.DISPLAY_YES_NO_IO_CAP) 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=False, resp_ui_response=True, expected_init_ui_event=UiMsgType.DISPLAY_YES_NO_WITH_VALUE, expected_resp_ui_event=None, expected_init_bond_event=BondMsgType.DEVICE_BOND_FAILED, expected_resp_bond_event=None) # no_input_no_output + display_yes_no is JustWorks no confirmation def test_dut_initiated_no_input_no_output_display_yes_no(self): # Arrange Loading
system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +11 −5 Original line number Diff line number Diff line Loading @@ -1318,16 +1318,16 @@ ErrorCode LinkLayerController::UserConfirmationRequestReply( security_manager_.AuthenticationRequestFinished(); ScheduleTask(milliseconds(5), [this, peer, key_vec]() { send_event_(bluetooth::hci::LinkKeyNotificationBuilder::Create( peer, key_vec, bluetooth::hci::KeyType::AUTHENTICATED_P256)); }); ScheduleTask(milliseconds(5), [this, peer]() { send_event_(bluetooth::hci::SimplePairingCompleteBuilder::Create( ErrorCode::SUCCESS, peer)); }); ScheduleTask(milliseconds(5), [this, peer, key_vec]() { send_event_(bluetooth::hci::LinkKeyNotificationBuilder::Create( peer, key_vec, bluetooth::hci::KeyType::AUTHENTICATED_P256)); }); ScheduleTask(milliseconds(15), [this, peer]() { AuthenticateRemoteStage2(peer); }); return ErrorCode::SUCCESS; Loading @@ -1338,6 +1338,12 @@ ErrorCode LinkLayerController::UserConfirmationRequestNegativeReply( if (security_manager_.GetAuthenticationAddress() != peer) { return ErrorCode::AUTHENTICATION_FAILURE; } ScheduleTask(milliseconds(5), [this, peer]() { send_event_(bluetooth::hci::SimplePairingCompleteBuilder::Create( ErrorCode::AUTHENTICATION_FAILURE, peer)); }); return ErrorCode::SUCCESS; } Loading