fuzz_x509crl.c 512 B

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