compilationopensslamerican-fuzzy-lop

How to compile openssl with afl-gcc


I need to compile openssl 1.0.1f version with afl-fuzz and then use it in an application to find heartbleed bug. I have done so far; Go to openssl1.0.1f directory and run following command

./config CC="afl-gcc" CXX="afl-g++"
./config no-shared no-idea no-mdc2 no-rc5 no-comp enable-tlsext no-ssl2
 make depend
 make && make install

Everything works fine but during compilation I see gcc -I commands compiling files rather than afl-gcc and I donot see Instrumentation details at the end as I see it in simple programs I compile with afl-fuzz. I am not sure openssl has compiled with gcc or afl-gcc. I have also replaced gcc with afl-gcc in Makefile but no result.

Can someone please explain as in all blogs about openssl and afl-fuzz, I have found these commands only.

Thanks.


Solution

  • I was making a simple mistake of calling ./configure after manually making changes to Makefile. Each ./configure command overwrites previous Makefile. So my step should be in following order.

    ./config no-shared no-idea no-mdc2 no-rc5 no-comp enable-tlsext no-ssl2
    make depend
    Manually replace every occurrence of `gcc`to `afl-gcc` in Makefile 
    make && make install
    

    Thanks.