From bac6d68fa516ee22d00214d4f96d4d38be4a6f19 Mon Sep 17 00:00:00 2001 From: WildSoft Date: Thu, 15 Oct 2026 11:52:08 +0300 Subject: [PATCH] Update public source --- reports/wifitrip.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/reports/wifitrip.py b/reports/wifitrip.py index d31d9f4..aea4846 100644 --- a/reports/wifitrip.py +++ b/reports/wifitrip.py @@ -1637,6 +1637,25 @@ def _map_existing_handshake_ids( "match the .wifitrip package." ) + expected_keys = [ + f"h{index:06d}" + for index in range( + 1, + len(session_handshakes) + 1, + ) + ] + + package_keys = { + handshake["handshake_key"] + for handshake in session_handshakes + } + + if package_keys != set(expected_keys): + raise WifitripError( + "Existing session handshake keys do not " + "match the exported sequence." + ) + fields = ( "bssid", "type", @@ -1664,7 +1683,14 @@ def _map_existing_handshake_ids( signature_positions = {} handshake_ids = {} - for handshake in session_handshakes: + ordered_handshakes = sorted( + session_handshakes, + key=lambda handshake: ( + handshake["handshake_key"] + ), + ) + + for handshake in ordered_handshakes: signature = tuple( handshake[field] for field in fields @@ -1792,6 +1818,7 @@ def _import_session_credentials( (access_point_id,), ) + def import_wifitrip(conn, package_path): started = time.monotonic()