blob: 15affb59b856b884f80cf45dc643d9bf982caf10 [file] [log] [blame]
Philippe Antoine72333522018-05-03 16:40:24 +02001#include <stdint.h>
2#include "mbedtls/x509_crl.h"
3
4int 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
10 mbedtls_x509_crl_init( &crl );
11 ret = mbedtls_x509_crl_parse( &crl, Data, Size );
Hanno Becker54ac1852020-10-09 09:45:29 +010012#if !defined(MBEDTLS_X509_REMOVE_INFO)
Philippe Antoine72333522018-05-03 16:40:24 +020013 if (ret == 0) {
14 ret = mbedtls_x509_crl_info( (char *) buf, sizeof( buf ) - 1, " ", &crl );
15 }
Hanno Becker54ac1852020-10-09 09:45:29 +010016#else
17 ((void) ret);
Hanno Beckereb2efb02020-10-16 06:54:39 +010018 ((void) buf);
Hanno Becker54ac1852020-10-09 09:45:29 +010019#endif /* !MBEDTLS_X509_REMOVE_INFO */
Philippe Antoine72333522018-05-03 16:40:24 +020020 mbedtls_x509_crl_free( &crl );
21#else
22 (void) Data;
23 (void) Size;
24#endif
25
26 return 0;
27}