Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .config/ci/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ python -m pip install --upgrade pip setuptools wheel --ignore-installed

# Make sure tox is installed and up to date
python -m pip install -U tox --ignore-installed

# Optional test dependency for ASN.1 OER interoperability tests
python -m pip install asn1tools
3 changes: 3 additions & 0 deletions .config/ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,8 @@ python -m pip install --upgrade pip setuptools wheel --ignore-installed
# Make sure tox is installed and up to date
python -m pip install -U tox --ignore-installed

# Optional test dependency for ASN.1 OER interoperability tests
python -m pip install asn1tools

# Dump Environment (so that we can check PATH, UT_FLAGS, etc.)
set
5 changes: 5 additions & 0 deletions .config/codespell_ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,8 @@ wan
wanna
webp
widgits
uper
UPER
uPER
acn
ACN
2 changes: 2 additions & 0 deletions scapy/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

from scapy.asn1.asn1 import *
from scapy.asn1.ber import *
from scapy.asn1.oer import *
from scapy.asn1.uper import *
from scapy.asn1.mib import *

from scapy.pipetool import *
Expand Down
7 changes: 6 additions & 1 deletion scapy/asn1/ber.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# Good read: https://luca.ntop.org/Teaching/Appunti/asn1.html

from scapy.config import conf
from scapy.error import warning
from scapy.compat import chb, orb, bytes_encode
from scapy.utils import binrepr, inet_aton, inet_ntoa
Expand Down Expand Up @@ -261,7 +262,9 @@ def BER_tagging_enc(s, implicit_tag=None, explicit_tag=None):
if implicit_tag is not None:
s = BER_id_enc(implicit_tag) + s[1:]
elif explicit_tag is not None:
s = BER_id_enc(explicit_tag) + BER_len_enc(len(s)) + s
s = BER_id_enc(explicit_tag) + BER_len_enc(
len(s), size=conf.ASN1_default_long_size,
) + s
return s

# [ BER classes ] #
Expand Down Expand Up @@ -633,6 +636,8 @@ def enc(cls, _ll, size_len=0):
ll = _ll
else:
ll = b"".join(x.enc(cls.codec) for x in _ll)
if not size_len:
size_len = conf.ASN1_default_long_size
return chb(int(cls.tag)) + BER_len_enc(len(ll), size=size_len) + ll

@classmethod
Expand Down
Loading
Loading