Skip to content

Commit 3c66f92

Browse files
committed
CI fixes: openssl 3.0 config, tox 4.. etc.
1 parent e1a2e80 commit 3c66f92

File tree

3 files changed

+42
-31
lines changed

3 files changed

+42
-31
lines changed

.config/ci/openssl.py

+12-20
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,23 @@
2121
).group(1).decode()
2222
OPENSSL_CONFIG = os.path.join(OPENSSL_DIR, 'openssl.cnf')
2323

24-
# https://askubuntu.com/a/1233456
25-
HEADER = b"openssl_conf = default_conf\n"
26-
FOOTER = b"""
27-
[ default_conf ]
24+
# https://www.openssl.org/docs/manmaster/man5/config.html
25+
DATA = b"""
26+
openssl_conf = openssl_init
2827
29-
ssl_conf = ssl_sect
28+
[openssl_init]
29+
ssl_conf = ssl_configuration
3030
31-
[ssl_sect]
31+
[ssl_configuration]
32+
system_default = tls_system_default
3233
33-
system_default = system_default_sect
34-
35-
[system_default_sect]
36-
MinProtocol = TLSv1.2
37-
CipherString = DEFAULT:@SECLEVEL=1
38-
"""
34+
[tls_system_default]
35+
MinProtocol = TLSv1
36+
CipherString = DEFAULT:@SECLEVEL=0
37+
Options = UnsafeLegacyRenegotiation
38+
""".strip()
3939

4040
# Copy and edit
41-
try:
42-
with open(OPENSSL_CONFIG, 'rb') as fd:
43-
DATA = fd.read()
44-
except FileNotFoundError:
45-
DATA = b""
46-
47-
DATA = HEADER + DATA + FOOTER
48-
4941
with tempfile.NamedTemporaryFile(suffix=".cnf", delete=False) as fd:
5042
fd.write(DATA)
5143
print(fd.name)

.config/ci/test.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ then
9292
fi
9393

9494
# Configure OpenSSL
95-
export OPENSSL_CONF=$($PYTHON `dirname $BASH_SOURCE`/openssl.py)
95+
export OPENSSL_CONF=$(python `dirname $BASH_SOURCE`/openssl.py)
9696

9797
# Dump vars (the others were already dumped in install.sh)
9898
echo UT_FLAGS=$UT_FLAGS
9999
echo TOXENV=$TOXENV
100+
echo OPENSSL_CONF=$OPENSSL_CONF
101+
echo OPENSSL_VER=$(openssl version)
100102

101103
# Launch Scapy unit tests
102104
TOX_PARALLEL_NO_SPINNER=1 tox -- ${UT_FLAGS} || exit 1

tox.ini

+27-10
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ minversion = 2.9
1212

1313
[testenv]
1414
description = "Scapy unit tests"
15-
whitelist_externals = sudo
15+
allowlist_externals = sudo
1616
parallel_show_output = true
17-
passenv = PATH PWD PROGRAMFILES WINDIR SYSTEMROOT OPENSSL_CONF
18-
# Used by scapy
19-
SCAPY_USE_LIBPCAP
17+
passenv =
18+
PATH
19+
PWD
20+
PROGRAMFILES
21+
WINDIR
22+
SYSTEMROOT
23+
OPENSSL_CONF
24+
# Used by scapy
25+
SCAPY_USE_LIBPCAP
2026
deps = mock
2127
# cryptography requirements
2228
setuptools>=18.5
@@ -43,12 +49,17 @@ commands =
4349

4450
[testenv:py38-isotp_kernel_module]
4551
description = "Scapy unit tests - ISOTP Linux kernel module"
46-
whitelist_externals = sudo
52+
allowlist_externals = sudo
4753
git
4854
bash
4955
lsmod
5056
modprobe
51-
passenv = PATH PWD PROGRAMFILES WINDIR SYSTEMROOT
57+
passenv =
58+
PATH
59+
PWD
60+
PROGRAMFILES
61+
WINDIR
62+
SYSTEMROOT
5263
deps = {[testenv]deps}
5364
commands =
5465
sudo apt-get -qy install build-essential linux-headers-$(uname -r) linux-modules-extra-$(uname -r)
@@ -75,7 +86,13 @@ commands =
7586

7687
[testenv:codecov]
7788
description = "Upload coverage results to codecov"
78-
passenv = TOXENV CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_*
89+
passenv =
90+
TOXENV
91+
CI
92+
TRAVIS
93+
TRAVIS_*
94+
APPVEYOR
95+
APPVEYOR_*
7996
deps = codecov
8097
commands = codecov -e TOXENV
8198

@@ -84,7 +101,7 @@ commands = codecov -e TOXENV
84101
[testenv:apitree]
85102
description = "Regenerates the API reference doc tree"
86103
skip_install = true
87-
changedir = doc/scapy
104+
changedir = {toxinidir}/doc/scapy
88105
deps = sphinx
89106
commands =
90107
sphinx-apidoc -f --no-toc -d 1 --separate --module-first --templatedir=_templates --output-dir api ../../scapy ../../scapy/modules/ ../../scapy/libs/ ../../scapy/tools/ ../../scapy/arch/ ../../scapy/contrib/scada/* ../../scapy/all.py ../../scapy/layers/all.py ../../scapy/compat.py
@@ -103,7 +120,7 @@ commands = python .config/mypy/mypy_check.py linux
103120
[testenv:docs]
104121
description = "Build the docs"
105122
skip_install = true
106-
changedir = doc/scapy
123+
changedir = {toxinidir}/doc/scapy
107124
deps = sphinx>=2.4.2
108125
sphinx_rtd_theme
109126
commands =
@@ -114,7 +131,7 @@ commands =
114131
[testenv:docs2]
115132
description = "Build the docs without rebuilding the API tree"
116133
skip_install = true
117-
changedir = doc/scapy
134+
changedir = {toxinidir}/doc/scapy
118135
deps = {[testenv:docs]deps}
119136
setenv =
120137
SCAPY_APITREE = 0

0 commit comments

Comments
 (0)