tree: 298844243d697e50798ccbc698bbf2910b687f53 [path history] [tgz]
  1. corpus_client/
  2. corpus_privkey/
  3. corpus_server/
  4. corpus_x509/
  5. client.c
  6. compile_hfuzz_openssl_master.sh
  7. hf_ssl_lib.h
  8. make.sh
  9. privkey.c
  10. README.md
  11. server.c
  12. x509.c
examples/openssl/README.md

Fuzzing OpenSSL

Requirements

  • honggfuzz
  • clang-5.0 or newer
  • openssl 1.1.0 (or the github's master branch)
  • libressl/boringssl should work as well, though they might require more specific building instructions

Preparation (for OpenSSL 1.1.0/master)

  1. Compile honggfuzz
  2. Unpack/Clone OpenSSL
$ git clone --depth=1 https://github.com/openssl/openssl.git
$ mv openssl openssl-master
  1. Use compile_hfuzz_openssl_master.sh to configure OpenSSL
$ cd openssl-master
$ <honggfuzz_dir>/examples/openssl/compile_hfuzz_openssl_master.sh [enable-asan|enable-msan|enable-ubsan]
  1. Compile OpenSSL
$ make -j$(nproc)
  1. Prepare fuzzing binaries

The make.sh script will compile honggfuzz and libFuzzer binaries. Syntax:

<honggfuzz_dir>/examples/openssl/make.sh <directory-with-open/libre/boring-ssl> [address|memory|undefined]
$ cd ..
$ <honggfuzz_dir>/examples/openssl/make.sh openssl-master address

Fuzzing

$ <honggfuzz_dir>/honggfuzz --input corpus_server/ -- ./openssl-master.address.server
$ <honggfuzz_dir>/honggfuzz --input corpus_client/ -- ./openssl-master.address.client
$ <honggfuzz_dir>/honggfuzz --input corpus_x509/ -- ./openssl-master.address.x509
$ <honggfuzz_dir>/honggfuzz --input corpus_privkey/ -- ./openssl-master.address.privkey