diff options
author | Tim Taubert <ttaubert@mozilla.com> | 2017-01-09 12:15:40 -0500 |
---|---|---|
committer | Tim Taubert <ttaubert@mozilla.com> | 2017-01-09 12:15:40 -0500 |
commit | e449c2b4fbfd41761ed159d649ab66bff2427a7e (patch) | |
tree | 1faf08a10bf3dfb4ffa7d8660c529dbf51f5a631 /fuzz/pkcs8_target.cc | |
parent | d8d18be6b10128c49d13e55f3f0fb860aabcbb13 (diff) | |
download | nss-hg-e449c2b4fbfd41761ed159d649ab66bff2427a7e.tar.gz |
Bug 1326416 - Update libFuzzer revision r=franziskus
Differential Revision: https://nss-review.dev.mozaws.net/D132
Diffstat (limited to 'fuzz/pkcs8_target.cc')
-rw-r--r-- | fuzz/pkcs8_target.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fuzz/pkcs8_target.cc b/fuzz/pkcs8_target.cc index 4ace36adc..cfc1a9137 100644 --- a/fuzz/pkcs8_target.cc +++ b/fuzz/pkcs8_target.cc @@ -1,20 +1,22 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <assert.h> -#include <stdint.h> #include <memory> +#include <vector> #include "keyhi.h" #include "pk11pub.h" -#include "registry.h" +#include "FuzzerInternal.h" +#include "FuzzerRandom.h" +#include "asn1_mutators.h" +#include "assert.h" #include "shared.h" -extern "C" int pkcs8_fuzzing_target(const uint8_t *Data, size_t Size) { +extern const uint16_t DEFAULT_MAX_LENGTH = 2048U; + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { SECItem data = {siBuffer, (unsigned char *)Data, (unsigned int)Size}; static std::unique_ptr<NSSDatabase> db(new NSSDatabase()); @@ -34,5 +36,4 @@ extern "C" int pkcs8_fuzzing_target(const uint8_t *Data, size_t Size) { return 0; } -REGISTER_FUZZING_TARGET("pkcs8", pkcs8_fuzzing_target, 2048, "PKCS#8 Import", - {}) +ADD_CUSTOM_MUTATORS({&ASN1MutatorFlipConstructed, &ASN1MutatorChangeType}) |