1 #define MBEDTLS_ALLOW_PRIVATE_ACCESS 2 3 #include <stdint.h> 4 #include "mbedtls/x509_crl.h" 5 LLVMFuzzerTestOneInput(const uint8_t * Data,size_t Size)6int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { 7 #ifdef MBEDTLS_X509_CRL_PARSE_C 8 int ret; 9 mbedtls_x509_crl crl; 10 unsigned char buf[4096]; 11 12 mbedtls_x509_crl_init( &crl ); 13 ret = mbedtls_x509_crl_parse( &crl, Data, Size ); 14 #if !defined(MBEDTLS_X509_REMOVE_INFO) 15 if (ret == 0) { 16 ret = mbedtls_x509_crl_info( (char *) buf, sizeof( buf ) - 1, " ", &crl ); 17 } 18 #else 19 ((void) ret); 20 ((void) buf); 21 #endif /* !MBEDTLS_X509_REMOVE_INFO */ 22 mbedtls_x509_crl_free( &crl ); 23 #else 24 (void) Data; 25 (void) Size; 26 #endif 27 28 return 0; 29 } 30