summaryrefslogtreecommitdiffstats
path: root/components/webcrypto/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'components/webcrypto/BUILD.gn')
-rw-r--r--components/webcrypto/BUILD.gn74
1 files changed, 74 insertions, 0 deletions
diff --git a/components/webcrypto/BUILD.gn b/components/webcrypto/BUILD.gn
index 94a251d..0db4ccc 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",
+ ]
+ deps = [
+ ":fuzzer_support",
+ ":webcrypto",
+ "//third_party/WebKit/public:blink_headers",
+ ]
+}