aboutsummaryrefslogtreecommitdiffstats
path: root/src/extra_tests/tls-attacker/fuzzing
diff options
context:
space:
mode:
authorJuraj Somorovsky <[email protected]>2016-11-19 22:25:40 +0100
committerJuraj Somorovsky <[email protected]>2016-11-19 22:25:40 +0100
commitae2a958630cd104f4117bb897481bc86a744b09b (patch)
tree103d3fed21c732fefcae952c76d49627832b83ee /src/extra_tests/tls-attacker/fuzzing
parentacf1999cb85fc6bca83ac828b66593a6767174f7 (diff)
TLS-Attacker testsuite and fuzzing
Diffstat (limited to 'src/extra_tests/tls-attacker/fuzzing')
-rw-r--r--src/extra_tests/tls-attacker/fuzzing/config.xml14
-rwxr-xr-xsrc/extra_tests/tls-attacker/fuzzing/server_fuzzer.sh8
-rwxr-xr-xsrc/extra_tests/tls-attacker/fuzzing/setup.sh31
3 files changed, 53 insertions, 0 deletions
diff --git a/src/extra_tests/tls-attacker/fuzzing/config.xml b/src/extra_tests/tls-attacker/fuzzing/config.xml
new file mode 100644
index 000000000..5ae1c829a
--- /dev/null
+++ b/src/extra_tests/tls-attacker/fuzzing/config.xml
@@ -0,0 +1,14 @@
+<startupCommandsHolder>
+ <serverCommand>../../../../botan </serverCommand>
+ <serverPort>55020</serverPort>
+ <workflowFolder>../TLS-Attacker/resources/fuzzing/workflows</workflowFolder>
+ <modifiedVariableTypes>TLS_CONSTANT,LENGTH,COUNT,PUBLIC_KEY,PADDING,SIGNATURE,PLAIN_PROTOCOL_MESSAGE</modifiedVariableTypes>
+ <outputFolder>output/</outputFolder>
+ <startupCommandsList>
+ <startupCommands>
+ <fuzzerCommand>simple_fuzzer -connect localhost:$PORT</fuzzerCommand>
+ <serverCommandParameters>tls_server ../rsa2048cert.pem ../rsa2048key.pem --port=$PORT </serverCommandParameters>
+ <shortName>botan-rsa</shortName>
+ </startupCommands>
+ </startupCommandsList>
+</startupCommandsHolder> \ No newline at end of file
diff --git a/src/extra_tests/tls-attacker/fuzzing/server_fuzzer.sh b/src/extra_tests/tls-attacker/fuzzing/server_fuzzer.sh
new file mode 100755
index 000000000..9e23aee89
--- /dev/null
+++ b/src/extra_tests/tls-attacker/fuzzing/server_fuzzer.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ -d tls-testsuite ]
+then
+ cd tls-testsuite
+fi
+
+java -jar ../TLS-Attacker/Runnable/target/TLS-Attacker-1.2.jar -loglevel ERROR multi_fuzzer -startup_command_file config.xml \ No newline at end of file
diff --git a/src/extra_tests/tls-attacker/fuzzing/setup.sh b/src/extra_tests/tls-attacker/fuzzing/setup.sh
new file mode 100755
index 000000000..8c83f6eff
--- /dev/null
+++ b/src/extra_tests/tls-attacker/fuzzing/setup.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+if [ ! -d output ]
+then
+ mkdir output
+fi
+
+cd ..
+
+openssl genpkey -algorithm RSA -out rsa2048key.pem -pkeyopt rsa_keygen_bits:2048
+openssl req -key rsa2048key.pem -new -x509 -days 365 -out rsa2048cert.pem -subj "/C=DE/ST=NRW/L=Bochum/O=TLS-Attacker/CN=tls-attacker.de"
+
+if [ ! -d TLS-Attacker ]
+then
+ git clone https://github.com/RUB-NDS/TLS-Attacker.git
+fi
+
+cd TLS-Attacker
+git checkout .
+git pull
+./mvnw clean package -DskipTests=true
+
+cd ../../../../
+make clean
+export ASAN_OPTIONS=check_initialization_order=true
+if [ -n "$CC" ]
+ then ./configure.py --with-sanitizers --disable-shared --with-debug-info --with-bzip2 --with-lzma --with-sqlite --with-zlib --cc="$CC" --cc-bin="$CXX"
+ else ./configure.py --with-sanitizers --disable-shared --with-debug-info --with-bzip2 --with-lzma --with-sqlite --with-zlib
+fi
+
+make -j4 \ No newline at end of file