mbedtls/programs/fuzz/fuzz_pkcs7.c
Nayna Jain 106a0afc5a pkcs7: provide fuzz harness
This allows for pkcs7 fuzz testing with OSS-Fuzz.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
2022-09-01 19:45:41 -05:00

19 lines
345 B
C

#include <stdint.h>
#include "mbedtls/pkcs7.h"
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
#ifdef MBEDTLS_PKCS7_C
mbedtls_pkcs7 pkcs7;
mbedtls_pkcs7_init( &pkcs7 );
mbedtls_pkcs7_parse_der( &pkcs7, Data, Size );
mbedtls_pkcs7_free( &pkcs7 );
#else
(void) Data;
(void) Size;
#endif
return 0;
}