From 18778f3f272fe9be5846748a253d7c76d76da168 Mon Sep 17 00:00:00 2001 From: Levon 'noptrix' Kayan Date: Fri, 6 Dec 2024 23:20:57 +0100 Subject: [PATCH] pyrit: provide patch files. --- packages/pyrit/fix-broken-join.patch | 24 ++++++++++++++++ packages/pyrit/scapy-2.3.2.patch | 42 ++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 packages/pyrit/fix-broken-join.patch create mode 100644 packages/pyrit/scapy-2.3.2.patch diff --git a/packages/pyrit/fix-broken-join.patch b/packages/pyrit/fix-broken-join.patch new file mode 100644 index 00000000000..aed1c4cd140 --- /dev/null +++ b/packages/pyrit/fix-broken-join.patch @@ -0,0 +1,24 @@ +From: =?utf-8?q?Rapha=C3=ABl_Hertzog?= +Date: Tue, 4 Feb 2020 12:35:11 +0100 +Subject: Fix broken join + +--- + cpyrit/storage.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/cpyrit/storage.py b/cpyrit/storage.py +index 3933f62..dcf3a51 100644 +--- a/cpyrit/storage.py ++++ b/cpyrit/storage.py +@@ -962,7 +962,10 @@ if 'sqlalchemy' in sys.modules: + pwtotal = 0 if pwtotal is None else int(pwtotal) + q = session.query(ESSID_DBObject.essid, + sql.func.sum(PAW2_DBObject.numElems)) +- q = q.outerjoin(PYR2_DBObject).outerjoin(PAW2_DBObject) ++ q = q.outerjoin(PYR2_DBObject, ++ PYR2_DBObject.essid_id==ESSID_DBObject.essid_id) ++ q = q.outerjoin(PAW2_DBObject, ++ PAW2_DBObject.key==PYR2_DBObject.key) + q = q.group_by(ESSID_DBObject.essid) + essid_results = {} + for essid, pwcount in q: diff --git a/packages/pyrit/scapy-2.3.2.patch b/packages/pyrit/scapy-2.3.2.patch new file mode 100644 index 00000000000..d1b0ec1e571 --- /dev/null +++ b/packages/pyrit/scapy-2.3.2.patch @@ -0,0 +1,42 @@ +From 14ec997174b8e8fd20d22b6a97c57e19633f12a0 Mon Sep 17 00:00:00 2001 +From: Ilya Terentyev +Date: Tue, 1 Nov 2016 20:40:15 +0300 +Subject: [PATCH] update isinstance(EnumField) for scapy 2.3.3+ + +scapy 2.3.2- requires that scapy.fields.EnumField is passed to +isinstance, while scapy 2.3.3+ needs scapy.fields._EnumField. +This patch accomodates pyrit for both versions. +Fixes #500. +--- + cpyrit/pckttools.py | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/cpyrit/pckttools.py b/cpyrit/pckttools.py +index 326829d..d58fff1 100644 +--- a/cpyrit/pckttools.py ++++ b/cpyrit/pckttools.py +@@ -54,12 +54,23 @@ + scapy.layers.dot11.PrismHeader) + + ++def isEnumField(f): ++ """Return True if f is an instance of EnumField. This function tries to be ++ portable: scapy versions 2.3.2 and earlier need isinstance(EnumField), ++ while scapy 2.3.3+ requires isinstance(_EnumField). ++ """ ++ try: ++ return isinstance(f, scapy.fields._EnumField) ++ except AttributeError: ++ return isinstance(f, scapy.fields.EnumField) ++ ++ + def isFlagSet(self, name, value): + """Return True if the given field 'includes' the given value. + Exact behaviour of this function is specific to the field-type. + """ + field, val = self.getfield_and_val(name) +- if isinstance(field, scapy.fields.EnumField): ++ if isEnumField(field): + if val not in field.i2s: + return False + return field.i2s[val] == value