diff --git a/fix_s390x_tests.patch b/fix_s390x_tests.patch deleted file mode 100644 index 2962826..0000000 --- a/fix_s390x_tests.patch +++ /dev/null @@ -1,246 +0,0 @@ -From 4ce0b897e60a67fec4b590af058fd702563d79c5 Mon Sep 17 00:00:00 2001 -From: Oscar -Date: Sun, 27 Dec 2020 11:18:50 -0800 -Subject: [PATCH] Fix #505 and other big endian arch bugfixes (#510) - -* issue #505: fix inet checksum calculation -* issue #505: fix pcapng unit test -* issue #505: fix ieee80211 -* issue #505: radiotap fix for big endian systems ---- - dpkt/compat.py | 12 ++++++++++-- - dpkt/dpkt.py | 24 +++++++++++++----------- - dpkt/ieee80211.py | 21 +++++++++++---------- - dpkt/pcapng.py | 8 +++++++- - dpkt/radiotap.py | 5 ++--- - 5 files changed, 43 insertions(+), 27 deletions(-) - ---- a/dpkt/compat.py -+++ b/dpkt/compat.py -@@ -1,5 +1,6 @@ - from __future__ import absolute_import - -+from struct import pack, unpack - import sys - - if sys.version_info < (3,): -@@ -19,9 +20,9 @@ try: - except ImportError: - from io import StringIO - --try: -+try: - from BytesIO import BytesIO --except ImportError: -+except ImportError: - from io import BytesIO - - if sys.version_info < (3,): -@@ -37,3 +38,10 @@ else: - - # python3 will return an int if you round to 0 decimal places - intround = round -+ -+ -+def ntole(v): -+ """convert a 2-byte word from the network byte order (big endian) to little endian; -+ replaces socket.ntohs() to work on both little and big endian architectures -+ """ -+ return unpack('') - -@@ -146,7 +144,7 @@ class Packet(_MetaPacket("Temp", (object - - def __str__(self): - return str(self.__bytes__()) -- -+ - def __bytes__(self): - return self.pack_hdr() + bytes(self.data) - -@@ -200,16 +198,17 @@ def hexdump(buf, length=16): - def in_cksum_add(s, buf): - n = len(buf) - cnt = (n // 2) * 2 -- a = array.array('H', buf[:cnt]) -+ a = struct.unpack('<{}H'.format(n // 2), buf[:cnt]) # unpack as little endian words -+ res = s + sum(a) - if cnt != n: -- a.append(compat_ord(buf[-1])) -- return s + sum(a) -+ res += compat_ord(buf[-1]) -+ return res - - - def in_cksum_done(s): - s = (s >> 16) + (s & 0xffff) - s += (s >> 16) -- return socket.ntohs(~s & 0xffff) -+ return ntole(~s & 0xffff) - - - def in_cksum(buf): -@@ -222,5 +221,6 @@ def test_utils(): - __hd = ' 0000: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e ...............' - h = hexdump(__buf) - assert (h == __hd) -+ assert in_cksum_add(0, __buf) == 12600 # endianness - c = in_cksum(__buf) - assert (c == 51150) ---- a/dpkt/ieee80211.py -+++ b/dpkt/ieee80211.py -@@ -8,6 +8,7 @@ import socket - import struct - - from . import dpkt -+from .compat import ntole - - # Frame Types - MGMT_TYPE = 0 -@@ -329,7 +330,7 @@ class IEEE80211(dpkt.Packet): - - # Strip off the FCS field - if self.fcs_present: -- self.fcs = struct.unpack('I', self.data[-1 * FCS_LENGTH:])[0] -+ self.fcs = struct.unpack(' + +- Update to 1.9.7.2: + - Fixed performance regression (#611) + - Moved the project documentation from Read the Docs(RST) to + github.io(MarkDown) + - Added a new mechanism for creating bit-sized field + definitions in the protocol parsers (Packet.__bit_fields__) + - Added pretty printing capability aka Packet.pprint(), + Packet.__pprint_funcs__ + - Added documentation on developing protocol parsers in dpkt + (creating_parsers.md) + - Added a universal pcap+pcapng reader + (dpkt.pcap.UniversalReader) + - Improved TLS ClientHello and ServerHello parsing: return an + "Unknown" ciphersuite instead of raising an exception, add + codes for rfc8701, GREASE ciphersutes + - Added function to get IP protocol name + - Modified Packet.__getitem__() and added Packet.__contains__() + to address the nested protocol layers + - Fixed payload length interpretation in AH decoder + - Improved handling of invalid chunks in HTTP and SCTP + - Fixed decoding of IPv6 fragments after the 1st fragment + - Support rfc3540 nonce sum flag in TCP + - Added in the TLS 1.3 Cipher Suite from the RFC 8446 dated + August 2018 + - Added support for Linux cooked capture v2, SLL2. + - New example showing how to process truncated DNS packets + (examples/print_dns_truncated.py). + - Corrected typo in BGP.notification attribute. + - BGP.Update.Attribute.MPReachNLRI.SNPA now inherits from + dpkt.Packet. + - Byteorder is now specified when packing GRE optional fields. + - #517: Improvement to Radiotap class, supporting multi-byte + and misaligned flags fields. Endianness is now enforced. + - Github issue template added for bug reporting. + - Compliance with flake8 formatting. + - asn1.py::utctime method now returns time in UTC, instead of + local. + - Allow multiple InterfaceDescriptionBlocks with pcapng.Writer. + - SCTP decoder DATA chunk padding aligned to 4-bytes, and + improved handling of .data field. + - IEEE80211 DELBA frame now works on big and little-endian + architectures. + - Introduce compat.ntole which converts from network byte order + to little-endian byte order, regardless of host endianness. + - Ethernet class now attempts to unpack the padding and trailer + if present. + - Added anonymous property to cipher suites, which returns True + if the cipher suite starts with 'anon'. + - Added pfs (Perfect Forward Secrecy) and aead (Authenticated + Encryption with Additional Data) properties to cipher suites. + - Added old CHACHA20-POLY1305 related cipher suites to TLS + CipherSuite list. + - Remove redundant num_compression_methods from TLSClientHello + - Testing improved from 90% coverage to over 99%. +- Remove upstreamed patch fix_s390x_tests.patch + ------------------------------------------------------------------- Sun Jan 3 16:55:41 UTC 2021 - Matej Cepl diff --git a/python-dpkt.spec b/python-dpkt.spec index 705c4fe..f420916 100644 --- a/python-dpkt.spec +++ b/python-dpkt.spec @@ -18,17 +18,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-dpkt -Version: 1.9.4 +Version: 1.9.7.2 Release: 0 Summary: Packet creation and parsing module for Python License: BSD-3-Clause Group: Development/Libraries/Python URL: https://github.com/kbandla/dpkt Source: https://github.com/kbandla/dpkt/archive/v%{version}.tar.gz -# PATCH-FIX-UPSTREAM fix_s390x_tests.patch gh#kbandla/dpkt#505 mcepl@suse.com -# Skip failing tests on s390x arch -Patch0: fix_s390x_tests.patch -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -55,12 +51,11 @@ sed -i -e '/addopts=/d' setup.cfg %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -# gh#kbandla/dpkt#505 %pytest -s dpkt %files %{python_files} %license LICENSE -%doc examples AUTHORS CHANGES README.rst +%doc examples AUTHORS README.md docs %{python_sitelib}/* %changelog diff --git a/v1.9.4.tar.gz b/v1.9.4.tar.gz deleted file mode 100644 index 8bc20bb..0000000 --- a/v1.9.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:864d227b6e3a5fe2ace1d3a0d863df70b5a4941fc94483d4d5962665927dc3bf -size 147123 diff --git a/v1.9.7.2.tar.gz b/v1.9.7.2.tar.gz new file mode 100644 index 0000000..bbc1add --- /dev/null +++ b/v1.9.7.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8570d7282c7fb8a7ea378bbc3ff7862637a704f1b2e6fd3b38ce1b5c3cbe28e1 +size 183683