404 lines
10 KiB
Python
404 lines
10 KiB
Python
# Copyright 2020 Google LLC. All Rights Reserved.
|
|
|
|
package(default_visibility = ["//visibility:private"])
|
|
|
|
cc_library(
|
|
name = "shared_settings",
|
|
defines = [
|
|
"ENABLE_LICENSE_PROTOCOL_2_2",
|
|
# Needed when talking to server SDKs [v16.3.3, v16.4.3] with license
|
|
# protocol v2.2 enabled (b/177271059).
|
|
# TODO(kqyang): Remove the flag after deprecating v16.x server SDKs.
|
|
"WORKAROUND_STRIP_PADDING_BUG",
|
|
] + 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, including ChromeOS
|
|
"HAS_PROVIDER_KEYS",
|
|
"KEY_TRAP",
|
|
# Disable the flag since we are using PKV1
|
|
# "PROVIDER_KEY_SW_SECURE_CRYPTO_ABOVE",
|
|
],
|
|
}) + 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 = "trap_keys",
|
|
srcs = [
|
|
"plain_aes.cc",
|
|
"trap_keys.cc",
|
|
],
|
|
hdrs = [
|
|
"plain_aes.h",
|
|
"trap_keys.h",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [":shared_settings"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "trap_key_test",
|
|
srcs = [
|
|
"trap_key_test.cc",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":license_whitebox",
|
|
":license_whitebox_test_base",
|
|
":shared_settings",
|
|
":test_license_builder",
|
|
":trap_keys",
|
|
"//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,
|
|
)
|
|
|
|
cc_library(
|
|
name = "license_whitebox_main",
|
|
srcs = [
|
|
"license_whitebox_main.cc",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":golden_data",
|
|
":license_whitebox_provider_keys_test_data",
|
|
":test_license_builder",
|
|
"//chromium_deps/base:glog",
|
|
"//external:gflags",
|
|
],
|
|
alwayslink = True,
|
|
)
|