fix(towercore): bind exported context to session
- Force EXPORT_CONTEXT to use session->UE after both peer selector paths. - Strip tag 0x09 and 0x0b peer selectors in the protocol guard.
This commit is contained in:
1 parent
ce5eb09db3
commit
aba00ab3ed
3 files changed
+23
-7
No files matched your search
@@ -36,6 +36,15 @@ class GuardTests(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(module.sanitize_frame(request), frame(0x23, []))
|
||||
|
||||
def test_strips_peer_selector_from_export_context(self) -> None:
|
||||
module = importlib.import_module("guard")
|
||||
request = frame(
|
||||
0x40,
|
||||
[(0x09, b"peer-id"), (0x0B, b"victim01"), (0x0C, b"\x01\0\0\0")],
|
||||
)
|
||||
expected = frame(0x40, [(0x0C, b"\x01\0\0\0")])
|
||||
self.assertEqual(module.sanitize_frame(request), expected)
|
||||
|
||||
def test_keeps_checker_read_by_message_ids(self) -> None:
|
||||
guard = importlib.util.find_spec("guard")
|
||||
self.assertIsNotNone(guard, "Towercore guard is not implemented")
|
||||
|
||||
Reference in new issue
Block a user