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

Commit ff3b6164 authored by Martin Brabham's avatar Martin Brabham
Browse files

Cert: SM responder reject ui event

Test responder rejecting the pairing.  DUT should still think its successful
Cert will reject and fail out.

Encryption fail will trigger pairing flow again, but we don't control that.

Bug: 145638034
Test: cert/run --gotta-go-fast --host --verbose SecurityTest:test_dut_initiated_display_yes_no_display_yes_no_resp_reject
Tag: #gd-refactor
Change-Id: I4bcda3900a1ba909320e91075ccf2ec70d1876d3
parent 7fc3ba30
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -207,7 +207,6 @@ 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)
@@ -228,6 +227,26 @@ class SecurityTest(GdBaseTestClass):
            expected_init_bond_event=BondMsgType.DEVICE_BOND_FAILED,
            expected_resp_bond_event=None)

    def test_dut_initiated_display_yes_no_display_yes_no_resp_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=True,
            resp_ui_response=False,
            expected_init_ui_event=UiMsgType.DISPLAY_YES_NO_WITH_VALUE,
            expected_resp_ui_event=None,
            expected_init_bond_event=BondMsgType.DEVICE_BONDED,
            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