1 #include <inttypes.h> 2 #include <openssl/err.h> 3 #include <openssl/evp.h> 4 #include <openssl/ssl.h> 5 6 #include <hf_ssl_lib.h> 7 #include <libhfuzz/libhfuzz.h> 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 LLVMFuzzerInitialize(int * argc,char *** argv)13int LLVMFuzzerInitialize(int* argc, char*** argv) { 14 HFInit(); 15 HFResetRand(); 16 17 return 1; 18 } 19 LLVMFuzzerTestOneInput(const uint8_t * buf,size_t len)20int LLVMFuzzerTestOneInput(const uint8_t* buf, size_t len) { 21 EVP_PKEY_free(d2i_AutoPrivateKey(NULL, &buf, len)); 22 return 0; 23 } 24 25 #ifdef __cplusplus 26 } 27 #endif 28