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

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

Cert: Add enforce_security_policy interface

PySecurity and CertSecurity now provide an API for
calling EnforceSecurityPolicy on the SecurityModule
through the facade

Bug: 145638034
Test: cert/run --host --test_filter=SecurityTest
Tag: #gd-refactor
Change-Id: Ie0ac34b5e2b680d51ce233d646ee53c4f96b2509
parent e93387c3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ from google.protobuf import empty_pb2 as empty_proto
from hci.facade import facade_pb2 as hci_facade
from security.facade_pb2 import IoCapabilityMessage
from security.facade_pb2 import AuthenticationRequirementsMessage
from security.facade_pb2 import SecurityPolicyMessage
from security.facade_pb2 import OobDataMessage
from security.facade_pb2 import UiCallbackMsg
from security.facade_pb2 import UiCallbackType
@@ -143,6 +144,12 @@ class PySecurity(Closable):
        """
        self._bond_event_stream.assert_event_occurs(lambda event: event.message_type == expected_bond_event)

    def enforce_security_policy(self, address, type, policy):
        """
            Call to enforce classic security policy
        """
        pass

    def close(self):
        if self._ui_event_stream is not None:
            safeClose(self._ui_event_stream)
+6 −0
Original line number Diff line number Diff line
@@ -192,5 +192,11 @@ class CertSecurity(PySecurity):
        """
        pass

    def enforce_security_policy(self, address, type, policy):
        """
            Pass for now
        """
        pass

    def close(self):
        safeClose(self._hci)