summaryrefslogtreecommitdiffstats
path: root/components/webcrypto/ec_import_key_spki_fuzzer.cc
diff options
context:
space:
mode:
authoreroman <eroman@chromium.org>2016-02-29 03:04:00 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-29 11:05:23 +0000
commit5a6f502d0e2ab2c368dbf3564061695931e882c7 (patch)
tree9e3fa2fb5d3958a27e0c33179e4bc8e907424db4 /components/webcrypto/ec_import_key_spki_fuzzer.cc
parentc2354045a4b129efd582a237802f83a6e4e85883 (diff)
downloadchromium_src-5a6f502d0e2ab2c368dbf3564061695931e882c7.zip
chromium_src-5a6f502d0e2ab2c368dbf3564061695931e882c7.tar.gz
chromium_src-5a6f502d0e2ab2c368dbf3564061695931e882c7.tar.bz2
Add fuzzers for import of WebCrypto DER-encoded keys.
* RSA PKCS8-formatted * RSA SPKI-formatted * EC PKCS8-formatted * EC SPK-formatted There is potentially some overlap with the existing fuzzer "boringssl_d2i_autoprivatekey_fuzzer", which should exercise most of the codepaths for the the PKCS8 formatted imports. Review URL: https://codereview.chromium.org/1743763003 Cr-Commit-Position: refs/heads/master@{#378193}
Diffstat (limited to 'components/webcrypto/ec_import_key_spki_fuzzer.cc')
-rw-r--r--components/webcrypto/ec_import_key_spki_fuzzer.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/components/webcrypto/ec_import_key_spki_fuzzer.cc b/components/webcrypto/ec_import_key_spki_fuzzer.cc
new file mode 100644
index 0000000..7f16cfc
--- /dev/null
+++ b/components/webcrypto/ec_import_key_spki_fuzzer.cc
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "components/webcrypto/fuzzer_support.h"
+
+// Entry point for LibFuzzer.
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ webcrypto::ImportEcKeyFromDerFuzzData(data, size,
+ blink::WebCryptoKeyFormatSpki);
+ return 0;
+}