| diff -Nur ORIG.openssl-1.1.0e/Configure openssl-1.1.0e/Configure |
| --- ORIG.openssl-1.1.0e/Configure 2017-02-16 12:58:20.000000000 +0100 |
| +++ openssl-1.1.0e/Configure 2017-02-18 01:10:44.446113321 +0100 |
| @@ -359,6 +359,7 @@ |
| "filenames", |
| "fuzz-libfuzzer", |
| "fuzz-afl", |
| + "fuzz-hfuzz", |
| "gost", |
| "heartbeats", |
| "hw(-.+)?", |
| @@ -427,6 +428,7 @@ |
| "egd" => "default", |
| "fuzz-libfuzzer" => "default", |
| "fuzz-afl" => "default", |
| + "fuzz-hfuzz" => "default", |
| "heartbeats" => "default", |
| "md2" => "default", |
| "msan" => "default", |
| @@ -1099,6 +1101,12 @@ |
| $config{cflags} .= "-fsanitize-coverage=edge,indirect-calls "; |
| } |
| |
| +unless ($disabled{"fuzz-hfuzz"}) { |
| + $config{cflags} .= "-march=skylake -fno-omit-frame-pointer -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp -fno-builtin -fno-inline -funroll-loops -g "; |
| + push @{$config{defines}}, "FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"; |
| + push @{$config{defines}}, "BN_DEBUG"; |
| +} |
| + |
| unless ($disabled{asan}) { |
| $config{cflags} .= "-fsanitize=address "; |
| } |
| diff -Nur ORIG.openssl-1.1.0e/crypto/cryptlib.c openssl-1.1.0e/crypto/cryptlib.c |
| --- ORIG.openssl-1.1.0e/crypto/cryptlib.c 2017-02-16 12:58:21.000000000 +0100 |
| +++ openssl-1.1.0e/crypto/cryptlib.c 2017-02-19 17:03:41.093898461 +0100 |
| @@ -324,7 +324,7 @@ |
| * pointers to volatile to not be emitted in some rare, |
| * never needed in real life, pieces of code. |
| */ |
| -int CRYPTO_memcmp(const volatile void * volatile in_a, |
| +int DISABLED_CRYPTO_memcmp(const volatile void * volatile in_a, |
| const volatile void * volatile in_b, |
| size_t len) |
| { |
| diff -Nur ORIG.openssl-1.1.0e/include/openssl/crypto.h openssl-1.1.0e/include/openssl/crypto.h |
| --- ORIG.openssl-1.1.0e/include/openssl/crypto.h 2017-02-16 12:58:23.000000000 +0100 |
| +++ openssl-1.1.0e/include/openssl/crypto.h 2017-02-19 17:01:34.004166029 +0100 |
| @@ -346,9 +346,13 @@ |
| * into a defined order as the return value when a != b is undefined, other |
| * than to be non-zero. |
| */ |
| +/* |
| int CRYPTO_memcmp(const volatile void * volatile in_a, |
| const volatile void * volatile in_b, |
| size_t len); |
| +*/ |
| + |
| +#define CRYPTO_memcmp memcmp |
| |
| /* Standard initialisation options */ |
| # define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L |