blob: 70184488cd70b51ee6ee4f1d3b1329168903898b [file] [log] [blame]
# 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.
import("//build/config/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
source_set("fido") {
sources = [
"attestation_object.cc",
"attestation_object.h",
"attestation_statement.cc",
"attestation_statement.h",
"attested_credential_data.cc",
"attested_credential_data.h",
"authenticator_data.cc",
"authenticator_data.h",
"authenticator_get_assertion_response.cc",
"authenticator_get_assertion_response.h",
"authenticator_get_info_response.cc",
"authenticator_get_info_response.h",
"authenticator_make_credential_response.cc",
"authenticator_make_credential_response.h",
"authenticator_supported_options.cc",
"authenticator_supported_options.h",
"ctap_constants.cc",
"ctap_constants.h",
"ctap_empty_authenticator_request.cc",
"ctap_empty_authenticator_request.h",
"ctap_get_assertion_request.cc",
"ctap_get_assertion_request.h",
"ctap_make_credential_request.cc",
"ctap_make_credential_request.h",
"device_response_converter.cc",
"device_response_converter.h",
"ec_public_key.cc",
"ec_public_key.h",
"fido_attestation_statement.cc",
"fido_attestation_statement.h",
"fido_hid_message.cc",
"fido_hid_message.h",
"fido_hid_packet.cc",
"fido_hid_packet.h",
"public_key.cc",
"public_key.h",
"public_key_credential_descriptor.cc",
"public_key_credential_descriptor.h",
"public_key_credential_params.cc",
"public_key_credential_params.h",
"public_key_credential_rp_entity.cc",
"public_key_credential_rp_entity.h",
"public_key_credential_user_entity.cc",
"public_key_credential_user_entity.h",
"register_response_data.cc",
"register_response_data.h",
"response_data.cc",
"response_data.h",
"sign_response_data.cc",
"sign_response_data.h",
"u2f_apdu_command.cc",
"u2f_apdu_command.h",
"u2f_apdu_response.cc",
"u2f_apdu_response.h",
"u2f_ble_connection.cc",
"u2f_ble_connection.h",
"u2f_ble_device.cc",
"u2f_ble_device.h",
"u2f_ble_discovery.cc",
"u2f_ble_discovery.h",
"u2f_ble_frames.cc",
"u2f_ble_frames.h",
"u2f_ble_transaction.cc",
"u2f_ble_transaction.h",
"u2f_ble_uuids.cc",
"u2f_ble_uuids.h",
"u2f_command_type.h",
"u2f_device.cc",
"u2f_device.h",
"u2f_discovery.cc",
"u2f_discovery.h",
"u2f_parsing_utils.cc",
"u2f_parsing_utils.h",
"u2f_register.cc",
"u2f_register.h",
"u2f_request.cc",
"u2f_request.h",
"u2f_return_code.h",
"u2f_sign.cc",
"u2f_sign.h",
"u2f_transport_protocol.h",
]
deps = [
"//base",
"//components/cbor",
"//crypto",
"//device/base",
"//device/bluetooth",
"//net",
"//services/device/public/mojom",
"//services/service_manager/public/cpp",
"//services/service_manager/public/mojom",
"//third_party/boringssl",
]
# HID is not supported on Android.
if (!is_android) {
sources += [
"u2f_hid_device.cc",
"u2f_hid_device.h",
"u2f_hid_discovery.cc",
"u2f_hid_discovery.h",
]
deps += [
"//services/device/public/cpp/hid",
"//services/device/public/mojom",
]
}
}
source_set("mocks") {
testonly = true
sources = [
"mock_u2f_ble_connection.cc",
"mock_u2f_ble_connection.h",
"mock_u2f_device.cc",
"mock_u2f_device.h",
"mock_u2f_discovery.cc",
"mock_u2f_discovery.h",
]
deps = [
":fido",
"//base",
"//testing/gmock",
]
}
fuzzer_test("u2f_apdu_fuzzer") {
sources = [
"u2f_apdu_fuzzer.cc",
]
deps = [
":fido",
"//net",
]
libfuzzer_options = [ "max_len=65537" ]
}
fuzzer_test("fido_hid_message_fuzzer") {
sources = [
"fido_hid_message_fuzzer.cc",
]
deps = [
":fido",
"//base",
]
libfuzzer_options = [ "max_len=2048" ]
}
fuzzer_test("u2f_ble_frames_fuzzer") {
sources = [
"u2f_ble_frames_fuzzer.cc",
]
deps = [
":fido",
"//net",
]
libfuzzer_options = [ "max_len=65535" ]
}
fuzzer_test("sign_response_data_fuzzer") {
sources = [
"sign_response_data_fuzzer.cc",
]
deps = [
":fido",
"//base",
"//net",
]
seed_corpus = "response_data_fuzzer_corpus/"
libfuzzer_options = [ "max_len=65537" ]
}
fuzzer_test("register_response_data_fuzzer") {
sources = [
"register_response_data_fuzzer.cc",
]
deps = [
":fido",
"//net",
]
seed_corpus = "response_data_fuzzer_corpus/"
libfuzzer_options = [ "max_len=65537" ]
}
fuzzer_test("ctap_response_fuzzer") {
sources = [
"ctap_response_fuzzer.cc",
]
deps = [
":fido",
"//base",
"//base:i18n",
]
seed_corpus = "ctap_response_fuzzer_corpus/"
libfuzzer_options = [ "max_len=65537" ]
}
is_linux_without_udev = is_linux && !use_udev
source_set("test_support") {
testonly = true
# Android doesn't compile.
# Linux, requires udev.
if (!is_linux_without_udev && !is_android) {
sources = [
"fake_hid_impl_for_testing.cc",
"fake_hid_impl_for_testing.h",
]
deps = [
"//base",
"//mojo/public/cpp/bindings",
"//services/device/public/mojom",
"//testing/gmock",
]
}
}