Skip to content

Commit aa04ec9

Browse files
authored
*BSD fixes (secdev#3810)
* FreeBSD - /dev/bpf cannot send packets to /dev/tun* and /dev/tap* * FreeBSD - unit test fixes * OpenBSD - unit test fixes * NetBSD - unit test fixes
1 parent 8969d10 commit aa04ec9

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

openssl.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@
3838
"""
3939

4040
# Copy and edit
41-
with open(OPENSSL_CONFIG, 'rb') as fd:
42-
DATA = fd.read()
41+
try:
42+
with open(OPENSSL_CONFIG, 'rb') as fd:
43+
DATA = fd.read()
44+
except FileNotFoundError:
45+
DATA = b""
4346

4447
DATA = HEADER + DATA + FOOTER
4548

test.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,21 @@ then
3030
else
3131
UT_FLAGS+=" -K vcan_socket"
3232
fi
33-
elif [[ "$OSTYPE" = "darwin"* ]] || [ "$TRAVIS_OS_NAME" = "osx" ]
33+
elif [[ "$OSTYPE" = "darwin"* ]] || [ "$TRAVIS_OS_NAME" = "osx" ] || [[ "$OSTYPE" = "FreeBSD" ]] || [[ "$OSTYPE" = *"bsd"* ]]
3434
then
3535
OSTOX="bsd"
3636
# Travis CI in macOS 10.13+ can't load kexts. Need this for tuntaposx.
3737
UT_FLAGS+=" -K tun -K tap"
38+
if [[ "$OSTYPE" = "openbsd"* ]]
39+
then
40+
# Note: LibreSSL 3.6.* does not support X25519 according to
41+
# the cryptogaphy module source code
42+
UT_FLAGS+=" -K libressl"
43+
fi
44+
if [[ "$OSTYPE" = "netbsd" ]]
45+
then
46+
UT_FLAGS+=" -K not_netbsd"
47+
fi
3848
fi
3949

4050
# pypy
@@ -82,7 +92,7 @@ then
8292
fi
8393

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

8797
# Dump vars (the others were already dumped in install.sh)
8898
echo UT_FLAGS=$UT_FLAGS

0 commit comments

Comments
 (0)