Update public source
This commit is contained in:
+28
-1
@@ -1637,6 +1637,25 @@ def _map_existing_handshake_ids(
|
|||||||
"match the .wifitrip package."
|
"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 = (
|
fields = (
|
||||||
"bssid",
|
"bssid",
|
||||||
"type",
|
"type",
|
||||||
@@ -1664,7 +1683,14 @@ def _map_existing_handshake_ids(
|
|||||||
signature_positions = {}
|
signature_positions = {}
|
||||||
handshake_ids = {}
|
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(
|
signature = tuple(
|
||||||
handshake[field]
|
handshake[field]
|
||||||
for field in fields
|
for field in fields
|
||||||
@@ -1792,6 +1818,7 @@ def _import_session_credentials(
|
|||||||
(access_point_id,),
|
(access_point_id,),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def import_wifitrip(conn, package_path):
|
def import_wifitrip(conn, package_path):
|
||||||
started = time.monotonic()
|
started = time.monotonic()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user