You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hostap/tests
Johannes Berg 87098d3324 build: Put archive files into build/ folder too
This is something I hadn't previously done, but there are
cases where it's needed, e.g., building 'wlantest' and then
one of the tests/fuzzing/*/ projects, they use a different
configuration (fuzzing vs. not fuzzing).

Perhaps more importantly, this gets rid of the last thing
that was dumped into the source directories, apart from
the binaries themselves.

Note that due to the use of thin archives, this required
building with absolute paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 years ago
..
ap-mgmt-fuzzer tests: Fix ap-mgmt-fuzzer build configuration to match libap.a 5 years ago
build Remove CONFIG_IEEE80211N build option 4 years ago
eapol-fuzzer Replace int status/reason_code with u16 variable 5 years ago
fuzzing build: Put archive files into build/ folder too 4 years ago
hwsim tests: dbus: Add test for RemoveAllNetworks while connected 4 years ago
p2p-fuzzer gitignore: Add various things 4 years ago
remote tests: remote: Add run_monitor test case 4 years ago
wnm-fuzzer tests: Free WNM allocations cleanly in wnm-fuzzer 5 years ago
.gitignore tests: Rewrite .gitignore file 4 years ago
Makefile build: Put archive files into build/ folder too 4 years ago
README tests: New style fuzzing tool for wpa_supplicant WNM handling 5 years ago
cipher-and-key-mgmt-testing.txt Fix the notes on EAPOL-Key testing procedures 7 years ago
test-aes.c tests: Move AES key wrap/unwrap test cases into hwsim framework 9 years ago
test-asn1.c
test-base64.c
test-eapol.c Store a copy of Association Request RSNXE in AP mode for later use 5 years ago
test-https.c Declare wpa_debug_* variables in src/utils/wpa_debug.h 11 years ago
test-https_server.c tests: Add a simple HTTPS server for TLS testing 5 years ago
test-json.c tests: libFuzzer integration for test-json and test-x509 5 years ago
test-list.c
test-md4.c
test-milenage.c
test-rc4.c
test-rsa-sig-ver.c tests: Fix resource leak in test-rsa-sig-ver on error paths 9 years ago
test-sha1.c tests: Move SHA1 test cases into hwsim framework 9 years ago
test-sha256.c tests: Move SHA256 test cases into hwsim framework 9 years ago
test-tls.c tests: TLS fuzzing tool 5 years ago
test-x509v3.c tests: Enable dumping of key information in test-x509v3 4 years ago
test_x509v3_nist.sh
test_x509v3_nist2.sh

README

hostap.git test tools
---------------------

The tests directory with its subdirectories contain number of tools used
for testing wpa_supplicant and hostapd implementations.

hwsim directory contains the test setup for full system testing of
wpa_supplicant and hostapd with a simulated radio (mac80211_hwsim). See
hwsim/READM and hwsim/vm/README for more details.


Build testing
-------------

wpa_supplicant and hostapd support number of build option
combinations. The test scripts in the build subdirectory can be used to
verify that various combinations do not break the builds. More
configuration examples can be added there
(build-{hostapd,wpa_supplicant}-*.config) to get them included in test
builds.

# Example
cd build
./run-build-tests.h


Fuzz testing
------------

Newer fuzz testing tools are under the fuzzing directory. See
fuzzing/README for more details on them. The following text describes
the older fuzz testing tools that are subject to removal once the same
newer tools have the same coverage available.

Number of the test tools here can be used for fuzz testing with tools
like American fuzzy lop (afl-fuzz) that are designed to modify an
external file for program input. ap-mgmt-fuzzer, eapol-fuzzer,
test-eapol, test-json, test-tls, and test-x509 are examples of such
tools that expose hostap.git module functionality with input from a file
specified on the command line.

Here are some examples of how fuzzing can be performed:

##### JSON parser
make clean
CC=afl-gcc make test-json
mkdir json-examples
cat > json-examples/1.json <<EOF
{"a":[[]],"b":1,"c":"q","d":{"e":[{}]}}
EOF
afl-fuzz -i json-examples -o json-findings -- $PWD/test-json @@

Alternatively, using libFuzzer from LLVM:
make clean
make test-json LIBFUZZER=y
mkdir json-examples
cat > json-examples/1.json <<EOF
{"a":[[]],"b":1,"c":"q","d":{"e":[{}]}}
EOF
./test-json json-examples

##### EAPOL-Key Supplicant
make clean
CC=afl-gcc make test-eapol TEST_FUZZ=y
mkdir eapol-auth-examples
./test-eapol auth write eapol-auth-examples/auth.msg
afl-fuzz -i eapol-auth-examples -o eapol-auth-findings -- $PWD/test-eapol auth read @@

##### EAPOL-Key Authenticator
make clean
CC=afl-gcc make test-eapol TEST_FUZZ=y
mkdir eapol-supp-examples
./test-eapol supp write eapol-supp-examples/supp.msg
afl-fuzz -i eapol-supp-examples -o eapol-supp-findings -- $PWD/test-eapol supp read @@

##### TLS client
make clean
CC=afl-gcc make test-tls TEST_FUZZ=y
mkdir tls-server-examples
./test-tls server write tls-server-examples/server.msg
afl-fuzz -i tls-server-examples -o tls-server-findings -- $PWD/test-tls server read @@

##### TLS server
make clean
CC=afl-gcc make test-tls TEST_FUZZ=y
mkdir tls-client-examples
./test-tls client write tls-client-examples/client.msg
afl-fuzz -i tls-client-examples -o tls-client-findings -- $PWD/test-tls client read @@

##### AP management frame processing
cd ap-mgmt-fuzzer
make clean
CC=afl-gcc make
mkdir multi-examples
cp multi.dat multi-examples
afl-fuzz -i multi-examples -o multi-findings -- $PWD/ap-mgmt-fuzzer -m @@

##### EAPOL-Key Supplicant (separate)
cd eapol-fuzzer
make clean
CC=afl-gcc make
mkdir eapol-examples
cp *.dat eapol-examples
afl-fuzz -i eapol-examples -o eapol-findings -- $PWD/eapol-fuzzer @@

##### P2P
cd p2p-fuzzer
make clean
CC=afl-gcc make
mkdir p2p-proberesp-examples
cp proberesp*.dat p2p-proberesp-examples
afl-fuzz -i p2p-proberesp-examples -o p2p-proberesp-findings -- $PWD/p2p-fuzzer proberesp @@
mkdir p2p-action-examples
cp go*.dat inv*.dat p2ps*.dat p2p-action-examples
afl-fuzz -i p2p-action-examples -o p2p-action-findings -- $PWD/p2p-fuzzer action @@

##### WNM
cd wnm-fuzzer
make clean
CC=afl-gcc make
mkdir wnm-examples
cp *.dat wnm-examples
afl-fuzz -i wnm-examples -o wnm-findings -- $PWD/wnm-fuzzer @@