Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(721)

Unified Diff: components/webcrypto/BUILD.gn

Issue 1743763003: Add fuzzers for import of WebCrypto DER-encoded keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/webcrypto/ec_import_key_pkcs8_fuzzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/BUILD.gn
diff --git a/components/webcrypto/BUILD.gn b/components/webcrypto/BUILD.gn
index 94a251d380e56431a0d69ff35cde9309e0a9c265..0db4ccc072d1427006d819e342e7fba4452ce563 100644
--- a/components/webcrypto/BUILD.gn
+++ b/components/webcrypto/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//testing/test.gni")
+import("//testing/libfuzzer/fuzzer_test.gni")
source_set("webcrypto") {
sources = [
@@ -93,3 +94,76 @@ source_set("unit_tests") {
"//third_party/re2",
]
}
+
+# Shared functionality for writing WebCrypto fuzzers at this layer (several
+# things need to be done to initialize Blink and pull in the right
+# dependencies).
+source_set("fuzzer_support") {
+ testonly = true
+
+ sources = [
+ "fuzzer_support.cc",
+ "fuzzer_support.h",
+ ]
+ deps = [
+ ":webcrypto",
+ "//crypto",
+ "//crypto:platform",
+
+ # The "blink_for_unittests" includes a dependency on Mojo, which otherwise
+ # public:blink lacks and would result in a linker error.
+ "//third_party/WebKit/public:blink_for_unittests",
+
+ # This contains a helper function for initializing Blink (needed for
+ # PartitionAlloc initialization).
+ "//components/test_runner:test_runner",
+ ]
+}
+
+# Tests the import of PKCS8 formatted EC keys.
+fuzzer_test("ec_import_key_pkcs8_fuzzer") {
+ sources = [
+ "ec_import_key_pkcs8_fuzzer.cc",
+ ]
+ deps = [
+ ":fuzzer_support",
+ ":webcrypto",
+ "//third_party/WebKit/public:blink_headers",
+ ]
+}
+
+# Tests the import of SPKI formatted EC keys.
+fuzzer_test("ec_import_key_spki_fuzzer") {
+ sources = [
+ "ec_import_key_spki_fuzzer.cc",
+ ]
+ deps = [
+ ":fuzzer_support",
+ ":webcrypto",
+ "//third_party/WebKit/public:blink_headers",
+ ]
+}
+
+# Tests the import of PKCS8 formatted RSA keys.
+fuzzer_test("rsa_import_key_pkcs8_fuzzer") {
+ sources = [
+ "rsa_import_key_pkcs8_fuzzer.cc",
+ ]
+ deps = [
+ ":fuzzer_support",
+ ":webcrypto",
+ "//third_party/WebKit/public:blink_headers",
+ ]
+}
+
+# Tests the import of SPKI formatted RSA keys.
+fuzzer_test("rsa_import_key_spki_fuzzer") {
+ sources = [
+ "rsa_import_key_pkcs8_fuzzer.cc",
Nico 2017/03/26 03:14:39 You copied rsa_import_key_pkcs8_fuzzer here and fo
eroman 2017/03/30 17:02:56 Ugh, I am terrible :( Thanks for pointing this ou
+ ]
+ deps = [
+ ":fuzzer_support",
+ ":webcrypto",
+ "//third_party/WebKit/public:blink_headers",
+ ]
+}
« no previous file with comments | « no previous file | components/webcrypto/ec_import_key_pkcs8_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698