2 #include "mbedtls/x509_csr.h"
4 int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
6 #ifdef MBEDTLS_X509_CSR_PARSE_C
9 unsigned char buf[4096];
11 mbedtls_x509_csr_init(&csr);
12 #if defined(MBEDTLS_USE_PSA_CRYPTO)
13 psa_status_t status = psa_crypto_init();
14 if (status != PSA_SUCCESS) {
17 #endif /* MBEDTLS_USE_PSA_CRYPTO */
18 ret = mbedtls_x509_csr_parse(&csr, Data, Size);
19 #if !defined(MBEDTLS_X509_REMOVE_INFO)
21 ret = mbedtls_x509_csr_info((char *) buf, sizeof(buf) - 1, " ", &csr);
26 #endif /* !MBEDTLS_X509_REMOVE_INFO */
28 #if defined(MBEDTLS_USE_PSA_CRYPTO)
30 mbedtls_psa_crypto_free();
31 #endif /* MBEDTLS_USE_PSA_CRYPTO */
32 mbedtls_x509_csr_free(&csr);