# Copyright 2015 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. import("//testing/test.gni") import("//testing/libfuzzer/fuzzer_test.gni") static_library("webcrypto") { sources = [ "algorithm_dispatch.cc", "algorithm_dispatch.h", "algorithm_implementation.cc", "algorithm_implementation.h", "algorithm_implementations.h", "algorithm_registry.cc", "algorithm_registry.h", "algorithms/aes.cc", "algorithms/aes.h", "algorithms/aes_cbc.cc", "algorithms/aes_ctr.cc", "algorithms/aes_gcm.cc", "algorithms/aes_kw.cc", "algorithms/asymmetric_key_util.cc", "algorithms/asymmetric_key_util.h", "algorithms/ec.cc", "algorithms/ec.h", "algorithms/ecdh.cc", "algorithms/ecdsa.cc", "algorithms/hkdf.cc", "algorithms/hmac.cc", "algorithms/pbkdf2.cc", "algorithms/rsa.cc", "algorithms/rsa.h", "algorithms/rsa_oaep.cc", "algorithms/rsa_pss.cc", "algorithms/rsa_sign.cc", "algorithms/rsa_sign.h", "algorithms/rsa_ssa.cc", "algorithms/secret_key_util.cc", "algorithms/secret_key_util.h", "algorithms/sha.cc", "algorithms/util.cc", "algorithms/util.h", "blink_key_handle.cc", "blink_key_handle.h", "crypto_data.cc", "crypto_data.h", "generate_key_result.cc", "generate_key_result.h", "jwk.cc", "jwk.h", "status.cc", "status.h", "webcrypto_impl.cc", "webcrypto_impl.h", ] deps = [ "//base", "//crypto", "//crypto:platform", "//third_party/blink/public:blink_headers", ] } source_set("unit_tests") { testonly = true sources = [ "algorithms/aes_cbc_unittest.cc", "algorithms/aes_ctr_unittest.cc", "algorithms/aes_gcm_unittest.cc", "algorithms/aes_kw_unittest.cc", "algorithms/ecdh_unittest.cc", "algorithms/ecdsa_unittest.cc", "algorithms/hmac_unittest.cc", "algorithms/rsa_oaep_unittest.cc", "algorithms/rsa_pss_unittest.cc", "algorithms/rsa_ssa_unittest.cc", "algorithms/sha_unittest.cc", "algorithms/test_helpers.cc", "algorithms/test_helpers.h", "status_unittest.cc", ] deps = [ ":webcrypto", "//base/test:test_support", "//crypto", "//crypto:platform", "//testing/gtest", "//testing/perf", "//third_party/blink/public:blink", "//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", "//base", "//crypto", "//crypto:platform", "//mojo/core/embedder", "//third_party/blink/public:blink", ] } # Tests the import of PKCS8 formatted EC keys. fuzzer_test("webcrypto_ec_import_key_pkcs8_fuzzer") { sources = [ "ec_import_key_pkcs8_fuzzer.cc", ] deps = [ ":fuzzer_support", ":webcrypto", "//third_party/blink/public:blink_headers", ] } # Tests the import of SPKI formatted EC keys. fuzzer_test("webcrypto_ec_import_key_spki_fuzzer") { sources = [ "ec_import_key_spki_fuzzer.cc", ] deps = [ ":fuzzer_support", ":webcrypto", "//third_party/blink/public:blink_headers", ] } # Tests the import of raw (X9.62) formatted EC keys. fuzzer_test("webcrypto_ec_import_key_raw_fuzzer") { sources = [ "ec_import_key_raw_fuzzer.cc", ] deps = [ ":fuzzer_support", ":webcrypto", "//third_party/blink/public:blink_headers", ] } # Tests the import of PKCS8 formatted RSA keys. fuzzer_test("webcrypto_rsa_import_key_pkcs8_fuzzer") { sources = [ "rsa_import_key_pkcs8_fuzzer.cc", ] deps = [ ":fuzzer_support", ":webcrypto", "//third_party/blink/public:blink_headers", ] } # Tests the import of SPKI formatted RSA keys. fuzzer_test("webcrypto_rsa_import_key_spki_fuzzer") { sources = [ "rsa_import_key_spki_fuzzer.cc", ] deps = [ ":fuzzer_support", ":webcrypto", "//third_party/blink/public:blink_headers", ] }