25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
437 B

  1. #include <openssl/mem.h>
  2. #include <openssl/x509.h>
  3. extern "C" int LLVMFuzzerTestOneInput(uint8_t *buf, size_t len) {
  4. const uint8_t *bufp = buf;
  5. X509 *x509 = d2i_X509(NULL, &bufp, len);
  6. if (x509 != NULL) {
  7. /* Extract the public key. */
  8. EVP_PKEY_free(X509_get_pubkey(x509));
  9. /* Reserialize the structure. */
  10. uint8_t *der = NULL;
  11. i2d_X509(x509, &der);
  12. OPENSSL_free(der);
  13. }
  14. X509_free(x509);
  15. return 0;
  16. }