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", |
+ ] |
+} |