349 lines
8.7 KiB
Python
349 lines
8.7 KiB
Python
# Copyright 2020 Google LLC. All Rights Reserved.
|
|
|
|
package(default_visibility = ["//visibility:private"])
|
|
|
|
cc_library(
|
|
name = "shared_settings",
|
|
defines = select({
|
|
"//:is_ce_disable_entitlement": [],
|
|
"//:is_ce": ["HAS_ENTITLEMENT"],
|
|
"//conditions:default": [],
|
|
}) + select({
|
|
"//:is_ce": [
|
|
"ALWAYS_DECRYPT_TO_CLEAR",
|
|
"HAS_GENERIC_CRYPTO",
|
|
"HAS_SIGN_PST_REPORT",
|
|
],
|
|
"//:is_old_api": [],
|
|
"//:is_old_vmpra": [],
|
|
"//conditions:default": [ # Chrome
|
|
# Comment out HAS_PROVIDER_KEYS temporarily
|
|
# "HAS_PROVIDER_KEYS",
|
|
],
|
|
}) + select({
|
|
"//:is_chromeos": ["WV_ENABLE_HW_VERIFICATION=1"],
|
|
"//:is_old_vmpra": ["WV_ENABLE_HW_VERIFICATION=1"],
|
|
"//conditions:default": ["WV_ENABLE_HW_VERIFICATION=0"],
|
|
}),
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "result",
|
|
hdrs = [
|
|
"result.h",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [":shared_settings"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "aead_whitebox",
|
|
hdrs = [
|
|
"aead_whitebox.h",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":result",
|
|
":shared_settings",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "license_whitebox",
|
|
hdrs = [
|
|
"license_whitebox.h",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":result",
|
|
":shared_settings",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "license_whitebox_proxy",
|
|
srcs = select({
|
|
"//:is_old_api": ["license_whitebox_proxy_impl.cc"],
|
|
"//:is_old_vmpra": ["license_whitebox_proxy_impl.cc"],
|
|
"//conditions:default": [],
|
|
}),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":license_whitebox",
|
|
":license_whitebox_provider_keys_test_data",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "test_key_types",
|
|
hdrs = [
|
|
"test_key_types.h",
|
|
],
|
|
deps = [":shared_settings"],
|
|
)
|
|
|
|
# This target provided the header needed to access the test keys. The
|
|
# implementation will be provided by "test_license_whitebox_keys_general" and
|
|
# "test_license_whitebox_keys_uat". Depending on which keys are needed, one of
|
|
# those targets will be used.
|
|
cc_library(
|
|
name = "test_license_whitebox_keys",
|
|
hdrs = [
|
|
"test_license_whitebox_keys.h",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [":shared_settings"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "test_license_whitebox_keys_general",
|
|
srcs = [
|
|
"test_license_whitebox_keys_general.cc",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":license_whitebox_proxy",
|
|
":shared_settings",
|
|
":test_license_whitebox_keys",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "test_license_whitebox_keys_uat",
|
|
srcs = [
|
|
"test_license_whitebox_keys_uat.cc",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":license_whitebox_proxy",
|
|
":shared_settings",
|
|
":test_license_whitebox_keys",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "aead_test_data",
|
|
hdrs = [
|
|
"aead_test_data.h",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [":shared_settings"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "test_license_provider_keys",
|
|
srcs = [
|
|
"test_license_provider_keys.cc",
|
|
],
|
|
hdrs = [
|
|
"test_license_provider_keys.h",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [":shared_settings"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "license_whitebox_provider_keys_test_data",
|
|
hdrs = [
|
|
"license_whitebox_provider_keys_test_data.h",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [":shared_settings"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "golden_data",
|
|
srcs = [
|
|
"golden_data.cc",
|
|
],
|
|
hdrs = [
|
|
"golden_data.h",
|
|
],
|
|
deps = [
|
|
":license_whitebox",
|
|
":shared_settings",
|
|
":test_key_types",
|
|
"//chromium_deps/cdm/protos",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "test_server",
|
|
srcs = ["test_server.cc"],
|
|
hdrs = ["test_server.h"],
|
|
deps = [
|
|
":shared_settings",
|
|
":test_license_whitebox_keys",
|
|
"//chromium_deps/base:glog",
|
|
"//crypto_utils:rsa_key",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "test_license_builder",
|
|
srcs = ["test_license_builder.cc"],
|
|
hdrs = ["test_license_builder.h"],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":shared_settings",
|
|
":test_key_types",
|
|
":test_license_provider_keys",
|
|
":test_server",
|
|
"//chromium_deps/cdm/keys:dev_certs",
|
|
"//chromium_deps/cdm/protos",
|
|
"//crypto_utils:aes_cbc_encryptor",
|
|
"//crypto_utils:crypto_util",
|
|
"//external:odk",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "aead_whitebox_test",
|
|
srcs = [
|
|
"aead_whitebox_create_test.cc",
|
|
"aead_whitebox_cross_instance_test.cc",
|
|
"aead_whitebox_decrypt_test.cc",
|
|
"aead_whitebox_encrypt_test.cc",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":aead_test_data",
|
|
":aead_whitebox",
|
|
":shared_settings",
|
|
"//chromium_deps/testing",
|
|
],
|
|
alwayslink = True,
|
|
)
|
|
|
|
cc_library(
|
|
name = "aead_whitebox_benchmark",
|
|
srcs = [
|
|
"aead_whitebox_benchmark.cc",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":aead_test_data",
|
|
":aead_whitebox",
|
|
":shared_settings",
|
|
"//benchmarking:data_source",
|
|
"//benchmarking:measurements",
|
|
"//chromium_deps/base:glog",
|
|
"//chromium_deps/testing",
|
|
],
|
|
alwayslink = True,
|
|
)
|
|
|
|
cc_library(
|
|
name = "license_whitebox_test_base",
|
|
srcs = [
|
|
"license_whitebox_test_base.cc",
|
|
],
|
|
hdrs = [
|
|
"license_whitebox_test_base.h",
|
|
],
|
|
deps = [
|
|
":golden_data",
|
|
":license_whitebox",
|
|
":license_whitebox_provider_keys_test_data",
|
|
":license_whitebox_proxy",
|
|
":shared_settings",
|
|
":test_license_whitebox_keys",
|
|
"//chromium_deps/testing",
|
|
"//crypto_utils:rsa_key",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "license_whitebox_test",
|
|
srcs = [
|
|
"license_whitebox_create_test.cc",
|
|
"license_whitebox_decrypt_test.cc",
|
|
"license_whitebox_entitlement_content_key_test.cc",
|
|
"license_whitebox_generic_crypto_test.cc",
|
|
"license_whitebox_get_secret_string_test.cc",
|
|
"license_whitebox_key_control_block_test.cc",
|
|
"license_whitebox_license_key_mode.cc",
|
|
"license_whitebox_masked_decrypt_test.cc",
|
|
"license_whitebox_process_license_response_core_message_test.cc",
|
|
"license_whitebox_process_license_response_test.cc",
|
|
"license_whitebox_query_content_key_status_test.cc",
|
|
"license_whitebox_query_signing_key_status_test.cc",
|
|
"license_whitebox_security_level_test.cc",
|
|
"license_whitebox_sign_license_request_test.cc",
|
|
"license_whitebox_sign_renewal_request_test.cc",
|
|
"license_whitebox_verify_renewal_response_test.cc",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":golden_data",
|
|
":license_whitebox",
|
|
":license_whitebox_provider_keys_test_data",
|
|
":license_whitebox_test_base",
|
|
":shared_settings",
|
|
":test_license_builder",
|
|
"//chromium_deps/testing",
|
|
],
|
|
alwayslink = True,
|
|
)
|
|
|
|
cc_library(
|
|
name = "remote_attestation_and_verification_test",
|
|
srcs = [
|
|
"remote_attestation_and_verification_test.cc",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":license_whitebox",
|
|
":license_whitebox_test_base",
|
|
":shared_settings",
|
|
":test_license_builder",
|
|
"//chromium_deps/testing",
|
|
],
|
|
alwayslink = True,
|
|
)
|
|
|
|
cc_library(
|
|
name = "license_whitebox_benchmark",
|
|
srcs = [
|
|
"license_whitebox_benchmark.cc",
|
|
"license_whitebox_decrypt_benchmark.cc",
|
|
"license_whitebox_process_license_response_benchmark.cc",
|
|
"license_whitebox_sign_benchmark.cc",
|
|
"license_whitebox_verify_benchmark.cc",
|
|
],
|
|
hdrs = [
|
|
"license_whitebox_benchmark.h",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":license_whitebox",
|
|
":license_whitebox_provider_keys_test_data",
|
|
":shared_settings",
|
|
":test_key_types",
|
|
":test_license_builder",
|
|
":test_license_whitebox_keys",
|
|
"//benchmarking:data_source",
|
|
"//benchmarking:measurements",
|
|
"//chromium_deps/base:glog",
|
|
"//chromium_deps/testing",
|
|
"//crypto_utils:crypto_util",
|
|
],
|
|
alwayslink = True,
|
|
)
|
|
|
|
cc_library(
|
|
name = "license_whitebox_uat_test",
|
|
srcs = [
|
|
"license_whitebox_uat_test.cc",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":license_whitebox",
|
|
":license_whitebox_provider_keys_test_data",
|
|
":shared_settings",
|
|
"//chromium_deps/testing",
|
|
],
|
|
alwayslink = True,
|
|
)
|