ソースを参照

Also re-serialize X509 objects in fuzz/cert.cc.

This is a fairly common operation on an X509.

Change-Id: I1820f20b555f75c98ab7e3283b5530bc1c200e2a
Reviewed-on: https://boringssl-review.googlesource.com/7611
Reviewed-by: Steven Valdez <svaldez@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 8年前
コミット
66ec5c9066
1個のファイルの変更7行の追加1行の削除
  1. +7
    -1
      fuzz/cert.cc

+ 7
- 1
fuzz/cert.cc ファイルの表示

@@ -1,11 +1,17 @@
#include <openssl/mem.h>
#include <openssl/x509.h>

extern "C" int LLVMFuzzerTestOneInput(uint8_t *buf, size_t len) {
const uint8_t *bufp = buf;
X509 *x509 = d2i_X509(NULL, &bufp, len);
if (x509 != NULL) {
/* Also extract the public key. */
/* Extract the public key. */
EVP_PKEY_free(X509_get_pubkey(x509));

/* Reserialize the structure. */
uint8_t *der = NULL;
i2d_X509(x509, &der);
OPENSSL_free(der);
}
X509_free(x509);
return 0;


読み込み中…
キャンセル
保存