From 6b00ecfb334fcb06710d21d20ea932be264c08e8 Mon Sep 17 00:00:00 2001 From: Aaron Vaage Date: Tue, 17 Nov 2020 10:27:42 -0800 Subject: [PATCH] Restructure Project To make it easier to have separate implementations, we have structured the repo so that there are three Bazel workspaces: - The API (and reference) - The vendor implementation for dev - The vendor implementation for prod This allows the vendor implementation to be separated from the API, while it makes little difference in this repo. While it makes little difference for this repo, it makes managing versions much easier internally. We do it here to better reflect our internal structure to partners. A vendor implementation has been stubbed in (BUILD file and directory structure) to provide vendors with some scaffolding to organize their implementation. --- whitebox-dev/WORKSPACE | 111 ++++++ whitebox-dev/impl/BUILD | 109 ++++++ whitebox-dev/tools/PLACEHOLDER | 0 whitebox-prod/WORKSPACE | 111 ++++++ whitebox-prod/impl/BUILD | 109 ++++++ whitebox-prod/tools/PLACEHOLDER | 0 whitebox/.clang-format | 172 +++++++++ README.md => whitebox/README.md | 0 WORKSPACE => whitebox/WORKSPACE | 0 {api => whitebox/api}/BUILD | 31 +- {api => whitebox/api}/aead_whitebox.h | 0 .../api}/aead_whitebox_benchmark.cc | 0 .../api}/aead_whitebox_create_test.cc | 0 .../api}/aead_whitebox_cross_instance_test.cc | 0 .../api}/aead_whitebox_decrypt_test.cc | 0 .../api}/aead_whitebox_encrypt_test.cc | 0 {api => whitebox/api}/export.h | 0 {api => whitebox/api}/golden_data.cc | 0 {api => whitebox/api}/golden_data.h | 0 {api => whitebox/api}/license_whitebox.h | 14 +- .../api}/license_whitebox_benchmark.cc | 0 .../api}/license_whitebox_benchmark.h | 0 .../api}/license_whitebox_chromeos_test.cc | 0 .../api}/license_whitebox_create_test.cc | 0 .../license_whitebox_decrypt_benchmark.cc | 0 .../api}/license_whitebox_decrypt_test.cc | 8 +- ...license_whitebox_get_secret_string_test.cc | 0 .../api/license_whitebox_golden_data_test.cc | 343 +++++++++++++++++ .../license_whitebox_masked_decrypt_test.cc | 0 ...ebox_process_license_response_benchmark.cc | 0 ...cess_license_response_core_message_test.cc | 0 ..._whitebox_process_license_response_test.cc | 54 ++- .../api}/license_whitebox_sign_benchmark.cc | 0 ...ense_whitebox_sign_license_request_test.cc | 0 ...ense_whitebox_sign_renewal_request_test.cc | 0 .../api}/license_whitebox_test_base.cc | 0 .../api}/license_whitebox_test_base.h | 0 .../api}/license_whitebox_verify_benchmark.cc | 0 ...e_whitebox_verify_renewal_response_test.cc | 0 {api => whitebox/api}/result.h | 0 {api => whitebox/api}/test_data.h | 0 {api => whitebox/api}/test_license_builder.cc | 0 {api => whitebox/api}/test_license_builder.h | 0 {benchmarking => whitebox/benchmarking}/BUILD | 2 +- .../benchmarking}/data_source.cc | 0 .../benchmarking}/data_source.h | 0 .../benchmarking}/measurements.cc | 0 .../benchmarking}/measurements.h | 0 .../chromium_deps}/base/BUILD | 2 +- .../chromium_deps}/base/check.h | 0 .../chromium_deps}/base/check_op.h | 0 .../chromium_deps}/base/logging.h | 0 .../chromium_deps}/cdm/keys/BUILD | 0 .../chromium_deps}/cdm/keys/certs.h | 0 .../cdm/keys/dev_rsa_drm_certificate.cc | 0 .../chromium_deps}/cdm/protos/BUILD | 0 .../chromium_deps}/cdm/protos/defs/BUILD | 0 .../defs/certificate_provisioning.proto | 0 .../protos/defs/client_identification.proto | 0 .../cdm/protos/defs/license_protocol.proto | 0 .../cdm/protos/defs/remote_attestation.proto | 0 .../cdm/protos/license_protocol.pb.h | 0 .../chromium_deps}/testing/BUILD | 0 .../testing/include/gmock/BUILD | 0 .../testing/include/gmock/gmock.h | 0 .../testing/include/gtest/BUILD | 0 .../testing/include/gtest/gtest.h | 0 .../third_party/boringssl/BUILD | 0 .../boringssl/src/include/openssl/aead.h | 0 .../boringssl/src/include/openssl/aes.h | 0 .../boringssl/src/include/openssl/bio.h | 0 .../boringssl/src/include/openssl/bn.h | 0 .../src/include/openssl/bytestring.h | 0 .../boringssl/src/include/openssl/cmac.h | 0 .../boringssl/src/include/openssl/err.h | 0 .../boringssl/src/include/openssl/evp.h | 0 .../boringssl/src/include/openssl/hmac.h | 0 .../boringssl/src/include/openssl/mem.h | 0 .../boringssl/src/include/openssl/pem.h | 0 .../boringssl/src/include/openssl/rand.h | 0 .../boringssl/src/include/openssl/rsa.h | 0 .../boringssl/src/include/openssl/sha.h | 0 .../boringssl/src/include/openssl/x509.h | 0 {crypto_utils => whitebox/crypto_utils}/BUILD | 0 .../crypto_utils}/aes_cbc_decryptor.cc | 0 .../crypto_utils}/aes_cbc_decryptor.h | 0 .../crypto_utils}/aes_cbc_decryptor_test.cc | 0 .../crypto_utils}/aes_cbc_encryptor.cc | 0 .../crypto_utils}/aes_cbc_encryptor.h | 0 .../crypto_utils}/aes_cbc_encryptor_test.cc | 0 .../crypto_utils}/aes_ctr_encryptor.cc | 0 .../crypto_utils}/aes_ctr_encryptor.h | 0 .../crypto_utils}/aes_ctr_encryptor_test.cc | 0 .../crypto_utils}/crypto_util.cc | 0 .../crypto_utils}/crypto_util.h | 0 .../crypto_utils}/crypto_util_test.cc | 0 .../crypto_utils}/openssl_util.h | 0 .../crypto_utils}/private_key_util.h | 0 .../crypto_utils}/random_util.cc | 0 .../crypto_utils}/random_util.h | 0 .../crypto_utils}/random_util_test.cc | 0 .../crypto_utils}/rsa_key.cc | 0 .../crypto_utils}/rsa_key.h | 0 .../crypto_utils}/rsa_key_test.cc | 0 .../crypto_utils}/rsa_test_keys.cc | 0 .../crypto_utils}/rsa_test_keys.h | 0 .../crypto_utils}/rsa_util.cc | 0 .../crypto_utils}/rsa_util.h | 0 .../crypto_utils}/rsa_util_test.cc | 0 .../crypto_utils}/sha_util.cc | 0 .../crypto_utils}/sha_util.h | 0 .../crypto_utils}/sha_util_test.cc | 0 {external => whitebox/external}/BUILD | 0 {external => whitebox/external}/odk.BUILD | 2 +- {impl => whitebox/impl}/reference/BUILD | 42 +- .../impl}/reference/aead_whitebox_impl.cc | 0 .../license_whitebox_golden_data_init_data.cc | 113 ++++++ .../impl}/reference/license_whitebox_impl.cc | 49 ++- .../impl}/reference/memory_util.cc | 0 .../impl}/reference/memory_util.h | 0 .../impl}/reference/test_data.cc | 0 {odk_deps => whitebox/odk_deps}/BUILD | 0 .../odk_deps}/license_protocol.pb.h | 0 whitebox/resources/7912.txt | 358 ++++++++++++++++++ 124 files changed, 1545 insertions(+), 85 deletions(-) create mode 100644 whitebox-dev/WORKSPACE create mode 100644 whitebox-dev/impl/BUILD create mode 100644 whitebox-dev/tools/PLACEHOLDER create mode 100644 whitebox-prod/WORKSPACE create mode 100644 whitebox-prod/impl/BUILD create mode 100644 whitebox-prod/tools/PLACEHOLDER create mode 100644 whitebox/.clang-format rename README.md => whitebox/README.md (100%) rename WORKSPACE => whitebox/WORKSPACE (100%) rename {api => whitebox/api}/BUILD (95%) rename {api => whitebox/api}/aead_whitebox.h (100%) rename {api => whitebox/api}/aead_whitebox_benchmark.cc (100%) rename {api => whitebox/api}/aead_whitebox_create_test.cc (100%) rename {api => whitebox/api}/aead_whitebox_cross_instance_test.cc (100%) rename {api => whitebox/api}/aead_whitebox_decrypt_test.cc (100%) rename {api => whitebox/api}/aead_whitebox_encrypt_test.cc (100%) rename {api => whitebox/api}/export.h (100%) rename {api => whitebox/api}/golden_data.cc (100%) rename {api => whitebox/api}/golden_data.h (100%) rename {api => whitebox/api}/license_whitebox.h (97%) rename {api => whitebox/api}/license_whitebox_benchmark.cc (100%) rename {api => whitebox/api}/license_whitebox_benchmark.h (100%) rename {api => whitebox/api}/license_whitebox_chromeos_test.cc (100%) rename {api => whitebox/api}/license_whitebox_create_test.cc (100%) rename {api => whitebox/api}/license_whitebox_decrypt_benchmark.cc (100%) rename {api => whitebox/api}/license_whitebox_decrypt_test.cc (99%) rename {api => whitebox/api}/license_whitebox_get_secret_string_test.cc (100%) create mode 100644 whitebox/api/license_whitebox_golden_data_test.cc rename {api => whitebox/api}/license_whitebox_masked_decrypt_test.cc (100%) rename {api => whitebox/api}/license_whitebox_process_license_response_benchmark.cc (100%) rename {api => whitebox/api}/license_whitebox_process_license_response_core_message_test.cc (100%) rename {api => whitebox/api}/license_whitebox_process_license_response_test.cc (93%) rename {api => whitebox/api}/license_whitebox_sign_benchmark.cc (100%) rename {api => whitebox/api}/license_whitebox_sign_license_request_test.cc (100%) rename {api => whitebox/api}/license_whitebox_sign_renewal_request_test.cc (100%) rename {api => whitebox/api}/license_whitebox_test_base.cc (100%) rename {api => whitebox/api}/license_whitebox_test_base.h (100%) rename {api => whitebox/api}/license_whitebox_verify_benchmark.cc (100%) rename {api => whitebox/api}/license_whitebox_verify_renewal_response_test.cc (100%) rename {api => whitebox/api}/result.h (100%) rename {api => whitebox/api}/test_data.h (100%) rename {api => whitebox/api}/test_license_builder.cc (100%) rename {api => whitebox/api}/test_license_builder.h (100%) rename {benchmarking => whitebox/benchmarking}/BUILD (92%) rename {benchmarking => whitebox/benchmarking}/data_source.cc (100%) rename {benchmarking => whitebox/benchmarking}/data_source.h (100%) rename {benchmarking => whitebox/benchmarking}/measurements.cc (100%) rename {benchmarking => whitebox/benchmarking}/measurements.h (100%) rename {chromium_deps => whitebox/chromium_deps}/base/BUILD (93%) rename {chromium_deps => whitebox/chromium_deps}/base/check.h (100%) rename {chromium_deps => whitebox/chromium_deps}/base/check_op.h (100%) rename {chromium_deps => whitebox/chromium_deps}/base/logging.h (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/keys/BUILD (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/keys/certs.h (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/keys/dev_rsa_drm_certificate.cc (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/protos/BUILD (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/protos/defs/BUILD (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/protos/defs/certificate_provisioning.proto (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/protos/defs/client_identification.proto (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/protos/defs/license_protocol.proto (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/protos/defs/remote_attestation.proto (100%) rename {chromium_deps => whitebox/chromium_deps}/cdm/protos/license_protocol.pb.h (100%) rename {chromium_deps => whitebox/chromium_deps}/testing/BUILD (100%) rename {chromium_deps => whitebox/chromium_deps}/testing/include/gmock/BUILD (100%) rename {chromium_deps => whitebox/chromium_deps}/testing/include/gmock/gmock.h (100%) rename {chromium_deps => whitebox/chromium_deps}/testing/include/gtest/BUILD (100%) rename {chromium_deps => whitebox/chromium_deps}/testing/include/gtest/gtest.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/BUILD (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/aead.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/aes.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/bio.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/bn.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/bytestring.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/cmac.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/err.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/evp.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/hmac.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/mem.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/pem.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/rand.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/rsa.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/sha.h (100%) rename {chromium_deps => whitebox/chromium_deps}/third_party/boringssl/src/include/openssl/x509.h (100%) rename {crypto_utils => whitebox/crypto_utils}/BUILD (100%) rename {crypto_utils => whitebox/crypto_utils}/aes_cbc_decryptor.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/aes_cbc_decryptor.h (100%) rename {crypto_utils => whitebox/crypto_utils}/aes_cbc_decryptor_test.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/aes_cbc_encryptor.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/aes_cbc_encryptor.h (100%) rename {crypto_utils => whitebox/crypto_utils}/aes_cbc_encryptor_test.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/aes_ctr_encryptor.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/aes_ctr_encryptor.h (100%) rename {crypto_utils => whitebox/crypto_utils}/aes_ctr_encryptor_test.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/crypto_util.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/crypto_util.h (100%) rename {crypto_utils => whitebox/crypto_utils}/crypto_util_test.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/openssl_util.h (100%) rename {crypto_utils => whitebox/crypto_utils}/private_key_util.h (100%) rename {crypto_utils => whitebox/crypto_utils}/random_util.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/random_util.h (100%) rename {crypto_utils => whitebox/crypto_utils}/random_util_test.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/rsa_key.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/rsa_key.h (100%) rename {crypto_utils => whitebox/crypto_utils}/rsa_key_test.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/rsa_test_keys.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/rsa_test_keys.h (100%) rename {crypto_utils => whitebox/crypto_utils}/rsa_util.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/rsa_util.h (100%) rename {crypto_utils => whitebox/crypto_utils}/rsa_util_test.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/sha_util.cc (100%) rename {crypto_utils => whitebox/crypto_utils}/sha_util.h (100%) rename {crypto_utils => whitebox/crypto_utils}/sha_util_test.cc (100%) rename {external => whitebox/external}/BUILD (100%) rename {external => whitebox/external}/odk.BUILD (98%) rename {impl => whitebox/impl}/reference/BUILD (68%) rename {impl => whitebox/impl}/reference/aead_whitebox_impl.cc (100%) create mode 100644 whitebox/impl/reference/license_whitebox_golden_data_init_data.cc rename {impl => whitebox/impl}/reference/license_whitebox_impl.cc (95%) rename {impl => whitebox/impl}/reference/memory_util.cc (100%) rename {impl => whitebox/impl}/reference/memory_util.h (100%) rename {impl => whitebox/impl}/reference/test_data.cc (100%) rename {odk_deps => whitebox/odk_deps}/BUILD (100%) rename {odk_deps => whitebox/odk_deps}/license_protocol.pb.h (100%) create mode 100644 whitebox/resources/7912.txt diff --git a/whitebox-dev/WORKSPACE b/whitebox-dev/WORKSPACE new file mode 100644 index 0000000..6bebbfa --- /dev/null +++ b/whitebox-dev/WORKSPACE @@ -0,0 +1,111 @@ +# Copyright 2020 Google LLC. All Rights Reserved. + +workspace(name = "whitebox_dev") + +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +local_repository( + name = "whitebox_api_repo", + path = "../whitebox", +) + +git_repository( + name = "glog_repo", + commit = "3ba8976592274bc1f907c402ce22558011d6fc5e", # 2020-02-16 + remote = "https://github.com/google/glog.git", +) + +git_repository( + name = "com_github_gflags_gflags", + commit = "2e227c3daae2ea8899f49858a23f3d318ea39b57", # 2020-01-15 + remote = "https://github.com/gflags/gflags.git", +) + +git_repository( + name = "abseil_repo", + commit = "fcb104594b0bb4b8ac306cb2f55ecdad40974683", # 2018-12-04 + remote = "https://github.com/abseil/abseil-cpp.git", +) + +git_repository( + name = "boringssl_repo", + commit = "14164f6fef47b7ebd97cdb0cea1624eabd6fe6b8", # 2018-11-26 + remote = "https://github.com/google/boringssl.git", +) + +git_repository( + name = "googletest_repo", + commit = "b6cd405286ed8635ece71c72f118e659f4ade3fb", # 2019-01-04 + remote = "https://github.com/google/googletest.git", +) + +# We use "com_google_protobuf" instead of "protobuf_repo" because Bazel's proto +# rules implicitly depend on @com_google_protobuf. See +# https://bazel.build/blog/2017/02/27/protocol-buffers.html. +git_repository( + name = "com_google_protobuf", + remote = "https://github.com/google/protobuf.git", + tag = "v3.8.0", +) + +# bazel_skylib is required by google protobuf. +git_repository( + name = "bazel_skylib", + remote = "https://github.com/bazelbuild/bazel-skylib.git", + tag = "1.0.2", +) + +# Protobuf library support. Not included in the recent protobuf release. +http_archive( + name = "zlib", + build_file = "@com_google_protobuf//:third_party/zlib.BUILD", + sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1", + strip_prefix = "zlib-1.2.11", + urls = ["https://zlib.net/zlib-1.2.11.tar.gz"], +) + +# ODK +new_git_repository( + name = "odk_repo", + build_file = "@whitebox_api_repo//external:odk.BUILD", + commit = "bee799748752fac84d9c3ecd549aa54f72c88d02", + remote = "https://widevine-partner.googlesource.com/oemcrypto_core_message.git", + repo_mapping = {"@whitebox" : "@whitebox_api_repo"} +) + +bind( + name = "glog", + actual = "@glog_repo//:glog", +) + +bind( + name = "gflags", + actual = "@com_github_gflags_gflags//:gflags", +) + +bind( + name = "boringssl", + actual = "@boringssl_repo//:crypto", +) + +bind( + name = "gtest", + actual = "@googletest_repo//:gtest", +) + +bind( + name = "gtest_main", + actual = "@googletest_repo//:gtest_main", +) + +bind( + name = "protobuf", + actual = "@com_google_protobuf//:protobuf", +) + +bind( + name = "odk", + actual = "@odk_repo//:odk", +) diff --git a/whitebox-dev/impl/BUILD b/whitebox-dev/impl/BUILD new file mode 100644 index 0000000..5e37782 --- /dev/null +++ b/whitebox-dev/impl/BUILD @@ -0,0 +1,109 @@ +# Copyright 2020 Google LLC. All Rights Reserved. + +package(default_visibility = [ + "//visibility:private", +]) + +cc_library( + name = "whitebox_common", + srcs = [ + "common_whitebox.cc", + "get_random_bytes.cc", + ], + visibility = ["//visibility:private"], +) + +cc_library( + name = "aead_whitebox", + srcs = [ + "aead_whitebox.cc", + ], + visibility = ["//visibility:public"], + deps = [ + ":whitebox_common", + "@whitebox_api_repo//api:aead_whitebox", + "@whitebox_api_repo//api:result", + ], +) + +cc_library( + name = "license_whitebox", + srcs = [ + "license_whitebox.cc", + ], + deps = [ + ":whitebox_common", + "@whitebox_api_repo//api:license_whitebox", + "@whitebox_api_repo//api:result", + ], +) + +cc_library( + name = "test_data", + testonly = True, + srcs = [ + "test_data.cc", + ], + hdrs = [ + "test_data_aead_init.h", + "test_data_license_init.h", + ], + deps = [ + "@whitebox_api_repo//api:test_data", + "@whitebox_api_repo//crypto_utils:rsa_test_keys", + ], +) + +cc_test( + name = "aead_whitebox_test", + size = "small", + timeout = "moderate", + deps = [ + ":aead_whitebox", + ":test_data", + "@whitebox_api_repo//api:aead_whitebox_test", + ], +) + +cc_test( + name = "license_whitebox_test", + size = "small", + timeout = "moderate", + deps = [ + ":license_whitebox", + ":test_data", + "@whitebox_api_repo//api:license_whitebox_test", + ], +) + +cc_test( + name = "aead_whitebox_benchmark", + size = "small", + deps = [ + ":aead_whitebox", + ":test_data", + "@whitebox_api_repo//api:aead_whitebox_benchmark", + ], +) + +cc_test( + name = "license_whitebox_benchmark", + size = "large", + deps = [ + ":license_whitebox", + ":test_data", + "@whitebox_api_repo//api:license_whitebox_benchmark", + ], +) + +cc_test( + name = "license_whitebox_golden_data", + size = "small", + srcs = [ + "license_whitebox_golden_data_init_data.cc", + ], + deps = [ + ":license_whitebox", + "@whitebox_api_repo//api:license_whitebox_golden_data", + ], +) diff --git a/whitebox-dev/tools/PLACEHOLDER b/whitebox-dev/tools/PLACEHOLDER new file mode 100644 index 0000000..e69de29 diff --git a/whitebox-prod/WORKSPACE b/whitebox-prod/WORKSPACE new file mode 100644 index 0000000..2fc85c7 --- /dev/null +++ b/whitebox-prod/WORKSPACE @@ -0,0 +1,111 @@ +# Copyright 2020 Google LLC. All Rights Reserved. + +workspace(name = "whitebox_prod") + +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +local_repository( + name = "whitebox_api_repo", + path = "../whitebox", +) + +git_repository( + name = "glog_repo", + commit = "3ba8976592274bc1f907c402ce22558011d6fc5e", # 2020-02-16 + remote = "https://github.com/google/glog.git", +) + +git_repository( + name = "com_github_gflags_gflags", + commit = "2e227c3daae2ea8899f49858a23f3d318ea39b57", # 2020-01-15 + remote = "https://github.com/gflags/gflags.git", +) + +git_repository( + name = "abseil_repo", + commit = "fcb104594b0bb4b8ac306cb2f55ecdad40974683", # 2018-12-04 + remote = "https://github.com/abseil/abseil-cpp.git", +) + +git_repository( + name = "boringssl_repo", + commit = "14164f6fef47b7ebd97cdb0cea1624eabd6fe6b8", # 2018-11-26 + remote = "https://github.com/google/boringssl.git", +) + +git_repository( + name = "googletest_repo", + commit = "b6cd405286ed8635ece71c72f118e659f4ade3fb", # 2019-01-04 + remote = "https://github.com/google/googletest.git", +) + +# We use "com_google_protobuf" instead of "protobuf_repo" because Bazel's proto +# rules implicitly depend on @com_google_protobuf. See +# https://bazel.build/blog/2017/02/27/protocol-buffers.html. +git_repository( + name = "com_google_protobuf", + remote = "https://github.com/google/protobuf.git", + tag = "v3.8.0", +) + +# bazel_skylib is required by google protobuf. +git_repository( + name = "bazel_skylib", + remote = "https://github.com/bazelbuild/bazel-skylib.git", + tag = "1.0.2", +) + +# Protobuf library support. Not included in the recent protobuf release. +http_archive( + name = "zlib", + build_file = "@com_google_protobuf//:third_party/zlib.BUILD", + sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1", + strip_prefix = "zlib-1.2.11", + urls = ["https://zlib.net/zlib-1.2.11.tar.gz"], +) + +# ODK +new_git_repository( + name = "odk_repo", + build_file = "@whitebox_api_repo//external:odk.BUILD", + commit = "bee799748752fac84d9c3ecd549aa54f72c88d02", + remote = "https://widevine-partner.googlesource.com/oemcrypto_core_message.git", + repo_mapping = {"@whitebox" : "@whitebox_api_repo"} +) + +bind( + name = "glog", + actual = "@glog_repo//:glog", +) + +bind( + name = "gflags", + actual = "@com_github_gflags_gflags//:gflags", +) + +bind( + name = "boringssl", + actual = "@boringssl_repo//:crypto", +) + +bind( + name = "gtest", + actual = "@googletest_repo//:gtest", +) + +bind( + name = "gtest_main", + actual = "@googletest_repo//:gtest_main", +) + +bind( + name = "protobuf", + actual = "@com_google_protobuf//:protobuf", +) + +bind( + name = "odk", + actual = "@odk_repo//:odk", +) diff --git a/whitebox-prod/impl/BUILD b/whitebox-prod/impl/BUILD new file mode 100644 index 0000000..5e37782 --- /dev/null +++ b/whitebox-prod/impl/BUILD @@ -0,0 +1,109 @@ +# Copyright 2020 Google LLC. All Rights Reserved. + +package(default_visibility = [ + "//visibility:private", +]) + +cc_library( + name = "whitebox_common", + srcs = [ + "common_whitebox.cc", + "get_random_bytes.cc", + ], + visibility = ["//visibility:private"], +) + +cc_library( + name = "aead_whitebox", + srcs = [ + "aead_whitebox.cc", + ], + visibility = ["//visibility:public"], + deps = [ + ":whitebox_common", + "@whitebox_api_repo//api:aead_whitebox", + "@whitebox_api_repo//api:result", + ], +) + +cc_library( + name = "license_whitebox", + srcs = [ + "license_whitebox.cc", + ], + deps = [ + ":whitebox_common", + "@whitebox_api_repo//api:license_whitebox", + "@whitebox_api_repo//api:result", + ], +) + +cc_library( + name = "test_data", + testonly = True, + srcs = [ + "test_data.cc", + ], + hdrs = [ + "test_data_aead_init.h", + "test_data_license_init.h", + ], + deps = [ + "@whitebox_api_repo//api:test_data", + "@whitebox_api_repo//crypto_utils:rsa_test_keys", + ], +) + +cc_test( + name = "aead_whitebox_test", + size = "small", + timeout = "moderate", + deps = [ + ":aead_whitebox", + ":test_data", + "@whitebox_api_repo//api:aead_whitebox_test", + ], +) + +cc_test( + name = "license_whitebox_test", + size = "small", + timeout = "moderate", + deps = [ + ":license_whitebox", + ":test_data", + "@whitebox_api_repo//api:license_whitebox_test", + ], +) + +cc_test( + name = "aead_whitebox_benchmark", + size = "small", + deps = [ + ":aead_whitebox", + ":test_data", + "@whitebox_api_repo//api:aead_whitebox_benchmark", + ], +) + +cc_test( + name = "license_whitebox_benchmark", + size = "large", + deps = [ + ":license_whitebox", + ":test_data", + "@whitebox_api_repo//api:license_whitebox_benchmark", + ], +) + +cc_test( + name = "license_whitebox_golden_data", + size = "small", + srcs = [ + "license_whitebox_golden_data_init_data.cc", + ], + deps = [ + ":license_whitebox", + "@whitebox_api_repo//api:license_whitebox_golden_data", + ], +) diff --git a/whitebox-prod/tools/PLACEHOLDER b/whitebox-prod/tools/PLACEHOLDER new file mode 100644 index 0000000..e69de29 diff --git a/whitebox/.clang-format b/whitebox/.clang-format new file mode 100644 index 0000000..085c2ed --- /dev/null +++ b/whitebox/.clang-format @@ -0,0 +1,172 @@ +--- +Language: Cpp +# BasedOnStyle: Chromium +AccessModifierOffset: -1 +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: false +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: true +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Inline +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: false +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DeriveLineEnding: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^' + Priority: 2 + SortPriority: 0 + - Regex: '^<.*\.h>' + Priority: 1 + SortPriority: 0 + - Regex: '^<.*' + Priority: 2 + SortPriority: 0 + - Regex: '.*' + Priority: 3 + SortPriority: 0 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IncludeIsMainSourceRegex: '' +IndentCaseLabels: true +IndentCaseBlocks: false +IndentGotoLabels: true +IndentPPDirectives: None +IndentWidth: 2 +IndentWrappedFunctionNames: false +InsertTrailingCommas: None +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBinPackProtocolList: Never +ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Left +RawStringFormats: + - Language: Cpp + Delimiters: + - cc + - CC + - cpp + - Cpp + - CPP + - 'c++' + - 'C++' + CanonicalDelimiter: '' + BasedOnStyle: google + - Language: TextProto + Delimiters: + - pb + - PB + - proto + - PROTO + EnclosingFunctions: + - EqualsProto + - EquivToProto + - PARSE_PARTIAL_TEXT_PROTO + - PARSE_TEST_PROTO + - PARSE_TEXT_PROTO + - ParseTextOrDie + - ParseTextProtoOrDie + CanonicalDelimiter: '' + BasedOnStyle: google +ReflowComments: true +SortIncludes: true +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpaceBeforeSquareBrackets: false +Standard: Auto +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 8 +UseCRLF: false +UseTab: Never +... + diff --git a/README.md b/whitebox/README.md similarity index 100% rename from README.md rename to whitebox/README.md diff --git a/WORKSPACE b/whitebox/WORKSPACE similarity index 100% rename from WORKSPACE rename to whitebox/WORKSPACE diff --git a/api/BUILD b/whitebox/api/BUILD similarity index 95% rename from api/BUILD rename to whitebox/api/BUILD index 090e158..bc0ac92 100644 --- a/api/BUILD +++ b/whitebox/api/BUILD @@ -122,6 +122,7 @@ cc_library( "license_whitebox_decrypt_test.cc", "license_whitebox_get_secret_string_test.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_sign_license_request_test.cc", "license_whitebox_sign_renewal_request_test.cc", @@ -144,23 +145,6 @@ cc_library( ], ) -# TODO(jrummell): Move sources into "license_whitebox_test" once all -# implementations support core_message. -cc_library( - name = "license_whitebox_core_message_test", - testonly = True, - srcs = [ - "license_whitebox_process_license_response_core_message_test.cc", - ], - visibility = ["//visibility:public"], - deps = [ - ":license_whitebox", - ":license_whitebox_test", - ":test_license_builder", - "//chromium_deps/testing", - ], -) - cc_library( name = "license_whitebox_benchmark", testonly = True, @@ -186,3 +170,16 @@ cc_library( "//crypto_utils:crypto_util", ], ) + +cc_library( + name = "license_whitebox_golden_data", + testonly = True, + srcs = [ + "license_whitebox_golden_data_test.cc", + ], + visibility = ["//visibility:public"], + deps = [ + ":license_whitebox", + "//chromium_deps/testing", + ], +) diff --git a/api/aead_whitebox.h b/whitebox/api/aead_whitebox.h similarity index 100% rename from api/aead_whitebox.h rename to whitebox/api/aead_whitebox.h diff --git a/api/aead_whitebox_benchmark.cc b/whitebox/api/aead_whitebox_benchmark.cc similarity index 100% rename from api/aead_whitebox_benchmark.cc rename to whitebox/api/aead_whitebox_benchmark.cc diff --git a/api/aead_whitebox_create_test.cc b/whitebox/api/aead_whitebox_create_test.cc similarity index 100% rename from api/aead_whitebox_create_test.cc rename to whitebox/api/aead_whitebox_create_test.cc diff --git a/api/aead_whitebox_cross_instance_test.cc b/whitebox/api/aead_whitebox_cross_instance_test.cc similarity index 100% rename from api/aead_whitebox_cross_instance_test.cc rename to whitebox/api/aead_whitebox_cross_instance_test.cc diff --git a/api/aead_whitebox_decrypt_test.cc b/whitebox/api/aead_whitebox_decrypt_test.cc similarity index 100% rename from api/aead_whitebox_decrypt_test.cc rename to whitebox/api/aead_whitebox_decrypt_test.cc diff --git a/api/aead_whitebox_encrypt_test.cc b/whitebox/api/aead_whitebox_encrypt_test.cc similarity index 100% rename from api/aead_whitebox_encrypt_test.cc rename to whitebox/api/aead_whitebox_encrypt_test.cc diff --git a/api/export.h b/whitebox/api/export.h similarity index 100% rename from api/export.h rename to whitebox/api/export.h diff --git a/api/golden_data.cc b/whitebox/api/golden_data.cc similarity index 100% rename from api/golden_data.cc rename to whitebox/api/golden_data.cc diff --git a/api/golden_data.h b/whitebox/api/golden_data.h similarity index 100% rename from api/golden_data.h rename to whitebox/api/golden_data.h diff --git a/api/license_whitebox.h b/whitebox/api/license_whitebox.h similarity index 97% rename from api/license_whitebox.h rename to whitebox/api/license_whitebox.h index cdfa3c0..36f42d9 100644 --- a/api/license_whitebox.h +++ b/whitebox/api/license_whitebox.h @@ -127,14 +127,20 @@ WB_License_SignLicenseRequest(const WB_License_Whitebox* whitebox, // null, if |message| was null, if |message_size| was zero, if |message| did // not conform to the expected format, if |signature| was null, if // |signature_size| was incorrect, if |session_key| was null, if -// |session_key_size| was incorrect, if |session_key| could not be unwrapped -// correctly, if |license_request| was null, or if |license_request_size| was -// zero. +// |session_key_size| was incorrect, if |license_request| was null, or if +// |license_request_size| was zero. // // WB_RESULT_INVALID_SIGNATURE if |message|'s signature does not match -// |signature|. +// |signature| or if |session_key| could not be unwrapped correctly (and +// interferes with verification). // // WB_RESULT_INVALID_STATE if a license has already been loaded. +// +// Notes: +// We allow a modified session key to be used. Using it will cause message +// verification to fail (therefore we return WB_RESULT_INVALID_SIGNATURE). +// Doing this was found to allow for better hardening of the license processing +// code. WB_API WB_Result WB_License_ProcessLicenseResponse(WB_License_Whitebox* whitebox, const uint8_t* core_message, diff --git a/api/license_whitebox_benchmark.cc b/whitebox/api/license_whitebox_benchmark.cc similarity index 100% rename from api/license_whitebox_benchmark.cc rename to whitebox/api/license_whitebox_benchmark.cc diff --git a/api/license_whitebox_benchmark.h b/whitebox/api/license_whitebox_benchmark.h similarity index 100% rename from api/license_whitebox_benchmark.h rename to whitebox/api/license_whitebox_benchmark.h diff --git a/api/license_whitebox_chromeos_test.cc b/whitebox/api/license_whitebox_chromeos_test.cc similarity index 100% rename from api/license_whitebox_chromeos_test.cc rename to whitebox/api/license_whitebox_chromeos_test.cc diff --git a/api/license_whitebox_create_test.cc b/whitebox/api/license_whitebox_create_test.cc similarity index 100% rename from api/license_whitebox_create_test.cc rename to whitebox/api/license_whitebox_create_test.cc diff --git a/api/license_whitebox_decrypt_benchmark.cc b/whitebox/api/license_whitebox_decrypt_benchmark.cc similarity index 100% rename from api/license_whitebox_decrypt_benchmark.cc rename to whitebox/api/license_whitebox_decrypt_benchmark.cc diff --git a/api/license_whitebox_decrypt_test.cc b/whitebox/api/license_whitebox_decrypt_test.cc similarity index 99% rename from api/license_whitebox_decrypt_test.cc rename to whitebox/api/license_whitebox_decrypt_test.cc index cad808f..1323ee2 100644 --- a/api/license_whitebox_decrypt_test.cc +++ b/whitebox/api/license_whitebox_decrypt_test.cc @@ -35,19 +35,19 @@ class LicenseWhiteboxDecryptTest : public LicenseWhiteboxTestBase { builder.AddContentKey(golden_data_.CBCCryptoKey().level, golden_data_.CBCCryptoKey().id, - golden_data_.CBCCryptoKey().content->key); + golden_data_.CBCCryptoKey().content->key, padding); builder.AddContentKey(golden_data_.CTRCryptoKey().level, golden_data_.CTRCryptoKey().id, - golden_data_.CTRCryptoKey().content->key); + golden_data_.CTRCryptoKey().content->key, padding); builder.AddContentKey(golden_data_.CBCDecodeKey().level, golden_data_.CBCDecodeKey().id, - golden_data_.CBCDecodeKey().content->key); + golden_data_.CBCDecodeKey().content->key, padding); builder.AddContentKey(golden_data_.CBCHardwareKey().level, golden_data_.CBCHardwareKey().id, - golden_data_.CBCHardwareKey().content->key); + golden_data_.CBCHardwareKey().content->key, padding); builder.AddOperatorSessionKey(non_content_key_id_); diff --git a/api/license_whitebox_get_secret_string_test.cc b/whitebox/api/license_whitebox_get_secret_string_test.cc similarity index 100% rename from api/license_whitebox_get_secret_string_test.cc rename to whitebox/api/license_whitebox_get_secret_string_test.cc diff --git a/whitebox/api/license_whitebox_golden_data_test.cc b/whitebox/api/license_whitebox_golden_data_test.cc new file mode 100644 index 0000000..c026de9 --- /dev/null +++ b/whitebox/api/license_whitebox_golden_data_test.cc @@ -0,0 +1,343 @@ +// Copyright 2020 Google LLC. All Rights Reserved. + +#include +#include +#include + +#include "api/license_whitebox.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace widevine { +// This must be defined by the implementation as they are implementation +// specific. They must be defined so that they work with the test key used to +// generate the license request. +extern const uint8_t kLicenseWhiteboxInitData[]; +extern const size_t kLicenseWhiteboxInitDataSize; + +namespace { + +const uint8_t kMessage[] = { + 0x0a, 0x2a, 0x0a, 0x10, 0x53, 0xbc, 0x88, 0x54, 0x04, 0xfc, 0x85, 0xbd, + 0x75, 0xce, 0x15, 0x2a, 0x06, 0xb5, 0x1f, 0xc5, 0x12, 0x10, 0x53, 0xbc, + 0x88, 0x54, 0x04, 0xfc, 0x85, 0xbd, 0x75, 0xce, 0x15, 0x2a, 0x06, 0xb5, + 0x1f, 0xc5, 0x1a, 0x00, 0x20, 0x01, 0x28, 0x00, 0x12, 0x12, 0x08, 0x01, + 0x10, 0x01, 0x18, 0x01, 0x20, 0x80, 0xa3, 0x05, 0x28, 0x80, 0xa3, 0x05, + 0x30, 0x80, 0xa3, 0x05, 0x1a, 0x66, 0x12, 0x10, 0x94, 0x40, 0xfa, 0xa2, + 0xd0, 0xe2, 0xa4, 0x80, 0xb4, 0x74, 0x68, 0x91, 0x0a, 0xb9, 0xe4, 0x6a, + 0x1a, 0x50, 0x30, 0xe2, 0xcb, 0x71, 0xa1, 0x92, 0xb7, 0xc8, 0x3f, 0xd9, + 0x00, 0x2e, 0xf0, 0xf8, 0xb1, 0xe6, 0x9e, 0x62, 0xca, 0x27, 0xb3, 0xa7, + 0x26, 0x19, 0x73, 0x9e, 0xf8, 0xc2, 0x8e, 0x6f, 0xea, 0xb3, 0x5b, 0x01, + 0xa6, 0xe8, 0x9b, 0x84, 0x1b, 0x9e, 0xaf, 0xe2, 0xa1, 0xff, 0x4a, 0xca, + 0xcf, 0x84, 0x3f, 0x36, 0xaa, 0x17, 0xa6, 0x0a, 0x0a, 0xe2, 0xcc, 0x12, + 0xb1, 0x9f, 0xac, 0x05, 0xdf, 0xe7, 0x00, 0xad, 0xc4, 0xa5, 0xd4, 0x4d, + 0x46, 0x01, 0xbb, 0xcc, 0x18, 0x7e, 0x4d, 0xb5, 0x05, 0x2a, 0x20, 0x01, + 0x1a, 0x52, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0xf1, 0xed, + 0x57, 0xf4, 0xad, 0x5d, 0x0e, 0x2c, 0xf9, 0x78, 0xc9, 0xe4, 0x4d, 0x2e, + 0xcc, 0x68, 0x1a, 0x20, 0xd7, 0xf5, 0x15, 0x85, 0x3b, 0x33, 0xea, 0x8e, + 0x40, 0xef, 0x2a, 0xd0, 0x8f, 0x96, 0x69, 0xb6, 0xf9, 0xdd, 0x63, 0x8f, + 0x80, 0x7e, 0x68, 0x02, 0xc7, 0x74, 0x55, 0x5d, 0xd4, 0x17, 0x45, 0x09, + 0x20, 0x02, 0x28, 0x01, 0x32, 0x00, 0x3a, 0x00, 0x62, 0x02, 0x48, 0x44, + 0x1a, 0x52, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xdb, 0x38, + 0x5d, 0x4a, 0x0d, 0x80, 0x37, 0x42, 0x10, 0x60, 0x0d, 0x24, 0x03, 0xde, + 0xd0, 0x3c, 0x1a, 0x20, 0x22, 0xab, 0x33, 0xb9, 0xe5, 0x16, 0xa2, 0x6d, + 0x5a, 0x42, 0x45, 0xd4, 0x0e, 0x47, 0x0c, 0xf3, 0x6c, 0x1f, 0x20, 0xd9, + 0x0e, 0x79, 0xd7, 0xb7, 0x34, 0xc1, 0xbe, 0xd2, 0x6b, 0x01, 0xff, 0x73, + 0x20, 0x02, 0x28, 0x01, 0x32, 0x00, 0x3a, 0x00, 0x62, 0x02, 0x48, 0x44, + 0x1a, 0x55, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xdd, 0xfb, + 0x7a, 0x27, 0x34, 0xd4, 0xec, 0xcf, 0x01, 0x9c, 0xbd, 0x84, 0xe3, 0xf0, + 0xbd, 0xc6, 0x1a, 0x20, 0x11, 0x0c, 0xa2, 0xc3, 0xb8, 0x95, 0xaf, 0x48, + 0x80, 0x57, 0xd1, 0x39, 0xec, 0xd7, 0x09, 0x5a, 0x95, 0x31, 0xf8, 0x3f, + 0xa0, 0x6d, 0x9c, 0xad, 0x10, 0x70, 0xa4, 0x6b, 0x6a, 0x5c, 0xca, 0x73, + 0x20, 0x02, 0x28, 0x01, 0x32, 0x00, 0x3a, 0x00, 0x62, 0x05, 0x41, 0x55, + 0x44, 0x49, 0x4f, 0x1a, 0x52, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x12, + 0x10, 0xcb, 0xac, 0x50, 0x57, 0x81, 0xcd, 0x04, 0xf6, 0x71, 0xb2, 0xc2, + 0x08, 0x86, 0x12, 0x78, 0x58, 0x1a, 0x20, 0x71, 0x0e, 0xd7, 0xa2, 0x8c, + 0x64, 0x75, 0x0b, 0x11, 0x9e, 0x48, 0x47, 0x0c, 0x2d, 0x78, 0x48, 0x1c, + 0x98, 0x2f, 0x14, 0x51, 0x15, 0x2a, 0x05, 0xe8, 0x84, 0x6e, 0x61, 0xc2, + 0x26, 0x82, 0xe6, 0x20, 0x02, 0x28, 0x01, 0x32, 0x00, 0x3a, 0x00, 0x62, + 0x02, 0x48, 0x44, 0x1a, 0x52, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, + 0x10, 0xa6, 0xd4, 0xb8, 0x0a, 0x37, 0x46, 0xf6, 0xc8, 0x59, 0x5a, 0x30, + 0x96, 0x39, 0x16, 0x29, 0x1e, 0x1a, 0x20, 0xff, 0xe7, 0xb2, 0x9e, 0x98, + 0x40, 0x33, 0xce, 0x9e, 0xcf, 0x85, 0x60, 0x52, 0x43, 0x38, 0xe6, 0x1b, + 0x07, 0x10, 0xfa, 0x71, 0xa8, 0x66, 0x0f, 0xd6, 0x9a, 0x09, 0xac, 0xb1, + 0x47, 0xe4, 0x19, 0x20, 0x02, 0x28, 0x01, 0x32, 0x00, 0x3a, 0x00, 0x62, + 0x02, 0x53, 0x44, 0x1a, 0x52, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x12, + 0x10, 0x57, 0x43, 0x24, 0x10, 0x4d, 0xd3, 0xcf, 0x6e, 0xef, 0x37, 0xce, + 0x5b, 0xba, 0xd1, 0x61, 0x62, 0x1a, 0x20, 0x54, 0xec, 0xbb, 0xc7, 0x4b, + 0xa6, 0x3f, 0x17, 0xcc, 0x5e, 0xb8, 0x20, 0x41, 0x9e, 0xcf, 0xe2, 0x9f, + 0x03, 0x9d, 0x79, 0xd0, 0x06, 0x0b, 0x0e, 0x6e, 0xf4, 0x9e, 0x93, 0x92, + 0x50, 0x19, 0xbd, 0x20, 0x02, 0x28, 0x01, 0x32, 0x00, 0x3a, 0x00, 0x62, + 0x02, 0x53, 0x44, 0x1a, 0x52, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x12, + 0x10, 0xd7, 0x93, 0x22, 0x74, 0xf1, 0x0b, 0x61, 0x26, 0x7e, 0x16, 0xd5, + 0x88, 0x5f, 0x70, 0x2b, 0x3d, 0x1a, 0x20, 0xb2, 0x21, 0xc6, 0xb4, 0x65, + 0xf1, 0x00, 0x07, 0x11, 0x0e, 0xe4, 0x67, 0x3c, 0xb4, 0x4c, 0xc9, 0xe9, + 0x82, 0x5e, 0xbc, 0x2a, 0x2a, 0xf0, 0x68, 0x45, 0xfe, 0xd2, 0xce, 0xea, + 0xae, 0xfb, 0x9a, 0x20, 0x02, 0x28, 0x01, 0x32, 0x00, 0x3a, 0x00, 0x62, + 0x02, 0x53, 0x44, 0x1a, 0x52, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x12, + 0x10, 0x96, 0x9e, 0xc6, 0xcb, 0xc0, 0xbf, 0xf5, 0x83, 0xef, 0xc9, 0xe7, + 0xbb, 0x2a, 0x1a, 0xce, 0x0b, 0x1a, 0x20, 0xe0, 0x23, 0x16, 0x1e, 0x00, + 0x05, 0xc0, 0xfe, 0x97, 0x47, 0x5f, 0x75, 0x69, 0x8c, 0x09, 0x8b, 0x3e, + 0x93, 0x1b, 0xa4, 0x84, 0x4b, 0xd3, 0xb1, 0x77, 0xd4, 0x42, 0xee, 0x7e, + 0xf5, 0xe4, 0x0c, 0x20, 0x02, 0x28, 0x01, 0x32, 0x00, 0x3a, 0x00, 0x62, + 0x02, 0x53, 0x44, 0x20, 0xb2, 0x88, 0xc6, 0xfa, 0x05, 0x38, 0x00, +}; +const uint8_t kSignature[] = { + 0x34, 0x7e, 0xc1, 0xa9, 0x3e, 0x1d, 0x66, 0x77, 0x5d, 0xac, 0xe8, + 0x8b, 0xc0, 0x37, 0x3e, 0x4c, 0x9b, 0xe5, 0x9c, 0x25, 0x04, 0xed, + 0x3f, 0x66, 0x6e, 0x6c, 0x51, 0x42, 0x57, 0x7f, 0x6c, 0x53, +}; +const uint8_t kSessionKey[] = { + 0x21, 0xd8, 0x3b, 0x58, 0xda, 0xa9, 0x3a, 0x1c, 0xdb, 0xfb, 0x54, 0xff, + 0x0d, 0x30, 0xcd, 0x00, 0xff, 0x52, 0xc4, 0xed, 0x5c, 0xf9, 0xc9, 0x1c, + 0x7b, 0x41, 0x48, 0xc0, 0x98, 0xa9, 0x74, 0x99, 0x79, 0xa0, 0x75, 0xc3, + 0x50, 0xf0, 0xac, 0xfa, 0xec, 0xc4, 0xc0, 0x34, 0x06, 0x5b, 0xb9, 0xaa, + 0x6d, 0xcf, 0x71, 0x69, 0xf0, 0x5e, 0x8f, 0x6b, 0x50, 0x9a, 0x16, 0x54, + 0xa7, 0x72, 0x11, 0x50, 0xf9, 0xec, 0x8d, 0xcc, 0x3a, 0x23, 0x16, 0x84, + 0x78, 0xea, 0xaa, 0xbd, 0x6f, 0xd9, 0x88, 0x5f, 0xa8, 0x82, 0x3c, 0x05, + 0x53, 0xe7, 0x76, 0x5f, 0xe3, 0x7a, 0x4a, 0xe5, 0xeb, 0x45, 0x9d, 0x04, + 0x45, 0xe8, 0x9a, 0x4a, 0x10, 0x02, 0x63, 0x97, 0x35, 0x68, 0x87, 0xc4, + 0xe3, 0xaa, 0xbd, 0x1b, 0xe7, 0xa2, 0xd4, 0x52, 0xb0, 0xea, 0x2d, 0x2f, + 0x59, 0x62, 0x7e, 0xb4, 0x6b, 0xe0, 0x06, 0x7a, 0xee, 0x98, 0x21, 0x74, + 0xec, 0x99, 0x61, 0x55, 0x9b, 0x1d, 0xf9, 0x5d, 0x6f, 0x80, 0x87, 0xdd, + 0xf3, 0x7b, 0x5d, 0x98, 0xb6, 0x37, 0x6a, 0x0a, 0x83, 0x5e, 0x36, 0x08, + 0x8a, 0xf4, 0xcd, 0x9e, 0x5c, 0x7d, 0xec, 0xf2, 0x4e, 0x5b, 0x4d, 0xac, + 0x9a, 0xab, 0xb1, 0x80, 0xc9, 0x58, 0xa0, 0x1d, 0x19, 0x16, 0x0b, 0xd5, + 0xea, 0xe7, 0xfc, 0xfd, 0x4e, 0x04, 0x98, 0xa1, 0x8d, 0x79, 0xb0, 0xa7, + 0xb5, 0x44, 0xfc, 0x12, 0xd2, 0x04, 0x7d, 0x53, 0x02, 0xfd, 0x70, 0x21, + 0xef, 0xfd, 0x64, 0x11, 0x48, 0x03, 0xc4, 0x66, 0x7a, 0x29, 0xc3, 0x83, + 0xfc, 0xee, 0xad, 0x9a, 0x4c, 0x97, 0x64, 0x0a, 0x9e, 0x72, 0x42, 0xc1, + 0x1f, 0x32, 0x29, 0x80, 0xcf, 0xb9, 0xdc, 0x1d, 0x81, 0x92, 0x13, 0xfe, + 0x85, 0x50, 0x53, 0x4a, 0x0a, 0xa2, 0x24, 0x52, 0x26, 0x9a, 0x65, 0x28, + 0x13, 0x26, 0xae, 0xf3, +}; +const uint8_t kLicenseRequest[] = { + 0x0a, 0x88, 0x0b, 0x08, 0x01, 0x12, 0xed, 0x09, 0x0a, 0xb0, 0x02, 0x08, + 0x02, 0x12, 0x10, 0x0c, 0x36, 0x48, 0x86, 0x75, 0xa1, 0x84, 0x53, 0x4d, + 0xbc, 0x55, 0x96, 0xc9, 0xf4, 0xaf, 0x0a, 0x18, 0x97, 0xe7, 0xdd, 0xf8, + 0x05, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xae, 0xa6, 0xa8, 0xea, 0xdd, 0xac, 0x6f, 0xb4, 0x41, 0x47, 0xcb, + 0x18, 0x81, 0xeb, 0xdf, 0x4f, 0x17, 0xf7, 0x17, 0xc0, 0xab, 0x6f, 0x47, + 0x50, 0xbf, 0xe4, 0x8c, 0xc9, 0x45, 0x24, 0x5e, 0x1c, 0x2e, 0x86, 0x9f, + 0xcb, 0x47, 0x05, 0xf9, 0xfe, 0x91, 0x90, 0xaf, 0xbd, 0x22, 0x14,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, + 0x43, 0x9f, 0xf7, 0x51, 0x7e, 0xbb, 0x55, 0x6d, 0xcc, 0x97, 0x38, 0xdb, + 0xa4, 0x4b, 0x96, 0x40, 0xe5, 0x2d, 0x8f, 0x43, 0xe3, 0x21, 0x15, 0xda, + 0x34, 0x97, 0x7a, 0x9e, 0xbb, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x48, 0x01, 0x12, 0x80, 0x02, 0xa2, 0x05, 0x30, 0x91, 0xed, 0xc2, + 0x17, 0xfd, 0x92, 0x5c, 0x69, 0x1f, 0xb4, 0x82, 0x35, 0x75, 0xcb, 0x48, + 0x22, 0x07, 0x54, 0x72, 0x05, 0x86, 0x2e, 0xa1, 0x98, 0xc9, 0x46, 0x07, + 0xc9, 0x26, 0x6b, 0x05, 0x56, 0xa2, 0xa6, 0x5b, 0xe3, 0xba, 0x80, 0xd0, + 0x01, 0xb3, 0xbd, 0x9f, 0x7b, 0x15, 0xe3, 0xe6, 0xad, 0x85, 0xe6, 0x92, + 0x35, 0xec, 0x9b, 0x18, 0x7e, 0x1d, 0x39, 0x93, 0xfb, 0x0b, 0x2c, 0xe8, + 0xa0, 0xee, 0x6e, 0x27, 0x8f, 0x08, 0x99, 0xc7, 0xd6, 0x08, 0x1f, 0xe5, + 0xd4, 0x9b, 0x30, 0x83, 0x31, 0xf8, 0x49, 0x05, 0x9b, 0xa0, 0x30, 0xaa, + 0xc1, 0x61, 0xd4, 0xec, 0x81, 0x28, 0xe1, 0x80, 0x17, 0x09, 0xdc, 0x35, + 0xb8, 0xdc, 0xd3, 0x46, 0x7b, 0xa6, 0xad, 0x44, 0x90, 0x17, 0x99, 0x8e, + 0x43, 0xd4, 0x35, 0x00, 0x98, 0x6c, 0xe5, 0xc3, 0x2e, 0xad, 0x80, 0xa6, + 0x35, 0x3e, 0xed, 0xb2, 0x22, 0xe0, 0xad, 0x8a, 0xd0, 0x1a, 0x5e, 0x27, + 0x29, 0xe2, 0xd9, 0x01,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4, 0x14, 0x8b, 0x9c, 0x29, 0xce, 0xd5, 0xea, + 0xd6, 0x45, 0xa9, 0x5b, 0x69, 0x8f, 0x1c, 0xdc, 0x6e, 0x1d, 0xb6, 0x67, + 0x8b, 0x85, 0x07, 0x41, 0x86, 0x08, 0x0d, 0x68, 0xd1, 0x3c, 0xd3, 0x7e, + 0x07, 0xb1, 0x6d, 0xe3, 0x70, 0xcd, 0x9a, 0xfb, 0x9b, 0x25, 0x56, 0x4a, + 0x73, 0xa3, 0x0e, 0x2a, 0xf8, 0x08, 0x5e, 0xa3, 0x7d, 0x31, 0x0c, 0x47, + 0x4f, 0x0e, 0x67, 0xac, 0x00, 0xca, 0x99, 0x2a, 0x52, 0x96, 0xfa, 0xed, + 0xad, 0x7a, 0xa0, 0x6e, 0xcd, 0x79, 0x0f, 0x1e, 0x3d, 0x42, 0x65, 0x58, + 0xfa, 0x98, 0x38, 0x3e, 0x3c, 0xd2, 0xed, 0x48, 0x30, 0x1a, 0x1b, 0x0a, + 0x11, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x06, 0x78, 0x38, 0x36, 0x2d, + 0x36, 0x34, 0x1a, 0x16, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x06, 0x47, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x1a, 0x17, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x09, 0x43, 0x68, 0x72, 0x6f, 0x6d, 0x65, + 0x43, 0x44, 0x4d, 0x1a, 0x16, 0x0a, 0x0d, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x05, 0x4c, 0x69, + 0x6e, 0x75, 0x78, 0x1a, 0x24, 0x0a, 0x14, 0x77, 0x69, 0x64, 0x65, 0x76, + 0x69, 0x6e, 0x65, 0x5f, 0x63, 0x64, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x0c, 0x34, 0x2e, 0x31, 0x30, 0x2e, 0x31, 0x36, + 0x38, 0x36, 0x2e, 0x39, 0x36, 0x32, 0x08, 0x08, 0x00, 0x10, 0x00, 0x18, + 0x01, 0x20, 0x00, 0x12, 0x3f, 0x0a, 0x3d, 0x0a, 0x27, 0x08, 0x01, 0x12, + 0x01, 0x30, 0x1a, 0x0d, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, + 0x5f, 0x74, 0x65, 0x73, 0x74, 0x22, 0x0a, 0x32, 0x30, 0x31, 0x35, 0x5f, + 0x74, 0x65, 0x61, 0x72, 0x73, 0x2a, 0x05, 0x41, 0x55, 0x44, 0x49, 0x4f, + 0x10, 0x01, 0x1a, 0x10, 0x53, 0xbc, 0x88, 0x54, 0x04, 0xfc, 0x85, 0xbd, + 0x75, 0xce, 0x15, 0x2a, 0x06, 0xb5, 0x1f, 0xc5, 0x18, 0x01, 0x20, 0xb2, + 0x88, 0xc6, 0xfa, 0x05, 0x30, 0x15, +}; + +const size_t kMessageSize = sizeof(kMessage); +const size_t kLicenseRequestSize = sizeof(kLicenseRequest); +const size_t kSignatureSize = sizeof(kSignature); +const size_t kSessionKeySize = sizeof(kSessionKey); + +// The pointer for core message must be non-null, but the length needs to be +// zero. +const uint8_t kCoreMessage[] = {0}; +const size_t kCoreMessageSize = 0; + +const uint8_t kPlaintext[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +const size_t kPlaintextSize = sizeof(kPlaintext); + +// Generated with: +// openssl aes-128-cbc -e -in clean -K 78a1dc0646119707e903514d8a00735f -iv +// 00000000000000000000000000000000 | xxd -i +const uint8_t kCiphertext[] = { + 0xef, 0x21, 0x57, 0x2d, 0xe1, 0x08, 0xc6, 0x3c, + 0x54, 0x7d, 0x3d, 0xde, 0x92, 0x2e, 0x5c, 0xe0, + + 0x79, 0x52, 0xb5, 0xc1, 0x76, 0x3e, 0xdf, 0x73, + 0x5b, 0x05, 0xe8, 0x20, 0xe6, 0xa3, 0x22, 0x49, + + 0xc7, 0xa5, 0x9f, 0xd5, 0x76, 0x6b, 0x20, 0xd3, + 0x21, 0x52, 0xe6, 0xc6, 0x9b, 0x22, 0xb0, 0xb3, + + 0xf8, 0x0d, 0x58, 0xdd, 0xb2, 0x37, 0x7d, 0x7e, + 0xe3, 0xaf, 0xaf, 0x82, 0x7b, 0xb8, 0x69, 0x12, + + // Drop the padding at the end of the ciphertext. + // 0x40, 0x03, 0x23, 0x83, 0x2f, 0x65, 0xda, 0x81, + // 0x78, 0x46, 0xa6, 0xa8, 0xa4, 0x2c, 0x86, 0x75, +}; +const size_t kCiphertextSize = sizeof(kCiphertext); + +// The key associated with this id is: 78a1dc0646119707e903514d8a00735f +const uint8_t kKeyId[] = { + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, +}; +const size_t kKeyIdSize = sizeof(kKeyId); + +const uint8_t kIv[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +const size_t kIvSize = sizeof(kIv); +} // namespace + +class LicenseWhiteboxDecryptGoldenData : public ::testing::Test { + protected: + void TearDown() override { WB_License_Delete(whitebox_); } + + WB_License_Whitebox* whitebox_ = nullptr; +}; + +TEST_F(LicenseWhiteboxDecryptGoldenData, CryptoKeyWithCbcDataInCbcMode) { + ASSERT_EQ(WB_License_Create(kLicenseWhiteboxInitData, + kLicenseWhiteboxInitDataSize, &whitebox_), + WB_RESULT_OK); + + ASSERT_EQ(WB_License_ProcessLicenseResponse( + whitebox_, kCoreMessage, kCoreMessageSize, kMessage, + kMessageSize, kSignature, kSignatureSize, kSessionKey, + kSessionKeySize, kLicenseRequest, kLicenseRequestSize), + WB_RESULT_OK); + + size_t plaintext_size = kCiphertextSize; + std::vector plaintext(plaintext_size); + ASSERT_EQ(WB_License_Decrypt(whitebox_, WB_CIPHER_MODE_CBC, kKeyId, + kKeyIdSize, kCiphertext, kCiphertextSize, kIv, + kIvSize, plaintext.data(), &plaintext_size), + WB_RESULT_OK); + + plaintext.resize(plaintext_size); + + const std::vector golden_plaintext(kPlaintext, + kPlaintext + kPlaintextSize); + + ASSERT_EQ(golden_plaintext, plaintext); +} + +} // namespace widevine diff --git a/api/license_whitebox_masked_decrypt_test.cc b/whitebox/api/license_whitebox_masked_decrypt_test.cc similarity index 100% rename from api/license_whitebox_masked_decrypt_test.cc rename to whitebox/api/license_whitebox_masked_decrypt_test.cc diff --git a/api/license_whitebox_process_license_response_benchmark.cc b/whitebox/api/license_whitebox_process_license_response_benchmark.cc similarity index 100% rename from api/license_whitebox_process_license_response_benchmark.cc rename to whitebox/api/license_whitebox_process_license_response_benchmark.cc diff --git a/api/license_whitebox_process_license_response_core_message_test.cc b/whitebox/api/license_whitebox_process_license_response_core_message_test.cc similarity index 100% rename from api/license_whitebox_process_license_response_core_message_test.cc rename to whitebox/api/license_whitebox_process_license_response_core_message_test.cc diff --git a/api/license_whitebox_process_license_response_test.cc b/whitebox/api/license_whitebox_process_license_response_test.cc similarity index 93% rename from api/license_whitebox_process_license_response_test.cc rename to whitebox/api/license_whitebox_process_license_response_test.cc index bdbb20f..750d4d9 100644 --- a/api/license_whitebox_process_license_response_test.cc +++ b/whitebox/api/license_whitebox_process_license_response_test.cc @@ -17,6 +17,12 @@ namespace widevine { class LicenseWhiteboxProcessLicenseResponseTest : public LicenseWhiteboxTestBase { protected: + // No content keys. No signing keys. + void UseLicenseWithNoKeys() { + TestLicenseBuilder builder; + builder.Build(*public_key_, &license_); + } + void UseLicenseWithoutSigningKey() { TestLicenseBuilder builder; builder.AddStubbedContentKey(); @@ -94,6 +100,20 @@ TEST_F(LicenseWhiteboxProcessLicenseResponseTest, WB_RESULT_INVALID_PARAMETER); } +TEST_F(LicenseWhiteboxProcessLicenseResponseTest, + InvalidParameterWithNoKeys) { + UseLicenseWithNoKeys(); + + ASSERT_EQ( + WB_License_ProcessLicenseResponse( + whitebox_, license_.core_message.data(), license_.core_message.size(), + license_.message.data(), license_.message.size(), + license_.signature.data(), license_.signature.size(), + license_.session_key.data(), license_.session_key.size(), + license_.request.data(), license_.request.size()), + WB_RESULT_OK); +} + class LicenseWhiteboxProcessLicenseResponseErrorTest : public LicenseWhiteboxProcessLicenseResponseTest { protected: @@ -150,6 +170,24 @@ TEST_F(LicenseWhiteboxProcessLicenseResponseErrorTest, WB_RESULT_INVALID_SIGNATURE); } +// If the session key is modified, unwrapping it will fail. Therefore, we will +// know that the parameter is invalid (compared to a modified license request). +// However, it was found that allowing the error to propagate was a better +// implementation solution, so we allow "invalid signature" to be returned. +TEST_F(LicenseWhiteboxProcessLicenseResponseErrorTest, + InvalidSignatureForModifedSessionKey) { + Modify(&license_.session_key); + + ASSERT_EQ( + WB_License_ProcessLicenseResponse( + whitebox_, license_.core_message.data(), license_.core_message.size(), + license_.message.data(), license_.message.size(), + license_.signature.data(), license_.signature.size(), + license_.session_key.data(), license_.session_key.size(), + license_.request.data(), license_.request.size()), + WB_RESULT_INVALID_SIGNATURE); +} + TEST_F(LicenseWhiteboxProcessLicenseResponseErrorTest, InvalidParameterForNullWhitebox) { ASSERT_EQ( @@ -228,22 +266,6 @@ TEST_F(LicenseWhiteboxProcessLicenseResponseErrorTest, WB_RESULT_INVALID_PARAMETER); } -// If the session key is modified, unwrapping it will fail. Therefore, we will -// know that the parameter is invalid (compared to a modified license request). -TEST_F(LicenseWhiteboxProcessLicenseResponseErrorTest, - InvalidParameterForModifedSessionKey) { - Modify(&license_.session_key); - - ASSERT_EQ( - WB_License_ProcessLicenseResponse( - whitebox_, license_.core_message.data(), license_.core_message.size(), - license_.message.data(), license_.message.size(), - license_.signature.data(), license_.signature.size(), - license_.session_key.data(), license_.session_key.size(), - license_.request.data(), license_.request.size()), - WB_RESULT_INVALID_PARAMETER); -} - TEST_F(LicenseWhiteboxProcessLicenseResponseErrorTest, InvalidParameterForNullLicenseRequest) { ASSERT_EQ(WB_License_ProcessLicenseResponse( diff --git a/api/license_whitebox_sign_benchmark.cc b/whitebox/api/license_whitebox_sign_benchmark.cc similarity index 100% rename from api/license_whitebox_sign_benchmark.cc rename to whitebox/api/license_whitebox_sign_benchmark.cc diff --git a/api/license_whitebox_sign_license_request_test.cc b/whitebox/api/license_whitebox_sign_license_request_test.cc similarity index 100% rename from api/license_whitebox_sign_license_request_test.cc rename to whitebox/api/license_whitebox_sign_license_request_test.cc diff --git a/api/license_whitebox_sign_renewal_request_test.cc b/whitebox/api/license_whitebox_sign_renewal_request_test.cc similarity index 100% rename from api/license_whitebox_sign_renewal_request_test.cc rename to whitebox/api/license_whitebox_sign_renewal_request_test.cc diff --git a/api/license_whitebox_test_base.cc b/whitebox/api/license_whitebox_test_base.cc similarity index 100% rename from api/license_whitebox_test_base.cc rename to whitebox/api/license_whitebox_test_base.cc diff --git a/api/license_whitebox_test_base.h b/whitebox/api/license_whitebox_test_base.h similarity index 100% rename from api/license_whitebox_test_base.h rename to whitebox/api/license_whitebox_test_base.h diff --git a/api/license_whitebox_verify_benchmark.cc b/whitebox/api/license_whitebox_verify_benchmark.cc similarity index 100% rename from api/license_whitebox_verify_benchmark.cc rename to whitebox/api/license_whitebox_verify_benchmark.cc diff --git a/api/license_whitebox_verify_renewal_response_test.cc b/whitebox/api/license_whitebox_verify_renewal_response_test.cc similarity index 100% rename from api/license_whitebox_verify_renewal_response_test.cc rename to whitebox/api/license_whitebox_verify_renewal_response_test.cc diff --git a/api/result.h b/whitebox/api/result.h similarity index 100% rename from api/result.h rename to whitebox/api/result.h diff --git a/api/test_data.h b/whitebox/api/test_data.h similarity index 100% rename from api/test_data.h rename to whitebox/api/test_data.h diff --git a/api/test_license_builder.cc b/whitebox/api/test_license_builder.cc similarity index 100% rename from api/test_license_builder.cc rename to whitebox/api/test_license_builder.cc diff --git a/api/test_license_builder.h b/whitebox/api/test_license_builder.h similarity index 100% rename from api/test_license_builder.h rename to whitebox/api/test_license_builder.h diff --git a/benchmarking/BUILD b/whitebox/benchmarking/BUILD similarity index 92% rename from benchmarking/BUILD rename to whitebox/benchmarking/BUILD index bdc671a..177bdd7 100644 --- a/benchmarking/BUILD +++ b/whitebox/benchmarking/BUILD @@ -25,6 +25,6 @@ cc_library( "measurements.h", ], deps = [ - "//chromium_deps/base:glog", + "//chromium_deps/base:glog", ], ) diff --git a/benchmarking/data_source.cc b/whitebox/benchmarking/data_source.cc similarity index 100% rename from benchmarking/data_source.cc rename to whitebox/benchmarking/data_source.cc diff --git a/benchmarking/data_source.h b/whitebox/benchmarking/data_source.h similarity index 100% rename from benchmarking/data_source.h rename to whitebox/benchmarking/data_source.h diff --git a/benchmarking/measurements.cc b/whitebox/benchmarking/measurements.cc similarity index 100% rename from benchmarking/measurements.cc rename to whitebox/benchmarking/measurements.cc diff --git a/benchmarking/measurements.h b/whitebox/benchmarking/measurements.h similarity index 100% rename from benchmarking/measurements.h rename to whitebox/benchmarking/measurements.h diff --git a/chromium_deps/base/BUILD b/whitebox/chromium_deps/base/BUILD similarity index 93% rename from chromium_deps/base/BUILD rename to whitebox/chromium_deps/base/BUILD index d934f0b..41bdc25 100644 --- a/chromium_deps/base/BUILD +++ b/whitebox/chromium_deps/base/BUILD @@ -5,7 +5,7 @@ cc_library( hdrs = [ "check.h", "check_op.h", - "logging.h" + "logging.h", ], strip_include_prefix = "//chromium_deps", visibility = ["//visibility:public"], diff --git a/chromium_deps/base/check.h b/whitebox/chromium_deps/base/check.h similarity index 100% rename from chromium_deps/base/check.h rename to whitebox/chromium_deps/base/check.h diff --git a/chromium_deps/base/check_op.h b/whitebox/chromium_deps/base/check_op.h similarity index 100% rename from chromium_deps/base/check_op.h rename to whitebox/chromium_deps/base/check_op.h diff --git a/chromium_deps/base/logging.h b/whitebox/chromium_deps/base/logging.h similarity index 100% rename from chromium_deps/base/logging.h rename to whitebox/chromium_deps/base/logging.h diff --git a/chromium_deps/cdm/keys/BUILD b/whitebox/chromium_deps/cdm/keys/BUILD similarity index 100% rename from chromium_deps/cdm/keys/BUILD rename to whitebox/chromium_deps/cdm/keys/BUILD diff --git a/chromium_deps/cdm/keys/certs.h b/whitebox/chromium_deps/cdm/keys/certs.h similarity index 100% rename from chromium_deps/cdm/keys/certs.h rename to whitebox/chromium_deps/cdm/keys/certs.h diff --git a/chromium_deps/cdm/keys/dev_rsa_drm_certificate.cc b/whitebox/chromium_deps/cdm/keys/dev_rsa_drm_certificate.cc similarity index 100% rename from chromium_deps/cdm/keys/dev_rsa_drm_certificate.cc rename to whitebox/chromium_deps/cdm/keys/dev_rsa_drm_certificate.cc diff --git a/chromium_deps/cdm/protos/BUILD b/whitebox/chromium_deps/cdm/protos/BUILD similarity index 100% rename from chromium_deps/cdm/protos/BUILD rename to whitebox/chromium_deps/cdm/protos/BUILD diff --git a/chromium_deps/cdm/protos/defs/BUILD b/whitebox/chromium_deps/cdm/protos/defs/BUILD similarity index 100% rename from chromium_deps/cdm/protos/defs/BUILD rename to whitebox/chromium_deps/cdm/protos/defs/BUILD diff --git a/chromium_deps/cdm/protos/defs/certificate_provisioning.proto b/whitebox/chromium_deps/cdm/protos/defs/certificate_provisioning.proto similarity index 100% rename from chromium_deps/cdm/protos/defs/certificate_provisioning.proto rename to whitebox/chromium_deps/cdm/protos/defs/certificate_provisioning.proto diff --git a/chromium_deps/cdm/protos/defs/client_identification.proto b/whitebox/chromium_deps/cdm/protos/defs/client_identification.proto similarity index 100% rename from chromium_deps/cdm/protos/defs/client_identification.proto rename to whitebox/chromium_deps/cdm/protos/defs/client_identification.proto diff --git a/chromium_deps/cdm/protos/defs/license_protocol.proto b/whitebox/chromium_deps/cdm/protos/defs/license_protocol.proto similarity index 100% rename from chromium_deps/cdm/protos/defs/license_protocol.proto rename to whitebox/chromium_deps/cdm/protos/defs/license_protocol.proto diff --git a/chromium_deps/cdm/protos/defs/remote_attestation.proto b/whitebox/chromium_deps/cdm/protos/defs/remote_attestation.proto similarity index 100% rename from chromium_deps/cdm/protos/defs/remote_attestation.proto rename to whitebox/chromium_deps/cdm/protos/defs/remote_attestation.proto diff --git a/chromium_deps/cdm/protos/license_protocol.pb.h b/whitebox/chromium_deps/cdm/protos/license_protocol.pb.h similarity index 100% rename from chromium_deps/cdm/protos/license_protocol.pb.h rename to whitebox/chromium_deps/cdm/protos/license_protocol.pb.h diff --git a/chromium_deps/testing/BUILD b/whitebox/chromium_deps/testing/BUILD similarity index 100% rename from chromium_deps/testing/BUILD rename to whitebox/chromium_deps/testing/BUILD diff --git a/chromium_deps/testing/include/gmock/BUILD b/whitebox/chromium_deps/testing/include/gmock/BUILD similarity index 100% rename from chromium_deps/testing/include/gmock/BUILD rename to whitebox/chromium_deps/testing/include/gmock/BUILD diff --git a/chromium_deps/testing/include/gmock/gmock.h b/whitebox/chromium_deps/testing/include/gmock/gmock.h similarity index 100% rename from chromium_deps/testing/include/gmock/gmock.h rename to whitebox/chromium_deps/testing/include/gmock/gmock.h diff --git a/chromium_deps/testing/include/gtest/BUILD b/whitebox/chromium_deps/testing/include/gtest/BUILD similarity index 100% rename from chromium_deps/testing/include/gtest/BUILD rename to whitebox/chromium_deps/testing/include/gtest/BUILD diff --git a/chromium_deps/testing/include/gtest/gtest.h b/whitebox/chromium_deps/testing/include/gtest/gtest.h similarity index 100% rename from chromium_deps/testing/include/gtest/gtest.h rename to whitebox/chromium_deps/testing/include/gtest/gtest.h diff --git a/chromium_deps/third_party/boringssl/BUILD b/whitebox/chromium_deps/third_party/boringssl/BUILD similarity index 100% rename from chromium_deps/third_party/boringssl/BUILD rename to whitebox/chromium_deps/third_party/boringssl/BUILD diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/aead.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/aead.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/aead.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/aead.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/aes.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/aes.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/aes.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/aes.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/bio.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/bio.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/bio.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/bio.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/bn.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/bn.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/bn.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/bn.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/bytestring.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/bytestring.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/bytestring.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/bytestring.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/cmac.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/cmac.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/cmac.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/cmac.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/err.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/err.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/err.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/err.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/evp.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/evp.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/evp.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/evp.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/hmac.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/hmac.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/hmac.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/hmac.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/mem.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/mem.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/mem.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/mem.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/pem.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/pem.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/pem.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/pem.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/rand.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/rand.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/rand.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/rand.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/rsa.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/rsa.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/rsa.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/rsa.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/sha.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/sha.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/sha.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/sha.h diff --git a/chromium_deps/third_party/boringssl/src/include/openssl/x509.h b/whitebox/chromium_deps/third_party/boringssl/src/include/openssl/x509.h similarity index 100% rename from chromium_deps/third_party/boringssl/src/include/openssl/x509.h rename to whitebox/chromium_deps/third_party/boringssl/src/include/openssl/x509.h diff --git a/crypto_utils/BUILD b/whitebox/crypto_utils/BUILD similarity index 100% rename from crypto_utils/BUILD rename to whitebox/crypto_utils/BUILD diff --git a/crypto_utils/aes_cbc_decryptor.cc b/whitebox/crypto_utils/aes_cbc_decryptor.cc similarity index 100% rename from crypto_utils/aes_cbc_decryptor.cc rename to whitebox/crypto_utils/aes_cbc_decryptor.cc diff --git a/crypto_utils/aes_cbc_decryptor.h b/whitebox/crypto_utils/aes_cbc_decryptor.h similarity index 100% rename from crypto_utils/aes_cbc_decryptor.h rename to whitebox/crypto_utils/aes_cbc_decryptor.h diff --git a/crypto_utils/aes_cbc_decryptor_test.cc b/whitebox/crypto_utils/aes_cbc_decryptor_test.cc similarity index 100% rename from crypto_utils/aes_cbc_decryptor_test.cc rename to whitebox/crypto_utils/aes_cbc_decryptor_test.cc diff --git a/crypto_utils/aes_cbc_encryptor.cc b/whitebox/crypto_utils/aes_cbc_encryptor.cc similarity index 100% rename from crypto_utils/aes_cbc_encryptor.cc rename to whitebox/crypto_utils/aes_cbc_encryptor.cc diff --git a/crypto_utils/aes_cbc_encryptor.h b/whitebox/crypto_utils/aes_cbc_encryptor.h similarity index 100% rename from crypto_utils/aes_cbc_encryptor.h rename to whitebox/crypto_utils/aes_cbc_encryptor.h diff --git a/crypto_utils/aes_cbc_encryptor_test.cc b/whitebox/crypto_utils/aes_cbc_encryptor_test.cc similarity index 100% rename from crypto_utils/aes_cbc_encryptor_test.cc rename to whitebox/crypto_utils/aes_cbc_encryptor_test.cc diff --git a/crypto_utils/aes_ctr_encryptor.cc b/whitebox/crypto_utils/aes_ctr_encryptor.cc similarity index 100% rename from crypto_utils/aes_ctr_encryptor.cc rename to whitebox/crypto_utils/aes_ctr_encryptor.cc diff --git a/crypto_utils/aes_ctr_encryptor.h b/whitebox/crypto_utils/aes_ctr_encryptor.h similarity index 100% rename from crypto_utils/aes_ctr_encryptor.h rename to whitebox/crypto_utils/aes_ctr_encryptor.h diff --git a/crypto_utils/aes_ctr_encryptor_test.cc b/whitebox/crypto_utils/aes_ctr_encryptor_test.cc similarity index 100% rename from crypto_utils/aes_ctr_encryptor_test.cc rename to whitebox/crypto_utils/aes_ctr_encryptor_test.cc diff --git a/crypto_utils/crypto_util.cc b/whitebox/crypto_utils/crypto_util.cc similarity index 100% rename from crypto_utils/crypto_util.cc rename to whitebox/crypto_utils/crypto_util.cc diff --git a/crypto_utils/crypto_util.h b/whitebox/crypto_utils/crypto_util.h similarity index 100% rename from crypto_utils/crypto_util.h rename to whitebox/crypto_utils/crypto_util.h diff --git a/crypto_utils/crypto_util_test.cc b/whitebox/crypto_utils/crypto_util_test.cc similarity index 100% rename from crypto_utils/crypto_util_test.cc rename to whitebox/crypto_utils/crypto_util_test.cc diff --git a/crypto_utils/openssl_util.h b/whitebox/crypto_utils/openssl_util.h similarity index 100% rename from crypto_utils/openssl_util.h rename to whitebox/crypto_utils/openssl_util.h diff --git a/crypto_utils/private_key_util.h b/whitebox/crypto_utils/private_key_util.h similarity index 100% rename from crypto_utils/private_key_util.h rename to whitebox/crypto_utils/private_key_util.h diff --git a/crypto_utils/random_util.cc b/whitebox/crypto_utils/random_util.cc similarity index 100% rename from crypto_utils/random_util.cc rename to whitebox/crypto_utils/random_util.cc diff --git a/crypto_utils/random_util.h b/whitebox/crypto_utils/random_util.h similarity index 100% rename from crypto_utils/random_util.h rename to whitebox/crypto_utils/random_util.h diff --git a/crypto_utils/random_util_test.cc b/whitebox/crypto_utils/random_util_test.cc similarity index 100% rename from crypto_utils/random_util_test.cc rename to whitebox/crypto_utils/random_util_test.cc diff --git a/crypto_utils/rsa_key.cc b/whitebox/crypto_utils/rsa_key.cc similarity index 100% rename from crypto_utils/rsa_key.cc rename to whitebox/crypto_utils/rsa_key.cc diff --git a/crypto_utils/rsa_key.h b/whitebox/crypto_utils/rsa_key.h similarity index 100% rename from crypto_utils/rsa_key.h rename to whitebox/crypto_utils/rsa_key.h diff --git a/crypto_utils/rsa_key_test.cc b/whitebox/crypto_utils/rsa_key_test.cc similarity index 100% rename from crypto_utils/rsa_key_test.cc rename to whitebox/crypto_utils/rsa_key_test.cc diff --git a/crypto_utils/rsa_test_keys.cc b/whitebox/crypto_utils/rsa_test_keys.cc similarity index 100% rename from crypto_utils/rsa_test_keys.cc rename to whitebox/crypto_utils/rsa_test_keys.cc diff --git a/crypto_utils/rsa_test_keys.h b/whitebox/crypto_utils/rsa_test_keys.h similarity index 100% rename from crypto_utils/rsa_test_keys.h rename to whitebox/crypto_utils/rsa_test_keys.h diff --git a/crypto_utils/rsa_util.cc b/whitebox/crypto_utils/rsa_util.cc similarity index 100% rename from crypto_utils/rsa_util.cc rename to whitebox/crypto_utils/rsa_util.cc diff --git a/crypto_utils/rsa_util.h b/whitebox/crypto_utils/rsa_util.h similarity index 100% rename from crypto_utils/rsa_util.h rename to whitebox/crypto_utils/rsa_util.h diff --git a/crypto_utils/rsa_util_test.cc b/whitebox/crypto_utils/rsa_util_test.cc similarity index 100% rename from crypto_utils/rsa_util_test.cc rename to whitebox/crypto_utils/rsa_util_test.cc diff --git a/crypto_utils/sha_util.cc b/whitebox/crypto_utils/sha_util.cc similarity index 100% rename from crypto_utils/sha_util.cc rename to whitebox/crypto_utils/sha_util.cc diff --git a/crypto_utils/sha_util.h b/whitebox/crypto_utils/sha_util.h similarity index 100% rename from crypto_utils/sha_util.h rename to whitebox/crypto_utils/sha_util.h diff --git a/crypto_utils/sha_util_test.cc b/whitebox/crypto_utils/sha_util_test.cc similarity index 100% rename from crypto_utils/sha_util_test.cc rename to whitebox/crypto_utils/sha_util_test.cc diff --git a/external/BUILD b/whitebox/external/BUILD similarity index 100% rename from external/BUILD rename to whitebox/external/BUILD diff --git a/external/odk.BUILD b/whitebox/external/odk.BUILD similarity index 98% rename from external/odk.BUILD rename to whitebox/external/odk.BUILD index 3d8ab53..2f63bb8 100644 --- a/external/odk.BUILD +++ b/whitebox/external/odk.BUILD @@ -54,7 +54,7 @@ cc_library( ], deps = [ ":core", - "@//odk_deps" + "@whitebox//odk_deps" ], includes = [ "oemcrypto/odk/include", diff --git a/impl/reference/BUILD b/whitebox/impl/reference/BUILD similarity index 68% rename from impl/reference/BUILD rename to whitebox/impl/reference/BUILD index d8a3a7b..b7fba73 100644 --- a/impl/reference/BUILD +++ b/whitebox/impl/reference/BUILD @@ -38,35 +38,6 @@ cc_library( ], ) -# Create a shared library of the whole api. The library will appear in the -# target specific directory under "//bazel-bin". -# -# In order for this to work, the white-box source needs to be in `srcs`. If it -# was included via `deps`, when the library is loaded, the symbols will be -# missing. -cc_binary( - name = "whiteboxapi", - srcs = [ - "aead_whitebox_impl.cc", - "license_whitebox_impl.cc", - ], - linkshared = True, - deps = [ - ":memory_util", - "//api:aead_whitebox", - "//api:license_whitebox", - "//api:result", - "//chromium_deps/cdm/keys:dev_certs", - "//chromium_deps/cdm/protos:license_protocol_proto", - "//chromium_deps/third_party/boringssl", - "//crypto_utils:aes_cbc_decryptor", - "//crypto_utils:aes_ctr_encryptor", - "//crypto_utils:crypto_util", - "//crypto_utils:rsa_key", - "//external:odk", - ], -) - cc_library( name = "test_data", testonly = True, @@ -105,7 +76,6 @@ cc_test( deps = [ ":license_whitebox", ":test_data", - "//api:license_whitebox_core_message_test", "//api:license_whitebox_test", ], ) @@ -120,6 +90,18 @@ cc_test( ], ) +cc_test( + name = "license_whitebox_golden_data", + size = "small", + srcs = [ + "license_whitebox_golden_data_init_data.cc", + ], + deps = [ + ":license_whitebox", + "//api:license_whitebox_golden_data", + ], +) + cc_library( name = "memory_util", srcs = ["memory_util.cc"], diff --git a/impl/reference/aead_whitebox_impl.cc b/whitebox/impl/reference/aead_whitebox_impl.cc similarity index 100% rename from impl/reference/aead_whitebox_impl.cc rename to whitebox/impl/reference/aead_whitebox_impl.cc diff --git a/whitebox/impl/reference/license_whitebox_golden_data_init_data.cc b/whitebox/impl/reference/license_whitebox_golden_data_init_data.cc new file mode 100644 index 0000000..263d246 --- /dev/null +++ b/whitebox/impl/reference/license_whitebox_golden_data_init_data.cc @@ -0,0 +1,113 @@ +// Copyright 2020 Google LLC. All Rights Reserved. + +#include +#include + +namespace widevine { + +extern const uint8_t kLicenseWhiteboxInitData[] = { + 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, + 0xae, 0xa6, 0xa8, 0xea, 0xdd, 0xac, 0x6f, 0xb4, 0x41, 0x47, 0xcb, 0x18, + 0x81, 0xeb, 0xdf, 0x4f, 0x17, 0xf7, 0x17, 0xc0, 0xab, 0x6f, 0x47, 0x50, + 0xbf, 0xe4, 0x8c, 0xc9, 0x45, 0x24, 0x5e, 0x1c, 0x2e, 0x86, 0x9f, 0xcb, + 0x47, 0x05, 0xf9, 0xfe, 0x91, 0x90, 0xaf, 0xbd, 0x22, 0x14, 0x47, 0xa7, + 0x34, 0x39, 0x79, 0x44, 0xe9, 0x92, 0x83, 0x4a, 0x80, 0xa8, 0x2a, 0xe6, + 0x9f, 0x2b, 0xb7, 0xda, 0x2a, 0xd2, 0xae, 0x57, 0x5b, 0xfa, 0xb6, 0xdf, + 0xca, 0x3e, 0xb1, 0xb8, 0x42, 0x0b, 0xde, 0x46, 0x36, 0xdb, 0x42, 0x33, + 0x8b, 0xda, 0x5c, 0x60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x6e, 0xad, 0x93, 0x79, 0x35, 0x87, 0x9a, + 0x41, 0xcc, 0x06, 0x24, 0xf0, 0x62, 0x09, 0xfe, 0x46, 0x9a, 0x38, 0xee, + 0xc0, 0xc8, 0x08, 0xce, 0x65, 0xda, 0xe4, 0x89, 0x1a, 0xfb, 0xe9, 0x53, + 0x0c, 0xd1, 0x80, 0x40, 0xfd, 0xc4, 0x97, 0xf8, 0x19, 0x4e, 0x03, 0x90, + 0x4a, 0xda, 0xfd, 0x13, 0x27, 0x89, 0xde, 0x12, 0x8d, 0x52, 0x5a, 0x07, + 0xf1, 0x9a, 0xa4, 0x54, 0x98, 0x86, 0xb2, 0x78, 0x76, 0xbf, 0x3a, 0xa9, + 0x8b, 0xed, 0xc7, 0x8b, 0x31, 0x02, 0x81, 0x81, 0x00, 0xe2, 0xf3, 0xab, + 0x53, 0x7b, 0xee, 0x36, 0xdb, 0xca, 0xa8, 0x74, 0x03, 0xdd, 0xe2, 0xce, + 0x87, 0xe2, 0x8c, 0x55, 0x8e, 0xd4, 0x0f, 0x32, 0xec, 0xd2, 0xf9, 0x8b, + 0x1f, 0x93, 0xdb, 0x84, 0xd2, 0x42, 0xe1, 0xc7, 0x21, 0x24, 0x2e, 0x36, + 0x0c, 0x02, 0x5d, 0x49, 0xea, 0xe0, 0x42, 0xd7, 0x7a, 0x3e, 0xc8, 0x51, + 0x92, 0x39, 0x56, 0x10, 0xd7, 0x90, 0x67, 0xa3, 0x34, 0xd6, 0xc2, 0x4a, + 0x33, 0x74, 0xfd, 0xe2, 0x7e, 0xe1, 0x3e, 0x59, 0xd7, 0x36, 0x6d, 0x7d, + 0xd4, 0xd8, 0x82, 0xfb, 0x2f, 0x1e, 0x5e, 0x32, 0xcd, 0xc3, 0x0a, 0x7f, + 0xbd, 0xb0, 0xb3, 0xf9, 0x77, 0x75, 0xb9, 0x0c, 0x63, 0x54, 0xff, 0x25, + 0xa3, 0xaf, 0x4a, 0x70, 0x61, 0x32, 0x91, 0xde, 0xf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0x6a, 0x73, 0x10}; + +extern const size_t kLicenseWhiteboxInitDataSize = + sizeof(kLicenseWhiteboxInitData); + +} // namespace widevine diff --git a/impl/reference/license_whitebox_impl.cc b/whitebox/impl/reference/license_whitebox_impl.cc similarity index 95% rename from impl/reference/license_whitebox_impl.cc rename to whitebox/impl/reference/license_whitebox_impl.cc index d370f90..58574a1 100644 --- a/impl/reference/license_whitebox_impl.cc +++ b/whitebox/impl/reference/license_whitebox_impl.cc @@ -202,11 +202,29 @@ namespace { // For simplicity we use a basic pad but we use a different byte for each // position as we need to support abirtary indexes and we want to make sure that // a wrong index will actually trigger a failure. -const uint8_t kSecretStringPattern[] = { +// +// Use a different pattern for CBC than for CTR to ensure that mixing them will +// fail. An implementation can use a different string per key and per cipher +// mode. +const uint8_t kCBCSecretStringPattern[] = { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, }; -const size_t kSecretStringPatternSize = sizeof(kSecretStringPattern); + +const uint8_t kCTRSecretStringPattern[] = { + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, +}; + +std::vector GetSecretStringFor(WB_CipherMode mode) { + return mode == WB_CIPHER_MODE_CBC ? + std::vector( + kCBCSecretStringPattern, + kCBCSecretStringPattern + sizeof(kCBCSecretStringPattern)) : + std::vector( + kCTRSecretStringPattern, + kCTRSecretStringPattern + sizeof(kCTRSecretStringPattern)); +} const ContentKey* FindKey(const WB_License_Whitebox* whitebox, const uint8_t* id, @@ -425,7 +443,7 @@ WB_Result WB_License_ProcessLicenseResponse(WB_License_Whitebox* whitebox, return WB_RESULT_INVALID_STATE; } - if (message_size == 0 || session_key_size == 0 || license_request_size == 0) { + if (message_size == 0 || license_request_size == 0) { DVLOG(1) << "Invalid parameter: array size 0."; return WB_RESULT_INVALID_PARAMETER; } @@ -436,12 +454,21 @@ WB_Result WB_License_ProcessLicenseResponse(WB_License_Whitebox* whitebox, return WB_RESULT_INVALID_PARAMETER; } + if (session_key_size != 256) { + DVLOG(1) << "Invalid parameter: invalid session key size."; + return WB_RESULT_INVALID_PARAMETER; + } + + // From talking with Intertrust, they suggested allowing an invalid session + // key to propogate through the system, leading to the message verification + // failing. While we could do that, in the reference, we opt to just return + // the signature error now. std::string decrypted_session_key; if (!whitebox->key->Decrypt( std::string(session_key, session_key + session_key_size), &decrypted_session_key)) { DVLOG(1) << "Invalid parameter: invalid session key."; - return WB_RESULT_INVALID_PARAMETER; + return WB_RESULT_INVALID_SIGNATURE; } std::string signing_key_material = widevine::crypto_util::DeriveKey( @@ -788,14 +815,15 @@ WB_Result WB_License_GetSecretString(const WB_License_Whitebox* whitebox, return WB_RESULT_INSUFFICIENT_SECURITY_LEVEL; } - if (!widevine::MemCopy(kSecretStringPattern, kSecretStringPatternSize, + const auto secret_pattern = GetSecretStringFor(mode); + if (!widevine::MemCopy(secret_pattern.data(), secret_pattern.size(), secret_string, *secret_string_size)) { - DVLOG(1) << "Buffer too small: needs " << kSecretStringPatternSize << "."; - *secret_string_size = kSecretStringPatternSize; + DVLOG(1) << "Buffer too small: needs " << secret_pattern.size() << "."; + *secret_string_size = secret_pattern.size(); return WB_RESULT_BUFFER_TOO_SMALL; } - *secret_string_size = kSecretStringPatternSize; + *secret_string_size = secret_pattern.size(); return WB_RESULT_OK; } @@ -900,11 +928,10 @@ WB_Result WB_License_MaskedDecrypt(const WB_License_Whitebox* whitebox, // Now apply the masking function to the data. This logic must be mirrored in // Unmask(). - const uint8_t* mask = kSecretStringPattern; - const size_t mask_size = kSecretStringPatternSize; + const auto mask = GetSecretStringFor(mode); for (size_t i = 0; i < output.size(); ++i) { masked_output_data[i] = - InverseMaskingFunction1(output[i] ^ mask[i % mask_size]); + InverseMaskingFunction1(output[i] ^ mask[i % mask.size()]); } return WB_RESULT_OK; diff --git a/impl/reference/memory_util.cc b/whitebox/impl/reference/memory_util.cc similarity index 100% rename from impl/reference/memory_util.cc rename to whitebox/impl/reference/memory_util.cc diff --git a/impl/reference/memory_util.h b/whitebox/impl/reference/memory_util.h similarity index 100% rename from impl/reference/memory_util.h rename to whitebox/impl/reference/memory_util.h diff --git a/impl/reference/test_data.cc b/whitebox/impl/reference/test_data.cc similarity index 100% rename from impl/reference/test_data.cc rename to whitebox/impl/reference/test_data.cc diff --git a/odk_deps/BUILD b/whitebox/odk_deps/BUILD similarity index 100% rename from odk_deps/BUILD rename to whitebox/odk_deps/BUILD diff --git a/odk_deps/license_protocol.pb.h b/whitebox/odk_deps/license_protocol.pb.h similarity index 100% rename from odk_deps/license_protocol.pb.h rename to whitebox/odk_deps/license_protocol.pb.h diff --git a/whitebox/resources/7912.txt b/whitebox/resources/7912.txt new file mode 100644 index 0000000..23dcf0c --- /dev/null +++ b/whitebox/resources/7912.txt @@ -0,0 +1,358 @@ + +const uint8_t kSignedDrmCertificate[] = { + 0x0a, 0xb0, 0x02, 0x08, 0x02, 0x12, 0x10, 0x0c, + 0x36, 0x48, 0x86, 0x75, 0xa1, 0x84, 0x53, 0x4d, + 0xbc, 0x55, 0x96, 0xc9, 0xf4, 0xaf, 0x0a, 0x18, + 0x97, 0xe7, 0xdd, 0xf8, 0x05, 0x22, 0x8e, 0x02, + 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xae, 0xa6, 0xa8, 0xea, 0xdd, 0xac, 0x6f, + 0xb4, 0x41, 0x47, 0xcb, 0x18, 0x81, 0xeb, 0xdf, + 0x4f, 0x17, 0xf7, 0x17, 0xc0, 0xab, 0x6f, 0x47, + 0x50, 0xbf, 0xe4, 0x8c, 0xc9, 0x45, 0x24, 0x5e, + 0x1c, 0x2e, 0x86, 0x9f, 0xcb, 0x47, 0x05, 0xf9, + 0xfe, 0x91, 0x90, 0xaf, 0xbd, 0x22, 0x14, 0x47, + 0xa7, 0x34, 0x39, 0x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, 0x51, + 0x7e, 0xbb, 0x55, 0x6d, 0xcc, 0x97, 0x38, 0xdb, + 0xa4, 0x4b, 0x96, 0x40, 0xe5, 0x2d, 0x8f, 0x43, + 0xe3, 0x21, 0x15, 0xda, 0x34, 0x97, 0x7a, 0x9e, + 0xbb, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x48, 0x01, 0x12, 0x80, 0x02, 0xa2, 0x05, + 0x30, 0x91, 0xed, 0xc2, 0x17, 0xfd, 0x92, 0x5c, + 0x69, 0x1f, 0xb4, 0x82, 0x35, 0x75, 0xcb, 0x48, + 0x22, 0x07, 0x54, 0x72, 0x05, 0x86, 0x2e, 0xa1, + 0x98, 0xc9, 0x46, 0x07, 0xc9, 0x26, 0x6b, 0x05, + 0x56, 0xa2, 0xa6, 0x5b, 0xe3, 0xba, 0x80, 0xd0, + 0x01, 0xb3, 0xbd, 0x9f, 0x7b, 0x15, 0xe3, 0xe6, + 0xad, 0x85, 0xe6, 0x92, 0x35, 0xec, 0x9b, 0x18, + 0x7e, 0x1d, 0x39, 0x93, 0xfb, 0x0b, 0x2c, 0xe8, + 0xa0, 0xee, 0x6e, 0x27, 0x8f, 0x08, 0x99, 0xc7, + 0xd6, 0x08, 0x1f, 0xe5, 0xd4, 0x9b, 0x30, 0x83, + 0x31, 0xf8, 0x49, 0x05, 0x9b, 0xa0, 0x30, 0xaa, + 0xc1, 0x61, 0xd4, 0xec, 0x81, 0x28, 0xe1, 0x80, + 0x17, 0x09, 0xdc, 0x35, 0xb8, 0xdc, 0xd3, 0x46, + 0x7b, 0xa6, 0xad, 0x44, 0x90, 0x17, 0x99, 0x8e, + 0x43, 0xd4, 0x35, 0x00, 0x98, 0x6c, 0xe5, 0xc3, + 0x2e, 0xad, 0x80, 0xa6, 0x35, 0x3e, 0xed, 0xb2, + 0x22, 0xe0, 0xad, 0x8a, 0xd0, 0x1a, 0x5e, 0x27, + 0x29, 0xe2, 0xd9, 0x01, 0x2d, 0xf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0x04, + 0x51, 0x6a, 0x75, 0x10, 0xd3, 0x80, 0x21, 0xa5, + 0x62, 0x9b, 0x9a, 0xa0, 0x27, 0xae, 0xad, 0x3c, + 0x75, 0x9b, 0x7a, 0xfe, 0x70, 0xbe, 0xd6, 0x5f, + 0x3d, 0xf6, 0x86, 0x0f, 0xf5, 0xeb, 0x60, 0xb9, + 0x83, 0xa3, 0xff, 0xa3, 0x3f, 0xde, 0x06, 0xf3, + 0xb7, 0x30, 0x14, 0xdf, 0xc8, 0x45, 0xab, 0x37, + 0x1c, 0x66, 0x00, 0x56, 0x2e, 0x9d, 0x90, 0x4f, + 0x84, 0x2b, 0x8b, 0xa4, 0xa5, 0xd9, 0x20, 0x0f, + 0xfa, 0x3e, 0xd4, 0x5d, 0x70, 0x55, 0x20, 0xa5, + 0xc3, 0x72, 0xa8, 0x89, 0xf9, 0xe3, 0x14, 0x38, + 0x62, 0x34, 0xc6, 0x89, 0x7a, 0xe6, 0x55, 0x85, + 0x1f, 0xcd, 0x9a, 0xdb, 0x4e, 0xf9, 0x12, 0x6c, + 0x78, 0x38, 0x6e, 0xa9, 0x3b, 0xcb, 0x25, 0xba, + 0x3e, 0xc4, 0x75, 0xc5, 0x5c, 0x60, 0x8e, 0x77, + 0x1c, 0x76, 0x3a, 0xb0, 0x25, 0x06, 0xf9, 0xb0, + 0x72, 0x52, 0xd6, 0xab, 0xf7, 0xea, 0x64, 0xb1, + 0xeb, 0xde, 0x7b, 0x95, 0xc6, 0x40, 0x76, 0x90, + 0x53, 0x3b, 0xd6, 0x89, 0x0b, 0x92, 0x74, 0xc1, + 0x60, 0x66, 0xf7, 0x4f, 0xc4, 0x01, 0xea, 0x35, + 0x5f, 0x0a, 0x02, 0x10, 0x68, 0x14, 0xd4, 0x9b, + 0xf0, 0xc8, 0x9e, 0x6e, 0x1f, 0x8d, 0xb2, 0xa4, + 0x78, 0x41, 0xcd, 0x0d, 0xad, 0x79, 0x32, 0x96, + 0xa1, 0x07, 0xc3, 0x62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0x10, 0x1e, 0xb8, 0xa4, 0x14, 0x8b, 0x9c, + 0x29, 0xce, 0xd5, 0xea, 0xd6, 0x45, 0xa9, 0x5b, + 0x69, 0x8f, 0x1c, 0xdc, 0x6e, 0x1d, 0xb6, 0x67, + 0x8b, 0x85, 0x07, 0x41, 0x86, 0x08, 0x0d, 0x68, + 0xd1, 0x3c, 0xd3, 0x7e, 0x07, 0xb1, 0x6d, 0xe3, + 0x70, 0xcd, 0x9a, 0xfb, 0x9b, 0x25, 0x56, 0x4a, + 0x73, 0xa3, 0x0e, 0x2a, 0xf8, 0x08, 0x5e, 0xa3, + 0x7d, 0x31, 0x0c, 0x47, 0x4f, 0x0e, 0x67, 0xac, + 0x00, 0xca, 0x99, 0x2a, 0x52, 0x96, 0xfa, 0xed, + 0xad, 0x7a, 0xa0, 0x6e, 0xcd, 0x79, 0x0f, 0x1e, + 0x3d, 0x42, 0x65, 0x58, 0xfa, 0x98, 0x38, 0x3e, + 0x3c, 0xd2, 0xed, 0x48, 0x30 }; + +Certificate: 0ab002080212100c36488675a184534dbc5596c9f4af0a1897e7ddf805228e023082010a0282010100aea6a8eaddac6fb44147cb1881ebdf4f17f717c0ab6f4750bfe48cc945245e1c2e869fcb4705f9fe9190afbd221447a734397944e992834a80a82ae69f2bb7da2ad2ae575bfab6dfca3eb1b8420bde4636db42338bda5c60447c99b498b41ed8256d6784c967de05e606b5b5cabcfab0a746293f63479d708da28d22c6eb06d45c3b6298c7da168f1759d5cbd15de3e107e69787f42253faf9a9f5ebd755df322d4e0786254493d6f7c6f97891241ed46be34aff4a3ab989906187b9414502fdd0c55a984188a4e3e2a29d9a903f448e3ae1d1e9799ac6e27c8e9c3db2e0265a4613c8439ff7517ebb556dcc9738dba44b9640e52d8f43e32115da34977a9ebb020301000128e83d4801128002a2053091edc217fd925c691fb4823575cb482207547205862ea198c94607c9266b0556a2a65be3ba80d001b3bd9f7b15e3e6ad85e69235ec9b187e1d3993fb0b2ce8a0ee6e278f0899c7d6081fe5d49b308331f849059ba030aac161d4ec8128e1801709dc35b8dcd3467ba6ad449017998e43d43500986ce5c32ead80a6353eedb222e0ad8ad01a5e2729e2d9012df3e8b8a56d8bfb1c8e77a1e08e641bfb3a052f966fe786ff758fdf3df42d7afc760df1de60e74bc187b03fa3e637f1f00a9e99e27f6a99e1de2c238dc62de84d4a2b02f2c1eaae9d2fb3ee84e9b8e47b62479cf0ed8037cf92c5aebb3231b4d7c4cea34eb6d6e9725fd1e5a0f1fb79b1a81ab4050aae020801121065802c9b625e5a319c33dc1cb7c3c6d418e3a5bdd005228e023082010a0282010100b80502043c2a8a0fd8d25c613e1e3e3b5e349f332f04516a7510d38021a5629b9aa027aead3c759b7afe70bed65f3df6860ff5eb60b983a3ffa33fde06f3b73014dfc845ab371c6600562e9d904f842b8ba4a5d9200ffa3ed45d705520a5c372a889f9e314386234c6897ae655851fcd9adb4ef9126c78386ea93bcb25ba3ec475c55c608e771c763ab02506f9b07252d6abf7ea64b1ebde7b95c6407690533bd6890b9274c16066f74fc401ea355f0a02106814d49bf0c89e6e1f8db2a47841cd0dad793296a107c36223404f2bf1fca16fd0a4b982634db62407f8f14acae3b05a038bd3e4bbbae4391bbfa7a47fb9d01de857ea88e5e36ee36e245859fc0f020301000128e83d1280037e06581a019184ab572afdcaddd03f161ce68200f8e6f8ad161947360bc8d49c0d68009b1c4644f9b3f3fb6ddfd92ef92de62d41d459d29d81bfaef3970a3a39d25b2662ecb03b2da7b68302faa6dd98d95a143cc8c1cb6adda76d2ee9c3723faf95a29cdc3e968b6821a91c051ca280a86669710a1ad7a44bf9218027460df694e2e9270396df221963f21ee6aa220a5ee4a4d0feb3d53eb5732f8f91e9a96b3b8be284c51339ea284d4d0edd55b6ad56f7416420e05e059f9734a96be25aa44560dba8c38755a42a82bd7f88edd19df346a667b33b8114c76a8838c423d824a50b23251a088136d6e8f475299d2afd46cea51b5cbdf789a572125cd24fbb813b387a10cd2a30e3447634ab3408f96b9cf3d98896d405f3f540d9c57962760fcd177cdd101eb8a4148b9c29ced5ead645a95b698f1cdc6e1db6678b85074186080d68d13cd37e07b16de370cd9afb9b25564a73a30e2af8085ea37d310c474f0e67ac00ca992a5296faedad7aa06ecd790f1e3d426558fa98383e3cd2ed4830 + +const uint8_t kDevicePublicKey[] = { + 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xae, 0xa6, 0xa8, 0xea, 0xdd, 0xac, 0x6f, + 0xb4, 0x41, 0x47, 0xcb, 0x18, 0x81, 0xeb, 0xdf, + 0x4f, 0x17, 0xf7, 0x17, 0xc0, 0xab, 0x6f, 0x47, + 0x50, 0xbf, 0xe4, 0x8c, 0xc9, 0x45, 0x24, 0x5e, + 0x1c, 0x2e, 0x86, 0x9f, 0xcb, 0x47, 0x05, 0xf9, + 0xfe, 0x91, 0x90, 0xaf, 0xbd, 0x22, 0x14, 0x47, + 0xa7, 0x34, 0x39, 0x79, 0x44, 0xe9, 0x92, 0x83, + 0x4a, 0x80, 0xa8, 0x2a, 0xe6, 0x9f, 0x2b, 0xb7, + 0xda, 0x2a, 0xd2, 0xae, 0x57, 0x5b, 0xfa, 0xb6, + 0xdf, 0xca, 0x3e, 0xb1, 0xb8, 0x42, 0x0b, 0xde, + 0x46, 0x36, 0xdb, 0x42, 0x33, 0x8b, 0xda, 0x5c, + 0x60, 0x44, 0x7c, 0x99, 0xb4, 0x98, 0xb4, 0x1e, + 0xd8, 0x25, 0x6d, 0x67, 0x84, 0xc9, 0x67, 0xde, + 0x05, 0xe6, 0x06, 0xb5, 0xb5, 0xca, 0xbc, 0xfa, + 0xb0, 0xa7, 0x46, 0x29, 0x3f, 0x63, 0x47, 0x9d, + 0x70, 0x8d, 0xa2, 0x8d, 0x22, 0xc6, 0xeb, 0x06, + 0xd4, 0x5c, 0x3b, 0x62, 0x98, 0xc7, 0xda, 0x16, + 0x8f, 0x17, 0x59, 0xd5, 0xcb, 0xd1, 0x5d, 0xe3, + 0xe1, 0x07, 0xe6, 0x97, 0x87, 0xf4, 0x22, 0x53, + 0xfa, 0xf9, 0xa9, 0xf5, 0xeb, 0xd7, 0x55, 0xdf, + 0x32, 0x2d, 0x4e, 0x07, 0x86, 0x25, 0x44, 0x93, + 0xd6, 0xf7, 0xc6, 0xf9, 0x78, 0x91, 0x24, 0x1e, + 0xd4, 0x6b, 0xe3, 0x4a, 0xff, 0x4a, 0x3a, 0xb9, + 0x89, 0x90, 0x61, 0x87, 0xb9, 0x41, 0x45, 0x02, + 0xfd, 0xd0, 0xc5, 0x5a, 0x98, 0x41, 0x88, 0xa4, + 0xe3, 0xe2, 0xa2, 0x9d, 0x9a, 0x90, 0x3f, 0x44, + 0x8e, 0x3a, 0xe1, 0xd1, 0xe9, 0x79, 0x9a, 0xc6, + 0xe2, 0x7c, 0x8e, 0x9c, 0x3d, 0xb2, 0xe0, 0x26, + 0x5a, 0x46, 0x13, 0xc8, 0x43, 0x9f, 0xf7, 0x51, + 0x7e, 0xbb, 0x55, 0x6d, 0xcc, 0x97, 0x38, 0xdb, + 0xa4, 0x4b, 0x96, 0x40, 0xe5, 0x2d, 0x8f, 0x43, + 0xe3, 0x21, 0x15, 0xda, 0x34, 0x97, 0x7a, 0x9e, + 0xbb, 0x02, 0x03, 0x01, 0x00, 0x01 }; + +Public key: 3082010a0282010100aea6a8eaddac6fb44147cb1881ebdf4f17f717c0ab6f4750bfe48cc945245e1c2e869fcb4705f9fe9190afbd221447a734397944e992834a80a82ae69f2bb7da2ad2ae575bfab6dfca3eb1b8420bde4636db42338bda5c60447c99b498b41ed8256d6784c967de05e606b5b5cabcfab0a746293f63479d708da28d22c6eb06d45c3b6298c7da168f1759d5cbd15de3e107e69787f42253faf9a9f5ebd755df322d4e0786254493d6f7c6f97891241ed46be34aff4a3ab989906187b9414502fdd0c55a984188a4e3e2a29d9a903f448e3ae1d1e9799ac6e27c8e9c3db2e0265a4613c8439ff7517ebb556dcc9738dba44b9640e52d8f43e32115da34977a9ebb0203010001 + +const uint8_t kDevicePrivateKey[] = { + 0x30, 0x82, 0x04, 0xbe, 0x02, 0x01, 0x00, 0x30, + 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x82, + 0x04, 0xa8, 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, + 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, 0xae, 0xa6, + 0xa8, 0xea, 0xdd, 0xac, 0x6f, 0xb4, 0x41, 0x47, + 0xcb, 0x18, 0x81, 0xeb, 0xdf, 0x4f, 0x17, 0xf7, + 0x17, 0xc0, 0xab, 0x6f, 0x47, 0x50, 0xbf, 0xe4, + 0x8c, 0xc9, 0x45, 0x24, 0x5e, 0x1c, 0x2e, 0x86, + 0x9f, 0xcb, 0x47, 0x05, 0xf9, 0xfe, 0x91, 0x90, + 0xaf, 0xbd, 0x22, 0x14, 0x47, 0xa7, 0x34, 0x39, + 0x79, 0x44, 0xe9, 0x92, 0x83, 0x4a, 0x80, 0xa8, + 0x2a, 0xe6, 0x9f, 0x2b, 0xb7, 0xda, 0x2a, 0xd2, + 0xae, 0x57, 0x5b, 0xfa, 0xb6, 0xdf, 0xca, 0x3e, + 0xb1, 0xb8, 0x42, 0x0b, 0xde, 0x46, 0x36, 0xdb, + 0x42, 0x33, 0x8b, 0xda, 0x5c, 0x60, 0x44, 0x7c, + 0x99, 0xb4, 0x98, 0xb4, 0x1e, 0xd8, 0x25, 0x6d, + 0x67, 0x84, 0xc9, 0x67, 0xde, 0x05, 0xe6, 0x06, + 0xb5, 0xb5, 0xca, 0xbc, 0xfa, 0xb0, 0xa7, 0x46, + 0x29, 0x3f, 0x63, 0x47, 0x9d, 0x70, 0x8d, 0xa2, + 0x8d, 0x22, 0xc6, 0xeb, 0x06, 0xd4, 0x5c, 0x3b, + 0x62, 0x98, 0xc7, 0xda, 0x16, 0x8f, 0x17, 0x59, + 0xd5, 0xcb, 0xd1, 0x5d, 0xe3, 0xe1, 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 0x04, 0x89, 0xfc, 0x01, 0x19, 0x3c, + 0xa3, 0x67, 0x6b, 0x94, 0xfb, 0x49, 0x35, 0x04, + 0x0e, 0xfe, 0xb8, 0x1f, 0xf1, 0x72, 0x08, 0xbd, + 0xb4, 0xd1, 0x53, 0x64, 0xc2, 0x25, 0x81, 0xfd, + 0xc4, 0xd3, 0xed, 0x22, 0xbd, 0xde, 0x9a, 0xce, + 0x04, 0x16, 0xff, 0x13, 0x17, 0x98, 0x3e, 0xc1, + 0x3b, 0xc7, 0x0d, 0x03, 0x1b, 0x82, 0xd8, 0x99, + 0x24, 0xd0, 0xdc, 0x30, 0xcf, 0xcd, 0x6e, 0x5e, + 0x9d, 0xfd, 0x51, 0x1e, 0xb8, 0x4e, 0x7b, 0x54, + 0x83, 0x9b, 0x4f, 0xf8, 0xa6, 0x03, 0xc1, 0x96, + 0xf1, 0x6d, 0xc0, 0xa7, 0x17, 0xbd, 0xf1, 0x60, + 0xcb, 0xe2, 0x05, 0xa5, 0x9b, 0x05, 0x2e, 0xaf, + 0xdc, 0xa7, 0x88, 0xde, 0x53, 0x42, 0xa9, 0xf4, + 0x0f, 0xae, 0xf9, 0x96, 0xe9, 0x2c, 0xa6, 0xe8, + 0x9d, 0x2c, 0x6b, 0xbc, 0xd8, 0x0f, 0x09, 0x5f, + 0x64, 0xb2, 0x21, 0x6f, 0xc0, 0x79, 0x3d, 0x6e, + 0xad, 0x93, 0x79, 0x35, 0x87, 0x9a, 0x41, 0xcc, + 0x06, 0x24, 0xf0, 0x62, 0x09, 0xfe, 0x46, 0x9a, + 0x38, 0xee, 0xc0, 0xc8, 0x08, 0xce, 0x65, 0xda, + 0xe4, 0x89, 0x1a, 0xfb, 0xe9, 0x53, 0x0c, 0xd1, + 0x80, 0x40, 0xfd, 0xc4, 0x97, 0xf8, 0x19, 0x4e, + 0x03, 0x90, 0x4a, 0xda, 0xfd, 0x13, 0x27, 0x89, + 0xde, 0x12, 0x8d, 0x52, 0x5a, 0x07, 0xf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 0x05, 0xa0, 0x4d, 0x3b, 0x1f, 0xa6, + 0xcc, 0x37, 0x7b, 0xb1, 0x46, 0xf2, 0xc7, 0x67, + 0xcd, 0xc1, 0x20, 0xc4, 0x14, 0xbd, 0x0e, 0x01, + 0xa7, 0xd6, 0x3c, 0xe8, 0x18, 0x9d, 0x71, 0x71, + 0x37, 0x2a, 0xc0, 0x45, 0x6a, 0x54, 0xe8, 0x63, + 0xf0, 0x6e, 0xd2, 0x9f, 0x95, 0x3b, 0xde, 0xb3, + 0xc5, 0x60, 0x57, 0x3d, 0xed, 0xef, 0x57, 0xcb, + 0x3d, 0x35, 0x3a, 0x2e, 0x5d, 0xb8, 0x0e, 0xf8, + 0xff, 0xd2, 0xca, 0xdd, 0xce, 0x0b, 0x10, 0x53, + 0xb4, 0xdb, 0x53, 0xf6, 0x02, 0xa5, 0xf1, 0x23, + 0x4d, 0x21, 0x6e, 0xc7, 0x52, 0x5a, 0x7a, 0x5d, + 0x88, 0x32, 0xa8, 0x65, 0x50, 0x21, 0xf5, 0x81, + 0x3f, 0x96, 0xd4, 0x57, 0x48, 0x66, 0xf3, 0x02, + 0x81, 0x81, 0x00, 0xdd, 0x83, 0xd6, 0x62, 0x9a, + 0xe1, 0x0c, 0xfc, 0x84, 0x96, 0xdc, 0xfd, 0xf5, + 0x31, 0xee, 0x42, 0x25, 0x76, 0xb1, 0xff, 0xc1, + 0xad, 0xc0, 0x17, 0xf5, 0x68, 0x8a, 0x49, 0x5d, + 0x08, 0xf3, 0x60, 0x42, 0xd5, 0x9a, 0x86, 0x17, + 0x89, 0x5f, 0x49, 0x63, 0x79, 0x68, 0xaf, 0x6f, + 0x0a, 0xee, 0xc4, 0xab, 0xc8, 0xdc, 0x0d, 0x6c, + 0x17, 0x3c, 0x43, 0x1a, 0xf8, 0x7d, 0x0d, 0x12, + 0xdc, 0xfa, 0x8d, 0xb5, 0x10, 0x25, 0x65, 0x90, + 0x36, 0x4a, 0x7c, 0x4b, 0xec, 0x9c, 0xd8, 0x06, + 0x27, 0xfa, 0x41, 0xa8, 0x53, 0x6b, 0x24, 0xf8, + 0xcd, 0x23, 0x97, 0xa3, 0x84, 0x56, 0xe7, 0x29, + 0xa9, 0x5f, 0x95, 0x08, 0x9e, 0x2d, 0x3f, 0xd1, + 0xd5, 0x47, 0x51, 0x27, 0x89, 0xc7, 0x6a, 0x29, + 0xce, 0x6e, 0x23, 0xce, 0x0c, 0xbd, 0x5d, 0xfc, + 0x4a, 0x9a, 0xb7, 0xe5, 0x59, 0x13, 0xc2, 0xe6, + 0xe3, 0xa1, 0xe9, 0x02, 0x81, 0x81, 0x00, 0xc3, + 0x6f, 0x98, 0xa4, 0xae, 0x97, 0xd7, 0xb9, 0xc6, + 0x0a, 0xc1, 0x43, 0xa8, 0xf4, 0x1f, 0x08, 0xfd, + 0x72, 0x81, 0xfa, 0x3b, 0x58, 0xcc, 0x3a, 0xf1, + 0x93, 0x54, 0xe0, 0x57, 0xf9, 0xa5, 0xf8, 0xad, + 0x69, 0x14, 0x75, 0xb2, 0x15, 0x77, 0x4d, 0xd8, + 0xad, 0xa6, 0xb5, 0x11, 0xb0, 0x9d, 0x28, 0xa2, + 0xfd, 0xd4, 0xac, 0x11, 0x78, 0x31, 0xe0, 0xd3, + 0x76, 0xee, 0x03, 0x56, 0x19, 0xb9, 0x67, 0xdd, + 0x95, 0x2c, 0xeb, 0xe8, 0x02, 0x8d, 0x25, 0x4e, + 0x64, 0x35, 0x41, 0xf7, 0x1e, 0xee, 0xfc, 0xc2, + 0x93, 0xd3, 0x15, 0x07, 0xe0, 0x53, 0x73, 0x0f, + 0x14, 0x03, 0x12, 0xdb, 0xdd, 0xc6, 0xde, 0x08, + 0x9c, 0x77, 0xa5, 0x20, 0x7d, 0xda, 0x0f, 0x91, + 0x7c, 0xb7, 0xf9, 0x04, 0xe5, 0xae, 0xfa, 0x8b, + 0x85, 0x4c, 0xf3, 0xff, 0xa5, 0xf2, 0x3a, 0x72, + 0x61, 0x1a, 0x09, 0x47, 0x19, 0x7d, 0x7f, 0x02, + 0x81, 0x80, 0x65, 0xce, 0x33, 0x53, 0xca, 0xfb, + 0xe0, 0x29, 0x83, 0x12, 0x93, 0x6c, 0xd9, 0xeb, + 0x3b, 0xaa, 0xc5, 0xc4, 0xd1, 0xb0, 0x01, 0x85, + 0xba, 0xc7, 0x6d, 0xdb, 0x3f, 0x86, 0x06, 0x4c, + 0x7e, 0xc4, 0x64, 0x65, 0x14, 0x5d, 0x9c, 0xe9, + 0x54, 0x62, 0x5c, 0xf2, 0x6e, 0xe3, 0x14, 0x80, + 0x48, 0x0c, 0xbc, 0xb4, 0xa1, 0xb6, 0x6d, 0x2f, + 0xa3, 0x21, 0xc0, 0xfc, 0x45, 0xa9, 0x2e, 0x3d, + 0x34, 0x2d, 0x05, 0x39, 0x4f, 0x4b, 0xf1, 0x8c, + 0xd3, 0x61, 0xbb, 0x80, 0x2d, 0xa3, 0x50, 0x5c, + 0xe0, 0xf4, 0xcd, 0xff, 0x95, 0xdc, 0xa8, 0x23, + 0x8f, 0x92, 0x69, 0xcd, 0x36, 0x8a, 0xba, 0xa5, + 0xe3, 0xfe, 0xce, 0x8e, 0x67, 0xc5, 0x54, 0x41, + 0x8c, 0x44, 0xc5, 0x50, 0x55, 0x7a, 0x7c, 0x91, + 0xc9, 0x2e, 0x9e, 0x32, 0x63, 0x37, 0x42, 0x68, + 0x29, 0x76, 0x41, 0xdb, 0x77, 0xfd, 0xcb, 0x6a, + 0x73, 0x10 }; + +Private key: 308204be020100300d06092a864886f70d0101010500048204a8308204a40201000282010100aea6a8eaddac6fb44147cb1881ebdf4f17f717c0ab6f4750bfe48cc945245e1c2e869fcb4705f9fe9190afbd221447a734397944e992834a80a82ae69f2bb7da2ad2ae575bfab6dfca3eb1b8420bde4636db42338bda5c60447c99b498b41ed8256d6784c967de05e606b5b5cabcfab0a746293f63479d708da28d22c6eb06d45c3b6298c7da168f1759d5cbd15de3e107e69787f42253faf9a9f5ebd755df322d4e0786254493d6f7c6f97891241ed46be34aff4a3ab989906187b9414502fdd0c55a984188a4e3e2a29d9a903f448e3ae1d1e9799ac6e27c8e9c3db2e0265a4613c8439ff7517ebb556dcc9738dba44b9640e52d8f43e32115da34977a9ebb0203010001028201005673e71fc3b54ce224825e557652850ac8e92657d844d03f778db1e71b93c2061f3dc2b1c42980337468f3a522ce791d9a6b6ccd20f5c689c59ff90489fc01193ca3676b94fb4935040efeb81ff17208bdb4d15364c22581fdc4d3ed22bdde9ace0416ff1317983ec13bc70d031b82d89924d0dc30cfcd6e5e9dfd511eb84e7b54839b4ff8a603c196f16dc0a717bdf160cbe205a59b052eafdca788de5342a9f40faef996e92ca6e89d2c6bbcd80f095f64b2216fc0793d6ead937935879a41cc0624f06209fe469a38eec0c808ce65dae4891afbe9530cd18040fdc497f8194e03904adafd132789de128d525a07f19aa4549886b27876bf3aa98bedc78b3102818100e2f3ab537bee36dbcaa87403dde2ce87e28c558ed40f32ecd2f98b1f93db84d242e1c721242e360c025d49eae042d77a3ec85192395610d79067a334d6c24a3374fde27ee13e59d7366d7dd4d882fb2f1e5e32cdc30a7fbdb0b3f97775b90c6354ff25a3af4a70613291defb9525b406989deb49c8e0c07e45fbe5f8725b6b1902818100c5014bb75f6dbca68cb8eba5ff0bd715d7eff6c9fe69cce5bd5ca805a04d3b1fa6cc377bb146f2c767cdc120c414bd0e01a7d63ce8189d7171372ac0456a54e863f06ed29f953bdeb3c560573dedef57cb3d353a2e5db80ef8ffd2caddce0b1053b4db53f602a5f1234d216ec7525a7a5d8832a8655021f5813f96d4574866f302818100dd83d6629ae10cfc8496dcfdf531ee422576b1ffc1adc017f5688a495d08f36042d59a8617895f49637968af6f0aeec4abc8dc0d6c173c431af87d0d12dcfa8db510256590364a7c4bec9cd80627fa41a8536b24f8cd2397a38456e729a95f95089e2d3fd1d547512789c76a29ce6e23ce0cbd5dfc4a9ab7e55913c2e6e3a1e902818100c36f98a4ae97d7b9c60ac143a8f41f08fd7281fa3b58cc3af19354e057f9a5f8ad691475b215774dd8ada6b511b09d28a2fdd4ac117831e0d376ee035619b967dd952cebe8028d254e643541f71eeefcc293d31507e053730f140312dbddc6de089c77a5207dda0f917cb7f904e5aefa8b854cf3ffa5f23a72611a0947197d7f02818065ce3353cafbe0298312936cd9eb3baac5c4d1b00185bac76ddb3f86064c7ec46465145d9ce954625cf26ee31480480cbcb4a1b66d2fa321c0fc45a92e3d342d05394f4bf18cd361bb802da3505ce0f4cdff95dca8238f9269cd368abaa5e3fece8e67c554418c44c550557a7c91c92e9e3263374268297641db77fdcb6a7310 +