/* Based on BoringSSL's cert.c fuzzer */ #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include #include #include int LLVMFuzzerInitialize(int* argc, char*** argv) { HFResetRand(); return 1; } int LLVMFuzzerTestOneInput(const uint8_t* buf, size_t len) { const uint8_t* b = buf; X509* x = d2i_X509(NULL, &b, len); if (x) { BIO* o = BIO_new_fp(stdout, BIO_NOCLOSE); X509_print_ex(o, x, XN_FLAG_RFC2253, X509_FLAG_COMPAT); unsigned char* der = NULL; i2d_X509(x, &der); OPENSSL_free(der); X509_free(x); BIO_free(o); } return 0; } #ifdef __cplusplus } #endif