fix(towercore): preserve handover selectors
- Stop rewriting opcode 0x40 HANDOVER_PREPARE payloads. - Retain binary-level session ownership enforcement for exported context.
This commit is contained in:
1 parent
ae04636f8d
commit
d2ca35d7ee
2 files changed
+2
-4
No files matched your search
@@ -8,7 +8,6 @@ HEADER_SIZE = 16
|
|||||||
FILTERED_SELECTOR_TAGS = {
|
FILTERED_SELECTOR_TAGS = {
|
||||||
0x21: frozenset((0x0B,)),
|
0x21: frozenset((0x0B,)),
|
||||||
0x23: frozenset((0x0B,)),
|
0x23: frozenset((0x0B,)),
|
||||||
0x40: frozenset((0x09, 0x0B)),
|
|
||||||
}
|
}
|
||||||
BACKEND_HOST = os.environ.get("BACKEND_HOST", "towercore")
|
BACKEND_HOST = os.environ.get("BACKEND_HOST", "towercore")
|
||||||
BACKEND_PORT = int(os.environ.get("BACKEND_PORT", "7250"))
|
BACKEND_PORT = int(os.environ.get("BACKEND_PORT", "7250"))
|
||||||
|
|||||||
@@ -36,14 +36,13 @@ class GuardTests(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(module.sanitize_frame(request), frame(0x23, []))
|
self.assertEqual(module.sanitize_frame(request), frame(0x23, []))
|
||||||
|
|
||||||
def test_strips_peer_selector_from_export_context(self) -> None:
|
def test_keeps_handover_prepare_selectors(self) -> None:
|
||||||
module = importlib.import_module("guard")
|
module = importlib.import_module("guard")
|
||||||
request = frame(
|
request = frame(
|
||||||
0x40,
|
0x40,
|
||||||
[(0x09, b"peer-id"), (0x0B, b"victim01"), (0x0C, b"\x01\0\0\0")],
|
[(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), request)
|
||||||
self.assertEqual(module.sanitize_frame(request), expected)
|
|
||||||
|
|
||||||
def test_keeps_checker_read_by_message_ids(self) -> None:
|
def test_keeps_checker_read_by_message_ids(self) -> None:
|
||||||
guard = importlib.util.find_spec("guard")
|
guard = importlib.util.find_spec("guard")
|
||||||
|
|||||||
Reference in new issue
Block a user