fuzz_x509crl.c 670 B

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