################################################################################ # 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 = "drm_root_certificate", srcs = ["drm_root_certificate.cc"], hdrs = ["drm_root_certificate.h"], deps = [ ":certificate_type", ":error_space", ":rsa_key", "//base", "@abseil_repo//absl/strings", "//external:openssl", "//util:status", "//protos/public:drm_certificate_proto", "//protos/public:errors_proto", "//protos/public:signed_drm_certificate_proto", ], ) cc_test( name = "drm_root_certificate_test", timeout = "short", srcs = ["drm_root_certificate_test.cc"], deps = [ ":drm_root_certificate", ":rsa_key", ":rsa_test_keys", "//base", "//testing:gunit_main", "//protos/public:drm_certificate_proto", "//protos/public:errors_proto", "//protos/public:signed_drm_certificate_proto", ], ) cc_library( name = "certificate_util", srcs = ["certificate_util.cc"], hdrs = ["certificate_util.h"], deps = [ ":certificate_type", ":drm_root_certificate", ":drm_service_certificate", ":verified_media_pipeline", ":vmp_checker", "//base", "//util:status", "//license_server_sdk/internal:sdk", ], ) 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", "@abseil_repo//absl/strings", "//util:status", "//protos/public:client_identification_proto", "//protos/public:errors_proto", ], ) 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", "//testing:gunit", "//testing:gunit_main", "//external:openssl", ], ) 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", "@abseil_repo//absl/strings", "//external:openssl", "//util/endian", ], ) 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", "@abseil_repo//absl/strings", "//external:openssl", ], ) 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", "//util: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", "//testing:gunit", "//testing:gunit_main", "@abseil_repo//absl/strings", "//protos/public:license_protocol_proto", ], ) cc_library( name = "test_certificates", testonly = 1, srcs = ["test_certificates.cc"], hdrs = ["test_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", "@abseil_repo//absl/strings", "@abseil_repo//absl/synchronization", "//util/endian", "//util/gtl:map_util", "//util:status", ], ) 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 = [ "//util:status", "//util:proto_status", "//protos/public:errors_proto", ], ) 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", "@abseil_repo//absl/strings", "@abseil_repo//absl/synchronization", "//util:status", "//protos/public:client_identification_proto", "//protos/public:errors_proto", "//protos/public:remote_attestation_proto", ], ) 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", "@abseil_repo//absl/strings", "@abseil_repo//absl/synchronization", "//util/gtl:map_util", "//util:status", "//protos/public:client_identification_proto", "//protos/public:drm_certificate_proto", "//protos/public:errors_proto", "//protos/public:signed_drm_certificate_proto", ], ) cc_test( name = "drm_service_certificate_test", timeout = "short", srcs = ["drm_service_certificate_test.cc"], deps = [ ":aes_cbc_util", ":drm_service_certificate", ":rsa_key", ":rsa_test_keys", ":rsa_util", ":test_certificates", "//base", "//external:protobuf", "//testing:gunit_main", "@abseil_repo//absl/strings", "//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", ], ) cc_library( name = "verified_media_pipeline", srcs = ["verified_media_pipeline.cc"], hdrs = ["verified_media_pipeline.h"], deps = [ ":vmp_checker", "//base", "@abseil_repo//absl/strings", "//util:status", "//protos/public:license_protocol_proto", ], ) cc_library( name = "x509_cert", srcs = ["x509_cert.cc"], hdrs = ["x509_cert.h"], deps = [ ":openssl_util", ":rsa_key", "//base", "@abseil_repo//absl/strings", "@abseil_repo//absl/synchronization", "//external:openssl", "//util:status", ], ) cc_library( name = "test_utils", testonly = 1, srcs = ["test_utils.cc"], hdrs = ["test_utils.h"], deps = [ "//base", "//external:openssl", "//util:status", ], ) 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", "//util: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", "//testing:gunit_main", "@abseil_repo//absl/strings", "//protos/public:errors_proto", "//protos/public:verified_media_pipeline_proto", ], ) cc_library( name = "string_util", srcs = ["string_util.cc"], hdrs = ["string_util.h"], deps = [ "//base", "//util:status", ], ) cc_test( name = "string_util_test", srcs = ["string_util_test.cc"], deps = [ ":string_util", "//base", "//testing:gunit_main", ], )