blob: 6ff0c05b290e3796d0c21cde673d31723019e719 [file] [log] [blame]
Mateusz Starzyk6c2e9b62021-05-19 17:54:54 +02001#define MBEDTLS_ALLOW_PRIVATE_ACCESS
2
Philippe Antoine72333522018-05-03 16:40:24 +02003#include <stdint.h>
4#include "mbedtls/x509_crl.h"
5
Gilles Peskine449bd832023-01-11 14:50:10 +01006int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
7{
Philippe Antoine72333522018-05-03 16:40:24 +02008#ifdef MBEDTLS_X509_CRL_PARSE_C
9 int ret;
10 mbedtls_x509_crl crl;
11 unsigned char buf[4096];
12
Gilles Peskine449bd832023-01-11 14:50:10 +010013 mbedtls_x509_crl_init(&crl);
14 ret = mbedtls_x509_crl_parse(&crl, Data, Size);
Hanno Becker54ac1852020-10-09 09:45:29 +010015#if !defined(MBEDTLS_X509_REMOVE_INFO)
Philippe Antoine72333522018-05-03 16:40:24 +020016 if (ret == 0) {
Gilles Peskine449bd832023-01-11 14:50:10 +010017 ret = mbedtls_x509_crl_info((char *) buf, sizeof(buf) - 1, " ", &crl);
Philippe Antoine72333522018-05-03 16:40:24 +020018 }
Hanno Becker54ac1852020-10-09 09:45:29 +010019#else
20 ((void) ret);
Hanno Beckereb2efb02020-10-16 06:54:39 +010021 ((void) buf);
Hanno Becker54ac1852020-10-09 09:45:29 +010022#endif /* !MBEDTLS_X509_REMOVE_INFO */
Gilles Peskine449bd832023-01-11 14:50:10 +010023 mbedtls_x509_crl_free(&crl);
Philippe Antoine72333522018-05-03 16:40:24 +020024#else
25 (void) Data;
26 (void) Size;
27#endif
28
29 return 0;
30}