Update public source
This commit is contained in:
+35
-10
@@ -1603,6 +1603,7 @@ def _session_id_by_hash(
|
||||
|
||||
return row["id"]
|
||||
|
||||
|
||||
def _map_existing_handshake_ids(
|
||||
conn,
|
||||
session_id,
|
||||
@@ -1636,8 +1637,6 @@ def _map_existing_handshake_ids(
|
||||
"match the .wifitrip package."
|
||||
)
|
||||
|
||||
handshake_ids = {}
|
||||
|
||||
fields = (
|
||||
"bssid",
|
||||
"type",
|
||||
@@ -1649,14 +1648,38 @@ def _map_existing_handshake_ids(
|
||||
"speed",
|
||||
)
|
||||
|
||||
for row, handshake in zip(
|
||||
rows,
|
||||
session_handshakes,
|
||||
):
|
||||
if any(
|
||||
row[field] != handshake[field]
|
||||
local_ids_by_signature = {}
|
||||
|
||||
for row in rows:
|
||||
signature = tuple(
|
||||
row[field]
|
||||
for field in fields
|
||||
):
|
||||
)
|
||||
|
||||
local_ids_by_signature.setdefault(
|
||||
signature,
|
||||
[],
|
||||
).append(row["id"])
|
||||
|
||||
signature_positions = {}
|
||||
handshake_ids = {}
|
||||
|
||||
for handshake in session_handshakes:
|
||||
signature = tuple(
|
||||
handshake[field]
|
||||
for field in fields
|
||||
)
|
||||
|
||||
local_ids = local_ids_by_signature.get(
|
||||
signature,
|
||||
)
|
||||
|
||||
position = signature_positions.get(
|
||||
signature,
|
||||
0,
|
||||
)
|
||||
|
||||
if local_ids is None or position >= len(local_ids):
|
||||
raise WifitripError(
|
||||
"Existing session handshake mapping "
|
||||
"does not match the .wifitrip package."
|
||||
@@ -1664,7 +1687,9 @@ def _map_existing_handshake_ids(
|
||||
|
||||
handshake_ids[
|
||||
handshake["handshake_key"]
|
||||
] = row["id"]
|
||||
] = local_ids[position]
|
||||
|
||||
signature_positions[signature] = position + 1
|
||||
|
||||
return handshake_ids
|
||||
|
||||
|
||||
Reference in New Issue
Block a user