34 Commits

Author SHA256 Message Date
5d3451ac74 Accepting request 1282974 from devel:languages:python
- Switch to pyproject macros.
- No more greedy globs in %files.

OBS-URL: https://build.opensuse.org/request/show/1282974
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=12
2025-06-05 18:34:41 +00:00
0b6f0686d0 Accepting request 1223764 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1223764
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=11
2024-11-13 14:28:34 +00:00
9fcfff08ea - Update to 1.9.8
* Fixed endianness issues in PCAPNG, Loopback
  * Improved MPLS unpacking to include IPv6
  * Fixed unpacking of multiple records in TLS messages
  * Updated docstrings for multiples modules
  * Fixed a long-standing issue where serializing IP would change its length
  * Fixed IEEE 802.11 Beacon byte ordering
  * Graceful handling of PCAPNG option comment UTF-8 decoding errors
  * Added support for PCAPNG Packet Block
  * Added modpcap reader support
- Drop skip-BE-tests.patch, merged upstream

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=31
2024-11-12 17:14:57 +00:00
81b2d3f34e Accepting request 1147607 from devel:languages:python
Forwarded request #1147585 from kairu

- Add Python 3.11 build.

OBS-URL: https://build.opensuse.org/request/show/1147607
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=10
2024-02-21 16:55:21 +00:00
c6deebff97 Accepting request 1147585 from home:kairu:branches:devel:languages:python
- Add Python 3.11 build.

OBS-URL: https://build.opensuse.org/request/show/1147585
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=29
2024-02-19 14:33:09 +00:00
b6e195da68 Accepting request 924285 from devel:languages:python
- Update skip-BE-tests.patch so that it actually fixes things,
  instead of just skipping tests (gh#kbandla/dpkt#615).
- 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
- Add patch skip-BE-tests.patch skipping failing tests again
  (gh#kbandla/dpkt#505).

OBS-URL: https://build.opensuse.org/request/show/924285
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=9
2021-10-20 18:22:45 +00:00
50540bbc24 Fix the patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=28
2021-10-08 19:50:52 +00:00
d339d509b9 Fix the patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=27
2021-10-08 07:09:50 +00:00
0f0c6211bf - Update skip-BE-tests.patch so that it actually fixes things,
instead of just skipping tests (gh#kbandla/dpkt#615).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=26
2021-10-08 06:54:26 +00:00
6e99acb1f1 Skip also one forgotten test
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=25
2021-10-07 13:06:49 +00:00
b867317fc6 - Add patch skip-BE-tests.patch skipping failing tests again
(gh#kbandla/dpkt#505).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=24
2021-10-07 13:01:42 +00:00
b6ff2a7bfc Fix typo
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=23
2021-10-07 12:13:12 +00:00
7f8f86cb2f - Skip failing tests again (gh#kbandla/dpkt#505).
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=22
2021-10-07 12:12:56 +00:00
9775d4d653 - 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.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=21
2021-10-07 11:45:56 +00:00
aa1ab76670 Accepting request 859976 from devel:languages:python
- Rename skip_s390x_tests.patch to fix_s390x_tests.patch (from the
  upstream commit 4ce0b897e60a), which seems to fix the problem.

OBS-URL: https://build.opensuse.org/request/show/859976
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=8
2021-01-08 16:31:57 +00:00
f38af8576f - Rename skip_s390x_tests.patch to fix_s390x_tests.patch (from the
upstream commit 4ce0b897e60a), which seems to fix the problem.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=19
2021-01-03 16:56:52 +00:00
97c49f7b34 Accepting request 855900 from devel:languages:python
Cleanup (forwarded request 855899 from mcepl)

OBS-URL: https://build.opensuse.org/request/show/855900
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=7
2020-12-16 10:00:14 +00:00
a8dc02647e Accepting request 855899 from home:mcepl:branches:devel:tools:scm
Cleanup

OBS-URL: https://build.opensuse.org/request/show/855899
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=17
2020-12-14 23:17:16 +00:00
bf0f209dbe Accepting request 855897 from home:mcepl:branches:devel:tools:scm
- Add skip_s390x_tests.patch to skip failing tests on s390x
  (gh#kbandla/dpkt#505).
- Update to 1.9.4:
  - drop python 2.6 support
  - add python 3.7, 3.8 support
  - fix netbios name encoding and decoding
  - properly set type of last vlan tag to type of eth.data layer
  - fix QinQ vlan tag parsing with miscellaneous data
  - add explicit iter to dpkt.Packet so dict() maps the fields nicely
  - fix ipv6 packet so that it can be used for generating IPv6 data
  - handle zero Eth type
  - python 3 compatibility fixes

OBS-URL: https://build.opensuse.org/request/show/855897
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=16
2020-12-14 23:07:25 +00:00
9158f566cb Accepting request 686318 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/686318
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=6
2019-03-20 12:19:46 +00:00
Tomáš Chvátal
0483c24185 Accepting request 686217 from home:jengelh:branches:devel:languages:python
- Use noun phrase in descriptions.

OBS-URL: https://build.opensuse.org/request/show/686217
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=14
2019-03-19 08:31:51 +00:00
487d2ca14f Accepting request 681304 from devel:languages:python
- Update to 1.9.2:
  * Tiny fixes for 3.7 python
- Enable tests
- Add proper dependencies

OBS-URL: https://build.opensuse.org/request/show/681304
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=5
2019-03-05 11:22:13 +00:00
Tomáš Chvátal
1ca0afc21b - Update to 1.9.2:
* Tiny fixes for 3.7 python
- Enable tests
- Add proper dependencies

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=12
2019-03-04 11:37:09 +00:00
64c94716ec Accepting request 561440 from devel:languages:python
- Update to version 1.9.1:
  * Allow building with python3
- Remove epydoc dependency so we can remove py2 only package

OBS-URL: https://build.opensuse.org/request/show/561440
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=4
2018-01-09 13:52:11 +00:00
Tomáš Chvátal
4365ee69fc - Update to version 1.9.1:
* Allow building with python3
- Remove epydoc dependency so we can remove py2 only package

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=10
2018-01-03 16:08:41 +00:00
Stephan Kulow
77b9bf1529 Accepting request 197804 from devel:languages:python
A new package to create / parse IP packets.  Required for plaso which I still hope to get into 13.1

OBS-URL: https://build.opensuse.org/request/show/197804
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dpkt?expand=0&rev=1
2013-09-11 11:07:58 +00:00
Sascha Peilicke
93ceeef752 Accepting request 197129 from home:gregfreemyer:Tools-for-forensic-boot-cd
clean-up macro definition as per python-pip.  saschpe requested this, so I'll let him review/accept this SR.

OBS-URL: https://build.opensuse.org/request/show/197129
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=8
2013-09-03 08:51:36 +00:00
Sascha Peilicke
36ca31846a Accepting request 196448 from home:gregfreemyer:Tools-for-forensic-boot-cd
update to v1.8.  Please add me as a maintainer so I can SR to factory.

OBS-URL: https://build.opensuse.org/request/show/196448
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=7
2013-09-02 08:32:51 +00:00
9aa824d41e Accepting request 72427 from home:saschpe:branches:devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/72427
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=6
2011-06-02 09:48:26 +00:00
OBS User unknown
e8e05294f1 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=5 2007-01-28 22:10:25 +00:00
OBS User unknown
9548042a66 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=4 2007-01-28 22:09:37 +00:00
OBS User unknown
0607e52fc5 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=3 2007-01-28 22:09:31 +00:00
OBS User unknown
549e4e8730 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=2 2006-10-27 12:06:50 +00:00
OBS User unknown
349aaf43d2 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=1 2006-10-27 12:06:42 +00:00
2 changed files with 0 additions and 145 deletions

View File

@@ -1,142 +0,0 @@
---
dpkt/loopback.py | 24 +++++++++++++++++-------
dpkt/pcapng.py | 24 ++++++++++++++----------
2 files changed, 31 insertions(+), 17 deletions(-)
--- a/dpkt/loopback.py
+++ b/dpkt/loopback.py
@@ -1,6 +1,9 @@
# $Id: loopback.py 38 2007-03-17 03:33:16Z dugsong $
# -*- coding: utf-8 -*-
"""Platform-dependent loopback header."""
+
+# https://wiki.wireshark.org/NullLoopback
+
from __future__ import absolute_import
from . import dpkt
@@ -24,17 +27,23 @@ class Loopback(dpkt.Packet):
def unpack(self, buf):
dpkt.Packet.unpack(self, buf)
- if self.family == 2:
- self.data = ip.IP(self.data)
-
- elif self.family == 0x02000000:
+ if self.family in (0x02, 0x02000000):
self.family = 2
self.data = ip.IP(self.data)
- elif self.family in (24, 28, 30):
+ elif self.family in (0x18, 0x18000000):
+ self.family = 24
self.data = ip6.IP6(self.data)
- elif self.family > 1500:
+ elif self.family in (0x1c, 0x1c000000):
+ self.family = 28
+ self.data = ip6.IP6(self.data)
+
+ elif self.family in (0x1e, 0x1e000000):
+ self.family = 30
+ self.data = ip6.IP6(self.data)
+
+ else:
self.data = ethernet.Ethernet(self.data)
@@ -43,7 +52,7 @@ def test_ethernet_unpack():
hdr = b'\x00\x02\x00\x02'
lo = Loopback(hdr + buf)
- assert lo.family == 33554944
+ assert lo.family in (0x02000200, 0x00020002) # little endian, big endian
assert isinstance(lo.data, ethernet.Ethernet)
assert lo.data.src == b'\x07\x08\t\n\x0b\x0c'
assert lo.data.dst == b'\x01\x02\x03\x04\x05\x06'
@@ -61,6 +70,7 @@ def test_ip_unpack():
def test_ip6_unpack():
+
import struct
buf = (b'\x60\x00\x00\x00\x00\x14\x06\x38\x26\x07\xf8\xb0\x40\x0c\x0c\x03\x00\x00\x00\x00\x00\x00'
b'\x00\x1a\x20\x01\x04\x70\xe5\xbf\xde\xad\x49\x57\x21\x74\xe8\x2c\x48\x87')
--- a/dpkt/pcapng.py
+++ b/dpkt/pcapng.py
@@ -888,6 +888,10 @@ def define_testdata():
def shb_idb_epb_be(self):
return self.valid_shb_be, self.valid_idb_be, self.valid_epb_be
+ @property
+ def shb_idb_epb(self):
+ return self.shb_idb_epb_le if sys.byteorder == 'little' else self.shb_idb_epb_be
+
return TestData()
@@ -1138,15 +1142,14 @@ def test_custom_read_write():
fobj.close()
# test pcapng customized writing
- if sys.byteorder == 'little':
- shb, idb, epb = define_testdata().shb_idb_epb_le
- else:
- shb, idb, epb = define_testdata().shb_idb_epb_be
+ shb, idb, epb = define_testdata().shb_idb_epb
fobj = BytesIO()
writer = Writer(fobj, shb=shb, idb=idb)
writer.writepkt(epb, ts=1442984653.210838)
- assert fobj.getvalue() == buf
+ # .valid_pcapng buf was collected on a little endian system
+ if sys.byteorder == 'little':
+ assert fobj.getvalue() == buf
fobj.close()
# same with timestamps defined inside EPB
@@ -1156,14 +1159,15 @@ def test_custom_read_write():
fobj = BytesIO()
writer = Writer(fobj, shb=shb, idb=idb)
writer.writepkt(epb)
- assert fobj.getvalue() == buf
+ if sys.byteorder == 'little':
+ assert fobj.getvalue() == buf
fobj.close()
def test_multi_idb_writer():
"""Test writing multiple interface description blocks into pcapng and read it"""
fobj = BytesIO()
- shb, idb, epb = define_testdata().shb_idb_epb_le
+ shb, idb, epb = define_testdata().shb_idb_epb
writer = Writer(fobj, shb=shb, idb=[idb, idb])
writer.writepkt(epb)
@@ -1190,7 +1194,7 @@ def test_writer_validate_instance():
def test_writepkt_epb_ts():
"""writepkt should assign ts_high/low for epb if they are 0"""
global time
- shb, idb, epb = define_testdata().shb_idb_epb_le
+ shb, idb, epb = define_testdata().shb_idb_epb
writer = Writer(fobj, shb=shb, idb=idb) # noqa
epb.ts_high = epb.ts_low = 0
ts = 1454725786.526401
@@ -1296,7 +1300,7 @@ def test_pcapng_block_unpack():
def test_epb_unpack():
"""EnhancedPacketBlock can only unpack data >64 bytes, the length of their header"""
- shb, idb, epb = define_testdata().shb_idb_epb_be
+ shb, idb, epb = define_testdata().shb_idb_epb
buf = b'quite-long-but-not-long-enough-at-least-32'
try:
epb.unpack(buf)
@@ -1306,7 +1310,7 @@ def test_epb_unpack():
def test_epb_unpack_length_mismatch():
"""Force calculated len to be 0 when unpacking epb, this should fail when unpacking"""
- shb, idb, epb = define_testdata().shb_idb_epb_be
+ shb, idb, epb = define_testdata().shb_idb_epb
unpackme = bytes(epb)
unpackme = unpackme[:-4] + b'\x00' * 4

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8570d7282c7fb8a7ea378bbc3ff7862637a704f1b2e6fd3b38ce1b5c3cbe28e1
size 183683