Files
media_cas_packager_sdk_source/common/BUILD
2018-12-07 16:45:21 -08:00

684 lines
15 KiB
Python

################################################################################
# Copyright 2017 Google LLC.
#
# This software is licensed under the terms defined in the Widevine Master
# License Agreement. For a copy of this agreement, please contact
# widevine-licensing@google.com.
################################################################################
#
# Constants, data structures, util classes for Widevine libraries.
package(
default_visibility = ["//visibility:public"],
)
filegroup(
name = "binary_release_files",
srcs = [
"certificate_type.h",
],
)
cc_library(
name = "widevine_system_id",
srcs = ["widevine_system_id.cc"],
hdrs = ["widevine_system_id.h"],
deps = ["//base"],
)
cc_library(
name = "certificate_type",
hdrs = ["certificate_type.h"],
)
cc_library(
name = "status",
srcs = ["status.cc"],
hdrs = ["status.h"],
deps = [
"//base",
"//util:error_space",
"@abseil_repo//absl/base:core_headers",
"@abseil_repo//absl/strings",
],
)
cc_test(
name = "status_test",
srcs = ["status_test.cc"],
deps = [
":status",
"//testing:gunit_main",
],
)
cc_library(
name = "client_cert",
srcs = ["client_cert.cc"],
hdrs = ["client_cert.h"],
deps = [
":crypto_util",
":drm_root_certificate",
":error_space",
":random_util",
":rsa_key",
":signing_key_util",
":wvm_token_handler",
"//base",
"//common:status",
"//protos/public:client_identification_proto",
"//protos/public:drm_certificate_proto",
"//protos/public:errors_proto",
"//protos/public:license_protocol_proto",
"//protos/public:signed_drm_certificate_proto",
"//strings",
"//util/gtl:map_util",
"@abseil_repo//absl/strings",
"@abseil_repo//absl/synchronization",
"@abseil_repo//absl/time",
],
)
cc_test(
name = "client_cert_test",
srcs = ["client_cert_test.cc"],
deps = [
":client_cert",
":drm_root_certificate",
":error_space",
":wvm_test_keys",
"//base",
"//common:rsa_key",
"//common:rsa_test_keys",
"//protos/public:drm_certificate_proto",
"//protos/public:errors_proto",
"//protos/public:signed_drm_certificate_proto",
"//strings",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
"@abseil_repo//absl/synchronization",
"@abseil_repo//absl/time",
],
)
cc_library(
name = "device_status_list",
srcs = ["device_status_list.cc"],
hdrs = ["device_status_list.h"],
deps = [
":client_cert",
":crypto_util",
":drm_root_certificate",
":drm_service_certificate",
":error_space",
":random_util",
":rsa_key",
":signing_key_util",
"//base",
"//common:status",
"//protos/public:client_identification_proto",
"//protos/public:device_certificate_status_proto",
"//protos/public:errors_proto",
"//protos/public:provisioned_device_info_proto",
"//util/gtl:map_util",
"@abseil_repo//absl/strings",
"@abseil_repo//absl/synchronization",
],
)
cc_test(
name = "device_status_list_test",
timeout = "short",
srcs = ["device_status_list_test.cc"],
deps = [
":client_cert",
":device_status_list",
"//base",
"//common:rsa_key",
"//common:rsa_test_keys",
"//protos/public:client_identification_proto",
"//protos/public:errors_proto",
"//protos/public:provisioned_device_info_proto",
"//protos/public:signed_drm_certificate_proto",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "drm_root_certificate",
srcs = ["drm_root_certificate.cc"],
hdrs = ["drm_root_certificate.h"],
deps = [
":certificate_type",
":error_space",
":rsa_key",
":sha_util",
"//base",
"//common:status",
"//external:openssl",
"//protos/public:drm_certificate_proto",
"//protos/public:errors_proto",
"//protos/public:signed_drm_certificate_proto",
"@abseil_repo//absl/memory",
"@abseil_repo//absl/strings",
"@abseil_repo//absl/synchronization",
],
)
cc_test(
name = "drm_root_certificate_test",
timeout = "short",
srcs = ["drm_root_certificate_test.cc"],
deps = [
":drm_root_certificate",
":error_space",
":rsa_key",
":rsa_test_keys",
":test_drm_certificates",
"//base",
"//external:protobuf",
"//protos/public:drm_certificate_proto",
"//protos/public:errors_proto",
"//protos/public:signed_drm_certificate_proto",
"//testing:gunit_main",
],
)
cc_library(
name = "client_id_util",
srcs = ["client_id_util.cc"],
hdrs = ["client_id_util.h"],
deps = [
":aes_cbc_util",
":drm_service_certificate",
":error_space",
"//base",
"//common:status",
"//protos/public:client_identification_proto",
"//protos/public:errors_proto",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "rsa_util",
srcs = ["rsa_util.cc"],
hdrs = ["rsa_util.h"],
deps = [
"//base",
"//external:openssl",
],
)
cc_test(
name = "rsa_util_test",
size = "medium",
timeout = "short",
srcs = ["rsa_util_test.cc"],
deps = [
":rsa_test_keys",
":rsa_util",
"//base",
"//external:openssl",
"//testing:gunit",
"//testing:gunit_main",
],
)
cc_library(
name = "openssl_util",
hdrs = ["openssl_util.h"],
deps = [
"//external:openssl",
],
)
cc_library(
name = "rsa_key",
srcs = ["rsa_key.cc"],
hdrs = ["rsa_key.h"],
deps = [
":rsa_util",
":sha_util",
"//base",
"//external:openssl",
],
)
cc_test(
name = "rsa_key_test",
size = "medium",
timeout = "short",
srcs = ["rsa_key_test.cc"],
deps = [
":rsa_key",
":rsa_test_keys",
":rsa_util",
"//testing:gunit",
"//testing:gunit_main",
],
)
cc_library(
name = "rsa_test_keys",
testonly = 1,
srcs = ["rsa_test_keys.cc"],
hdrs = ["rsa_test_keys.h"],
deps = [
"//base",
],
)
cc_library(
name = "mock_rsa_key",
testonly = 1,
hdrs = ["mock_rsa_key.h"],
deps = [
":rsa_key",
"//testing:gunit",
],
)
cc_library(
name = "aes_cbc_util",
srcs = ["aes_cbc_util.cc"],
hdrs = ["aes_cbc_util.h"],
visibility = ["//visibility:public"],
deps = [
"//base",
"//external:openssl",
],
)
cc_test(
name = "aes_cbc_util_test",
srcs = ["aes_cbc_util_test.cc"],
deps = [
":aes_cbc_util",
"//testing:gunit_main",
],
)
cc_library(
name = "crypto_util",
srcs = ["crypto_util.cc"],
hdrs = ["crypto_util.h"],
visibility = ["//visibility:public"],
deps = [
"//base",
"//external:openssl",
"//util/endian",
"@abseil_repo//absl/strings",
],
)
cc_test(
name = "crypto_util_test",
size = "medium",
srcs = ["crypto_util_test.cc"],
deps = [
":crypto_util",
"//testing:gunit",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "ecb_util",
srcs = ["ecb_util.cc"],
hdrs = ["ecb_util.h"],
visibility = ["//visibility:public"],
deps = [
"//base",
"//external:openssl",
"@abseil_repo//absl/strings",
],
)
cc_test(
name = "ecb_util_test",
size = "small",
srcs = ["ecb_util_test.cc"],
deps = [
":ecb_util",
"//testing:gunit",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "file_util",
srcs = ["file_util.cc"],
hdrs = ["file_util.h"],
deps = [
"//base",
],
)
cc_test(
name = "file_util_test",
srcs = ["file_util_test.cc"],
deps = [
":file_util",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "random_util",
srcs = ["random_util.cc"],
hdrs = ["random_util.h"],
deps = [
"//base",
"//external:openssl",
],
)
cc_test(
name = "random_util_test",
srcs = ["random_util_test.cc"],
deps = [
":random_util",
"//testing:gunit_main",
],
)
cc_library(
name = "sha_util",
srcs = ["sha_util.cc"],
hdrs = ["sha_util.h"],
deps = [
"//base",
"//external:openssl",
],
)
cc_test(
name = "sha_util_test",
srcs = ["sha_util_test.cc"],
deps = [
":sha_util",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "signature_util",
srcs = ["signature_util.cc"],
hdrs = ["signature_util.h"],
deps = [
":aes_cbc_util",
":rsa_key",
":sha_util",
"//base",
"//common:status",
],
)
cc_library(
name = "signing_key_util",
srcs = ["signing_key_util.cc"],
hdrs = ["signing_key_util.h"],
deps = [
":crypto_util",
"//base",
"//protos/public:license_protocol_proto",
],
)
cc_test(
name = "signing_key_util_test",
size = "small",
srcs = ["signing_key_util_test.cc"],
deps = [
":crypto_util",
":signing_key_util",
"//protos/public:license_protocol_proto",
"//testing:gunit",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "test_drm_certificates",
testonly = 1,
srcs = ["test_drm_certificates.cc"],
hdrs = ["test_drm_certificates.h"],
deps = [
"//base",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "wvm_token_handler",
srcs = ["wvm_token_handler.cc"],
hdrs = ["wvm_token_handler.h"],
deps = [
":aes_cbc_util",
":ecb_util",
":sha_util",
"//base",
"//common:status",
"//util/endian",
"//util/gtl:map_util",
"@abseil_repo//absl/strings",
"@abseil_repo//absl/synchronization",
],
)
cc_test(
name = "wvm_token_handler_test",
size = "small",
srcs = ["wvm_token_handler_test.cc"],
deps = [
":wvm_test_keys",
":wvm_token_handler",
"//testing:gunit",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "wvm_test_keys",
testonly = 1,
srcs = ["wvm_test_keys.cc"],
hdrs = ["wvm_test_keys.h"],
deps = [
":wvm_token_handler",
"//base",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "error_space",
srcs = ["error_space.cc"],
hdrs = ["error_space.h"],
deps = [
"//common:status",
"//protos/public:errors_proto",
"//util:proto_status",
],
)
cc_library(
name = "remote_attestation_verifier",
srcs = ["remote_attestation_verifier.cc"],
hdrs = ["remote_attestation_verifier.h"],
deps = [
":client_id_util",
":drm_service_certificate",
":error_space",
":rsa_key",
":x509_cert",
"//base",
"//common:status",
"//protos/public:client_identification_proto",
"//protos/public:errors_proto",
"//protos/public:remote_attestation_proto",
"@abseil_repo//absl/strings",
"@abseil_repo//absl/synchronization",
],
)
cc_library(
name = "drm_service_certificate",
srcs = ["drm_service_certificate.cc"],
hdrs = ["drm_service_certificate.h"],
deps = [
":aes_cbc_util",
":certificate_type",
":drm_root_certificate",
":error_space",
":rsa_key",
":rsa_util",
"//base",
"//common:status",
"//protos/public:client_identification_proto",
"//protos/public:drm_certificate_proto",
"//protos/public:errors_proto",
"//protos/public:signed_drm_certificate_proto",
"//util/gtl:map_util",
"@abseil_repo//absl/strings",
"@abseil_repo//absl/synchronization",
],
)
cc_test(
name = "drm_service_certificate_test",
timeout = "short",
srcs = ["drm_service_certificate_test.cc"],
deps = [
":aes_cbc_util",
":drm_root_certificate",
":drm_service_certificate",
":rsa_key",
":rsa_test_keys",
":rsa_util",
":test_drm_certificates",
"//base",
"//external:protobuf",
"//protos/public:client_identification_proto",
"//protos/public:drm_certificate_proto",
"//protos/public:errors_proto",
"//protos/public:license_server_sdk_proto",
"//protos/public:signed_drm_certificate_proto",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "verified_media_pipeline",
srcs = ["verified_media_pipeline.cc"],
hdrs = ["verified_media_pipeline.h"],
deps = [
":vmp_checker",
"//base",
"//common:status",
"//protos/public:license_protocol_proto",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "x509_cert",
srcs = ["x509_cert.cc"],
hdrs = ["x509_cert.h"],
deps = [
":error_space",
":openssl_util",
":rsa_key",
"//base",
"//common:status",
"//external:openssl",
"@abseil_repo//absl/strings",
"@abseil_repo//absl/synchronization",
],
)
cc_library(
name = "test_utils",
testonly = 1,
srcs = ["test_utils.cc"],
hdrs = ["test_utils.h"],
deps = [
"//base",
"//common:status",
"//external:openssl",
],
)
cc_test(
name = "x509_cert_test",
timeout = "short",
srcs = ["x509_cert_test.cc"],
deps = [
":rsa_key",
":test_utils",
":x509_cert",
"//base",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "vmp_checker",
srcs = ["vmp_checker.cc"],
hdrs = ["vmp_checker.h"],
deps = [
":certificate_type",
":error_space",
":rsa_key",
":x509_cert",
"//base",
"//common:status",
"//protos/public:errors_proto",
"//protos/public:verified_media_pipeline_proto",
],
)
cc_test(
name = "vmp_checker_test",
timeout = "short",
srcs = ["vmp_checker_test.cc"],
deps = [
":rsa_key",
":vmp_checker",
"//base",
"//protos/public:errors_proto",
"//protos/public:verified_media_pipeline_proto",
"//testing:gunit_main",
"@abseil_repo//absl/strings",
],
)
cc_library(
name = "string_util",
srcs = ["string_util.cc"],
hdrs = ["string_util.h"],
deps = [
"//base",
"//common:status",
],
)
cc_test(
name = "string_util_test",
srcs = ["string_util_test.cc"],
deps = [
":string_util",
"//base",
"//testing:gunit_main",
],
)