summaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorTim Taubert <ttaubert@mozilla.com>2017-02-22 14:47:50 +0100
committerTim Taubert <ttaubert@mozilla.com>2017-02-22 14:47:50 +0100
commitc7d78a6f5f7d47be42d0688675edbe2a2bce40d8 (patch)
tree04d245c228ce7abb048f2d53530cdc501527e1f5 /fuzz
parent667a694a55fab80febd778184b0bfce61ef5576c (diff)
downloadnss-hg-c7d78a6f5f7d47be42d0688675edbe2a2bce40d8.tar.gz
Bug 1341611 - Remove hash fuzzing target r=franziskus
Differential Revision: https://nss-review.dev.mozaws.net/D228
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/fuzz.gyp12
-rw-r--r--fuzz/hash.options3
-rw-r--r--fuzz/hash_target.cc39
3 files changed, 0 insertions, 54 deletions
diff --git a/fuzz/fuzz.gyp b/fuzz/fuzz.gyp
index fee1d01f4..f4cf8c139 100644
--- a/fuzz/fuzz.gyp
+++ b/fuzz/fuzz.gyp
@@ -113,17 +113,6 @@
],
},
{
- 'target_name': 'nssfuzz-hash',
- 'type': 'executable',
- 'sources': [
- 'hash_target.cc',
- ],
- 'dependencies': [
- '<(DEPTH)/exports.gyp:nss_exports',
- 'fuzz_base',
- ],
- },
- {
'target_name': 'nssfuzz-certDN',
'type': 'executable',
'sources': [
@@ -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 <memory>
-#include <vector>
-
-#include "hasht.h"
-#include "pk11pub.h"
-#include "secoidt.h"
-#include "shared.h"
-
-const std::vector<SECOidTag> 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<NSSDatabase> 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;
-}