/ tests / secfuzzer / SecCertificateFuzzer.c
SecCertificateFuzzer.c
 1  //
 2  //  SecCertificateFuzzer.c
 3  //  Security
 4  //
 5  
 6  #include <CoreFoundation/CoreFoundation.h>
 7  #include <Security/Security.h>
 8  
 9  int
10  SecCertificateFuzzer(const void *data, size_t len);
11  
12  int
13  SecCertificateFuzzer(const void *data, size_t len)
14  {
15      CFDataRef d = CFDataCreateWithBytesNoCopy(NULL, data, len, kCFAllocatorNull);
16      SecCertificateRef cert = SecCertificateCreateWithData(NULL, d);
17      CFRelease(d);
18      if (cert)
19          CFRelease(cert);
20  
21      return 0;
22  }