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

Commit 3a577bca authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

LE Security Test Test: Just Works IUT Responder – Handle AuthReq flag RFU correctly

Implementation of SM/SLA/JW/BI-03-C test case

Tag: #gd-refactor
Bug: 155399771
Test: gd/cert/run --host --test_filter=LeSecurityTest
Change-Id: I894c0f0027f888630696ba264aaa65e887034baf
parent efdf4190
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -229,3 +229,40 @@ class LeSecurityTest(GdBaseTestClass):

        # IUT and Lower Tester perform phase 2 of the just works pairing and establish an encrypted link with the generated STK.
        self.dut_security.wait_for_bond_event(expected_bond_event=BondMsgType.DEVICE_BONDED)

    @metadata(
        pts_test_id="SM/SLA/JW/BI-03-C", pts_test_name="Just Works IUT Responder – Handle AuthReq flag RFU correctly")
    def test_just_works_iut_responder_auth_req_rfu(self):
        """
            Verify that the IUT is able to perform the Just Works pairing procedure when receiving additional bits set in the AuthReq flag. Reserved For Future Use bits are correctly handled when acting as slave, responder.
        """
        self._prepare_dut_for_connection()

        self.dut.security.SetLeIoCapability(
            LeIoCapabilityMessage(capabilities=LeIoCapabilityMessage.LeIoCapabilities.KEYBOARD_DISPLAY))
        self.dut.security.SetOobDataPresent(OobDataMessage(data_present=OobDataPresent.NOT_PRESENT))
        self.dut.security.SetLeAuthReq(LeAuthReqMsg(auth_req=0x00))

        self.cert.security.SetLeIoCapability(
            LeIoCapabilityMessage(capabilities=LeIoCapabilityMessage.LeIoCapabilities.NO_INPUT_NO_OUTPUT))
        self.cert.security.SetOobDataPresent(OobDataMessage(data_present=OobDataPresent.NOT_PRESENT))
        self.cert.security.SetLeAuthReq(LeAuthReqMsg(auth_req=0x0C))

        # 1. Lower Tester transmits Pairing Request command with:
        # a. IO Capability set to ”NoInputNoOutput”
        # b. OOB data flag set to 0x00 (OOB Authentication data not present)
        # c. MITM set to ‘0’ and all reserved bits are set to ‘1’
        self.cert.security.CreateBondLe(self.dut_address)

        self.dut_security.wait_for_ui_event(expected_ui_event=UiMsgType.DISPLAY_PAIRING_PROMPT)

        # 2. IUT responds with a Pairing Response command, with:
        # a. IO capability set to any IO capability
        # b. OOB data flag set to 0x00 (OOB Authentication data not present)
        # c. All reserved bits are set to ‘0’
        self.dut.security.SendUiCallback(
            UiCallbackMsg(
                message_type=UiCallbackType.PAIRING_PROMPT, boolean=True, unique_id=1, address=self.dut_address))

        # 3. IUT and Lower Tester perform phase 2 of the just works pairing and establish an encrypted link with the generated STK.
        self.dut_security.wait_for_bond_event(expected_bond_event=BondMsgType.DEVICE_BONDED)