Latest update.
This commit is contained in:
+12
-8
@@ -1,7 +1,10 @@
|
||||
# I Can Haz Fuzz?
|
||||
Fuzzing OpenSSL
|
||||
===============
|
||||
|
||||
OpenSSL can use either LibFuzzer or AFL to do fuzzing.
|
||||
|
||||
LibFuzzer
|
||||
=========
|
||||
---------
|
||||
|
||||
How to fuzz OpenSSL with [libfuzzer](http://llvm.org/docs/LibFuzzer.html),
|
||||
starting from a vanilla+OpenSSH server Ubuntu install.
|
||||
@@ -68,7 +71,7 @@ prebuilt fuzzer library. This is represented as `$PATH_TO_LIBFUZZER_DIR` below.
|
||||
--debug
|
||||
|
||||
AFL
|
||||
===
|
||||
---
|
||||
|
||||
This is an alternative to using LibFuzzer.
|
||||
|
||||
@@ -92,7 +95,7 @@ Run one of the fuzzers:
|
||||
Where $FUZZER is one of the executables in `fuzz/`.
|
||||
|
||||
Reproducing issues
|
||||
==================
|
||||
------------------
|
||||
|
||||
If a fuzzer generates a reproducible error, you can reproduce the problem using
|
||||
the fuzz/*-test binaries and the file generated by the fuzzer. They binaries
|
||||
@@ -108,7 +111,7 @@ To reproduce the crash you can run:
|
||||
fuzz/$FUZZER-test $file
|
||||
|
||||
Random numbers
|
||||
==============
|
||||
--------------
|
||||
|
||||
The client and server fuzzer normally generate random numbers as part of the TLS
|
||||
connection setup. This results in the coverage of the fuzzing corpus changing
|
||||
@@ -127,16 +130,17 @@ the same client hello with the same random number in it, and so the server, as
|
||||
emulated by the file, can be generated for that client hello.
|
||||
|
||||
Coverage changes
|
||||
================
|
||||
----------------
|
||||
|
||||
Since the corpus depends on the default behaviour of the client and the server,
|
||||
changes in what they send by default will have an impact on the coverage. The
|
||||
corpus will need to be updated in that case.
|
||||
|
||||
Updating the corpus
|
||||
===================
|
||||
-------------------
|
||||
|
||||
The client and server corpus is generated with multiple config options:
|
||||
|
||||
- The options as documented above
|
||||
- Without enable-ec_nistp_64_gcc_128 and without --debug
|
||||
- With no-asm
|
||||
@@ -147,7 +151,7 @@ The libfuzzer merge option is used to add the additional coverage
|
||||
from each config to the minimal set.
|
||||
|
||||
Minimizing the corpus
|
||||
=====================
|
||||
---------------------
|
||||
|
||||
When you have gathered corpus data from more than one fuzzer run
|
||||
or for any other reason want to to minimize the data
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/asn1t.h>
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/ocsp.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "rand.inc"
|
||||
|
||||
DEFINE_STACK_OF(SSL_COMP)
|
||||
|
||||
/* unused, to avoid warning. */
|
||||
static int idx;
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "fuzzer.h"
|
||||
#include "rand.inc"
|
||||
|
||||
DEFINE_STACK_OF(OSSL_CMP_ITAV)
|
||||
|
||||
int FuzzerInitialize(int *argc, char ***argv)
|
||||
{
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
|
||||
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include "rand.inc"
|
||||
|
||||
DEFINE_STACK_OF(SSL_COMP)
|
||||
|
||||
static const uint8_t kCertificateDER[] = {
|
||||
0x30, 0x82, 0x02, 0xff, 0x30, 0x82, 0x01, 0xe7, 0xa0, 0x03, 0x02, 0x01,
|
||||
0x02, 0x02, 0x11, 0x00, 0xb1, 0x84, 0xee, 0x34, 0x99, 0x98, 0x76, 0xfb,
|
||||
|
||||
Reference in New Issue
Block a user