blob: fde13da4c7be5c3b4b518ab6fb4665ac9b860dc5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# 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
```shell
$ git clone --depth=1 https://github.com/openssl/openssl.git
$ mv openssl openssl-master
```
3. Use ```compile_hfuzz_openssl_master.sh``` to configure OpenSSL
```shell
$ cd openssl-master
$ <honggfuzz_dir>/examples/openssl/compile_hfuzz_openssl_master.sh [enable-asan|enable-msan|enable-ubsan]
```
4. Compile OpenSSL
```shell
$ make -j$(nproc)
```
5. Prepare fuzzing binaries
The _make.sh_ script will compile honggfuzz and libFuzzer binaries. Syntax:
```shell
<honggfuzz_dir>/examples/openssl/make.sh <directory-with-open/libre/boring-ssl> [address|memory|undefined]
```
```shell
$ cd ..
$ <honggfuzz_dir>/examples/openssl/make.sh openssl-master address
```
**Fuzzing**
```shell
$ <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
```
|