Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2016-02-18 02:59:41 +0300
committerAdam Langley <agl@google.com>2016-02-18 03:10:15 +0300
commitf48fcaf9010a04f2616174b6d61d321bdb21b791 (patch)
tree174df6401ee939d1ffb9b04baa54ae8ae4be7ca8 /fuzz
parentde9423821705341a2be0ae98e8aab8c3a06887a3 (diff)
Have fuzz/cert.cc also call X509_get_pubkey.
crypto/x509 parses the SPKI on-demand, so we weren't actually exercising the SPKI code. Change-Id: I2e16045bd35dbe04d4b8d8b45939c8885e09a550 Reviewed-on: https://boringssl-review.googlesource.com/7161 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/cert.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/fuzz/cert.cc b/fuzz/cert.cc
index ad40a319..4078c0ec 100644
--- a/fuzz/cert.cc
+++ b/fuzz/cert.cc
@@ -2,6 +2,11 @@
extern "C" int LLVMFuzzerTestOneInput(uint8_t *buf, size_t len) {
const uint8_t *bufp = buf;
- X509_free(d2i_X509(NULL, &bufp, len));
+ X509 *x509 = d2i_X509(NULL, &bufp, len);
+ if (x509 != NULL) {
+ /* Also extract the public key. */
+ EVP_PKEY_free(X509_get_pubkey(x509));
+ }
+ X509_free(x509);
return 0;
}