mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-10-10 02:57:25 +02:00
auto-t: update scapy imports for newer version
Something changed between scapy versions and now the modules being imported don't exist.
This commit is contained in:
parent
f3e4263f51
commit
ea571861d6
@ -3,7 +3,11 @@ import sys
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
from scapy.layers.dot11 import *
|
from scapy.layers.dot11 import *
|
||||||
from scapy.arch import str2mac, get_if_raw_hwaddr
|
from scapy.arch import str2mac
|
||||||
|
try:
|
||||||
|
from scapy.arch import get_if_raw_hwaddr
|
||||||
|
except:
|
||||||
|
from scapy.arch.unix import get_if_raw_hwaddr
|
||||||
from time import time, sleep
|
from time import time, sleep
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
|
@ -7,7 +7,10 @@ from weakref import WeakValueDictionary
|
|||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from scapy.all import *
|
from scapy.all import *
|
||||||
from scapy.contrib.wpa_eapol import WPA_key
|
try:
|
||||||
|
from scapy.contrib.wpa_eapol import WPA_key
|
||||||
|
except:
|
||||||
|
from scapy.layers.eap import EAPOL_KEY
|
||||||
|
|
||||||
import iwd
|
import iwd
|
||||||
from config import ctx
|
from config import ctx
|
||||||
@ -444,9 +447,15 @@ class Hwsim(iwd.AsyncOpAbstract):
|
|||||||
|
|
||||||
# NOTE: Expected key_info is 0x008a, with the install flag
|
# NOTE: Expected key_info is 0x008a, with the install flag
|
||||||
# this becomes 0x00ca.
|
# this becomes 0x00ca.
|
||||||
eapol = WPA_key( descriptor_type = 2,
|
try:
|
||||||
key_info = 0x00ca, # Includes an invalid install flag!
|
eapol = WPA_key( descriptor_type = 2,
|
||||||
replay_counter = struct.pack(">Q", 100))
|
key_info = 0x00ca, # Includes an invalid install flag!
|
||||||
|
replay_counter = struct.pack(">Q", 100))
|
||||||
|
except:
|
||||||
|
eapol = EAPOL_KEY( key_descriptor_type = 2,
|
||||||
|
install = 1,
|
||||||
|
key_ack = 1,
|
||||||
|
key_replay_counter = 1)
|
||||||
frame /= LLC()/SNAP()/EAPOL(version="802.1X-2004", type="EAPOL-Key")
|
frame /= LLC()/SNAP()/EAPOL(version="802.1X-2004", type="EAPOL-Key")
|
||||||
frame /= eapol
|
frame /= eapol
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user