guidovranken / cryptofuzz

Fuzzing cryptographic libraries. Magic bug printer go brrrr.

Home Page:https://guidovranken.com/2019/05/14/differential-fuzzing-of-cryptographic-libraries/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: undefined symbol: cryptofuzz::module::OpenSSL::OpenSSL()

dgh05t opened this issue · comments

Hi,
My system is ubuntu 20.04 , installed openssl and libssl-dev with apt-get, compiler and linker are clang-11 and lld-11.
I want to fuzz wolfCrypt , and I compiled wolfCrypt's module.
But when I tried to complie Cryptofuzz, it shows log below:

clang++-11 -fsanitize=address,undefined,fuzzer-no-link -D_GLIBCXX_DEBUG -O2 -g -DCRYPTOFUZZ_WOLFCRYPT -DCRYPTOFUZZ_OPENSSL_110 -Wall -Wextra -std=c++17 -I include/ -I . -I fuzzing-headers/include -DFUZZING_HEADERS_NO_IMPL driver.o executor.o util.o entry.o tests.o operation.o datasource.o repository.o options.o components.o wycheproof.o crypto.o mutator.o numbers.o mutatorpool.o modules/wolfcrypt/module.a -fsanitize=fuzzer third_party/cpu_features/build/libcpu_features.a  -o cryptofuzz
ld: error: undefined symbol: cryptofuzz::module::OpenSSL::OpenSSL()
>>> referenced by new_allocator.h:147 (/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/new_allocator.h:147)
>>>               entry.o:(std::_Sp_counted_ptr_inplace<cryptofuzz::module::OpenSSL, std::allocator<cryptofuzz::module::OpenSSL>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<cryptofuzz::module::OpenSSL>))

ld: error: undefined symbol: typeinfo for cryptofuzz::module::OpenSSL
>>> referenced by entry.cpp
>>>               entry.o:(.data+0xBBC8)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:43: cryptofuzz] Error 1

why's that? thank you.

Set CRYPTOFUZZ_NO_OPENSSL in CXXFLAGS, eg.:

export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_NO_OPENSSL"

and then compile again (you actually only need to recompile entry.o, eg. from the cryptofuzz/ directory type make -B entry.o and then make).

Let me know if there are other issues.

Unless you are compiling with OpenSSL?

The you need to type make in cryptofuzz/modules/openssl/ first (and the same for wolfcrypt).

The issue is resolved with adding -DCRYPTOFUZZ_NO_OPENSSL, Thank you!

Great!