Philippe Antoine | 7233352 | 2018-05-03 16:40:24 +0200 | [diff] [blame] | 1 | #include <stdint.h> |
| 2 | #include "mbedtls/x509_crl.h" |
| 3 | |
Gilles Peskine | 1b6c09a | 2023-01-11 14:52:35 +0100 | [diff] [blame^] | 4 | int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) |
| 5 | { |
Philippe Antoine | 7233352 | 2018-05-03 16:40:24 +0200 | [diff] [blame] | 6 | #ifdef MBEDTLS_X509_CRL_PARSE_C |
| 7 | int ret; |
| 8 | mbedtls_x509_crl crl; |
| 9 | unsigned char buf[4096]; |
| 10 | |
Gilles Peskine | 1b6c09a | 2023-01-11 14:52:35 +0100 | [diff] [blame^] | 11 | mbedtls_x509_crl_init(&crl); |
| 12 | ret = mbedtls_x509_crl_parse(&crl, Data, Size); |
Philippe Antoine | 7233352 | 2018-05-03 16:40:24 +0200 | [diff] [blame] | 13 | if (ret == 0) { |
Gilles Peskine | 1b6c09a | 2023-01-11 14:52:35 +0100 | [diff] [blame^] | 14 | ret = mbedtls_x509_crl_info((char *) buf, sizeof(buf) - 1, " ", &crl); |
Philippe Antoine | 7233352 | 2018-05-03 16:40:24 +0200 | [diff] [blame] | 15 | } |
Gilles Peskine | 1b6c09a | 2023-01-11 14:52:35 +0100 | [diff] [blame^] | 16 | mbedtls_x509_crl_free(&crl); |
Philippe Antoine | 7233352 | 2018-05-03 16:40:24 +0200 | [diff] [blame] | 17 | #else |
| 18 | (void) Data; |
| 19 | (void) Size; |
| 20 | #endif |
| 21 | |
| 22 | return 0; |
| 23 | } |