From c7d78a6f5f7d47be42d0688675edbe2a2bce40d8 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Wed, 22 Feb 2017 14:47:50 +0100 Subject: Bug 1341611 - Remove hash fuzzing target r=franziskus Differential Revision: https://nss-review.dev.mozaws.net/D228 --- fuzz/fuzz.gyp | 12 ------------ fuzz/hash.options | 3 --- fuzz/hash_target.cc | 39 --------------------------------------- 3 files changed, 54 deletions(-) delete mode 100644 fuzz/hash.options delete mode 100644 fuzz/hash_target.cc (limited to 'fuzz') diff --git a/fuzz/fuzz.gyp b/fuzz/fuzz.gyp index fee1d01f4..f4cf8c139 100644 --- a/fuzz/fuzz.gyp +++ b/fuzz/fuzz.gyp @@ -112,17 +112,6 @@ 'fuzz_base', ], }, - { - 'target_name': 'nssfuzz-hash', - 'type': 'executable', - 'sources': [ - 'hash_target.cc', - ], - 'dependencies': [ - '<(DEPTH)/exports.gyp:nss_exports', - 'fuzz_base', - ], - }, { 'target_name': 'nssfuzz-certDN', 'type': 'executable', @@ -287,7 +276,6 @@ 'type': 'none', 'dependencies': [ 'nssfuzz-certDN', - 'nssfuzz-hash', 'nssfuzz-pkcs8', 'nssfuzz-quickder', 'nssfuzz-tls-client', diff --git a/fuzz/hash.options b/fuzz/hash.options deleted file mode 100644 index 635be52a5..000000000 --- a/fuzz/hash.options +++ /dev/null @@ -1,3 +0,0 @@ -[libfuzzer] -max_len = 4096 - diff --git a/fuzz/hash_target.cc b/fuzz/hash_target.cc deleted file mode 100644 index 87b0f82c7..000000000 --- a/fuzz/hash_target.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* 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 -#include - -#include "hasht.h" -#include "pk11pub.h" -#include "secoidt.h" -#include "shared.h" - -const std::vector algos = {SEC_OID_MD5, SEC_OID_SHA1, SEC_OID_SHA256, - SEC_OID_SHA384, SEC_OID_SHA512}; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { - uint8_t hashOut[HASH_LENGTH_MAX]; - - static std::unique_ptr db(new NSSDatabase()); - assert(db != nullptr); - - // simple hashing. - for (auto algo : algos) { - assert(PK11_HashBuf(algo, hashOut, data, size) == SECSuccess); - } - - // hashing with context. - for (auto algo : algos) { - unsigned int len = 0; - PK11Context *context = PK11_CreateDigestContext(algo); - assert(context != nullptr); - assert(PK11_DigestBegin(context) == SECSuccess); - assert(PK11_DigestFinal(context, hashOut, &len, HASH_LENGTH_MAX) == - SECSuccess); - PK11_DestroyContext(context, PR_TRUE); - } - - return 0; -} -- cgit v1.2.1