diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b9ecc6e..dac0704e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,42 @@ [TOC] +## 17.1.2 (2023-06-23) + +### Features: + + - Added APIs to support Google Cast functionality on devices whose OEMCrypto + implementations support being a Cast Receiver. + - Note that if you plan to support Cast Receiver functionality, you must run + the unit tests with the `--cast` flag in order to add the Cast Receiver + unit tests to the test run. + - Added `Cdm::initDataContainsEmbeddedKeys()`, which allows clients to ask the + CE CDM whether a given initialization data blob contains embedded keys, + which may affect how it should be passed to the CDM. + - The CE CDM will now returning a meaningful error instead of + `kUnexpectedError` in more cases. + - Improved logging of failed server responses during tests. + +### Bugfixes: + + - Fixed an issue where `Cdm::getKeyAllowedUsages()` would return the wrong + value for entitled keys. + - Fixed a rare crash that could occur when opening and closing sessions in + parallel from different threads. + - Fixed rare issues that could occur when provisioning multiple sessions in + parallel from different threads. + - Fixed an issue that could occur on some OEMCrypto implementations because + the code to restore a persistent license failed to generate a nonce before + signing a fake license request. + - Reduced the amount of "L1 Terminate" spammed to the log. + - Fixed crashes that could occur due to `OEMCrypto_GetBootCertificateChain()` + returning an empty additional signature. + - Fixed issues that could occur if multiple persistent licenses shared the + same PST. + - Improved the reliability of the parallel decrypt tests on slow OEMCrypto + implementations. + - Improved the reliability of the duration tests on slow internet connections. + ## 17.1.1 (2022-11-28) ### Features: diff --git a/README.md b/README.md index a51ad5f0..80ce0336 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Widevine CE CDM 17.1.1 +# Widevine CE CDM 17.1.2 -Released 2022-11-28 +Released 2023-06-23 ## Getting Started diff --git a/build.py b/build.py index ee45912e..b6795b6c 100755 --- a/build.py +++ b/build.py @@ -12,6 +12,7 @@ from __future__ import print_function import argparse +import json import math import os import subprocess @@ -149,42 +150,59 @@ def RunNinja(output_path, options): def RunXcode(output_path, options): """Run Xcode as a build system.""" - if 'all' in options.target: - scheme = 'All' - elif len(options.target) == 1: - scheme = options.target[0] + # Xcode generates a separate project for each GYP file and requires telling + # which project to use for a target. So we need to generate a mapping of + # target name to the project that defined it. + projects = (['cdm/cdm_unittests.xcodeproj'] + + [val.replace('.gyp', '.xcodeproj') for val in options.extra_gyp]) + target_map = {} + if 'all' in options.target or 'All' in options.target: + target_map['All'] = os.path.join(output_path, projects[0]) + targets = ['All'] else: - raise ValueError('Can only specify one target on Xcode') + targets = options.target + for name in projects: + # List every target in a project. + project = os.path.join(output_path, name) + cmd = ['xcodebuild', 'build', '-project', project, '-list', '-json'] + data = json.loads(subprocess.check_output(cmd).decode('utf8')) + for scheme in data['project']['schemes'] + data['project']['targets']: + # 'All' will appear in each project, but it is handled above. + target_map[scheme] = project - cmd = [ - 'xcodebuild', 'test' if options.xcode_test else 'build', - '-project', os.path.join(output_path, 'cdm', 'cdm_unittests.xcodeproj'), - '-scheme', scheme, - '-configuration', options.build_config, - '-derivedDataPath', os.path.join(output_path, 'DerivedData'), - ] - if options.xcode_test: - cmd += ['-only-testing:' + scheme] - if options.ios_device_name: - if options.ios: - cmd += ['-destination', 'platform=iOS,name=' + options.ios_device_name] + for scheme in targets: + cmd = [ + 'xcodebuild', 'test' if options.xcode_test else 'build', + '-project', target_map[scheme], + '-scheme', scheme, + '-configuration', options.build_config, + '-derivedDataPath', os.path.join(output_path, 'DerivedData'), + ] + if options.xcode_test: + cmd += ['-only-testing:' + scheme] + if options.ios_device_name: + if options.ios: + cmd += ['-destination', 'platform=iOS,name=' + options.ios_device_name] + else: + cmd += [ + '-destination', + 'platform=iOS Simulator,name=' + options.ios_device_name, + ] + elif options.ios: + cmd += ['-destination', 'generic/platform=iOS'] + elif options.ios_sim: + cmd += ['-destination', 'generic/platform=iOS Simulator'] else: - cmd += [ - '-destination', - 'platform=iOS Simulator,name=' + options.ios_device_name, - ] - elif options.ios: - cmd += ['-destination', 'generic/platform=iOS'] - elif options.ios_sim: - cmd += ['-destination', 'generic/platform=iOS Simulator'] - else: - cmd += ['-destination', 'platform=macOS,arch=x86_64'] + cmd += ['-destination', 'platform=macOS,arch=x86_64'] - if options.jobs is not None: - cmd += ['-jobs', str(options.jobs)] - if not options.verbose: - cmd += ['-quiet'] - return VerboseSubprocess(cmd) + if options.jobs is not None: + cmd += ['-jobs', str(options.jobs)] + if not options.verbose: + cmd += ['-quiet'] + ret = VerboseSubprocess(cmd) + if ret != 0: + return ret + return 0 # Map from generator name to generator invocation function. @@ -247,7 +265,7 @@ def ImportPlatform(platform, is_cobalt, skip_deps, gyp_args): for variable, value in target['export_variables'].items(): existing_value = os.environ.get(variable) if not existing_value: - if '/' in value or '\\' in value: + if '"' not in value and ('/' in value or '\\' in value): # Use absolute paths since the output directory will be different. If # "value" is already absolute, os.path.join will only use that part. value = os.path.normpath(os.path.join(CDM_TOP_PATH, target_path, diff --git a/cdm/cdm_reboot_tests.gyp b/cdm/cdm_reboot_tests.gyp index 62dff0cb..d3abb4da 100644 --- a/cdm/cdm_reboot_tests.gyp +++ b/cdm/cdm_reboot_tests.gyp @@ -31,6 +31,8 @@ '../core/test/http_socket.cpp', '../core/test/license_holder.cpp', '../core/test/license_request.cpp', + '../core/test/message_dumper.cpp', + '../core/test/provisioning_holder.cpp', '../core/test/reboot_test.cpp', '../core/test/test_base.cpp', '../core/test/test_printers.cpp', diff --git a/cdm/core_unittests.gypi b/cdm/core_unittests.gypi index 425be333..dd3644d3 100644 --- a/cdm/core_unittests.gypi +++ b/cdm/core_unittests.gypi @@ -24,12 +24,14 @@ '../core/test/license_keys_unittest.cpp', '../core/test/license_request.cpp', '../core/test/license_unittest.cpp', + '../core/test/message_dumper.cpp', '../core/test/okp_fallback_policy_test.cpp', '../core/test/ota_keybox_provisioner_test.cpp', '../core/test/parallel_operations_test.cpp', '../core/test/policy_engine_constraints_unittest.cpp', '../core/test/policy_engine_unittest.cpp', '../core/test/policy_integration_test.cpp', + '../core/test/provisioning_holder.cpp', '../core/test/rw_lock_test.cpp', '../core/test/service_certificate_unittest.cpp', '../core/test/system_id_extractor_unittest.cpp', diff --git a/cdm/include/cdm.h b/cdm/include/cdm.h index fd8359ba..64d2ead8 100644 --- a/cdm/include/cdm.h +++ b/cdm/include/cdm.h @@ -530,6 +530,19 @@ class CDM_EXPORT Cdm : public ITimerClient { virtual Status getStatusForHdcpVersion(HdcpVersion hdcp, KeyStatus* key_status) = 0; + // Checks if the given initialization data contains embedded, entitled keys. + // Sets the variable pointed to by |contains_keys| to true if the init data + // contains embedded keys or false if it does not. This function is useful if + // apps choose to handle such initialization data differently, such as in the + // case of key rotation or loading an offline entitlement license. + // + // For PSSH init data, this function accepts the full concatenated blob of + // PSSH boxes from the stream. It will return true if any of the PSSHs contain + // embedded Widevine keys. + virtual Status initDataContainsEmbeddedKeys(InitDataType init_data_type, + const std::string& init_data, + bool* contains_keys) = 0; + // Creates a new session. // Do not use this to load an existing persistent session (use load()). // If successful, the session ID is returned via |session_id|. @@ -875,6 +888,35 @@ class CDM_EXPORT Cdm : public ITimerClient { // and apps to gather these metrics to send them back to Google for analysis. virtual Status getMetrics(std::string* serialized_metrics) = 0; + // Creates a Cast Provisioning Request message. + // This method is only useful on devices that implement support for Google + // Cast. Calling this method will generate a provisioning request that can be + // used to provision the device's Cast certificate. The request should be sent + // to the provisioning server just like a request from + // getProvisioningRequest(). However, the response should be given to + // handleCastProvisioningResponse() in order to extract the additional, + // Cast-specific fields. + virtual Status getCastProvisioningRequest(std::string* request) = 0; + + // Handles a Cast provisioning response. + // This method is only useful on devices that implement support for Google + // Cast. It returns both the Cast public certificate and a wrapped private key + // that can be used with castSign(). Handling a Cast provisioning response + // does not affect the device's Widevine provisioning status. See + // handleProvisioningResponse() for handling Widevine provisioning. + virtual Status handleCastProvisioningResponse(const std::string& response, + std::string* cert, + std::string* wrapped_key) = 0; + + // Signs a method for Cast usage. + // This method is only useful on devices that support Google Cast and after + // receiving a wrapped private key from handleCastProvisioningResponse(). This + // method generates a signature for the message using the given private key in + // PKCS#1 with block type 1 padding. + virtual Status castSign(const std::string& wrapped_key, + const std::string& message, + std::string* signature) = 0; + protected: Cdm() {} }; diff --git a/cdm/include/cdm_version.h b/cdm/include/cdm_version.h index ae89af8b..4ecdf4da 100644 --- a/cdm/include/cdm_version.h +++ b/cdm/include/cdm_version.h @@ -13,7 +13,7 @@ # define CDM_VERSION_MINOR 1 #endif #ifndef CDM_VERSION_PATCH -# define CDM_VERSION_PATCH 1 +# define CDM_VERSION_PATCH 2 #endif #ifndef CDM_VERSION_TAG # define CDM_VERSION_TAG "" diff --git a/cdm/oemcrypto_reference_implementation.gyp b/cdm/oemcrypto_reference_implementation.gyp deleted file mode 100644 index ed97d27f..00000000 --- a/cdm/oemcrypto_reference_implementation.gyp +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary -# source code may only be used and distributed under the Widevine License -# Agreement. -{ - 'includes': [ - 'platform_properties.gypi', - ], - 'variables': { - # Directory where OEMCrypto header, test, and reference files lives. - 'oemcrypto_dir': '../oemcrypto', - # Directory where widevine utilities live. - 'util_dir': '../util', - }, - 'targets': [ - { - 'target_name': 'oec_ref', - 'type': 'static_library', - 'standalone_static_library': 1, - 'hard_dependency': 1, - 'includes': [ - '../oemcrypto/ref/oec_ref.gypi', - ], - 'dependencies': [ - '<(oemcrypto_dir)/util/oec_ref_util.gyp:oec_ref_util', - ], - }, - { - 'target_name': 'oec_ref_shared', - 'type': 'shared_library', - 'dependencies': [ - 'oec_ref' - ], - }, - ], -} diff --git a/cdm/src/cdm.cpp b/cdm/src/cdm.cpp index 3d27a0d6..32c88c18 100644 --- a/cdm/src/cdm.cpp +++ b/cdm/src/cdm.cpp @@ -50,6 +50,9 @@ constexpr char kNoSandboxId[] = ""; const int64_t kPolicyTimerDurationMilliseconds = 5000; void* const kPolicyTimerContext = nullptr; +const std::string kEmptyAuthority; +const std::string kCastAuthority = "cast.google.com"; + struct HostType { Cdm::IStorage* storage; Cdm::IClock* clock; @@ -228,6 +231,10 @@ class CdmImpl final : public Cdm, public WvCdmEventListener { Status getStatusForHdcpVersion(HdcpVersion hdcp, KeyStatus* key_status) override; + Status initDataContainsEmbeddedKeys(InitDataType init_data_type, + const std::string& init_data, + bool* contains_keys) override; + Status createSession(SessionType session_type, std::string* session_id) override; @@ -301,6 +308,15 @@ class CdmImpl final : public Cdm, public WvCdmEventListener { Status getMetrics(std::string* serialized_metrics) override; + Status getCastProvisioningRequest(std::string* request) override; + + Status handleCastProvisioningResponse(const std::string& response, + std::string* cert, + std::string* wrapped_key) override; + + Status castSign(const std::string& wrapped_key, const std::string& message, + std::string* signature) override; + // ITimerClient: void onTimerExpired(void* context) override; @@ -322,6 +338,14 @@ class CdmImpl final : public Cdm, public WvCdmEventListener { GenericSigningAlgorithmType algorithm); Cdm::Status ConvertHdcpLevel(const std::string& query_value, Cdm::HdcpVersion* result); + Status getProvisioningRequest(CdmCertificateType cert_type, + const std::string& authority, + std::string* request); + Status handleProvisioningResponse(const std::string& response, + std::string* cert, + std::string* wrapped_key); + + Cdm::Status ConvertStatusCode(CdmResponseType inner_error) const; IEventListener* listener_; bool policy_timer_enabled_; @@ -430,15 +454,9 @@ Cdm::Status CdmImpl::getRobustnessLevel(RobustnessLevel* level) { } std::string level_string; - const CdmResponseType result = cdm_engine_->QueryStatus( - kLevelDefault, QUERY_KEY_SECURITY_LEVEL, &level_string); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } + const auto result = ConvertStatusCode(cdm_engine_->QueryStatus( + kLevelDefault, QUERY_KEY_SECURITY_LEVEL, &level_string)); + if (result != kSuccess) return result; if (level_string == QUERY_VALUE_SECURITY_LEVEL_L1) { *level = kL1; @@ -461,15 +479,9 @@ Cdm::Status CdmImpl::getSystemId(uint32_t* id) { } std::string id_string; - const CdmResponseType result = - cdm_engine_->QueryStatus(kLevelDefault, QUERY_KEY_SYSTEM_ID, &id_string); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } + const auto result = ConvertStatusCode(cdm_engine_->QueryStatus( + kLevelDefault, QUERY_KEY_SYSTEM_ID, &id_string)); + if (result != kSuccess) return result; *id = static_cast(std::stoul(id_string)); return kSuccess; @@ -482,15 +494,9 @@ Cdm::Status CdmImpl::getResourceRatingTier(uint32_t* tier) { } std::string tier_string; - const CdmResponseType result = cdm_engine_->QueryStatus( - kLevelDefault, QUERY_KEY_RESOURCE_RATING_TIER, &tier_string); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } + const auto result = ConvertStatusCode(cdm_engine_->QueryStatus( + kLevelDefault, QUERY_KEY_RESOURCE_RATING_TIER, &tier_string)); + if (result != kSuccess) return result; const uint32_t parsed_tier = static_cast(std::stoul(tier_string)); if (parsed_tier <= 0) { @@ -507,18 +513,8 @@ Cdm::Status CdmImpl::getOemCryptoBuildInfo(std::string* build_info) { LOGE("Missing build_info parameter to receive build info."); return kTypeError; } - - CdmResponseType result = cdm_engine_->QueryStatus( - kLevelDefault, QUERY_KEY_OEMCRYPTO_BUILD_INFORMATION, build_info); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - - return kSuccess; + return ConvertStatusCode(cdm_engine_->QueryStatus( + kLevelDefault, QUERY_KEY_OEMCRYPTO_BUILD_INFORMATION, build_info)); } Cdm::ProvisioningStatus CdmImpl::getProvisioningStatus() { @@ -540,51 +536,18 @@ Cdm::ProvisioningStatus CdmImpl::getProvisioningStatus() { } Cdm::Status CdmImpl::getProvisioningRequest(std::string* request) { - std::string empty_authority; - std::string ignored_base_url; - CdmResponseType result = cdm_engine_->GetProvisioningRequest( - kCertificateWidevine, empty_authority, provisioning_service_certificate_, - kLevelDefault, request, &ignored_base_url); - if (result == CERT_PROVISIONING_NONCE_GENERATION_ERROR) { - LOGE("Nonce quota exceeded"); - return kResourceContention; - } else if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - return kSuccess; + return getProvisioningRequest(kCertificateWidevine, kEmptyAuthority, request); } Cdm::Status CdmImpl::handleProvisioningResponse(const std::string& response) { std::string ignored_cert; std::string ignored_wrapped_key; - - CdmResponseType result = cdm_engine_->HandleProvisioningResponse( - response, kLevelDefault, &ignored_cert, &ignored_wrapped_key); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - - return kSuccess; + return handleProvisioningResponse(response, &ignored_cert, + &ignored_wrapped_key); } Cdm::Status CdmImpl::removeProvisioning() { - CdmResponseType result = cdm_engine_->Unprovision(kSecurityLevelL1); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - return kSuccess; + return ConvertStatusCode(cdm_engine_->Unprovision(kSecurityLevelL1)); } Cdm::Status CdmImpl::listStoredLicenses(std::vector* key_set_ids) { @@ -592,16 +555,8 @@ Cdm::Status CdmImpl::listStoredLicenses(std::vector* key_set_ids) { LOGE("Missing vector parameter to receive key_set_ids."); return kTypeError; } - CdmResponseType result = - cdm_engine_->ListStoredLicenses(kSecurityLevelL1, key_set_ids); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - return kSuccess; + return ConvertStatusCode(cdm_engine_->ListStoredLicenses( + kSecurityLevelL1, key_set_ids)); } Cdm::Status CdmImpl::listUsageRecords(std::vector* ksids) { @@ -609,51 +564,26 @@ Cdm::Status CdmImpl::listUsageRecords(std::vector* ksids) { LOGE("Missing vector parameter to receive KSIDs."); return kTypeError; } - CdmResponseType result = cdm_engine_->ListUsageIds( - property_set_.app_id(), kSecurityLevelL1, ksids, nullptr); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - return kSuccess; + return ConvertStatusCode(cdm_engine_->ListUsageIds( + property_set_.app_id(), kSecurityLevelL1, ksids, nullptr)); } Cdm::Status CdmImpl::deleteUsageRecord(const std::string& key_set_id) { - CdmResponseType result = cdm_engine_->DeleteUsageRecord( - property_set_.app_id(), kSecurityLevelL1, key_set_id); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - return kSuccess; + return ConvertStatusCode(cdm_engine_->DeleteUsageRecord( + property_set_.app_id(), kSecurityLevelL1, key_set_id)); } Cdm::Status CdmImpl::deleteAllUsageRecords() { - CdmResponseType result = - cdm_engine_->RemoveAllUsageInfo(property_set_.app_id(), kSecurityLevelL1); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - return kSuccess; + return ConvertStatusCode(cdm_engine_->RemoveAllUsageInfo( + property_set_.app_id(), kSecurityLevelL1)); } Cdm::Status CdmImpl::getStatusForHdcpVersion(Cdm::HdcpVersion hdcp, Cdm::KeyStatus* key_status) { std::string query_value; - if (cdm_engine_->QueryStatus(kLevelDefault, QUERY_KEY_MAX_HDCP_LEVEL, - &query_value) != NO_ERROR) { - return kUnexpectedError; - } + auto result = ConvertStatusCode(cdm_engine_->QueryStatus( + kLevelDefault, QUERY_KEY_MAX_HDCP_LEVEL, &query_value)); + if (result != kSuccess) return result; if (query_value == QUERY_VALUE_HDCP_NONE || query_value == QUERY_VALUE_HDCP_LEVEL_UNKNOWN) { @@ -662,15 +592,46 @@ Cdm::Status CdmImpl::getStatusForHdcpVersion(Cdm::HdcpVersion hdcp, *key_status = Cdm::kUsable; } else { Cdm::HdcpVersion max_hdcp; - if (ConvertHdcpLevel(query_value, &max_hdcp) != kSuccess) { - return kUnexpectedError; - } + result = ConvertHdcpLevel(query_value, &max_hdcp); + if (result != kSuccess) return result; *key_status = (hdcp <= max_hdcp ? Cdm::kUsable : Cdm::kOutputRestricted); } return kSuccess; } +Cdm::Status CdmImpl::initDataContainsEmbeddedKeys(InitDataType init_data_type, + const std::string& init_data, + bool* contains_keys) { + if (contains_keys == nullptr) { + LOGE("Missing pointer to result variable."); + return kTypeError; + } + + if (init_data_type != kCenc) { + // Only PSSHs can contain embedded keys. + *contains_keys = false; + return kSuccess; + } + + std::string oec_version; + auto result = ConvertStatusCode(cdm_engine_->QueryStatus( + wvcdm::kLevelDefault, QUERY_KEY_OEMCRYPTO_API_VERSION, &oec_version)); + if (result != kSuccess) return result; + + InitializationData init_data_obj(CENC_INIT_DATA_FORMAT, init_data, + oec_version); + if (init_data_obj.IsEmpty()) { + // Note that InitializationData's idea of "empty" includes "failed to find + // and parse a Widevine PSSH". + LOGE("Failed to parse init data. It may not contain a Widevine PSSH."); + return kNotSupported; + } + + *contains_keys = init_data_obj.contains_entitled_keys(); + return kSuccess; +} + Cdm::Status CdmImpl::createSession(SessionType session_type, std::string* session_id) { if (session_id == nullptr) { @@ -691,25 +652,18 @@ Cdm::Status CdmImpl::createSession(SessionType session_type, return kNotSupported; } - CdmResponseType result = cdm_engine_->OpenSession( - "com.widevine.alpha", &property_set_, this, session_id); - switch (result) { - case NO_ERROR: - sessions_[*session_id].type = session_type; - return kSuccess; - case NEED_PROVISIONING: - // The Session ID may have been set by the CDM Engine despite this - // failure. We clear the ID here to ensure that we don't communicate a - // misleading ID to the application. - session_id->clear(); - return kNeedsDeviceCertificate; - case SYSTEM_INVALIDATED_ERROR: - LOGE("System invalidated"); - return kSystemStateLost; - default: - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; + const auto result = ConvertStatusCode(cdm_engine_->OpenSession( + "com.widevine.alpha", &property_set_, this, session_id)); + if (result != kSuccess) { + // The Session ID may have been set by the CDM Engine despite this + // failure. We clear the ID here to ensure that we don't communicate a + // misleading ID to the application. + session_id->clear(); + return result; } + + sessions_[*session_id].type = session_type; + return kSuccess; } Cdm::Status CdmImpl::generateRequest(const std::string& session_id, @@ -767,11 +721,10 @@ Cdm::Status CdmImpl::generateRequest(const std::string& session_id, } std::string oec_version; - if (cdm_engine_->QueryStatus(wvcdm::kLevelDefault, - QUERY_KEY_OEMCRYPTO_API_VERSION, - &oec_version) != NO_ERROR) { - return kUnexpectedError; - } + auto result = ConvertStatusCode(cdm_engine_->QueryStatus( + wvcdm::kLevelDefault, QUERY_KEY_OEMCRYPTO_API_VERSION, &oec_version)); + if (result != kSuccess) return result; + InitializationData init_data_obj(init_data_type_name, init_data, oec_version); if (init_data_obj.IsEmpty()) { // Note that InitializationData's idea of "empty" includes "failed to find @@ -782,31 +735,10 @@ Cdm::Status CdmImpl::generateRequest(const std::string& session_id, } CdmKeyRequest key_request; - - const CdmResponseType result = cdm_engine_->GenerateKeyRequest( + result = ConvertStatusCode(cdm_engine_->GenerateKeyRequest( session_id, session_id, init_data_obj, license_type, app_parameters_, - &key_request); - - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } else if (result == LICENSE_REQUEST_NONCE_GENERATION_ERROR) { - LOGE("Nonce quota exceeded"); - return kResourceContention; - } else if (result == NEED_PROVISIONING) { - LOGE("Device not provisioned"); - return kNeedsDeviceCertificate; - } else if (result == PRIVACY_MODE_ERROR_1 || result == PRIVACY_MODE_ERROR_2 || - result == PRIVACY_MODE_ERROR_3) { - LOGE("No licensing service certificate installed"); - return kNeedsServiceCertificate; - } else if (result != KEY_MESSAGE) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } + &key_request)); + if (result != kSuccess) return result; sessions_[session_id].callable = true; assert(key_request.type == kKeyRequestTypeInitial); @@ -827,20 +759,9 @@ Cdm::Status CdmImpl::load(const std::string& session_id) { return kQuotaExceeded; } - CdmResponseType result = cdm_engine_->OpenSession( - "com.widevine.alpha", &property_set_, session_id, this); - switch (result) { - case NO_ERROR: - break; - case SYSTEM_INVALIDATED_ERROR: - LOGE("System invalidated"); - return kSystemStateLost; - case NEED_PROVISIONING: - return kNeedsDeviceCertificate; - default: - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } + auto result = ConvertStatusCode(cdm_engine_->OpenSession( + "com.widevine.alpha", &property_set_, session_id, this)); + if (result != kSuccess) return result; DeviceFiles f(&file_system_); if (!f.Init(kSecurityLevelUnknown)) { @@ -851,20 +772,11 @@ Cdm::Status CdmImpl::load(const std::string& session_id) { if (!f.LicenseExists(session_id)) { // This might be a usage record session which needs to be loaded. CdmKeyMessage ignored_release_message; - result = - cdm_engine_->LoadUsageSession(session_id, &ignored_release_message); - if (result != KEY_MESSAGE) { + result = ConvertStatusCode(cdm_engine_->LoadUsageSession( + session_id, &ignored_release_message)); + if (result != kSuccess) { cdm_engine_->CloseSession(session_id); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result == LOAD_USAGE_INFO_MISSING) { - LOGE("Unable to load license: %s", session_id.c_str()); - return kSessionNotFound; - } else { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } + return result; } sessions_[session_id].type = kPersistentUsageRecord; @@ -872,17 +784,8 @@ Cdm::Status CdmImpl::load(const std::string& session_id) { return kSuccess; } - result = cdm_engine_->RestoreKey(session_id, session_id); - if (result == GET_RELEASED_LICENSE_ERROR) { - // This was partially removed already. - // The EME spec states that we should be able to load it, but not use it. - } else if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != KEY_ADDED) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } + result = ConvertStatusCode(cdm_engine_->RestoreKey(session_id, session_id)); + if (result != kSuccess) return result; if (!policy_timer_enabled_) { policy_timer_enabled_ = true; @@ -916,31 +819,14 @@ Cdm::Status CdmImpl::update(const std::string& session_id, // AddKey(), it will internally delegate to RenewKey(). CdmKeySetId key_set_id = session_id; CdmLicenseType license_type = {}; // Required for AddKey. Unused otherwise. - const CdmResponseType result = + const CdmResponseType inner_error = cdm_engine_->AddKey(session_id, response, &license_type, &key_set_id); // result should only be NEED_KEY after server certificate provisioning, which // should no longer happen in this version of the CDM. - assert(result != NEED_KEY); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } else if (result == OFFLINE_LICENSE_PROHIBITED) { - LOGE("A temporary session cannot be used for a persistent license."); - return kRangeError; - } else if (result == STORAGE_PROHIBITED) { - LOGE("A temporary session cannot be used for a persistent usage records."); - return kRangeError; - } else if (result == NEED_PROVISIONING) { - LOGE("The device needs to reprovision."); - return kNeedsDeviceCertificate; - } else if (result != KEY_ADDED) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } + assert(inner_error != NEED_KEY); + const auto result = ConvertStatusCode(inner_error); + if (result != kSuccess) return result; if (!policy_timer_enabled_) { policy_timer_enabled_ = true; @@ -970,11 +856,10 @@ Cdm::Status CdmImpl::loadEmbeddedKeys(const std::string& session_id, } std::string oec_version; - if (cdm_engine_->QueryStatus(wvcdm::kLevelDefault, - QUERY_KEY_OEMCRYPTO_API_VERSION, - &oec_version) != NO_ERROR) { - return kUnexpectedError; - } + auto result = ConvertStatusCode(cdm_engine_->QueryStatus( + wvcdm::kLevelDefault, QUERY_KEY_OEMCRYPTO_API_VERSION, &oec_version)); + if (result != kSuccess) return result; + InitializationData init_data_obj(CENC_INIT_DATA_FORMAT, init_data, oec_version); if (init_data_obj.IsEmpty()) { @@ -986,25 +871,9 @@ Cdm::Status CdmImpl::loadEmbeddedKeys(const std::string& session_id, } CdmKeyRequest key_request; - const CdmResponseType result = cdm_engine_->GenerateKeyRequest( + return ConvertStatusCode(cdm_engine_->GenerateKeyRequest( session_id, session_id, init_data_obj, kLicenseTypeEmbeddedKeyData, - app_parameters_, &key_request); - - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } else if (result == LICENSE_REQUEST_NONCE_GENERATION_ERROR) { - LOGE("Nonce quota exceeded"); - return kResourceContention; - } else if (result != KEY_ADDED) { - LOGE("Unexpected Failure: GenerateKeyRequest() returned %d", - static_cast(result)); - return kUnexpectedError; - } - return kSuccess; + app_parameters_, &key_request)); } Cdm::Status CdmImpl::getExpiration(const std::string& session_id, @@ -1050,24 +919,9 @@ Cdm::Status CdmImpl::getKeyAllowedUsages(const std::string& session_id, } CdmKeyAllowedUsage usage_for_key; - CdmResponseType result = - cdm_engine_->QueryKeyAllowedUsage(session_id, key_id, &usage_for_key); - if (result != NO_ERROR) { - // TODO(b/114435278): There are multiple KEY_NOT_FOUND_* errors that should - // probably all turn into kNoKey. Here, and below, and everywhere. - if (result == KEY_NOT_FOUND_1) { - return kNoKey; - } else if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } else { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - } + const auto result = ConvertStatusCode(cdm_engine_->QueryKeyAllowedUsage( + session_id, key_id, &usage_for_key)); + if (result != kSuccess) return result; *usage_flags = KeyAllowedFlags(usage_for_key); return kSuccess; @@ -1081,24 +935,9 @@ Cdm::Status CdmImpl::getKeyAllowedUsages(const std::string& key_id, } CdmKeyAllowedUsage usage_for_key; - const CdmResponseType result = - cdm_engine_->QueryKeyAllowedUsage(key_id, &usage_for_key); - if (result != NO_ERROR) { - if (result == KEY_NOT_FOUND_1 || result == KEY_NOT_FOUND_2) { - return kNoKey; - } else if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } else if (result == KEY_CONFLICT_1) { - return kTypeError; - } else { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } - } + const auto result = ConvertStatusCode(cdm_engine_->QueryKeyAllowedUsage( + key_id, &usage_for_key)); + if (result != kSuccess) return result; *usage_flags = KeyAllowedFlags(usage_for_key); return kSuccess; @@ -1146,16 +985,11 @@ Cdm::Status CdmImpl::close(const std::string& session_id) { return kSessionNotFound; } - const CdmResponseType result = cdm_engine_->CloseSession(session_id); - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; + const auto result = ConvertStatusCode(cdm_engine_->CloseSession(session_id)); + if (result == kSuccess) { + sessions_.erase(session_id); } - sessions_.erase(session_id); - return kSuccess; + return result; } Cdm::Status CdmImpl::remove(const std::string& session_id) { @@ -1185,23 +1019,12 @@ Cdm::Status CdmImpl::remove(const std::string& session_id) { it->second = kReleased; } - const CdmResponseType result = cdm_engine_->GenerateKeyRequest( + const auto result = ConvertStatusCode(cdm_engine_->GenerateKeyRequest( session_id, session_id, empty_initialization_data, kLicenseTypeRelease, - app_parameters_, &key_request); - - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } else if (result == LICENSE_REQUEST_NONCE_GENERATION_ERROR) { - LOGE("Nonce quota exceeded"); - return kResourceContention; - } else if (result != KEY_MESSAGE) { - LOGE("Unexpected error %d", static_cast(result)); + app_parameters_, &key_request)); + if (result != kSuccess) { cdm_engine_->CloseSession(session_id); - return kUnexpectedError; + return result; } LOGI("A license release has been generated."); @@ -1226,18 +1049,8 @@ Cdm::Status CdmImpl::forceRemove(const std::string& session_id) { return kRangeError; } - const CdmResponseType result = cdm_engine_->RemoveLicense(session_id); - - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } else if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } else if (result != NO_ERROR) { - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; - } + const auto result = ConvertStatusCode(cdm_engine_->RemoveLicense(session_id)); + if (result != kSuccess) return result; sessions_.erase(session_id); cdm_engine_->CloseSession(session_id); @@ -1330,41 +1143,10 @@ Cdm::Status CdmImpl::decrypt(const std::string& session_id, return cdm_sample; }); - const CdmResponseType result = - cdm_engine_->DecryptV16(session_id, parameters); - - if (result == NO_ERROR) { - return kSuccess; - } - - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } - - if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } - - if (result == OUTPUT_TOO_LARGE_ERROR) { - LOGE("Output too large"); - return kOutputTooLarge; - } - - if (result == NEED_KEY || result == KEY_NOT_FOUND_3 || - result == SESSION_NOT_FOUND_FOR_DECRYPT) { - LOGE("Key not available."); - return kNoKey; - } - - if (result == INSUFFICIENT_OUTPUT_PROTECTION) { - LOGE("Key usage blocked due to HDCP or display resolution constraints."); - return kKeyUsageBlockedByPolicy; - } - - LOGE("Decrypt error: %d", static_cast(result)); - return kDecryptError; + const auto result = + ConvertStatusCode(cdm_engine_->DecryptV16(session_id, parameters)); + if (result == kUnexpectedError) return kDecryptError; + return result; } Cdm::Status CdmImpl::genericEncrypt(const std::string& session_id, @@ -1381,33 +1163,8 @@ Cdm::Status CdmImpl::genericEncrypt(const std::string& session_id, return kNotSupported; } - CdmResponseType result = cdm_engine_->GenericEncrypt( - session_id, in_buffer, key_id, iv, cdm_algorithm, out_buffer); - if (result == NO_ERROR) { - return kSuccess; - } - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } - if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } - if (result == OUTPUT_TOO_LARGE_ERROR) { - LOGE("Output too large"); - return kOutputTooLarge; - } - if (result == SESSION_NOT_FOUND_13) { - LOGE("No such session: %s", session_id.c_str()); - return kSessionNotFound; - } - if (result == KEY_NOT_FOUND_3 || result == NEED_KEY) { - LOGE("Key Error: %s", session_id.c_str()); - return kNoKey; - } - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; + return ConvertStatusCode(cdm_engine_->GenericEncrypt( + session_id, in_buffer, key_id, iv, cdm_algorithm, out_buffer)); } Cdm::Status CdmImpl::genericDecrypt(const std::string& session_id, @@ -1424,33 +1181,8 @@ Cdm::Status CdmImpl::genericDecrypt(const std::string& session_id, return kNotSupported; } - const CdmResponseType result = cdm_engine_->GenericDecrypt( - session_id, in_buffer, key_id, iv, cdm_algorithm, out_buffer); - if (result == NO_ERROR) { - return kSuccess; - } - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } - if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } - if (result == OUTPUT_TOO_LARGE_ERROR) { - LOGE("Output too large"); - return kOutputTooLarge; - } - if (result == SESSION_NOT_FOUND_14) { - LOGE("No such session: %s", session_id.c_str()); - return kSessionNotFound; - } - if (result == KEY_NOT_FOUND_4 || result == NEED_KEY) { - LOGE("Key Error: %s", session_id.c_str()); - return kNoKey; - } - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; + return ConvertStatusCode(cdm_engine_->GenericDecrypt( + session_id, in_buffer, key_id, iv, cdm_algorithm, out_buffer)); } Cdm::Status CdmImpl::genericSign(const std::string& session_id, @@ -1464,29 +1196,8 @@ Cdm::Status CdmImpl::genericSign(const std::string& session_id, return kNotSupported; } - const CdmResponseType result = cdm_engine_->GenericSign( - session_id, message, key_id, cdm_algorithm, signature); - if (result == NO_ERROR) { - return kSuccess; - } - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } - if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } - if (result == SESSION_NOT_FOUND_15) { - LOGE("No such session: %s", session_id.c_str()); - return kSessionNotFound; - } - if (result == KEY_NOT_FOUND_5 || result == NEED_KEY) { - LOGE("Key Error: %s", session_id.c_str()); - return kNoKey; - } - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; + return ConvertStatusCode(cdm_engine_->GenericSign( + session_id, message, key_id, cdm_algorithm, signature)); } Cdm::Status CdmImpl::genericVerify(const std::string& session_id, @@ -1500,29 +1211,8 @@ Cdm::Status CdmImpl::genericVerify(const std::string& session_id, return kNotSupported; } - const CdmResponseType result = cdm_engine_->GenericVerify( - session_id, message, key_id, cdm_algorithm, signature); - if (result == NO_ERROR) { - return kSuccess; - } - if (result == SYSTEM_INVALIDATED_ERROR) { - LOGE("System invalidated"); - return kSystemStateLost; - } - if (result == SESSION_LOST_STATE_ERROR) { - LOGE("Session invalidated"); - return kSessionStateLost; - } - if (result == SESSION_NOT_FOUND_16) { - LOGE("No such session: %s", session_id.c_str()); - return kSessionNotFound; - } - if (result == KEY_NOT_FOUND_6 || result == NEED_KEY) { - LOGE("Key Error: %s", session_id.c_str()); - return kNoKey; - } - LOGE("Unexpected error %d", static_cast(result)); - return kUnexpectedError; + return ConvertStatusCode(cdm_engine_->GenericVerify( + session_id, message, key_id, cdm_algorithm, signature)); } Cdm::Status CdmImpl::setVideoResolution(const std::string& session_id, @@ -1555,6 +1245,23 @@ Cdm::Status CdmImpl::getMetrics(std::string* serialized_metrics) { return kSuccess; } +Cdm::Status CdmImpl::getCastProvisioningRequest(std::string* request) { + return getProvisioningRequest(kCertificateX509, kCastAuthority, request); +} + +Cdm::Status CdmImpl::handleCastProvisioningResponse(const std::string& response, + std::string* cert, + std::string* wrapped_key) { + return handleProvisioningResponse(response, cert, wrapped_key); +} + +Cdm::Status CdmImpl::castSign(const std::string& wrapped_key, + const std::string& message, + std::string* signature) { + return ConvertStatusCode(cdm_engine_->SignRsa(wrapped_key, message, signature, + kSign_PKCS1_Block1)); +} + void CdmImpl::onTimerExpired(void* context) { if (context == kPolicyTimerContext) { if (policy_timer_enabled_) { @@ -1693,6 +1400,116 @@ Cdm::Status CdmImpl::ConvertHdcpLevel(const std::string& query_value, return kSuccess; } +Cdm::Status CdmImpl::getProvisioningRequest(CdmCertificateType cert_type, + const std::string& authority, + std::string* request) { + std::string ignored_base_url; + return ConvertStatusCode(cdm_engine_->GetProvisioningRequest( + cert_type, authority, provisioning_service_certificate_, kLevelDefault, + request, &ignored_base_url)); +} + +Cdm::Status CdmImpl::handleProvisioningResponse(const std::string& response, + std::string* cert, + std::string* wrapped_key) { + return ConvertStatusCode(cdm_engine_->HandleProvisioningResponse( + response, kLevelDefault, cert, wrapped_key)); +} + +Cdm::Status CdmImpl::ConvertStatusCode(CdmResponseType inner_error) const { + switch (inner_error) { + case GET_RELEASED_LICENSE_ERROR: + // This was partially removed already. + // The EME spec states that we should be able to load it, but not use it. + case KEY_ADDED: + case KEY_MESSAGE: + case NO_ERROR: + return kSuccess; + + case KEY_CONFLICT_1: + LOGE("Multiple sessions contain given key (inner_error=%d)", inner_error); + return kTypeError; + + case NEED_PROVISIONING: + LOGE("Device not provisioned (inner_error=%d)", inner_error); + return kNeedsDeviceCertificate; + case LOAD_USAGE_INFO_MISSING: + LOGE("Unable to load license (inner_error=%d)", inner_error); + return kSessionNotFound; + case SESSION_NOT_FOUND_1: + case SESSION_NOT_FOUND_2: + case SESSION_NOT_FOUND_3: + case SESSION_NOT_FOUND_4: + case SESSION_NOT_FOUND_5: + case SESSION_NOT_FOUND_6: + case SESSION_NOT_FOUND_7: + case SESSION_NOT_FOUND_8: + case SESSION_NOT_FOUND_9: + case SESSION_NOT_FOUND_10: + case SESSION_NOT_FOUND_11: + case SESSION_NOT_FOUND_12: + case SESSION_NOT_FOUND_13: + case SESSION_NOT_FOUND_14: + case SESSION_NOT_FOUND_15: + case SESSION_NOT_FOUND_16: + //case SESSION_NOT_FOUND_17: // undefined + case SESSION_NOT_FOUND_18: + case SESSION_NOT_FOUND_19: + case SESSION_NOT_FOUND_20: + case SESSION_NOT_FOUND_21: + case SESSION_NOT_FOUND_22: + case SESSION_NOT_FOUND_23: + LOGE("Session not found (inner_error=%d)", inner_error); + return kSessionNotFound; + case KEY_NOT_FOUND_1: + case KEY_NOT_FOUND_2: + case KEY_NOT_FOUND_3: + case KEY_NOT_FOUND_4: + case KEY_NOT_FOUND_5: + case KEY_NOT_FOUND_6: + case NEED_KEY: + case NO_CONTENT_KEY: + case NO_CONTENT_KEY_2: + case NO_CONTENT_KEY_3: + case SESSION_NOT_FOUND_FOR_DECRYPT: + LOGE("Key not found (inner_error=%d)", inner_error); + return kNoKey; + case INSUFFICIENT_OUTPUT_PROTECTION: + LOGE("Key usage blocked due to HDCP or display resolution constraints."); + return kKeyUsageBlockedByPolicy; + case OFFLINE_LICENSE_PROHIBITED: + LOGE("A temporary session cannot be used for a persistent license."); + return kRangeError; + case STORAGE_PROHIBITED: + LOGE( + "A temporary session cannot be used for a persistent usage records."); + return kRangeError; + + case CERT_PROVISIONING_NONCE_GENERATION_ERROR: + case LICENSE_REQUEST_NONCE_GENERATION_ERROR: + LOGE("Nonce quota exceeded (inner_error=%d)", inner_error); + return kResourceContention; + case SESSION_LOST_STATE_ERROR: + LOGE("Session invalidated (inner_error=%d)", inner_error); + return kSessionStateLost; + case SYSTEM_INVALIDATED_ERROR: + LOGE("System invalidated (inner_error=%d)", inner_error); + return kSystemStateLost; + case OUTPUT_TOO_LARGE_ERROR: + LOGE("Output too large (inner_error=%d)", inner_error); + return kOutputTooLarge; + case PRIVACY_MODE_ERROR_1: + case PRIVACY_MODE_ERROR_2: + case PRIVACY_MODE_ERROR_3: + LOGE("No service certificate installed (inner_error=%d)", inner_error); + return kNeedsServiceCertificate; + + default: + LOGE("Unknown error: %d", inner_error); + return kUnexpectedError; + } +} + } // namespace // static diff --git a/cdm/src/properties_ce.cpp b/cdm/src/properties_ce.cpp index 3c8f6f79..477f3629 100644 --- a/cdm/src/properties_ce.cpp +++ b/cdm/src/properties_ce.cpp @@ -191,7 +191,10 @@ void Properties::InitOnce() { allow_restore_of_offline_licenses_with_release_ = true; delay_oem_crypto_termination_ = false; SetClientInfo(); - session_property_set_.reset(new CdmClientPropertySetMap()); + { + std::unique_lock lock(session_mutex_); + session_property_set_.reset(new CdmClientPropertySetMap()); + } } // static diff --git a/cdm/test/cdm_test.cpp b/cdm/test/cdm_test.cpp index ec0b9635..e88fc19f 100644 --- a/cdm/test/cdm_test.cpp +++ b/cdm/test/cdm_test.cpp @@ -11,9 +11,13 @@ #include #include #include +#include #include #include +#include +#include +#include #include "OEMCryptoCENC.h" #include "cdm.h" @@ -204,6 +208,12 @@ const std::string kNewValue = "A New Value"; const std::string kParamName = "PARAM"; const std::string kParamName2 = "PARAM2"; +const std::string kFakeCastMessage = a2bs_hex( + // ASN.1 SHA-1 identifier + "3021300906052b0e03021a05000414" + // Fake SHA-1 digest (actually just random bytes) + "96b34d11727bb41089e989ea51588666f924a40e"); + class CdmTest : public WvCdmTestBase, public Cdm::IEventListener { public: CdmTest() {} @@ -2431,6 +2441,33 @@ TEST_F(CdmTest, EncryptedPlaybackWithoutALicense) { EXPECT_EQ(Cdm::kNoKey, status); } +TEST_F(CdmTest, CheckInitDataEmbeddedKeys) { + bool contains_embedded_keys; + + // WebM (cannot contain embedded keys) + EXPECT_EQ(cdm_->initDataContainsEmbeddedKeys(Cdm::kWebM, kWebMInitData, + &contains_embedded_keys), + Cdm::kSuccess); + EXPECT_FALSE(contains_embedded_keys); + + // PSSH without embedded keys + EXPECT_EQ(cdm_->initDataContainsEmbeddedKeys(Cdm::kCenc, kCencInitData, + &contains_embedded_keys), + Cdm::kSuccess); + EXPECT_FALSE(contains_embedded_keys); + + // PSSH with embedded keys + EXPECT_EQ(cdm_->initDataContainsEmbeddedKeys( + Cdm::kCenc, kCencEntitlementInitData1, &contains_embedded_keys), + Cdm::kSuccess); + EXPECT_TRUE(contains_embedded_keys); + + // Null out pointer + EXPECT_NE( + cdm_->initDataContainsEmbeddedKeys(Cdm::kCenc, kCencInitData, nullptr), + Cdm::kSuccess); +} + TEST_F(CdmTest, GetEmptyMetrics) { std::string metrics; Cdm::Status status = cdm_->getMetrics(&metrics); @@ -2691,6 +2728,72 @@ TEST_F(CdmIndividualizationTest, NoLoadWithoutProvisioning) { EXPECT_EQ(Cdm::kNeedsDeviceCertificate, cdm_->load(kBogusSessionId)); } +TEST_F(CdmIndividualizationTest, CastReceiverProvisionAndSign) { + if (!CheckProvisioningSupport()) { + GTEST_SKIP() << "OEMCrypto does not support provisioning"; + } + if (!wvoec::global_features.cast_receiver) { + GTEST_SKIP() << "OEMCrypto does not support Cast Receiver functionality"; + } + + ASSERT_NO_FATAL_FAILURE(ProvisionDevice()); + + // Perform Cast provisioning and store the public cert and wrapped private key + // for use later in the test + std::string cast_prov_request; + ASSERT_EQ(cdm_->getCastProvisioningRequest(&cast_prov_request), + Cdm::kSuccess); + + const std::string cast_prov_response = + GetProvisioningResponse(cast_prov_request); + ASSERT_FALSE(cast_prov_response.empty()); + + std::string cert; + std::string wrapped_key; + ASSERT_EQ(cdm_->handleCastProvisioningResponse(cast_prov_response, &cert, + &wrapped_key), + Cdm::kSuccess); + EXPECT_FALSE(cert.empty()); + ASSERT_FALSE(wrapped_key.empty()); + + // Perform cast signing using the wrapped private key + std::string signature; + ASSERT_EQ(cdm_->castSign(wrapped_key, kFakeCastMessage, &signature), + Cdm::kSuccess); + + // Verify the signature against the public key + // + // 1) Load the public key into an RSA struct + std::unique_ptr bio(BIO_new(BIO_s_mem()), BIO_free_all); + ASSERT_NE(bio, nullptr); + ASSERT_EQ(BIO_write(bio.get(), cert.data(), static_cast(cert.size())), + static_cast(cert.size())); + + std::unique_ptr x509( + PEM_read_bio_X509(bio.get(), nullptr, nullptr, nullptr), X509_free); + ASSERT_NE(x509, nullptr); + + std::unique_ptr pubkey( + X509_get_pubkey(x509.get()), EVP_PKEY_free); + ASSERT_NE(pubkey, nullptr); + + // Not a std::unique_ptr because "get0" returns a non-owning pointer. + RSA* const rsa = EVP_PKEY_get0_RSA(pubkey.get()); + ASSERT_NE(rsa, nullptr); + + // 2) Decrypt the signature + std::string decrypted_digest(RSA_size(rsa), 0); + const int decrypted_length = RSA_public_decrypt( + static_cast(signature.size()), + reinterpret_cast(signature.data()), + reinterpret_cast(&decrypted_digest[0]), rsa, RSA_PKCS1_PADDING); + ASSERT_GT(decrypted_length, 0); + + // 3) Compare the digests + decrypted_digest.resize(decrypted_length); + EXPECT_EQ(decrypted_digest, kFakeCastMessage); +} + class CdmProv40IndividualizationTest : public CdmTest {}; TEST_F(CdmProv40IndividualizationTest, NeedsOemCertProvisioning) { diff --git a/cdm/test/perf_test_xctest.mm b/cdm/test/perf_test_xctest.mm index 333bd855..d2b8527f 100644 --- a/cdm/test/perf_test_xctest.mm +++ b/cdm/test/perf_test_xctest.mm @@ -20,7 +20,7 @@ int argc = 1; testing::InitGoogleTest(&argc, argv); - XCTAssertEqual(widevine::PerfTestMain(&widevine::Cdm::initialize, &widevine::Cdm::create, cert), 0); + XCTAssertEqual(widevine::PerfTestMain(&widevine::Cdm::initialize, &widevine::Cdm::create, ""), 0); } @end diff --git a/core/include/cdm_engine.h b/core/include/cdm_engine.h index 2bc0a7a8..76ffa386 100644 --- a/core/include/cdm_engine.h +++ b/core/include/cdm_engine.h @@ -391,6 +391,13 @@ class CdmEngine { virtual void SetDefaultOtaKeyboxFallbackDurationRules(); virtual void SetFastOtaKeyboxFallbackDurationRules(); + // A signing method specifically used by Cast. + // This method should not be used otherwise. + virtual CdmResponseType SignRsa(const std::string& wrapped_key, + const std::string& message, + std::string* signature, + RSA_Padding_Scheme padding_scheme); + protected: friend class CdmEngineFactory; @@ -438,6 +445,8 @@ class CdmEngine { CdmSessionMap session_map_; CdmReleaseKeySetMap release_key_sets_; std::unique_ptr cert_provisioning_; + // Lock must be acquired before using |cert_provisioning_|. + std::mutex cert_provisioning_mutex_; wvutil::FileSystem* file_system_; wvutil::Clock clock_; std::string spoid_; diff --git a/core/include/cdm_session.h b/core/include/cdm_session.h index c98c8030..14400aa4 100644 --- a/core/include/cdm_session.h +++ b/core/include/cdm_session.h @@ -220,6 +220,13 @@ class CdmSession { virtual metrics::SessionMetrics* GetMetrics() { return metrics_.get(); } + virtual CdmResponseType LoadCastPrivateKey( + const CryptoWrappedKey& private_key); + + virtual CdmResponseType GenerateRsaSignature(const std::string& message, + std::string* signature, + RSA_Padding_Scheme scheme); + private: friend class CdmSessionTest; diff --git a/core/include/crypto_session.h b/core/include/crypto_session.h index 20421510..7d6cc3a7 100644 --- a/core/include/crypto_session.h +++ b/core/include/crypto_session.h @@ -363,6 +363,11 @@ class CryptoSession { virtual CdmResponseType LoadOtaProvisioning(bool use_test_key, const std::string& response); + // Cast specific generate signature method. + virtual CdmResponseType GenerateRsaSignature(const std::string& message, + std::string* signature, + RSA_Padding_Scheme scheme); + protected: // Creates an instance of CryptoSession with the given |crypto_metrics|. // |crypto_metrics| is owned by the caller, must NOT be null, and must @@ -401,8 +406,6 @@ class CryptoSession { // Note: This function will lock the global static field lock in write mode. bool SetUpUsageTableHeader(RequestedSecurityLevel requested_security_level); - CdmResponseType GenerateRsaSignature(const std::string& message, - std::string* signature); size_t GetMaxSubsampleRegionSize(); bool SetDestinationBufferType(); diff --git a/core/include/device_files.h b/core/include/device_files.h index 8b3926ef..93fd99a8 100644 --- a/core/include/device_files.h +++ b/core/include/device_files.h @@ -196,7 +196,7 @@ class DeviceFiles { std::string* provider_session_token); virtual bool DeleteUsageInfo(const std::string& usage_info_file_name, - const std::string& provider_session_token); + const CdmKeySetId& key_set_id); // Deletes a set of provider sessions from the specified usage info. // Sessions removed are based on the provided |key_set_ids|. If @@ -259,7 +259,6 @@ class DeviceFiles { virtual bool StoreUsageInfo(const std::string& usage_info_file_name, const std::vector& usage_data); virtual bool UpdateUsageInfo(const std::string& usage_info_file_name, - const std::string& provider_session_token, const CdmUsageData& usage_data); virtual bool StoreHlsAttributes(const std::string& key_set_id, diff --git a/core/include/properties.h b/core/include/properties.h index 72b8e376..360cac5c 100644 --- a/core/include/properties.h +++ b/core/include/properties.h @@ -142,6 +142,7 @@ class Properties { static void InitOnce(); static std::mutex init_mutex_; + static std::mutex session_mutex_; static bool is_initialized_; static bool oem_crypto_use_secure_buffers_; static bool oem_crypto_use_fifo_; diff --git a/core/include/wv_cdm_types.h b/core/include/wv_cdm_types.h index 7ee68be8..e6ffd370 100644 --- a/core/include/wv_cdm_types.h +++ b/core/include/wv_cdm_types.h @@ -442,6 +442,17 @@ enum CdmResponseType : int32_t { PROVISIONING_4_FAILED_TO_STORE_OEM_CERTIFICATE = 384, PROVISIONING_4_FAILED_TO_STORE_DRM_CERTIFICATE = 385, PROVISIONING_4_FAILED_TO_INITIALIZE_DEVICE_FILES_3 = 386, + GET_SIGNATURE_HASH_ALGORITHM_ERROR_1 = 387, + GET_SIGNATURE_HASH_ALGORITHM_ERROR_2 = 388, + GET_SIGNATURE_HASH_ALGORITHM_ERROR_3 = 389, + UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_1 = 390, + UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_2 = 391, + UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_3 = 392, + UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_4 = 393, + STORE_ATSC_LICENSE_DEVICE_FILES_INIT_ERROR = 394, + STORE_ATSC_LICENSE_ERROR = 395, + SESSION_NOT_FOUND_GENERIC_CRYPTO = 396, + SESSION_NOT_FOUND_24 = 397, // Don't forget to add new values to // * core/test/test_printers.cpp. // * android/include/mapErrors-inl.h diff --git a/core/src/cdm_engine.cpp b/core/src/cdm_engine.cpp index 726763c8..8a062f31 100644 --- a/core/src/cdm_engine.cpp +++ b/core/src/cdm_engine.cpp @@ -65,7 +65,6 @@ class UsagePropertySet : public CdmClientPropertySet { CdmEngine::CdmEngine(wvutil::FileSystem* file_system, std::shared_ptr metrics) : metrics_(metrics), - cert_provisioning_(), file_system_(file_system), spoid_(EMPTY_SPOID), usage_session_(), @@ -1065,6 +1064,7 @@ CdmResponseType CdmEngine::GetProvisioningRequest( } // TODO(b/141705730): Remove usage entries on provisioning. + std::unique_lock cert_lock(cert_provisioning_mutex_); if (!cert_provisioning_) { cert_provisioning_.reset( new CertificateProvisioning(metrics_->GetCryptoMetrics())); @@ -1094,6 +1094,7 @@ CdmResponseType CdmEngine::HandleProvisioningResponse( std::string* wrapped_key) { LOGI("response_size = %zu, security_level = %s", response.size(), RequestedSecurityLevelToString(requested_security_level)); + std::unique_lock cert_lock(cert_provisioning_mutex_); if (response.empty()) { LOGE("Empty provisioning response"); cert_provisioning_.reset(); @@ -1655,7 +1656,7 @@ CdmResponseType CdmEngine::RemoveAllUsageInfo( } if (!handle.DeleteUsageInfo(DeviceFiles::GetUsageInfoFileName(app_id), - usage_data[0].provider_session_token)) { + usage_data[0].key_set_id)) { LOGW("Failed to delete usage info"); break; } @@ -1707,25 +1708,18 @@ CdmResponseType CdmEngine::RemoveUsageInfo( new CdmSession(file_system_, metrics_->AddSession())); usage_session_->Init(usage_property_set_.get()); - CdmKeyMessage license_request; - CdmKeyResponse license_response; - CdmUsageEntry usage_entry; - uint32_t usage_entry_number; - std::string drm_certificate; - CryptoWrappedKey wrapped_private_key; - - if (!handle.RetrieveUsageInfo( - DeviceFiles::GetUsageInfoFileName(app_id), provider_session_token, - &license_request, &license_response, &usage_entry, - &usage_entry_number, &drm_certificate, &wrapped_private_key)) { + DeviceFiles::CdmUsageData usage_data; + if (!handle.RetrieveUsageInfo(DeviceFiles::GetUsageInfoFileName(app_id), + provider_session_token, &usage_data)) { // Try other security level continue; } if (usage_session_->supports_usage_info()) { - status = usage_session_->DeleteUsageEntry(usage_entry_number); + status = + usage_session_->DeleteUsageEntry(usage_data.usage_entry_number); if (!handle.DeleteUsageInfo(DeviceFiles::GetUsageInfoFileName(app_id), - provider_session_token)) { + usage_data.key_set_id)) { status = REMOVE_USAGE_INFO_ERROR_1; } usage_session_.reset(); @@ -2292,4 +2286,54 @@ void CdmEngine::SetFastOtaKeyboxFallbackDurationRules() { } system_fallback_policy->SetFastBackoffDurationRules(); } + +CdmResponseType CdmEngine::SignRsa(const std::string& wrapped_key, + const std::string& message, + std::string* signature, + RSA_Padding_Scheme padding_scheme) { + // Try to open cdm session. + CdmSessionId session_id; + auto sts = OpenSession("com.widevine", nullptr, nullptr, &session_id); + if (sts != NO_ERROR) { + LOGE("OpenSession failed, status: %d", static_cast(sts)); + return sts; + } + + // Retrieve the cdm session + std::shared_ptr session; + { + std::unique_lock lock(session_map_lock_); + if (!session_map_.FindSession(session_id, &session)) { + LOGE("Session not found: session_id = %s", IdToString(session_id)); + CloseSession(session_id); + return CdmResponseType(SESSION_NOT_FOUND_24); + } + } + + // Load cast private key for signing + CryptoWrappedKey key(CryptoWrappedKey::kRsa, wrapped_key); + sts = session->LoadCastPrivateKey(key); + if (sts != NO_ERROR) { + LOGE("LoadCastPrivateKey failed, status: %d", static_cast(sts)); + CloseSession(session_id); + return sts; + } + + // Generate Rsa signature for cast message + sts = session->GenerateRsaSignature(message, signature, padding_scheme); + if (sts != NO_ERROR) { + LOGE("GenerateRsaSignature failed, status: %d", static_cast(sts)); + CloseSession(session_id); + return sts; + } + + // Try to close cdm session. + sts = CloseSession(session_id); + if (sts != NO_ERROR) { + LOGE("CloseSession failed, status: %d", static_cast(sts)); + return sts; + } + + return sts; +} } // namespace wvcdm diff --git a/core/src/cdm_session.cpp b/core/src/cdm_session.cpp index 87659180..c35f1ef7 100644 --- a/core/src/cdm_session.cpp +++ b/core/src/cdm_session.cpp @@ -305,8 +305,11 @@ CdmResponseType CdmSession::RestoreOfflineSession(const CdmKeySetId& key_set_id, std::string fake_message("empty message"); std::string core_message; std::string license_request_signature; + uint32_t nonce; // Sign a fake message so that OEMCrypto will start the rental clock. The // signature and generated core message are ignored. + result = crypto_session_->GenerateNonce(&nonce); + if (result != NO_ERROR) return result; result = crypto_session_->PrepareAndSignLicenseRequest( fake_message, &core_message, &license_request_signature); if (result != NO_ERROR) return result; @@ -1017,8 +1020,7 @@ bool CdmSession::DeleteLicenseFile() { std::string app_id; GetApplicationId(&app_id); return file_handle_->DeleteUsageInfo( - DeviceFiles::GetUsageInfoFileName(app_id), - license_parser_->provider_session_token()); + DeviceFiles::GetUsageInfoFileName(app_id), key_set_id_); } } @@ -1151,8 +1153,7 @@ bool CdmSession::UpdateUsageInfo() { usage_data.usage_entry_number = usage_entry_number_; return file_handle_->UpdateUsageInfo( - DeviceFiles::GetUsageInfoFileName(app_id), usage_provider_session_token_, - usage_data); + DeviceFiles::GetUsageInfoFileName(app_id), usage_data); } void CdmSession::UpdateRequestLatencyTiming(CdmResponseType sts) { @@ -1237,6 +1238,18 @@ CdmResponseType CdmSession::LoadPrivateKey( } } +CdmResponseType CdmSession::LoadCastPrivateKey( + const CryptoWrappedKey& private_key) { + return crypto_session_->LoadCertificatePrivateKey(private_key); +} + +CdmResponseType CdmSession::GenerateRsaSignature(const std::string& message, + std::string* signature, + RSA_Padding_Scheme scheme) { + return crypto_session_->GenerateRsaSignature(message, signature, + scheme); +} + // For testing only - takes ownership of pointers void CdmSession::set_license_parser(CdmLicense* license_parser) { diff --git a/core/src/certificate_provisioning.cpp b/core/src/certificate_provisioning.cpp index ca28ea9f..0ed12abe 100644 --- a/core/src/certificate_provisioning.cpp +++ b/core/src/certificate_provisioning.cpp @@ -22,18 +22,19 @@ const std::string kEmptyString; // URL for Google Provisioning Server. // The provisioning server supplies the certificate that is needed // to communicate with the License Server. -const std::string kProvisioningServerUrl = +const char kProvisioningServerUrl[] = "https://www.googleapis.com/" "certificateprovisioning/v1/devicecertificates/create" "?key=AIzaSyB-5OLKTx2iU5mko18DfdwK5611JIjbUhE"; + // In case of provisioning 4, the default url is used as a way to inform app of // the current provisioning stage. In the first stage, this suffix is appended // to kProvisioningServerUrl; in the second stage, there is no change to // kProvisioningServerUrl. -const std::string kProv40FirstStageServerUrlSuffix = "&preProvisioning=true"; +const char kProv40FirstStageServerUrlSuffix[] = "&preProvisioning=true"; // NOTE: Provider ID = widevine.com -const std::string kCpProductionServiceCertificate = wvutil::a2bs_hex( +const char kCpProductionServiceCertificate[] = "0ab9020803121051434fe2a44c763bcc2c826a2d6ef9a718f7d793d005228e02" "3082010a02820101009e27088659dbd9126bc6ed594caf652b0eaab82abb9862" "ada1ee6d2cb5247e94b28973fef5a3e11b57d0b0872c930f351b5694354a8c77" @@ -55,12 +56,12 @@ const std::string kCpProductionServiceCertificate = wvutil::a2bs_hex( "76e6f76e2751fbefb669f05703cec8c64cf7a62908d5fb870375eb0cc96c508e" "26e0c050f3fd3ebe68cef9903ef6405b25fc6e31f93559fcff05657662b3653a" "8598ed5751b38694419242a875d9e00d5a5832933024b934859ec8be78adccbb" - "1ec7127ae9afeef9c5cd2e15bd3048e8ce652f7d8c5d595a0323238c598a28"); + "1ec7127ae9afeef9c5cd2e15bd3048e8ce652f7d8c5d595a0323238c598a28"; // Used in provisioning 4 client identification name value pairs. -const std::string kKeyAppParameterSpoid = "spoid"; -const std::string kKeyAppParameterProviderId = "provider_id"; -const std::string kKeyAppParameterStableId = "stable_id"; +const char kKeyAppParameterSpoid[] = "spoid"; +const char kKeyAppParameterProviderId[] = "provider_id"; +const char kKeyAppParameterStableId[] = "stable_id"; // Retrieves |stored_oem_cert| from |file_handle|, and load the OEM private key // to |crypto_session|. Returns true if all operations are successful. @@ -112,9 +113,10 @@ void CertificateProvisioning::GetProvisioningServerUrl( CdmResponseType CertificateProvisioning::Init( const std::string& service_certificate) { - std::string certificate = service_certificate.empty() - ? kCpProductionServiceCertificate - : service_certificate; + std::string certificate = + service_certificate.empty() + ? wvutil::a2bs_hex(kCpProductionServiceCertificate) + : service_certificate; return service_certificate_->Init(certificate); } @@ -371,13 +373,14 @@ CdmResponseType CertificateProvisioning::GetProvisioning40RequestInternal( if (stored_oem_cert.empty()) { // This is the first stage provisioning. - default_url->assign(kProvisioningServerUrl + + default_url->assign(std::string(kProvisioningServerUrl) + kProv40FirstStageServerUrlSuffix); // First-stage provisioning always uses the WV production service cert for // encryption. ServiceCertificate wv_service_cert; - status = wv_service_cert.Init(kCpProductionServiceCertificate); + status = wv_service_cert.Init( + wvutil::a2bs_hex(kCpProductionServiceCertificate)); if (status != NO_ERROR) return status; // Since |stored_oem_cert| is empty, the client identification token will be diff --git a/core/src/crypto_session.cpp b/core/src/crypto_session.cpp index eb715315..63ad9d22 100644 --- a/core/src/crypto_session.cpp +++ b/core/src/crypto_session.cpp @@ -176,6 +176,12 @@ size_t GenericEncryptionBlockSize(CdmEncryptionAlgorithm algorithm) { } return kAes128BlockSize; } + +uint8_t* MutableStringDataPointer(std::string* s) { + if (s == nullptr) return nullptr; + if (s->empty()) return nullptr; + return reinterpret_cast(&s->front()); +} } // namespace // CryptoSession variables allocation. @@ -1387,18 +1393,18 @@ CdmResponseType CryptoSession::GetBootCertificateChain( size_t bcc_length = 0; size_t additional_signature_length = 0; - OEMCryptoResult sts; - WithOecReadLock("GetBootCertificateChain Attempt 1", [&] { - sts = OEMCrypto_GetBootCertificateChain(nullptr, &bcc_length, nullptr, - &additional_signature_length); - }); + OEMCryptoResult sts = + WithOecReadLock("GetBootCertificateChain Attempt 1", [&] { + return OEMCrypto_GetBootCertificateChain(nullptr, &bcc_length, nullptr, + &additional_signature_length); + }); if (sts == OEMCrypto_ERROR_SHORT_BUFFER) { bcc->resize(bcc_length); additional_signature->resize(additional_signature_length); - WithOecReadLock("GetBootCertificateChain Attempt 2", [&] { - sts = OEMCrypto_GetBootCertificateChain( - reinterpret_cast(&bcc->front()), &bcc_length, - reinterpret_cast(&additional_signature->front()), + sts = WithOecReadLock("GetBootCertificateChain Attempt 2", [&] { + return OEMCrypto_GetBootCertificateChain( + MutableStringDataPointer(bcc), &bcc_length, + MutableStringDataPointer(additional_signature), &additional_signature_length); }); } @@ -1446,11 +1452,10 @@ CdmResponseType CryptoSession::GenerateCertificateKeyPair( WithOecSessionLock("GenerateCertificateKeyPair Attempt 2", [&] { M_TIME( status = OEMCrypto_GenerateCertificateKeyPair( - oec_session_id_, reinterpret_cast(&public_key->front()), - &public_key_length, - reinterpret_cast(&public_key_signature->front()), + oec_session_id_, MutableStringDataPointer(public_key), + &public_key_length, MutableStringDataPointer(public_key_signature), &public_key_signature_length, - reinterpret_cast(&wrapped_private_key->front()), + MutableStringDataPointer(wrapped_private_key), &wrapped_private_key_length, &oemcrypto_key_type), metrics_, oemcrypto_generate_certificate_key_pair_, status); }); @@ -1567,7 +1572,8 @@ CdmResponseType CryptoSession::GenerateDerivedKeys( } CdmResponseType CryptoSession::GenerateRsaSignature(const std::string& message, - std::string* signature) { + std::string* signature, + RSA_Padding_Scheme scheme) { LOGV("Generating RSA signature: id = %u", oec_session_id_); RETURN_IF_NULL(signature, PARAMETER_NULL); @@ -1584,7 +1590,7 @@ CdmResponseType CryptoSession::GenerateRsaSignature(const std::string& message, oec_session_id_, reinterpret_cast(message.data()), message.size(), reinterpret_cast(const_cast(signature->data())), - &length, kSign_RSASSA_PSS), + &length, scheme), metrics_, oemcrypto_generate_rsa_signature_, sts, metrics::Pow2Bucket(length)); }); @@ -3383,4 +3389,5 @@ CryptoSession* CryptoSessionFactory::MakeCryptoSession( metrics::CryptoMetrics* crypto_metrics) { return new CryptoSession(crypto_metrics); } + } // namespace wvcdm diff --git a/core/src/device_files.cpp b/core/src/device_files.cpp index b637b6f2..22eb9eb7 100644 --- a/core/src/device_files.cpp +++ b/core/src/device_files.cpp @@ -1123,7 +1123,7 @@ bool DeviceFiles::GetProviderSessionToken(const std::string& app_id, } bool DeviceFiles::DeleteUsageInfo(const std::string& usage_info_file_name, - const std::string& provider_session_token) { + const CdmKeySetId& key_set_id) { RETURN_FALSE_IF_UNINITIALIZED(); video_widevine_client::sdk::File file; if (RetrieveHashedFile(usage_info_file_name, &file) != kNoError) { @@ -1135,17 +1135,19 @@ bool DeviceFiles::DeleteUsageInfo(const std::string& usage_info_file_name, int index = 0; bool found = false; for (; index < usage_info->sessions_size(); ++index) { - if (usage_info->sessions(index).token() == provider_session_token) { + const auto& session = usage_info->sessions(index); + if (session.key_set_id() == key_set_id) { found = true; break; } } if (!found) { - LOGE("Unable to find provider session token: pst = %s", - wvutil::b2a_hex(provider_session_token).c_str()); + LOGE("Unable to find usage info: key_set_id = %s", IdToString(key_set_id)); return false; } + LOGD("Deleting usage info: key_set_id = %s, pst = %s", IdToString(key_set_id), + wvutil::b2a_hex(usage_info->sessions(index).token()).c_str()); google::protobuf::RepeatedPtrField* sessions = usage_info->mutable_sessions(); @@ -1374,7 +1376,6 @@ bool DeviceFiles::StoreUsageInfo(const std::string& usage_info_file_name, } bool DeviceFiles::UpdateUsageInfo(const std::string& usage_info_file_name, - const std::string& provider_session_token, const CdmUsageData& usage_data) { RETURN_FALSE_IF_UNINITIALIZED(); @@ -1383,43 +1384,52 @@ bool DeviceFiles::UpdateUsageInfo(const std::string& usage_info_file_name, LOGE("Usage info file does not exist"); return false; } - if (RetrieveHashedFile(usage_info_file_name, &file) != kNoError) { LOGE("Unable to retrieve usage info file"); return false; } + video_widevine_client::sdk::UsageInfo* usage_info = file.mutable_usage_info(); int index = 0; - for (; index < file.usage_info().sessions_size(); ++index) { - if (file.usage_info().sessions(index).token() == provider_session_token) { - UsageInfo* usage_info = file.mutable_usage_info(); - UsageInfo_ProviderSession* provider_session = - usage_info->mutable_sessions(index); - provider_session->set_license_request(usage_data.license_request); - provider_session->set_license(usage_data.license); - provider_session->set_key_set_id(usage_data.key_set_id); - provider_session->set_usage_entry(usage_data.usage_entry); - provider_session->set_usage_entry_number(usage_data.usage_entry_number); - - if (usage_data.drm_certificate.size() > 0) { - uint32_t drm_certificate_id; - if (!FindOrInsertUsageCertificate(usage_data.drm_certificate, - usage_data.wrapped_private_key, - usage_info, &drm_certificate_id)) { - LOGE("Unable to find a certificate in to update the usage info"); - return false; - } - provider_session->set_drm_certificate_id(drm_certificate_id); - } - - std::string serialized_file; - file.SerializeToString(&serialized_file); - return StoreFileWithHash(usage_info_file_name, serialized_file) == - kNoError; - } + for (; index < usage_info->sessions_size(); ++index) { + // Use key set ID to identify usage info. PST is not guaranteed + // to be unique. + if (usage_info->sessions(index).key_set_id() == usage_data.key_set_id) + break; + } + if (index == usage_info->sessions_size()) { + LOGE("Failed to find usage info: key_set_id = %s", + IdToString(usage_data.key_set_id)); + return false; } - return false; + video_widevine_client::sdk::UsageInfo::ProviderSession* session = + usage_info->mutable_sessions(index); + // Verify that the PST are the same. + if (session->token() != usage_data.provider_session_token) { + LOGE("Mismatch PST: key_set_id = %s", IdToString(usage_data.key_set_id)); + return false; + } + + // Update session. + session->set_license_request(usage_data.license_request); + session->set_license(usage_data.license); + session->set_usage_entry(usage_data.usage_entry); + session->set_usage_entry_number(usage_data.usage_entry_number); + if (usage_data.drm_certificate.size() > 0) { + uint32_t drm_certificate_id; + if (!FindOrInsertUsageCertificate(usage_data.drm_certificate, + usage_data.wrapped_private_key, + usage_info, &drm_certificate_id)) { + LOGE("Unable to find a certificate in to update the usage info"); + return false; + } + session->set_drm_certificate_id(drm_certificate_id); + } + + std::string serialized_file; + file.SerializeToString(&serialized_file); + return StoreFileWithHash(usage_info_file_name, serialized_file) == kNoError; } bool DeviceFiles::RetrieveUsageInfo(const std::string& usage_info_file_name, diff --git a/core/src/license_key_status.cpp b/core/src/license_key_status.cpp index a4fc365b..6294cb7a 100644 --- a/core/src/license_key_status.cpp +++ b/core/src/license_key_status.cpp @@ -96,7 +96,7 @@ bool LicenseKeys::GetAllowedUsage(const KeyId& key_id, } else if (content_keyid_to_entitlement_key_id_.count(key_id) > 0) { if (key_statuses_.count(content_keyid_to_entitlement_key_id_[key_id]) > 0) { return key_statuses_[content_keyid_to_entitlement_key_id_[key_id]] - ->CanDecryptContent(); + ->GetAllowedUsage(allowed_usage); } return false; } else { diff --git a/core/src/properties.cpp b/core/src/properties.cpp index 1eeb8e17..746a437b 100644 --- a/core/src/properties.cpp +++ b/core/src/properties.cpp @@ -12,7 +12,10 @@ const char* kSecurityLevelDirs[] = {"L1/", "L3/"}; } // namespace namespace wvcdm { +using UniqueLock = std::unique_lock; + std::mutex Properties::init_mutex_; +std::mutex Properties::session_mutex_; bool Properties::is_initialized_ = false; bool Properties::oem_crypto_use_secure_buffers_; bool Properties::oem_crypto_use_fifo_; @@ -26,6 +29,7 @@ std::unique_ptr Properties::session_property_set_; bool Properties::AddSessionPropertySet(const CdmSessionId& session_id, CdmClientPropertySet* property_set) { + UniqueLock lock(session_mutex_); if (!session_property_set_) { return false; } @@ -37,6 +41,7 @@ bool Properties::AddSessionPropertySet(const CdmSessionId& session_id, } bool Properties::RemoveSessionPropertySet(const CdmSessionId& session_id) { + UniqueLock lock(session_mutex_); if (!session_property_set_) { return false; } @@ -45,6 +50,7 @@ bool Properties::RemoveSessionPropertySet(const CdmSessionId& session_id) { CdmClientPropertySet* Properties::GetCdmClientPropertySet( const CdmSessionId& session_id) { + // Call must obtain |session_mutex_|. if (session_property_set_) { CdmClientPropertySetMap::iterator it = session_property_set_->find(session_id); @@ -57,6 +63,7 @@ CdmClientPropertySet* Properties::GetCdmClientPropertySet( bool Properties::GetApplicationId(const CdmSessionId& session_id, std::string* app_id) { + UniqueLock lock(session_mutex_); const CdmClientPropertySet* property_set = GetCdmClientPropertySet(session_id); if (property_set == nullptr) { @@ -68,6 +75,7 @@ bool Properties::GetApplicationId(const CdmSessionId& session_id, bool Properties::GetServiceCertificate(const CdmSessionId& session_id, std::string* service_certificate) { + UniqueLock lock(session_mutex_); const CdmClientPropertySet* property_set = GetCdmClientPropertySet(session_id); if (property_set == nullptr) { @@ -79,6 +87,7 @@ bool Properties::GetServiceCertificate(const CdmSessionId& session_id, bool Properties::SetServiceCertificate(const CdmSessionId& session_id, const std::string& service_certificate) { + UniqueLock lock(session_mutex_); CdmClientPropertySet* property_set = GetCdmClientPropertySet(session_id); if (property_set == nullptr) { return false; @@ -88,6 +97,7 @@ bool Properties::SetServiceCertificate(const CdmSessionId& session_id, } bool Properties::UsePrivacyMode(const CdmSessionId& session_id) { + UniqueLock lock(session_mutex_); const CdmClientPropertySet* property_set = GetCdmClientPropertySet(session_id); if (property_set == nullptr) { @@ -97,6 +107,7 @@ bool Properties::UsePrivacyMode(const CdmSessionId& session_id) { } uint32_t Properties::GetSessionSharingId(const CdmSessionId& session_id) { + UniqueLock lock(session_mutex_); const CdmClientPropertySet* property_set = GetCdmClientPropertySet(session_id); if (property_set == nullptr) { diff --git a/core/src/system_id_extractor.cpp b/core/src/system_id_extractor.cpp index 33da5757..9db41f6d 100644 --- a/core/src/system_id_extractor.cpp +++ b/core/src/system_id_extractor.cpp @@ -19,7 +19,7 @@ constexpr size_t kKeyboxSystemIdOffset = 4; // system ID (0 = leaf/device cert, 1 = intermediate/device family cert). constexpr size_t kOemCertSystemIdIndex = 1; // OID of X.509 certificate extension containing the Widevine system ID. -const std::string kWidevineSystemIdExtensionOid = "1.3.6.1.4.1.11129.4.1.1"; +const char kWidevineSystemIdExtensionOid[] = "1.3.6.1.4.1.11129.4.1.1"; constexpr size_t kSystemIdLength = sizeof(uint32_t); diff --git a/core/src/usage_table_header.cpp b/core/src/usage_table_header.cpp index f0cc7969..4d57dc72 100644 --- a/core/src/usage_table_header.cpp +++ b/core/src/usage_table_header.cpp @@ -835,7 +835,7 @@ CdmResponseType UsageTableHeader::StoreEntry(uint32_t usage_entry_number, } device_files->DeleteUsageInfo( usage_entry_info_[usage_entry_number].usage_info_file_name, - provider_session_token); + usage_entry_info_[usage_entry_number].key_set_id); if (!device_files->StoreUsageInfo( provider_session_token, key_request, key_response, usage_entry_info_[usage_entry_number].usage_info_file_name, diff --git a/core/test/config_test_env.h b/core/test/config_test_env.h index 1bd6e0de..9b3906b4 100644 --- a/core/test/config_test_env.h +++ b/core/test/config_test_env.h @@ -92,7 +92,13 @@ class ConfigTestEnv { } int test_pass() const { return test_pass_; } const std::string& test_data_path() const { return test_data_path_; } + int server_version() const { return server_version_; } + // Return true if the server version has been set and it is older than the + // specified version. We know the server version is set, if it is nonzero. + bool ServerOlderThan(int server_version) { + return server_version_ > 0 && server_version_ < server_version; + } static const CdmInitData GetInitData(ContentId content_id); static const std::string& GetLicenseServerUrl( ServerConfigurationId server_configuration_id); @@ -122,9 +128,17 @@ class ConfigTestEnv { void set_test_data_path(const std::string& test_data_path) { test_data_path_ = test_data_path; } + void set_server_version(int server_version) { + if (server_version >= 0) server_version_ = server_version; + } // The QA service certificate, used for a local provisioning server. static std::string QAProvisioningServiceCertificate(); + bool dump_golden_data() const { return dump_golden_data_; } + void set_dump_golden_data(bool dump_golden_data) { + dump_golden_data_ = dump_golden_data; + } + private: void Init(ServerConfigurationId server_id); @@ -139,6 +153,10 @@ class ConfigTestEnv { std::string provisioning_service_certificate_; int test_pass_; std::string test_data_path_; // Where to store test data for reboot tests. + int server_version_ = 0; + // It dump_golden_data_ is true, message data is dumped to a file for help + // in generating golden test data. + bool dump_golden_data_ = false; }; // The default provisioning server URL for a default provisioning request. diff --git a/core/test/device_files_unittest.cpp b/core/test/device_files_unittest.cpp index 8c6acb66..7998605a 100644 --- a/core/test/device_files_unittest.cpp +++ b/core/test/device_files_unittest.cpp @@ -2900,7 +2900,7 @@ const DeviceFilesTestListUsageInfoData kTestListUsageInfoData[] = { {"usaget3ED.bin", true}, }; -struct UsageInfo { +struct UsageInfoTestContext { std::string app_id; DeviceFiles::CdmUsageData usage_data; std::string file_data; @@ -2910,12 +2910,14 @@ const std::string kEmptyUsageInfoFileData = a2bs_hex( "0A06080310012A001220468A9A97B23D0E17147416276CB133175F0A18534155C6FFEF024A" "D80371D7C4"); -const UsageInfo kUsageInfoTestData[] = { - // test vector 0, app id: "", usage entry 0 +const UsageInfoTestContext kUsageInfoTestData[] = { + // Test vector 0 - app id: "", usage entry count: 1 {"", { + // PST: a2bs_hex("b8e7f26b6b8b59babf05b5a1f8927b412a85bc8551a928f00856329814ae" "5a82"), + // License request: a2bs_hex("4463dc57079c27e34ae115c6f65b08f6311c4ea604a6512c42470b6f692a" "76ea769d60d0b6bcf8d565ef31eb925f38e2095039c9f2f113ecee020f11" "26eb30165372d538b551ebd7bae5cf0bbeebb3cdb6f180d42868051aab8f" @@ -2925,6 +2927,7 @@ const UsageInfo kUsageInfoTestData[] = { "6ffc101036da70e69c06e4916493e82e9fe3f65d85254c8c14f6ca0579bf" "b3eaa86b2d7bb5ff572eccfd70f2ea4695f326beadf241ae4311e428c7c1" "2a0d4d1915cd0537ff0f62cf13eb2fa2"), + // License: a2bs_hex( "bbe6b4b60da9d9bc34dcc8502fb81d8fd5fdbc8fa89605c86205f2b8c6530ff64" "c8c31f579bd8eca603dfd5e397ac35e48931fd330351d01361bb31caaa7dbf816" @@ -2942,14 +2945,61 @@ const UsageInfo kUsageInfoTestData[] = { "5ce8f1fe59e317214005cee5e25904c9fb0af7e2b6b4dccdf78e61e179a9f9399" "6ec3c76f6da9b5a291bf08a73032b37edcbbbdd20cff94088a489167c56e5e75b" "376874e9750212fe94d7656d9cd835db3b771ba5b58d2b255"), + // Key set ID: "ksid854c8a60a5a547e122c24fca", + // Usage entry: a2bs_hex("7d2b905e5eafd4b28aeeb7633283579e48add21a68eb26cc8c3b2e344579" "003b12a38554336305525fa6ab70f024a18c73631bb1531eca3f0782c72d" "ba017311b3f1e98c739632e305e4bc0b2561ae2b"), + // Usage entry index: 5, + // DRM certificate: kEmptyString, + // Wrapped private key: CryptoWrappedKey(), }, + // File contents for test vector 0 + // sessions: + // -token: + // b8e7f26b6b8b59babf05b5a1f8927b412a85bc8551a928f00856329814ae + // 5a82 + // license_request: + // 4463dc57079c27e34ae115c6f65b08f6311c4ea604a6512c42470b6f692a + // 76ea769d60d0b6bcf8d565ef31eb925f38e2095039c9f2f113ecee020f11 + // 26eb30165372d538b551ebd7bae5cf0bbeebb3cdb6f180d42868051aab8f + // f4947460dd96f0f8259fc6001059c998d2eb6902c064f9ae08e6cd3c7807 + // e50379507b41620d15dd76c0b1e7ed9417efd6825959b5077f464e6429a4 + // dee467a1ba2b05d38049912d5539f1ee9f5d8a569aa1c384384f847ed64f + // 6ffc101036da70e69c06e4916493e82e9fe3f65d85254c8c14f6ca0579bf + // b3eaa86b2d7bb5ff572eccfd70f2ea4695f326beadf241ae4311e428c7c1 + // 2a0d4d1915cd0537ff0f62cf13eb2fa2 + // license: + // bbe6b4b60da9d9bc34dcc8502fb81d8fd5fdbc8fa89605c86205f2b8c653 + // 0ff64c8c31f579bd8eca603dfd5e397ac35e48931fd330351d01361bb31c + // aaa7dbf816a6144a12b6c22d1dceba20669ed635a40831066abd80713421 + // 19d7da11c43696b2898d3df3b36beb8da013d9dc145343494b19d6da085f + // 4a41e421d3def2ad8b72dffffb6e79bbceaf8594045d16a62eed16904a35 + // 69860c531a32eaa5abb868b1dd6a0b03d69c1a3f8336af80eb80badbbc7b + // 80ca5943bd5b374302147052201faed30e9ffa99fc00b47f7eeb469512a4 + // 13e873f91d959cccacccd3585b7f00ed8d4685022101713c3adc439f2751 + // 2a45926c1d2473477662c4bace72f380d105ddc9f7be49ed71991b3d9e29 + // a2038201373f98a845a57624a692f44ebd316d26c48fee82b655583317ec + // a4aaa4dac841524a2dca111749629637ef29fa7e72645a875957fb3d98a5 + // e6c8065b1349cfa23011cd6349d911c535475fed50be9eacb6a1ff3ea745 + // 8823f0229f2fa90b7a7099e8ec349d3d0fe0277cba5157ca62c8fbaa893f + // 37b8c8cea2a0d2d2912caccf92d31aa17439479711b4a5b77445cc02c18b + // fe0195ce8f1fe59e317214005cee5e25904c9fb0af7e2b6b4dccdf78e61e + // 179a9f93996ec3c76f6da9b5a291bf08a73032b37edcbbbdd20cff94088a + // 489167c56e5e75b376874e9750212fe94d7656d9cd835db3b771ba5b58d2 + // b255 + // key_set_id: "ksid854c8a60a5a547e122c24fca" + // usage_entry: + // 7d2b905e5eafd4b28aeeb7633283579e48add21a68eb26cc8c3b2e344579 + // 003b12a38554336305525fa6ab70f024a18c73631bb1531eca3f0782c72d + // ba017311b3f1e98c739632e305e4bc0b2561ae2b + // usage_entry_number: 5 + // drm_certificate_id: 0 + // drm_certificate_cache: a2bs_hex( "0AA407080310012A9D070A9A070A20B8E7F26B6B8B59BABF05B5A1F8927B412A85BC8" "551A928F00856329814AE5A821280024463DC57079C27E34AE115C6F65B08F6311C4E" @@ -2980,10 +3030,12 @@ const UsageInfo kUsageInfoTestData[] = { "F024A18C73631BB1531ECA3F0782C72DBA017311B3F1E98C739632E305E4BC0B2561A" "E2B30051220BCA71B49A97A2CFD5A3C4619807FE9EFCB68F9C69C4D63254FF10B22F1" "13FA82")}, - // test vector 1, app id: "", usage entry 1 + // Test vector 1 - app id: "", usage entry count: 2 {"", { + // PST: a2bs_hex("5d637be37a9722aa35c23d346470851aca7d2edcd1a27edf124ea6"), + // License request: a2bs_hex("bc96d6878e3086c33624821f1f3ece23f27e58222c2bb8d1615476a11792" "63b58f6427e92911d961fc7a3afd947aed8c9aead1f08457925d2ce4e0f6" "18b21942baa60b231eae864048f94f74ffa700e5777f812adb6f0cb6ba6f" @@ -2991,6 +3043,7 @@ const UsageInfo kUsageInfoTestData[] = { "cbea9d397fe00942e7ff73b8152cdc083b63a9f9c4a77056a0d79f44f267" "da0ed629d9c902f7e838957ea41aa442221c3aa9410db58302b468c6d7f2" "113663809f0dcf187c108ced"), + // License: a2bs_hex("f6fb3693413cc1d7d5e3459b856e4156c78f8d85d548939fd00474c8cded" "c46835cc981758500fe61cc79383b4d9f87c3e33d19c2d25d7d15dd0f3d2" "b1af4583b71e90c59886d297e78e929c2f3840c82c626914a4eb537b3a51" @@ -3003,15 +3056,93 @@ const UsageInfo kUsageInfoTestData[] = { "5fd980a67d8f33cc1d6cf20ee4c24582d03967ed48b6f28e7514e4d18f38" "c8cb1e54fba59af7d6a79c6c5a7ab06baac964c7958d201910adca018022" "fbeb8535b64f5ce83d3c"), + // Key set ID: "ksid2f2e85ce8a677f60047d7024e07b5ae6", + // Usge entry: a2bs_hex("b74880fbddc5bb9db82f09bc7de3ffd95a0a671b979d4c1f0564eaf63eb6" "b5a8c3f16d9f964afbd011e2326f9c27afbe74536f3f0601a71d9c1c422f" "335611bf3bf1a1c89e2dea27c17a9d9a58a74121e840b002e8a6fb590072" "45be786c1f64"), + // Usage entry index: 9, + // DRM certificate: kEmptyString, + // Wrapped private key: CryptoWrappedKey(), }, + // File contents for test vector 1 + // sessions: + // -token: + // b8e7f26b6b8b59babf05b5a1f8927b412a85bc8551a928f00856329814ae + // 5a82 + // license_request: + // 4463dc57079c27e34ae115c6f65b08f6311c4ea604a6512c42470b6f692a + // 76ea769d60d0b6bcf8d565ef31eb925f38e2095039c9f2f113ecee020f11 + // 26eb30165372d538b551ebd7bae5cf0bbeebb3cdb6f180d42868051aab8f + // f4947460dd96f0f8259fc6001059c998d2eb6902c064f9ae08e6cd3c7807 + // e50379507b41620d15dd76c0b1e7ed9417efd6825959b5077f464e6429a4 + // dee467a1ba2b05d38049912d5539f1ee9f5d8a569aa1c384384f847ed64f + // 6ffc101036da70e69c06e4916493e82e9fe3f65d85254c8c14f6ca0579bf + // b3eaa86b2d7bb5ff572eccfd70f2ea4695f326beadf241ae4311e428c7c1 + // 2a0d4d1915cd0537ff0f62cf13eb2fa2 + // license: + // bbe6b4b60da9d9bc34dcc8502fb81d8fd5fdbc8fa89605c86205f2b8c653 + // 0ff64c8c31f579bd8eca603dfd5e397ac35e48931fd330351d01361bb31c + // aaa7dbf816a6144a12b6c22d1dceba20669ed635a40831066abd80713421 + // 19d7da11c43696b2898d3df3b36beb8da013d9dc145343494b19d6da085f + // 4a41e421d3def2ad8b72dffffb6e79bbceaf8594045d16a62eed16904a35 + // 69860c531a32eaa5abb868b1dd6a0b03d69c1a3f8336af80eb80badbbc7b + // 80ca5943bd5b374302147052201faed30e9ffa99fc00b47f7eeb469512a4 + // 13e873f91d959cccacccd3585b7f00ed8d4685022101713c3adc439f2751 + // 2a45926c1d2473477662c4bace72f380d105ddc9f7be49ed71991b3d9e29 + // a2038201373f98a845a57624a692f44ebd316d26c48fee82b655583317ec + // a4aaa4dac841524a2dca111749629637ef29fa7e72645a875957fb3d98a5 + // e6c8065b1349cfa23011cd6349d911c535475fed50be9eacb6a1ff3ea745 + // 8823f0229f2fa90b7a7099e8ec349d3d0fe0277cba5157ca62c8fbaa893f + // 37b8c8cea2a0d2d2912caccf92d31aa17439479711b4a5b77445cc02c18b + // fe0195ce8f1fe59e317214005cee5e25904c9fb0af7e2b6b4dccdf78e61e + // 179a9f93996ec3c76f6da9b5a291bf08a73032b37edcbbbdd20cff94088a + // 489167c56e5e75b376874e9750212fe94d7656d9cd835db3b771ba5b58d2 + // b255 + // key_set_id: "ksid854c8a60a5a547e122c24fca" + // usage_entry: + // 7d2b905e5eafd4b28aeeb7633283579e48add21a68eb26cc8c3b2e344579 + // 003b12a38554336305525fa6ab70f024a18c73631bb1531eca3f0782c72d + // ba017311b3f1e98c739632e305e4bc0b2561ae2b + // usage_entry_number: 5 + // drm_certificate_id: 0 + // -token: + // 5d637be37a9722aa35c23d346470851aca7d2edcd1a27edf124ea6 + // license_request: + // bc96d6878e3086c33624821f1f3ece23f27e58222c2bb8d1615476a11792 + // 63b58f6427e92911d961fc7a3afd947aed8c9aead1f08457925d2ce4e0f6 + // 18b21942baa60b231eae864048f94f74ffa700e5777f812adb6f0cb6ba6f + // 0d145e3951191eb217140c32f2c7565053222131ff823bc36d80b24b561c + // cbea9d397fe00942e7ff73b8152cdc083b63a9f9c4a77056a0d79f44f267 + // da0ed629d9c902f7e838957ea41aa442221c3aa9410db58302b468c6d7f2 + // 113663809f0dcf187c108ced + // license: + // f6fb3693413cc1d7d5e3459b856e4156c78f8d85d548939fd00474c8cded + // c46835cc981758500fe61cc79383b4d9f87c3e33d19c2d25d7d15dd0f3d2 + // b1af4583b71e90c59886d297e78e929c2f3840c82c626914a4eb537b3a51 + // 61d963472b6592c0fa1e415556bc009c2da22bcf743ac434e22f8a33b432 + // 10dfd8aa09fe86105610f366e6fb7da18996cf7c7db425a9bb50e4a13190 + // a680b9f82d37d09658585abe3bf9f009a5c1ce38a7cefe17f71fb402768b + // 2d66b4ca523ed06729349695d7864d7cf7a1cc11d0da2b8a43db834d10b4 + // 7d9579ec9e46986a133277b92c636cb2a6a823afe73317266c9c0601ddba + // db76e1d254d6183b93a1ea91a7e6c567331b3ee3a5ab1484af91fd0f8dac + // 5fd980a67d8f33cc1d6cf20ee4c24582d03967ed48b6f28e7514e4d18f38 + // c8cb1e54fba59af7d6a79c6c5a7ab06baac964c7958d201910adca018022 + // fbeb8535b64f5ce83d3c + // key_set_id: "ksid2f2e85ce8a677f60047d7024e07b5ae6" + // usage_entry: + // b74880fbddc5bb9db82f09bc7de3ffd95a0a671b979d4c1f0564eaf63eb6 + // b5a8c3f16d9f964afbd011e2326f9c27afbe74536f3f0601a71d9c1c422f + // 335611bf3bf1a1c89e2dea27c17a9d9a58a74121e840b002e8a6fb590072 + // 45be786c1f64 + // usage_entry_number: 9 + // drm_certificate_id: 0 + // drm_certificate_cache: a2bs_hex( "0AE80C080310012AE10C0A9A070A20B8E7F26B6B8B59BABF05B5A1F8927B412A85BC8" "551A928F00856329814AE5A821280024463DC57079C27E34AE115C6F65B08F6311C4E" @@ -3062,11 +3193,13 @@ const UsageInfo kUsageInfoTestData[] = { "326F9C27AFBE74536F3F0601A71D9C1C422F335611BF3BF1A1C89E2DEA27C17A9D9A5" "8A74121E840B002E8A6FB59007245BE786C1F6430091220B9626315C7601BC2BD1E1C" "88F752C956261CE7509669B2AEAA1E7F1304017941")}, - // test vector 2, app id: "app_1", usage entry 0 + // Test vector 2 - app id: "app_1", usage entry count: 1 {"app_1", { + // PST: a2bs_hex("bb3370ccd3c3c49573d6b74386d1886d9888bd81fe3241bcd2bac9407d1a" "834e"), + // License request: a2bs_hex("dc0e51cfa5863f6c0b32a4ad7fa40625dadcc2dcde9e7fa3983b8804d996" "6803181682fc8ae831472e0b2fc26276242fbce624d286eedecce5555804" "913b4f8f86c5ae86160b8434b109169a63da04c5265102d772c1180543ef" @@ -3074,6 +3207,7 @@ const UsageInfo kUsageInfoTestData[] = { "8f6c6ad84b37ee1c7dfafb99289206cb752d063f330efd85885f4b72ba1c" "a5823eed865a461345e3d6417872bf3b0608b3d9e1004c11e7326d3ed406" "192e13455d0ec4e1f558a147"), + // License: a2bs_hex("f42a68ca3a14fb68f5992e4519f57970c3dae73f8da1d5b0b1da3eff7a95" "4012a0dc634357f3f5477a820e182182f24ae8e835ab10c18386cc8a0727" "d3f38b628639bfbd69a94d4053eab1c31e075e014cc578b226cfe24d6b42" @@ -3083,7 +3217,9 @@ const UsageInfo kUsageInfoTestData[] = { "8ccc896dd4cdf45f9090c96dfb925795cfb4ccda83e3eb4f745577b17fc1" "66bf5f4103c9085134cad7863a41b04f32ef20201e54b55f1817ce589619" "b096c254fd2c2fa4a06f4de35ccfd23e"), + // Key set ID: "kside11109bf20cde544083ef4ee", + // Usage entry: a2bs_hex("ea106c124476b753d39368a5966972a2729bb8bbea734a2b3e812b705eac" "e016c8a03c9a406094d80059ef4ca26f1928fa2daa5de9a6f22372e5c7a9" "41e610d1efb56ed7ce2228a70e2e150afb66edc2da066d463aa90ba0caff" @@ -3092,6 +3228,38 @@ const UsageInfo kUsageInfoTestData[] = { kEmptyString, CryptoWrappedKey(), }, + // File contents for test vector 2 + // sessions: + // -token: + // bb3370ccd3c3c49573d6b74386d1886d9888bd81fe3241bcd2bac9407d1a + // 834e + // license_request: + // dc0e51cfa5863f6c0b32a4ad7fa40625dadcc2dcde9e7fa3983b8804d996 + // 6803181682fc8ae831472e0b2fc26276242fbce624d286eedecce5555804 + // 913b4f8f86c5ae86160b8434b109169a63da04c5265102d772c1180543ef + // 226d2140357aca6cf87da3f7e370dfc08ca92a1f7c7d314eab36292a9170 + // 8f6c6ad84b37ee1c7dfafb99289206cb752d063f330efd85885f4b72ba1c + // a5823eed865a461345e3d6417872bf3b0608b3d9e1004c11e7326d3ed406 + // 192e13455d0ec4e1f558a147 + // license: + // f42a68ca3a14fb68f5992e4519f57970c3dae73f8da1d5b0b1da3eff7a95 + // 4012a0dc634357f3f5477a820e182182f24ae8e835ab10c18386cc8a0727 + // d3f38b628639bfbd69a94d4053eab1c31e075e014cc578b226cfe24d6b42 + // db242972def8f23a4aae88451307c2abaf54c1803ae54e3f1149aa6e6d42 + // 88cc7d474e876be07954e8b2deff4ade4bf30229fb6c92df4d66cd463f68 + // 6b4754b940210eb59f1581d658ddf8de8389e0e2d123e2cae3c2be6eb194 + // 8ccc896dd4cdf45f9090c96dfb925795cfb4ccda83e3eb4f745577b17fc1 + // 66bf5f4103c9085134cad7863a41b04f32ef20201e54b55f1817ce589619 + // b096c254fd2c2fa4a06f4de35ccfd23e + // key_set_id: "kside11109bf20cde544083ef4ee" + // usage_entry: + // ea106c124476b753d39368a5966972a2729bb8bbea734a2b3e812b705eac + // e016c8a03c9a406094d80059ef4ca26f1928fa2daa5de9a6f22372e5c7a9 + // 41e610d1efb56ed7ce2228a70e2e150afb66edc2da066d463aa90ba0caff + // 078fbfec05c8 + // usage_entry_number: 0 + // drm_certificate_id: 0 + // drm_certificate_cache: a2bs_hex("0AF404080310012AED040AEA040A20BB3370CCD3C3C49573D6B74386D1886D98" "88BD81FE3241BCD2BAC9407D1A834E12C001DC0E51CFA5863F6C0B32A4AD7FA4" "0625DADCC2DCDE9E7FA3983B8804D9966803181682FC8AE831472E0B2FC26276" @@ -3113,17 +3281,20 @@ const UsageInfo kUsageInfoTestData[] = { "4CA26F1928FA2DAA5DE9A6F22372E5C7A941E610D1EFB56ED7CE2228A70E2E15" "0AFB66EDC2DA066D463AA90BA0CAFF078FBFEC05C8300012203384AAAFD3A883" "17E6ED20BB88B0B3C01388AB1DF721547AE6FCB586659BC437")}, - // test vector 3, app id: "app_2", usage entry 0 + // Test vector 3 - app id: "app_2", usage entry count: 1 {"app_2", { + // PST: a2bs_hex( "9212a6926f21c6727c1ee89d5607047a1636f206f70e21fda86e01b6a4b5"), + // License request: a2bs_hex("ef947abed64078edf5b21fe6d3fb65384595d63a6d03e4d1d397c5019dee" "b6890d3ef8773002b91e255af0820fb594069df55d8abf96498e493f5c70" "f6b85f50e12a1ed3c039ad0cd838fe44d3fa9e2bbddeb2919041203111ed" "7778701b04d6b15f41d0bde799e20a38b27bf96fdbe844f10364baeb5935" "96220993c608ac793de76c237ca350931a7e216538074dbd83ddf262d9f1" "8acd91e1ea5372f7e773c5b64333"), + // License: a2bs_hex("7709721b3aa48597e88c99e82eaf7dff07e87e0318d9d7cec29096ec5918" "26aa7a359316d6de1d1329b408543e237de84c986987ead1bb6a0c38817e" "93013e5c989d366f49590b834453ec64b7433bf0b3335b9e222bad4caf55" @@ -3134,14 +3305,49 @@ const UsageInfo kUsageInfoTestData[] = { "094020ce08209bbc08f13fe2b96d7ba8213c8e9c85b6a623788d34da794e" "17e4cd3bd65680b97fb30bad64ddc42b1bcfb0b83e5dda3501a5902ca609" "f41837a0d5cd096e0659b67c"), + // Key set ID: "ksid62d88ed7b292217b0238be", + // Usage entry: a2bs_hex("5422463fd2e4dd47626e97dd6b4ee0b89523aaebe8d11e7e7be703ef01e4" "9b17eaf020cede0a9e0e7b5d91e4db7abdce445936cb2deecdefefdb14b7" "8f67b7ca5c733c9e88446fd814584584b86becbf6eb2b0e3d5603e8b"), + // Usage entry index: 25, + // DRM certificate: kEmptyString, + // Wrapped private key: CryptoWrappedKey(), }, + // File contents for test vector 3 + // sessions: + // -token: + // 9212a6926f21c6727c1ee89d5607047a1636f206f70e21fda86e01b6a4b5 + // license_request: + // ef947abed64078edf5b21fe6d3fb65384595d63a6d03e4d1d397c5019dee + // b6890d3ef8773002b91e255af0820fb594069df55d8abf96498e493f5c70 + // f6b85f50e12a1ed3c039ad0cd838fe44d3fa9e2bbddeb2919041203111ed + // 7778701b04d6b15f41d0bde799e20a38b27bf96fdbe844f10364baeb5935 + // 96220993c608ac793de76c237ca350931a7e216538074dbd83ddf262d9f1 + // 8acd91e1ea5372f7e773c5b64333 + // license: + // 7709721b3aa48597e88c99e82eaf7dff07e87e0318d9d7cec29096ec5918 + // 26aa7a359316d6de1d1329b408543e237de84c986987ead1bb6a0c38817e + // 93013e5c989d366f49590b834453ec64b7433bf0b3335b9e222bad4caf55 + // 4d69575c58595283166fea42e89645fc7e2d3ac9e0c1399b096cf3fed1e5 + // deb1bc4e0ee894f0ae3f929dd7dba4530e5655edbbf6041df430482eb2e8 + // 91b6a93af84d3c16dbad92733ffd34e8f4ce24506bead578d20cd3e291c2 + // fc2f811db875f49abc21a24277d2ba474fe6af6c14021cfead5513e0999e + // 094020ce08209bbc08f13fe2b96d7ba8213c8e9c85b6a623788d34da794e + // 17e4cd3bd65680b97fb30bad64ddc42b1bcfb0b83e5dda3501a5902ca609 + // f41837a0d5cd096e0659b67c + // key_set_id: "ksid62d88ed7b292217b0238be" + // usage_entry: + // 5422463fd2e4dd47626e97dd6b4ee0b89523aaebe8d11e7e7be703ef01e4 + // 9b17eaf020cede0a9e0e7b5d91e4db7abdce445936cb2deecdefefdb14b7 + // 8f67b7ca5c733c9e88446fd814584584b86becbf6eb2b0e3d5603e8b + // usage_entry_number: 25 + // drm_certificate_id: 0 + // drm_certificate_cache: a2bs_hex( "0AE604080310012ADF040ADC040A1E9212A6926F21C6727C1EE89D5607047A1636F20" "6F70E21FDA86E01B6A4B512A401EF947ABED64078EDF5B21FE6D3FB65384595D63A6D" @@ -3162,16 +3368,19 @@ const UsageInfo kUsageInfoTestData[] = { "E703EF01E49B17EAF020CEDE0A9E0E7B5D91E4DB7ABDCE445936CB2DEECDEFEFDB14B" "78F67B7CA5C733C9E88446FD814584584B86BECBF6EB2B0E3D5603E8B30191220E964" "7EB0AC28F0CB11C85111D69B5FA74E80015F4A07FB5C144E6CFE0E8E3709")}, - // test vector 4, app id: "app_2", usage entry 1 + // Test vector 4 - app id: "app_2", usage entry count: 2 {"app_2", { + // PST: a2bs_hex("831fad51e52a403524539eab6a1b201e46674ca3b9167b1c1b53f5e5e3"), + // License request: a2bs_hex("36d83acbc5e4ed027ed583e3b2169d98f4abedda15b781408e68efa14fef" "a9f3f0309bcb5a9fff6580636ebe3548e5acb43b76cfeb29a9c86324e62a" "eb40556005c6686e718f9bf61b0681d43b5b1e88084b3aea27a6b0e844e5" "500b6fcfacf2ee44d6af7f64154ab3fd4fbd0b8056cf63971076a1eb3642" "b78d5e76b84f4ed9f6220089863f8a4911691e79feffc9f804c4c36c7f85" "e45b1d276c85875875267eb65da70fd2d5e9176d6914"), + // License: a2bs_hex("317bd7063bfb9fae1b2e46f4cf15b7bc8c92517ff5c32cbb52ae4b67afc5" "d569cb66a462def7a18a7d0acebf9f6e8a604356ade2c81450c5466a4728" "90b03eefcf65388f060e24551c67b7d46ae5d4d841d5cc63d137fd543fae" @@ -3183,15 +3392,78 @@ const UsageInfo kUsageInfoTestData[] = { "84bfafe4d82e5d05a26ac06cde29faf6ab05b96685649c923779ce5ef7f3" "16531ada8e74e45ab1dc1d75648aa2de052674728867e87639ff9b782a3" "3"), + // Key set ID. "kside1d30b33b55f2deb4716", + // Usage entry: a2bs_hex("d44a9d70a7c582559f089b1c0fdfcbdaf5e26b672fca5d58e889b407a0ba" "8599079cde11fadfab23aa1b97622839f3b7e1a96f8332bec5fbcbc9eb64" "fd5ed05887b8fa3bfd6ecc7bc91e621342732062d2f4411b763e20328af6" "f8ef5030e2f8027aef9e"), + // Usage entry index: 6, + // DRM certirficate: kEmptyString, + // Wrapped private key: CryptoWrappedKey(), }, + // File contents for test vector 4 + // sessions: + // -token: + // 9212a6926f21c6727c1ee89d5607047a1636f206f70e21fda86e01b6a4b5 + // license_request: + // ef947abed64078edf5b21fe6d3fb65384595d63a6d03e4d1d397c5019dee + // b6890d3ef8773002b91e255af0820fb594069df55d8abf96498e493f5c70 + // f6b85f50e12a1ed3c039ad0cd838fe44d3fa9e2bbddeb2919041203111ed + // 7778701b04d6b15f41d0bde799e20a38b27bf96fdbe844f10364baeb5935 + // 96220993c608ac793de76c237ca350931a7e216538074dbd83ddf262d9f1 + // 8acd91e1ea5372f7e773c5b64333 + // license: + // 7709721b3aa48597e88c99e82eaf7dff07e87e0318d9d7cec29096ec5918 + // 26aa7a359316d6de1d1329b408543e237de84c986987ead1bb6a0c38817e + // 93013e5c989d366f49590b834453ec64b7433bf0b3335b9e222bad4caf55 + // 4d69575c58595283166fea42e89645fc7e2d3ac9e0c1399b096cf3fed1e5 + // deb1bc4e0ee894f0ae3f929dd7dba4530e5655edbbf6041df430482eb2e8 + // 91b6a93af84d3c16dbad92733ffd34e8f4ce24506bead578d20cd3e291c2 + // fc2f811db875f49abc21a24277d2ba474fe6af6c14021cfead5513e0999e + // 094020ce08209bbc08f13fe2b96d7ba8213c8e9c85b6a623788d34da794e + // 17e4cd3bd65680b97fb30bad64ddc42b1bcfb0b83e5dda3501a5902ca609 + // f41837a0d5cd096e0659b67c + // key_set_id: "ksid62d88ed7b292217b0238be" + // usage_entry: + // 5422463fd2e4dd47626e97dd6b4ee0b89523aaebe8d11e7e7be703ef01e4 + // 9b17eaf020cede0a9e0e7b5d91e4db7abdce445936cb2deecdefefdb14b7 + // 8f67b7ca5c733c9e88446fd814584584b86becbf6eb2b0e3d5603e8b + // usage_entry_number: 25 + // drm_certificate_id: 0 + // -token: + // 831fad51e52a403524539eab6a1b201e46674ca3b9167b1c1b53f5e5e3 + // license_request: + // 36d83acbc5e4ed027ed583e3b2169d98f4abedda15b781408e68efa14fef + // a9f3f0309bcb5a9fff6580636ebe3548e5acb43b76cfeb29a9c86324e62a + // eb40556005c6686e718f9bf61b0681d43b5b1e88084b3aea27a6b0e844e5 + // 500b6fcfacf2ee44d6af7f64154ab3fd4fbd0b8056cf63971076a1eb3642 + // b78d5e76b84f4ed9f6220089863f8a4911691e79feffc9f804c4c36c7f85 + // e45b1d276c85875875267eb65da70fd2d5e9176d6914 + // license: + // 317bd7063bfb9fae1b2e46f4cf15b7bc8c92517ff5c32cbb52ae4b67afc5 + // d569cb66a462def7a18a7d0acebf9f6e8a604356ade2c81450c5466a4728 + // 90b03eefcf65388f060e24551c67b7d46ae5d4d841d5cc63d137fd543fae + // 2c771756590b90e480ca0126f1fc0090ace62499e47569fc52196c788f80 + // 139755bdf12a7acb29fd6e23a46a4c036f04ff1ed6cd714094253bf1c587 + // 62c93f0ddf8a73c4be927ffec2723a16d8ffe5128851f58537461275f6aa + // 1976e3b399b7243919207e040ec16c5328e8ab082278fce0e5d3df5c5f92 + // dba51fa6613587d4ece31f2c001b49bfaed434f9512e895c2e09c88ddbf1 + // 84bfafe4d82e5d05a26ac06cde29faf6ab05b96685649c923779ce5ef7f3 + // 16531ada8e74e45ab1dc1d75648aa2de052674728867e87639ff9b782a33 + // key_set_id: "kside1d30b33b55f2deb4716" + // usage_entry: + // d44a9d70a7c582559f089b1c0fdfcbdaf5e26b672fca5d58e889b407a0ba + // 8599079cde11fadfab23aa1b97622839f3b7e1a96f8332bec5fbcbc9eb64 + // fd5ed05887b8fa3bfd6ecc7bc91e621342732062d2f4411b763e20328af6 + // f8ef5030e2f8027aef9e + // usage_entry_number: 6 + // drm_certificate_id: 0 + // drm_certificate_cache: a2bs_hex( "0AE809080310012AE1090ADC040A1E9212A6926F21C6727C1EE89D5607047A1636F20" "6F70E21FDA86E01B6A4B512A401EF947ABED64078EDF5B21FE6D3FB65384595D63A6D" @@ -3231,18 +3503,21 @@ const UsageInfo kUsageInfoTestData[] = { "F8332BEC5FBCBC9EB64FD5ED05887B8FA3BFD6ECC7BC91E621342732062D2F4411B76" "3E20328AF6F8EF5030E2F8027AEF9E300612203F1EEC1DDC56EE480AC744C1D72379E" "AFFD4675FF15A7D53BD56AC9736D62FC1")}, - // test vector 5, app id: "app_1", usage entry 1 + // Test vector 5 - app id: "app_1", usage entry 2 {"app_1", { + // PST a2bs_hex("eace80e30bfda213f1ce4dbcfd9d4d24b8e2ae00054d167d9d7ae9954706" "2b9113"), - a2bs_hex("68a7665a21348fc0590328608dc520be40f5b749328568fe383ef69c1a58" - "7ab2446cf9c41d821373d0856a883b316519a42218f80e7bd5764d16bac9" - "a9b427a7278f5940e563fcf6dee0ff3aadbb702ebf2c54ec354ae7acc84e" - "e6a54bca1f30e38ef71c44a81d0009b1484feaf4f1a56f58c35bb2372c80" - "c6dfb389e6de60bdd3d46c03975715260f6fdbe42facb64c22eda9635c04" - "da79434e1c41fbd2fdbbab6598283226c0278e8e0a96d780d3436523efd" - "1"), + // License request: + a2bs_hex( + "68a7665a21348fc0590328608dc520be40f5b749328568fe383ef69c1a58" + "7ab2446cf9c41d821373d0856a883b316519a42218f80e7bd5764d16bac9" + "a9b427a7278f5940e563fcf6dee0ff3aadbb702ebf2c54ec354ae7acc84e" + "e6a54bca1f30e38ef71c44a81d0009b1484feaf4f1a56f58c35bb2372c80" + "c6dfb389e6de60bdd3d46c03975715260f6fdbe42facb64c22eda9635c04" + "da79434e1c41fbd2fdbbab6598283226c0278e8e0a96d780d3436523efd1"), + // License: a2bs_hex("ff6fecf7157828812a2d6dcb15383a6d9af4519ef804c6053a10c436002d" "e3a4efcc017755f4ad1101bdc813e2d211732418dee529cbb413c48aa588" "4c76a5c6f556a715055560d4247f5bf310956949a3a171a4aa608a484468" @@ -3252,16 +3527,89 @@ const UsageInfo kUsageInfoTestData[] = { "0211c2f8d9e4d5be18509c327c647d654c4b6cc430b98f1ff37c96fab087" "fb561b8cc18480f877c873594d3148ff74b0e3c6327c27ca876dae742239" "8fc5e85269cba49ad099"), + // Key set ID: "ksid8e80350cbef6463a0025e6cc", + // Usage entry: a2bs_hex("7ccc7ce96055e16a52fa192ea2cf3c9df3e89b9133a52286f71e6c6d82d0" "435f6b2155dfde590b347d8c86f62d7dfbaae640c237256f609e5da9cc6c" "103465fe3441612bbdfdf4d1c24b2147feb8565cef4993e439c9d564a39a" "4ac5bb1da69acb44da06e4522c9a93d310cdda5dac1e1e0b91abff41e4e2" "edda4001"), + // Usage entry index: 7, + // DRM certificate: kDrmCertificate, + // Wrapped private key: kCryptoWrappedKey, }, + // File contents for test vector 5 + // sessions: + // -token: + // bb3370ccd3c3c49573d6b74386d1886d9888bd81fe3241bcd2bac9407d1a + // 834e + // license_request: + // dc0e51cfa5863f6c0b32a4ad7fa40625dadcc2dcde9e7fa3983b8804d996 + // 6803181682fc8ae831472e0b2fc26276242fbce624d286eedecce5555804 + // 913b4f8f86c5ae86160b8434b109169a63da04c5265102d772c1180543ef + // 226d2140357aca6cf87da3f7e370dfc08ca92a1f7c7d314eab36292a9170 + // 8f6c6ad84b37ee1c7dfafb99289206cb752d063f330efd85885f4b72ba1c + // a5823eed865a461345e3d6417872bf3b0608b3d9e1004c11e7326d3ed406 + // 192e13455d0ec4e1f558a147 + // license: + // f42a68ca3a14fb68f5992e4519f57970c3dae73f8da1d5b0b1da3eff7a95 + // 4012a0dc634357f3f5477a820e182182f24ae8e835ab10c18386cc8a0727 + // d3f38b628639bfbd69a94d4053eab1c31e075e014cc578b226cfe24d6b42 + // db242972def8f23a4aae88451307c2abaf54c1803ae54e3f1149aa6e6d42 + // 88cc7d474e876be07954e8b2deff4ade4bf30229fb6c92df4d66cd463f68 + // 6b4754b940210eb59f1581d658ddf8de8389e0e2d123e2cae3c2be6eb194 + // 8ccc896dd4cdf45f9090c96dfb925795cfb4ccda83e3eb4f745577b17fc1 + // 66bf5f4103c9085134cad7863a41b04f32ef20201e54b55f1817ce589619 + // b096c254fd2c2fa4a06f4de35ccfd23e + // key_set_id: "kside11109bf20cde544083ef4ee" + // usage_entry: + // ea106c124476b753d39368a5966972a2729bb8bbea734a2b3e812b705eac + // e016c8a03c9a406094d80059ef4ca26f1928fa2daa5de9a6f22372e5c7a9 + // 41e610d1efb56ed7ce2228a70e2e150afb66edc2da066d463aa90ba0caff + // 078fbfec05c8 + // usage_entry_number: 0 + // drm_certificate_id: 0 + // -token: + // eace80e30bfda213f1ce4dbcfd9d4d24b8e2ae00054d167d9d7ae9954706 + // 2b9113 + // license_request: + // 68a7665a21348fc0590328608dc520be40f5b749328568fe383ef69c1a58 + // 7ab2446cf9c41d821373d0856a883b316519a42218f80e7bd5764d16bac9 + // a9b427a7278f5940e563fcf6dee0ff3aadbb702ebf2c54ec354ae7acc84e + // e6a54bca1f30e38ef71c44a81d0009b1484feaf4f1a56f58c35bb2372c80 + // c6dfb389e6de60bdd3d46c03975715260f6fdbe42facb64c22eda9635c04 + // da79434e1c41fbd2fdbbab6598283226c0278e8e0a96d780d3436523efd1 + // license: + // ff6fecf7157828812a2d6dcb15383a6d9af4519ef804c6053a10c436002d + // e3a4efcc017755f4ad1101bdc813e2d211732418dee529cbb413c48aa588 + // 4c76a5c6f556a715055560d4247f5bf310956949a3a171a4aa608a484468 + // 84e7676d558ff64d392b84e617805693d90f1e9b7b540c383d384d7f7ce0 + // 6c23618681bd838ceb1a514047f1c562c43159cc5e21588fbfce8a354111 + // 160f1a1e2bd3d798a000579bdfdb977252809ee1502df8045972fe8aac84 + // 0211c2f8d9e4d5be18509c327c647d654c4b6cc430b98f1ff37c96fab087 + // fb561b8cc18480f877c873594d3148ff74b0e3c6327c27ca876dae742239 + // 8fc5e85269cba49ad099 + // key_set_id: "ksid8e80350cbef6463a0025e6cc" + // usage_entry: + // 7ccc7ce96055e16a52fa192ea2cf3c9df3e89b9133a52286f71e6c6d82d0 + // 435f6b2155dfde590b347d8c86f62d7dfbaae640c237256f609e5da9cc6c + // 103465fe3441612bbdfdf4d1c24b2147feb8565cef4993e439c9d564a39a + // 4ac5bb1da69acb44da06e4522c9a93d310cdda5dac1e1e0b91abff41e4e2 + // edda4001 + // usage_entry_number: 7 + // drm_certificate_id: 0 + // drm_certificate_cache: + // -drm_certificate_id: 0 + // drm_certificate: + // certificate: "a drm certificate" + // wrapped_private_key: "a wrapped private key" + // key_type: RSA + // acquisition_time_seconds: 0 + // expiration_time_seconds: 0 a2bs_hex( "0AA00A080310012A990A0AEA040A20BB3370CCD3C3C49573D6B74386D1886D9888BD8" "1FE3241BCD2BAC9407D1A834E12C001DC0E51CFA5863F6C0B32A4AD7FA40625DADCC2" @@ -3303,10 +3651,12 @@ const UsageInfo kUsageInfoTestData[] = { "726D20636572746966696361746512156120777261707065642070726976617465206" "B657918001220BD67878F6AA958EC6996061F69BF65E9806221BCA1CF26FFA4BF1D0B" "4ECE8806")}, - // test vector 6, app id: "", usage entry 2 + // Test vector 6 - app id: "", usage entry count: 3 {"", { + // PST: a2bs_hex("1fbf0a1d2432805a0f8292ff627a9a7c60b733a51b365892c832261d71"), + // License request: a2bs_hex("1ad116a26f423c7019fa8dca226c2d2bdeec91beb1fd38d6890e32745a4d" "bb9409b65fe834c2522d92621b265a9d526b4fcadcacf4c4deb364661118" "494fd1561621392bf4450e6833be290d49e59e665a031375ee56ad1f3392" @@ -3314,6 +3664,7 @@ const UsageInfo kUsageInfoTestData[] = { "ca72b8b311ad329d2c9cb0909c2ecbe3fbaf88e81bb5aeaa6480fff67e87" "77fa00c783aa160f1e211cb9bf3835fa8f82923c05895c359cf306f5cb90" "a73b8ce2ce9ed210485e1c57"), + // License: a2bs_hex("0bf120627d01690d14321fa967d81997b959b35ed7745dee9e885dd402df" "83c3b8f52999b16c2d1d47bf4724a9ced984175eb8a032d613294c148020" "74154c34fd40fe6ea74fa830fdcb9cc7e0799a75aadaf41ddda3d0038896" @@ -3323,15 +3674,121 @@ const UsageInfo kUsageInfoTestData[] = { "4149f53038b432964705e26c3bb6535461b7fff27ac8eff679dce8e5bfe1" "d000b69a22d9efc1f310ba2f0115c96b00bc15888fbb3edd230834458491" "eede2440550dd59c613dc8433efe979c71e9"), + // Key set ID: "ksida5d27d7b0ccd433203e157", + // Usage entry: a2bs_hex("1be7cd47cefdef69576348ef9a143be2311041a5f80259938fa886139679" "4eabcc985a695be2ef4a8361d86979859c490922d92d3ed0484e1666270a" "a96388bf6be3c4f4f0b7e2f59efc6b8e965d8fadd5ab86b2bb816d2573ec" "36eb42b571297681be152d40639d"), + // Usage entry index: 0, + // DRM certificate: kEmptyString, + // Wrapped private key. CryptoWrappedKey(), }, + // File contents for test vector 6 + // sessions: + // -token: + // b8e7f26b6b8b59babf05b5a1f8927b412a85bc8551a928f00856329814ae + // 5a82 + // license_request: + // 4463dc57079c27e34ae115c6f65b08f6311c4ea604a6512c42470b6f692a + // 76ea769d60d0b6bcf8d565ef31eb925f38e2095039c9f2f113ecee020f11 + // 26eb30165372d538b551ebd7bae5cf0bbeebb3cdb6f180d42868051aab8f + // f4947460dd96f0f8259fc6001059c998d2eb6902c064f9ae08e6cd3c7807 + // e50379507b41620d15dd76c0b1e7ed9417efd6825959b5077f464e6429a4 + // dee467a1ba2b05d38049912d5539f1ee9f5d8a569aa1c384384f847ed64f + // 6ffc101036da70e69c06e4916493e82e9fe3f65d85254c8c14f6ca0579bf + // b3eaa86b2d7bb5ff572eccfd70f2ea4695f326beadf241ae4311e428c7c1 + // 2a0d4d1915cd0537ff0f62cf13eb2fa2 + // license: + // bbe6b4b60da9d9bc34dcc8502fb81d8fd5fdbc8fa89605c86205f2b8c653 + // 0ff64c8c31f579bd8eca603dfd5e397ac35e48931fd330351d01361bb31c + // aaa7dbf816a6144a12b6c22d1dceba20669ed635a40831066abd80713421 + // 19d7da11c43696b2898d3df3b36beb8da013d9dc145343494b19d6da085f + // 4a41e421d3def2ad8b72dffffb6e79bbceaf8594045d16a62eed16904a35 + // 69860c531a32eaa5abb868b1dd6a0b03d69c1a3f8336af80eb80badbbc7b + // 80ca5943bd5b374302147052201faed30e9ffa99fc00b47f7eeb469512a4 + // 13e873f91d959cccacccd3585b7f00ed8d4685022101713c3adc439f2751 + // 2a45926c1d2473477662c4bace72f380d105ddc9f7be49ed71991b3d9e29 + // a2038201373f98a845a57624a692f44ebd316d26c48fee82b655583317ec + // a4aaa4dac841524a2dca111749629637ef29fa7e72645a875957fb3d98a5 + // e6c8065b1349cfa23011cd6349d911c535475fed50be9eacb6a1ff3ea745 + // 8823f0229f2fa90b7a7099e8ec349d3d0fe0277cba5157ca62c8fbaa893f + // 37b8c8cea2a0d2d2912caccf92d31aa17439479711b4a5b77445cc02c18b + // fe0195ce8f1fe59e317214005cee5e25904c9fb0af7e2b6b4dccdf78e61e + // 179a9f93996ec3c76f6da9b5a291bf08a73032b37edcbbbdd20cff94088a + // 489167c56e5e75b376874e9750212fe94d7656d9cd835db3b771ba5b58d2 + // b255 + // key_set_id: "ksid854c8a60a5a547e122c24fca" + // usage_entry: + // 7d2b905e5eafd4b28aeeb7633283579e48add21a68eb26cc8c3b2e344579 + // 003b12a38554336305525fa6ab70f024a18c73631bb1531eca3f0782c72d + // ba017311b3f1e98c739632e305e4bc0b2561ae2b + // usage_entry_number: 5 + // drm_certificate_id: 0 + // -token: + // 5d637be37a9722aa35c23d346470851aca7d2edcd1a27edf124ea6 + // license_request: + // bc96d6878e3086c33624821f1f3ece23f27e58222c2bb8d1615476a11792 + // 63b58f6427e92911d961fc7a3afd947aed8c9aead1f08457925d2ce4e0f6 + // 18b21942baa60b231eae864048f94f74ffa700e5777f812adb6f0cb6ba6f + // 0d145e3951191eb217140c32f2c7565053222131ff823bc36d80b24b561c + // cbea9d397fe00942e7ff73b8152cdc083b63a9f9c4a77056a0d79f44f267 + // da0ed629d9c902f7e838957ea41aa442221c3aa9410db58302b468c6d7f2 + // 113663809f0dcf187c108ced + // license: + // f6fb3693413cc1d7d5e3459b856e4156c78f8d85d548939fd00474c8cded + // c46835cc981758500fe61cc79383b4d9f87c3e33d19c2d25d7d15dd0f3d2 + // b1af4583b71e90c59886d297e78e929c2f3840c82c626914a4eb537b3a51 + // 61d963472b6592c0fa1e415556bc009c2da22bcf743ac434e22f8a33b432 + // 10dfd8aa09fe86105610f366e6fb7da18996cf7c7db425a9bb50e4a13190 + // a680b9f82d37d09658585abe3bf9f009a5c1ce38a7cefe17f71fb402768b + // 2d66b4ca523ed06729349695d7864d7cf7a1cc11d0da2b8a43db834d10b4 + // 7d9579ec9e46986a133277b92c636cb2a6a823afe73317266c9c0601ddba + // db76e1d254d6183b93a1ea91a7e6c567331b3ee3a5ab1484af91fd0f8dac + // 5fd980a67d8f33cc1d6cf20ee4c24582d03967ed48b6f28e7514e4d18f38 + // c8cb1e54fba59af7d6a79c6c5a7ab06baac964c7958d201910adca018022 + // fbeb8535b64f5ce83d3c + // key_set_id: "ksid2f2e85ce8a677f60047d7024e07b5ae6" + // usage_entry: + // b74880fbddc5bb9db82f09bc7de3ffd95a0a671b979d4c1f0564eaf63eb6 + // b5a8c3f16d9f964afbd011e2326f9c27afbe74536f3f0601a71d9c1c422f + // 335611bf3bf1a1c89e2dea27c17a9d9a58a74121e840b002e8a6fb590072 + // 45be786c1f64 + // usage_entry_number: 9 + // drm_certificate_id: 0 + // -token: + // 1fbf0a1d2432805a0f8292ff627a9a7c60b733a51b365892c832261d71 + // license_request: + // 1ad116a26f423c7019fa8dca226c2d2bdeec91beb1fd38d6890e32745a4d + // bb9409b65fe834c2522d92621b265a9d526b4fcadcacf4c4deb364661118 + // 494fd1561621392bf4450e6833be290d49e59e665a031375ee56ad1f3392 + // 436ba213abc5ac10a199e73123f84f7644282137da24cbde30c10a6eb847 + // ca72b8b311ad329d2c9cb0909c2ecbe3fbaf88e81bb5aeaa6480fff67e87 + // 77fa00c783aa160f1e211cb9bf3835fa8f82923c05895c359cf306f5cb90 + // a73b8ce2ce9ed210485e1c57 + // license: + // 0bf120627d01690d14321fa967d81997b959b35ed7745dee9e885dd402df + // 83c3b8f52999b16c2d1d47bf4724a9ced984175eb8a032d613294c148020 + // 74154c34fd40fe6ea74fa830fdcb9cc7e0799a75aadaf41ddda3d0038896 + // da966b1a67ff4e6c7403debfdbe7d1d48f1a3304124f04c974bfa0eff4d0 + // b1733a84aa6f89ec74c89dad2168da4706f6dfcfd980502b573d0f7b3791 + // 252cc918394e8b3a3e1ef37ce48b7fd6a2040db5915f55809f284ce4ec24 + // 4149f53038b432964705e26c3bb6535461b7fff27ac8eff679dce8e5bfe1 + // d000b69a22d9efc1f310ba2f0115c96b00bc15888fbb3edd230834458491 + // eede2440550dd59c613dc8433efe979c71e9 + // key_set_id: "ksida5d27d7b0ccd433203e157" + // usage_entry: + // 1be7cd47cefdef69576348ef9a143be2311041a5f80259938fa886139679 + // 4eabcc985a695be2ef4a8361d86979859c490922d92d3ed0484e1666270a + // a96388bf6be3c4f4f0b7e2f59efc6b8e965d8fadd5ab86b2bb816d2573ec + // 36eb42b571297681be152d40639d + // usage_entry_number: 0 + // drm_certificate_id: 0 + // drm_certificate_cache: a2bs_hex( "0ADA11080310012AD3110A9A070A20B8E7F26B6B8B59BABF05B5A1F8927B412A85BC8" "551A928F00856329814AE5A821280024463DC57079C27E34AE115C6F65B08F6311C4E" @@ -3400,16 +3857,19 @@ const UsageInfo kUsageInfoTestData[] = { "859C490922D92D3ED0484E1666270AA96388BF6BE3C4F4F0B7E2F59EFC6B8E965D8FA" "DD5AB86B2BB816D2573EC36EB42B571297681BE152D40639D3000122076CFC9DBA6CD" "93FFC6BB74D61C1B644CC32121553C50817A9F6F00633575E659")}, - // test vector 7, app id: "app_2", usage entry 2 + // Test vector 7 - app id: "app_2", usage entry count: 3 {"app_2", { + // PST: a2bs_hex("8f922e955b269458ed1345bde9a24516520a536817e8e8612154a1"), + // License request: a2bs_hex("d4acc596a52055cee710e1fec44796dbf3ae6b017ab156d9bff7bfdb8f1e" "6352bfbe453034968f940c36ac18800e22bb2ff71268053702ef3fce3fb2" "d607a078e0d1449fcc9d0675d41b1a65f78e3c02370d18112aae1e2577ff" "9087825a45125db5dee8e27bd14ea8666b4e8e6aba6811c40b585aabb9c9" "185209a48d11130ff690316916961f28286c71c3e985d7dc3352166e414b" "89da2c17cc5b69fc9c00990697f5"), + // License: a2bs_hex("169d3c432f9c2f8b99e11632bd7d6a63f3d57679c567bedcb2e596ace105" "0453732040cb468e9c43f6009b430ca4a4046d017e67a4badd5b71c0c9fc" "e2274817f0bcda311a4f8703e6dc32aedf30e6f9abd40e249fc8b0a5045c" @@ -3420,14 +3880,110 @@ const UsageInfo kUsageInfoTestData[] = { "a0c07f9cd805fcdc0d30f70e4c4b2959a0f52385c6bd3e6eeb4e3d81fdc1" "a9dc3c76faf1bfed913d58567fa9b296d27dff5217c583e7c134a642601f" "8237"), + // Key set ID: "kside684918d6c39bfa652a40ad936", + // Usage entry: a2bs_hex("703f69807c8f4d140168874b924a625132eb3b896a381d617b8fb83c7314" "a6b634d840925f711ae330599f0e0863800902b05d201a8a87b88a4bc170" "65a1a8a556c34bf86b53afcc9951be15bea9ab55"), + // Usage entry index: 27, + // DRM certificate: kAnotherDrmCertificate, + // Wrapped private key: kAnotherCryptoWrappedKey, }, + // File contents for test vector 7 + // sessions: + // -token: + // 9212a6926f21c6727c1ee89d5607047a1636f206f70e21fda86e01b6a4b5 + // license_request: + // ef947abed64078edf5b21fe6d3fb65384595d63a6d03e4d1d397c5019dee + // b6890d3ef8773002b91e255af0820fb594069df55d8abf96498e493f5c70 + // f6b85f50e12a1ed3c039ad0cd838fe44d3fa9e2bbddeb2919041203111ed + // 7778701b04d6b15f41d0bde799e20a38b27bf96fdbe844f10364baeb5935 + // 96220993c608ac793de76c237ca350931a7e216538074dbd83ddf262d9f1 + // 8acd91e1ea5372f7e773c5b64333 + // license: + // 7709721b3aa48597e88c99e82eaf7dff07e87e0318d9d7cec29096ec5918 + // 26aa7a359316d6de1d1329b408543e237de84c986987ead1bb6a0c38817e + // 93013e5c989d366f49590b834453ec64b7433bf0b3335b9e222bad4caf55 + // 4d69575c58595283166fea42e89645fc7e2d3ac9e0c1399b096cf3fed1e5 + // deb1bc4e0ee894f0ae3f929dd7dba4530e5655edbbf6041df430482eb2e8 + // 91b6a93af84d3c16dbad92733ffd34e8f4ce24506bead578d20cd3e291c2 + // fc2f811db875f49abc21a24277d2ba474fe6af6c14021cfead5513e0999e + // 094020ce08209bbc08f13fe2b96d7ba8213c8e9c85b6a623788d34da794e + // 17e4cd3bd65680b97fb30bad64ddc42b1bcfb0b83e5dda3501a5902ca609 + // f41837a0d5cd096e0659b67c + // key_set_id: "ksid62d88ed7b292217b0238be" + // usage_entry: + // 5422463fd2e4dd47626e97dd6b4ee0b89523aaebe8d11e7e7be703ef01e4 + // 9b17eaf020cede0a9e0e7b5d91e4db7abdce445936cb2deecdefefdb14b7 + // 8f67b7ca5c733c9e88446fd814584584b86becbf6eb2b0e3d5603e8b + // usage_entry_number: 25 + // drm_certificate_id: 0 + // -token: + // 831fad51e52a403524539eab6a1b201e46674ca3b9167b1c1b53f5e5e3 + // license_request: + // 36d83acbc5e4ed027ed583e3b2169d98f4abedda15b781408e68efa14fef + // a9f3f0309bcb5a9fff6580636ebe3548e5acb43b76cfeb29a9c86324e62a + // eb40556005c6686e718f9bf61b0681d43b5b1e88084b3aea27a6b0e844e5 + // 500b6fcfacf2ee44d6af7f64154ab3fd4fbd0b8056cf63971076a1eb3642 + // b78d5e76b84f4ed9f6220089863f8a4911691e79feffc9f804c4c36c7f85 + // e45b1d276c85875875267eb65da70fd2d5e9176d6914 + // license: + // 317bd7063bfb9fae1b2e46f4cf15b7bc8c92517ff5c32cbb52ae4b67afc5 + // d569cb66a462def7a18a7d0acebf9f6e8a604356ade2c81450c5466a4728 + // 90b03eefcf65388f060e24551c67b7d46ae5d4d841d5cc63d137fd543fae + // 2c771756590b90e480ca0126f1fc0090ace62499e47569fc52196c788f80 + // 139755bdf12a7acb29fd6e23a46a4c036f04ff1ed6cd714094253bf1c587 + // 62c93f0ddf8a73c4be927ffec2723a16d8ffe5128851f58537461275f6aa + // 1976e3b399b7243919207e040ec16c5328e8ab082278fce0e5d3df5c5f92 + // dba51fa6613587d4ece31f2c001b49bfaed434f9512e895c2e09c88ddbf1 + // 84bfafe4d82e5d05a26ac06cde29faf6ab05b96685649c923779ce5ef7f3 + // 16531ada8e74e45ab1dc1d75648aa2de052674728867e87639ff9b782a33 + // key_set_id: "kside1d30b33b55f2deb4716" + // usage_entry: + // d44a9d70a7c582559f089b1c0fdfcbdaf5e26b672fca5d58e889b407a0ba + // 8599079cde11fadfab23aa1b97622839f3b7e1a96f8332bec5fbcbc9eb64 + // fd5ed05887b8fa3bfd6ecc7bc91e621342732062d2f4411b763e20328af6 + // f8ef5030e2f8027aef9e + // usage_entry_number: 6 + // drm_certificate_id: 0 + // -token: 8f922e955b269458ed1345bde9a24516520a536817e8e8612154a1 + // license_request: + // d4acc596a52055cee710e1fec44796dbf3ae6b017ab156d9bff7bfdb8f1e + // 6352bfbe453034968f940c36ac18800e22bb2ff71268053702ef3fce3fb2 + // d607a078e0d1449fcc9d0675d41b1a65f78e3c02370d18112aae1e2577ff + // 9087825a45125db5dee8e27bd14ea8666b4e8e6aba6811c40b585aabb9c9 + // 185209a48d11130ff690316916961f28286c71c3e985d7dc3352166e414b + // 89da2c17cc5b69fc9c00990697f5 + // license: + // 169d3c432f9c2f8b99e11632bd7d6a63f3d57679c567bedcb2e596ace105 + // 0453732040cb468e9c43f6009b430ca4a4046d017e67a4badd5b71c0c9fc + // e2274817f0bcda311a4f8703e6dc32aedf30e6f9abd40e249fc8b0a5045c + // c1e47e60a60b4893ef92602f5584e1162f4ff3ee6d906228f97b442ace1f + // b175d113b671bdbe4ceffdd98f2bb094c0dfac03b79541a44d8affdc987f + // 4268706b5a554e998907eb7126e8c6bc07c837d8aeebea3249e37b4b7dd7 + // 327300fe7e62c15981cf73a13e806d065bcadc2c747256907a5493592b07 + // a0c07f9cd805fcdc0d30f70e4c4b2959a0f52385c6bd3e6eeb4e3d81fdc1 + // a9dc3c76faf1bfed913d58567fa9b296d27dff5217c583e7c134a642601f + // 8237 + // key_set_id: "kside684918d6c39bfa652a40ad936" + // usage_entry: + // 703f69807c8f4d140168874b924a625132eb3b896a381d617b8fb83c7314 + // a6b634d840925f711ae330599f0e0863800902b05d201a8a87b88a4bc170 + // 65a1a8a556c34bf86b53afcc9951be15bea9ab55 + // usage_entry_number: 27 + // drm_certificate_id: 0 + // drm_certificate_cache: + // -drm_certificate_id: 0 + // drm_certificate: + // certificate: "another drm certificate" + // wrapped_private_key: "another wrapped private key" + // key_type: ECC + // acquisition_time_seconds: 0 + // expiration_time_seconds: 0 a2bs_hex( "0AF60E080310012AEF0E0ADC040A1E9212A6926F21C6727C1EE89D5607047A1636F20" "6F70E21FDA86E01B6A4B512A401EF947ABED64078EDF5B21FE6D3FB65384595D63A6D" @@ -3486,17 +4042,20 @@ const UsageInfo kUsageInfoTestData[] = { "46865722064726D206365727469666963617465121B616E6F74686572207772617070" "65642070726976617465206B65791801122082BB366A1D04CD51FA6BE0E5E1F7B9393" "0C2E887586E2E5FBC6838ADDD3A209B")}, - // test vector 8, app id: "app_1", usage entry 2 + // Test vector 8 - app id: "app_1", usage entry count: 2 {"app_1", { + // PST: a2bs_hex("d0b9a07ad7ffeec13784bd60da011be3589f3e450227fd36b1a3f6786cdb" "fe8f"), + // License request: a2bs_hex("a419c5687a592099dc67da8bc4f5ef238c80fe4ce3e2fcb025392efb1438" "4b581b595a0e8fa95de637fb2184719eb36ad6539ee9df0f67697f91d018" "6e04552e811196029cf4e256518ddf3215af8ec61442c17d6753b93f9d3a" "9240bae39bacf5563659cf47d3a611ce20ed3ebbf86cddad60cc2847c459" "5dcfd934d012ce205960052158461d7c5d480de2e597876e64e8f8de6928" "29a3"), + // Licenes: a2bs_hex("f7c19357e50fc474437c1a635c5bae8f6f51afa20750766db19457dff7ae" "f2cae78848a225cc6a088bbcffead5be6aab6fc8af091bf459c3bd9bcfa1" "8de53ef76db1b4826cf0b8ff7b2d7c44bbadb3cd7aedd8f639d1f38c52a5" @@ -3507,14 +4066,115 @@ const UsageInfo kUsageInfoTestData[] = { "b872dbcb703d7bf20b9ecaa481425a5218d85a49595f3ed268d61f1be8e3" "8e6126eb075fa6b7ae80431c8521c4bc2ce701e45d33bfca9a5b0b66b550" "aab21eae41f84cadfd2517dee9a2c139ad475c387d25"), + // Key set ID: "ksid321bb636f8a3f5cd5d54a236", + // Usage entry: a2bs_hex("c3cb027611397b5d70cc0b08e0f5249cd19996da674e33722902173d45d7" "09914a3d7e898d93170317bfcff34861c0d687048cc93542a75a2c99b232" "3fafea1ee0c3e3d24edf2633"), + // Usage entry index: 7, + // DRM certificate: kDrmCertificate, + // Wrapped private key. kCryptoWrappedKey, }, + // File contents for test vector 8 + // sessions: + // -token: + // bb3370ccd3c3c49573d6b74386d1886d9888bd81fe3241bcd2bac9407d1a + // 834e + // license_request: + // dc0e51cfa5863f6c0b32a4ad7fa40625dadcc2dcde9e7fa3983b8804d996 + // 6803181682fc8ae831472e0b2fc26276242fbce624d286eedecce5555804 + // 913b4f8f86c5ae86160b8434b109169a63da04c5265102d772c1180543ef + // 226d2140357aca6cf87da3f7e370dfc08ca92a1f7c7d314eab36292a9170 + // 8f6c6ad84b37ee1c7dfafb99289206cb752d063f330efd85885f4b72ba1c + // a5823eed865a461345e3d6417872bf3b0608b3d9e1004c11e7326d3ed406 + // 192e13455d0ec4e1f558a147 + // license: + // f42a68ca3a14fb68f5992e4519f57970c3dae73f8da1d5b0b1da3eff7a95 + // 4012a0dc634357f3f5477a820e182182f24ae8e835ab10c18386cc8a0727 + // d3f38b628639bfbd69a94d4053eab1c31e075e014cc578b226cfe24d6b42 + // db242972def8f23a4aae88451307c2abaf54c1803ae54e3f1149aa6e6d42 + // 88cc7d474e876be07954e8b2deff4ade4bf30229fb6c92df4d66cd463f68 + // 6b4754b940210eb59f1581d658ddf8de8389e0e2d123e2cae3c2be6eb194 + // 8ccc896dd4cdf45f9090c96dfb925795cfb4ccda83e3eb4f745577b17fc1 + // 66bf5f4103c9085134cad7863a41b04f32ef20201e54b55f1817ce589619 + // b096c254fd2c2fa4a06f4de35ccfd23e + // key_set_id: "kside11109bf20cde544083ef4ee" + // usage_entry: + // ea106c124476b753d39368a5966972a2729bb8bbea734a2b3e812b705eac + // e016c8a03c9a406094d80059ef4ca26f1928fa2daa5de9a6f22372e5c7a9 + // 41e610d1efb56ed7ce2228a70e2e150afb66edc2da066d463aa90ba0caff + // 078fbfec05c8 + // usage_entry_number: 0 + // drm_certificate_id: 0 + // -token: + // eace80e30bfda213f1ce4dbcfd9d4d24b8e2ae00054d167d9d7ae9954706 + // 2b9113 + // license_request: + // 68a7665a21348fc0590328608dc520be40f5b749328568fe383ef69c1a58 + // 7ab2446cf9c41d821373d0856a883b316519a42218f80e7bd5764d16bac9 + // a9b427a7278f5940e563fcf6dee0ff3aadbb702ebf2c54ec354ae7acc84e + // e6a54bca1f30e38ef71c44a81d0009b1484feaf4f1a56f58c35bb2372c80 + // c6dfb389e6de60bdd3d46c03975715260f6fdbe42facb64c22eda9635c04 + // da79434e1c41fbd2fdbbab6598283226c0278e8e0a96d780d3436523efd1 + // license: + // ff6fecf7157828812a2d6dcb15383a6d9af4519ef804c6053a10c436002d + // e3a4efcc017755f4ad1101bdc813e2d211732418dee529cbb413c48aa588 + // 4c76a5c6f556a715055560d4247f5bf310956949a3a171a4aa608a484468 + // 84e7676d558ff64d392b84e617805693d90f1e9b7b540c383d384d7f7ce0 + // 6c23618681bd838ceb1a514047f1c562c43159cc5e21588fbfce8a354111 + // 160f1a1e2bd3d798a000579bdfdb977252809ee1502df8045972fe8aac84 + // 0211c2f8d9e4d5be18509c327c647d654c4b6cc430b98f1ff37c96fab087 + // fb561b8cc18480f877c873594d3148ff74b0e3c6327c27ca876dae742239 + // 8fc5e85269cba49ad099 + // key_set_id: "ksid8e80350cbef6463a0025e6cc" + // usage_entry: + // 7ccc7ce96055e16a52fa192ea2cf3c9df3e89b9133a52286f71e6c6d82d0 + // 435f6b2155dfde590b347d8c86f62d7dfbaae640c237256f609e5da9cc6c + // 103465fe3441612bbdfdf4d1c24b2147feb8565cef4993e439c9d564a39a + // 4ac5bb1da69acb44da06e4522c9a93d310cdda5dac1e1e0b91abff41e4e2 + // edda4001 + // usage_entry_number: 7 + // drm_certificate_id: 0 + // -token: + // d0b9a07ad7ffeec13784bd60da011be3589f3e450227fd36b1a3f6786cdb + // fe8f + // license_request: + // a419c5687a592099dc67da8bc4f5ef238c80fe4ce3e2fcb025392efb1438 + // 4b581b595a0e8fa95de637fb2184719eb36ad6539ee9df0f67697f91d018 + // 6e04552e811196029cf4e256518ddf3215af8ec61442c17d6753b93f9d3a + // 9240bae39bacf5563659cf47d3a611ce20ed3ebbf86cddad60cc2847c459 + // 5dcfd934d012ce205960052158461d7c5d480de2e597876e64e8f8de6928 + // 29a3 + // license: + // f7c19357e50fc474437c1a635c5bae8f6f51afa20750766db19457dff7ae + // f2cae78848a225cc6a088bbcffead5be6aab6fc8af091bf459c3bd9bcfa1 + // 8de53ef76db1b4826cf0b8ff7b2d7c44bbadb3cd7aedd8f639d1f38c52a5 + // 8611a9782aeace72be69a73d2e091a1120dc63f7ba6f1cb6cddd69e9a236 + // 232ed8c14cee665756ba51f1d2e2530ab3662ce1b6efba91c5f10c53abc8 + // 86d6f25b5dc40417e54270843f3b454c8c047fc366249e30379b0fbe0174 + // fcab8b8405ae7f20f6f2b81f11082ff0e270b75f1e1aa7ed5806f4e65b46 + // b872dbcb703d7bf20b9ecaa481425a5218d85a49595f3ed268d61f1be8e3 + // 8e6126eb075fa6b7ae80431c8521c4bc2ce701e45d33bfca9a5b0b66b550 + // aab21eae41f84cadfd2517dee9a2c139ad475c387d25 + // key_set_id: "ksid321bb636f8a3f5cd5d54a236" + // usage_entry: + // c3cb027611397b5d70cc0b08e0f5249cd19996da674e33722902173d45d7 + // 09914a3d7e898d93170317bfcff34861c0d687048cc93542a75a2c99b232 + // 3fafea1ee0c3e3d24edf2633 + // usage_entry_number: 7 + // drm_certificate_id: 0 + // drm_certificate_cache: + // -drm_certificate_id: 0 + // drm_certificate: + // certificate: "a drm certificate" + // wrapped_private_key: "a wrapped private key" + // key_type: RSA + // acquisition_time_seconds: 0 + // expiration_time_seconds: 0 a2bs_hex( "0AF30E080310012AEC0E0AEA040A20BB3370CCD3C3C49573D6B74386D1886D9888BD8" "1FE3241BCD2BAC9407D1A834E12C001DC0E51CFA5863F6C0B32A4AD7FA40625DADCC2" @@ -5223,8 +5883,7 @@ TEST_F(DeviceFilesUsageInfoTest, ListNullParam) { TEST_F(DeviceFilesUsageInfoTest, ListIdsNull) { MockFileSystem file_system; - std::string app_id = kUsageInfoTestData[0].app_id; - + const std::string& app_id = kUsageInfoTestData[0].app_id; DeviceFiles device_files(&file_system); EXPECT_TRUE(device_files.Init(kSecurityLevelL1)); EXPECT_FALSE(device_files.ListUsageIds(app_id, nullptr, nullptr)); @@ -5233,13 +5892,14 @@ TEST_F(DeviceFilesUsageInfoTest, ListIdsNull) { TEST_F(DeviceFilesUsageInfoTest, ListUsageIds) { MockFileSystem file_system; - int index = 8; - std::string app_id = kUsageInfoTestData[index].app_id; + const int index = 8; + const std::string& app_id = kUsageInfoTestData[index].app_id; - std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); - std::string path = device_base_path_ + file_name; - std::string file_data = (index < 0) ? kEmptyUsageInfoFileData - : kUsageInfoTestData[index].file_data; + const std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); + const std::string path = device_base_path_ + file_name; + const std::string& file_data = (index < 0) + ? kEmptyUsageInfoFileData + : kUsageInfoTestData[index].file_data; if (index >= 0) { // Call to Open will return a unique_ptr, freeing this object. MockFile* file = new MockFile(); @@ -5248,11 +5908,10 @@ TEST_F(DeviceFilesUsageInfoTest, ListUsageIds) { .WillRepeatedly(Return(true)); EXPECT_CALL(file_system, FileSize(StrEq(path))) .Times(2) - .WillRepeatedly(Return(kUsageInfoTestData[index].file_data.size())); + .WillRepeatedly(Return(file_data.size())); EXPECT_CALL(file_system, Open(StrEq(path), _)) .WillOnce(Return(ByMove(std::unique_ptr(file)))); - EXPECT_CALL(*file, - Read(NotNull(), Eq(kUsageInfoTestData[index].file_data.size()))) + EXPECT_CALL(*file, Read(NotNull(), Eq(file_data.size()))) .WillOnce(DoAll(SetArrayArgument<0>(file_data.begin(), file_data.end()), Return(file_data.size()))); } else { @@ -5267,28 +5926,36 @@ TEST_F(DeviceFilesUsageInfoTest, ListUsageIds) { EXPECT_TRUE(device_files.ListUsageIds(app_id, &key_set_ids, &provider_session_tokens)); - EXPECT_EQ(key_set_ids.size(), provider_session_tokens.size()); - if (index >= 0) { - for (size_t i = 0; i < provider_session_tokens.size(); ++i) { - bool found = false; - for (int j = 0; !found && j <= index; ++j) { - if (app_id == kUsageInfoTestData[j].app_id && - kUsageInfoTestData[j].usage_data.provider_session_token == - provider_session_tokens[i] && - kUsageInfoTestData[j].usage_data.key_set_id == key_set_ids[i]) { - found = true; - } + ASSERT_EQ(key_set_ids.size(), provider_session_tokens.size()); + if (index < 0) return; + // Ensure that all the listed key set IDs and PSTs are found within + // the list of usage entries. + // Note: Any entry found in |.file_data| would have been defined in + // in |.usage_data| at or before the current |index|. + for (size_t i = 0; i < provider_session_tokens.size(); ++i) { + const std::string& pst = provider_session_tokens[i]; + const CdmKeySetId& ksid = key_set_ids[i]; + bool found = false; + for (int j = 0; !found && j <= index; ++j) { + if (kUsageInfoTestData[j].app_id != app_id) continue; + const DeviceFiles::CdmUsageData& usage_data = + kUsageInfoTestData[j].usage_data; + if (pst == usage_data.provider_session_token && + ksid == usage_data.key_set_id) { + found = true; } - EXPECT_TRUE(found); } + EXPECT_TRUE(found); } } TEST_P(DeviceFilesUsageInfoListTest, UsageInfoList) { MockFileSystem file_system; - int index = GetParam(); + const int index = GetParam(); + // List of all file names. std::vector file_list; + // List of only usage info files. std::vector expected_usage_file_list; for (int i = 0; i <= index; ++i) { file_list.push_back(kTestListUsageInfoData[i].file_name); @@ -5317,31 +5984,31 @@ TEST_P(DeviceFilesUsageInfoTest, Store) { // Call to Open will return a unique_ptr, freeing this object. MockFile* file = new MockFile(); - int index = GetParam(); + const int index = GetParam(); - std::string app_id; - if (index >= 0) app_id = kUsageInfoTestData[index].app_id; - std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); - std::string path = device_base_path_ + file_name; + const std::string app_id = + (index >= 0) ? kUsageInfoTestData[index].app_id : ""; + const std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); + const std::string path = device_base_path_ + file_name; + // Raw data fields for each usage info record matching belonging + // to the same |app_id|. std::vector usage_data_fields; std::vector usage_data_list; for (int i = 0; i <= index; ++i) { - if (kUsageInfoTestData[i].app_id == app_id) { - usage_data_list.push_back(kUsageInfoTestData[i].usage_data); - usage_data_fields.push_back( - kUsageInfoTestData[i].usage_data.provider_session_token); - usage_data_fields.push_back( - kUsageInfoTestData[i].usage_data.license_request); - usage_data_fields.push_back(kUsageInfoTestData[i].usage_data.license); - usage_data_fields.push_back(kUsageInfoTestData[i].usage_data.key_set_id); - usage_data_fields.push_back(kUsageInfoTestData[i].usage_data.usage_entry); - usage_data_fields.push_back( - kUsageInfoTestData[i].usage_data.drm_certificate); - usage_data_fields.push_back( - kUsageInfoTestData[i].usage_data.wrapped_private_key.key()); - } + if (kUsageInfoTestData[i].app_id != app_id) continue; + const DeviceFiles::CdmUsageData& usage_data = + kUsageInfoTestData[i].usage_data; + usage_data_list.push_back(kUsageInfoTestData[i].usage_data); + + usage_data_fields.push_back(usage_data.provider_session_token); + usage_data_fields.push_back(usage_data.license_request); + usage_data_fields.push_back(usage_data.license); + usage_data_fields.push_back(usage_data.key_set_id); + usage_data_fields.push_back(usage_data.usage_entry); + usage_data_fields.push_back(usage_data.drm_certificate); + usage_data_fields.push_back(usage_data.wrapped_private_key.key()); } EXPECT_CALL(file_system, Open(StrEq(path), _)) @@ -5359,15 +6026,15 @@ TEST_P(DeviceFilesUsageInfoTest, Store) { TEST_P(DeviceFilesUsageInfoTest, Retrieve) { MockFileSystem file_system; - int index = GetParam(); + const int index = GetParam(); - std::string app_id; - if (index >= 0) app_id = kUsageInfoTestData[index].app_id; - - std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); - std::string path = device_base_path_ + file_name; - std::string file_data = (index < 0) ? kEmptyUsageInfoFileData - : kUsageInfoTestData[index].file_data; + const std::string app_id = + (index >= 0) ? kUsageInfoTestData[index].app_id : ""; + const std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); + const std::string path = device_base_path_ + file_name; + const std::string& file_data = (index < 0) + ? kEmptyUsageInfoFileData + : kUsageInfoTestData[index].file_data; if (index >= 0) { // Call to Open will return a unique_ptr, freeing this object. MockFile* file = new MockFile(); @@ -5376,11 +6043,10 @@ TEST_P(DeviceFilesUsageInfoTest, Retrieve) { .WillRepeatedly(Return(true)); EXPECT_CALL(file_system, FileSize(StrEq(path))) .Times(2) - .WillRepeatedly(Return(kUsageInfoTestData[index].file_data.size())); + .WillRepeatedly(Return(file_data.size())); EXPECT_CALL(file_system, Open(StrEq(path), _)) .WillOnce(Return(ByMove(std::unique_ptr(file)))); - EXPECT_CALL(*file, - Read(NotNull(), Eq(kUsageInfoTestData[index].file_data.size()))) + EXPECT_CALL(*file, Read(NotNull(), Eq(file_data.size()))) .WillOnce(DoAll(SetArrayArgument<0>(file_data.begin(), file_data.end()), Return(file_data.size()))); } else { @@ -5393,49 +6059,45 @@ TEST_P(DeviceFilesUsageInfoTest, Retrieve) { EXPECT_TRUE(device_files.RetrieveUsageInfo(file_name, &usage_data_list)); - for (size_t i = 0; i < usage_data_list.size(); ++i) { + for (const auto& retrieved_usage_data : usage_data_list) { bool found = false; - int j = 0; - while (!found && j <= index) { - if (app_id == kUsageInfoTestData[j].app_id && - usage_data_list[i].provider_session_token == - kUsageInfoTestData[j].usage_data.provider_session_token) { - EXPECT_EQ(kUsageInfoTestData[j].usage_data.license_request, - usage_data_list[i].license_request); - EXPECT_EQ(kUsageInfoTestData[j].usage_data.license, - usage_data_list[i].license); - EXPECT_EQ(kUsageInfoTestData[j].usage_data.key_set_id, - usage_data_list[i].key_set_id); - EXPECT_EQ(kUsageInfoTestData[j].usage_data.usage_entry, - usage_data_list[i].usage_entry); - EXPECT_EQ(kUsageInfoTestData[j].usage_data.usage_entry_number, - usage_data_list[i].usage_entry_number); - EXPECT_EQ(kUsageInfoTestData[j].usage_data.drm_certificate, - usage_data_list[i].drm_certificate); - EXPECT_EQ(kUsageInfoTestData[j].usage_data.wrapped_private_key.type(), - usage_data_list[i].wrapped_private_key.type()); - EXPECT_EQ(kUsageInfoTestData[j].usage_data.wrapped_private_key.key(), - usage_data_list[i].wrapped_private_key.key()); - found = true; - } - ++j; + for (int i = 0; !found && i <= index; i++) { + if (kUsageInfoTestData[i].app_id != app_id) continue; + const auto& known_usage_data = kUsageInfoTestData[i].usage_data; + if (known_usage_data.key_set_id != retrieved_usage_data.key_set_id) + continue; + // Rest of the entry data must match. + EXPECT_EQ(retrieved_usage_data.provider_session_token, + known_usage_data.provider_session_token); + EXPECT_EQ(retrieved_usage_data.license_request, + known_usage_data.license_request); + EXPECT_EQ(retrieved_usage_data.license, known_usage_data.license); + EXPECT_EQ(retrieved_usage_data.key_set_id, known_usage_data.key_set_id); + EXPECT_EQ(retrieved_usage_data.usage_entry, known_usage_data.usage_entry); + EXPECT_EQ(retrieved_usage_data.usage_entry_number, + known_usage_data.usage_entry_number); + EXPECT_EQ(retrieved_usage_data.drm_certificate, + known_usage_data.drm_certificate); + EXPECT_EQ(retrieved_usage_data.wrapped_private_key, + known_usage_data.wrapped_private_key); + found = true; } - EXPECT_TRUE(found); + EXPECT_TRUE(found) << "key_set_id = " << retrieved_usage_data.key_set_id; } } TEST_P(DeviceFilesUsageInfoTest, ListKeySetIds) { MockFileSystem file_system; - int index = GetParam(); + const int index = GetParam(); + const std::string app_id = + (index >= 0) ? kUsageInfoTestData[index].app_id : ""; + const std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); + const std::string path = device_base_path_ + file_name; + const std::string& file_data = (index < 0) + ? kEmptyUsageInfoFileData + : kUsageInfoTestData[index].file_data; - std::string app_id; - if (index >= 0) app_id = kUsageInfoTestData[index].app_id; - - std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); - std::string path = device_base_path_ + file_name; - std::string file_data = (index < 0) ? kEmptyUsageInfoFileData - : kUsageInfoTestData[index].file_data; if (index >= 0) { // Call to Open will return a unique_ptr, freeing this object. MockFile* file = new MockFile(); @@ -5444,11 +6106,10 @@ TEST_P(DeviceFilesUsageInfoTest, ListKeySetIds) { .WillRepeatedly(Return(true)); EXPECT_CALL(file_system, FileSize(StrEq(path))) .Times(2) - .WillRepeatedly(Return(kUsageInfoTestData[index].file_data.size())); + .WillRepeatedly(Return(file_data.size())); EXPECT_CALL(file_system, Open(StrEq(path), _)) .WillOnce(Return(ByMove(std::unique_ptr(file)))); - EXPECT_CALL(*file, - Read(NotNull(), Eq(kUsageInfoTestData[index].file_data.size()))) + EXPECT_CALL(*file, Read(NotNull(), Eq(file_data.size()))) .WillOnce(DoAll(SetArrayArgument<0>(file_data.begin(), file_data.end()), Return(file_data.size()))); } else { @@ -5458,35 +6119,37 @@ TEST_P(DeviceFilesUsageInfoTest, ListKeySetIds) { DeviceFiles device_files(&file_system); EXPECT_TRUE(device_files.Init(kSecurityLevelL1)); - std::vector key_set_ids; + std::vector key_set_ids; EXPECT_TRUE(device_files.ListUsageIds(app_id, &key_set_ids, nullptr)); - if (index >= 0) { - for (size_t i = 0; i < key_set_ids.size(); ++i) { - bool found = false; - for (int j = 0; !found && j <= index; ++j) { - if (app_id == kUsageInfoTestData[j].app_id && - kUsageInfoTestData[j].usage_data.key_set_id == key_set_ids[i]) { - found = true; - } + if (index < 0) { + EXPECT_TRUE(key_set_ids.empty()); + return; + } + for (const CdmKeySetId& key_set_id : key_set_ids) { + bool found = false; + for (int i = 0; !found && i <= index; i++) { + if (app_id == kUsageInfoTestData[i].app_id && + kUsageInfoTestData[i].usage_data.key_set_id == key_set_id) { + found = true; } - EXPECT_TRUE(found); } + EXPECT_TRUE(found); } } TEST_P(DeviceFilesUsageInfoTest, ListProviderSessionTokenIds) { MockFileSystem file_system; - int index = GetParam(); + const int index = GetParam(); + const std::string app_id = + (index >= 0) ? kUsageInfoTestData[index].app_id : ""; + const std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); + const std::string path = device_base_path_ + file_name; + const std::string& file_data = (index < 0) + ? kEmptyUsageInfoFileData + : kUsageInfoTestData[index].file_data; - std::string app_id; - if (index >= 0) app_id = kUsageInfoTestData[index].app_id; - - std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); - std::string path = device_base_path_ + file_name; - std::string file_data = (index < 0) ? kEmptyUsageInfoFileData - : kUsageInfoTestData[index].file_data; if (index >= 0) { // Call to Open will return a unique_ptr, freeing this object. MockFile* file = new MockFile(); @@ -5495,11 +6158,10 @@ TEST_P(DeviceFilesUsageInfoTest, ListProviderSessionTokenIds) { .WillRepeatedly(Return(true)); EXPECT_CALL(file_system, FileSize(StrEq(path))) .Times(2) - .WillRepeatedly(Return(kUsageInfoTestData[index].file_data.size())); + .WillRepeatedly(Return(file_data.size())); EXPECT_CALL(file_system, Open(StrEq(path), _)) .WillOnce(Return(ByMove(std::unique_ptr(file)))); - EXPECT_CALL(*file, - Read(NotNull(), Eq(kUsageInfoTestData[index].file_data.size()))) + EXPECT_CALL(*file, Read(NotNull(), Eq(file_data.size()))) .WillOnce(DoAll(SetArrayArgument<0>(file_data.begin(), file_data.end()), Return(file_data.size()))); } else { @@ -5513,18 +6175,19 @@ TEST_P(DeviceFilesUsageInfoTest, ListProviderSessionTokenIds) { EXPECT_TRUE( device_files.ListUsageIds(app_id, nullptr, &provider_session_tokens)); - if (index >= 0) { - for (size_t i = 0; i < provider_session_tokens.size(); ++i) { - bool found = false; - for (int j = 0; !found && j <= index; ++j) { - if (app_id == kUsageInfoTestData[j].app_id && - kUsageInfoTestData[j].usage_data.provider_session_token == - provider_session_tokens[i]) { - found = true; - } + if (index < 0) { + EXPECT_TRUE(provider_session_tokens.empty()); + return; + } + for (const std::string& pst : provider_session_tokens) { + bool found = false; + for (int i = 0; !found && i <= index; i++) { + if (app_id == kUsageInfoTestData[i].app_id && + kUsageInfoTestData[i].usage_data.provider_session_token == pst) { + found = true; } - EXPECT_TRUE(found); } + EXPECT_TRUE(found); } } @@ -5533,23 +6196,24 @@ TEST_P(DeviceFilesUsageInfoTest, RetrieveByProviderSessionToken) { // Call to Open will return a unique_ptr, freeing this object. MockFile* file = new MockFile(); - int index = GetParam(); - - std::string app_id; - if (index >= 0) app_id = kUsageInfoTestData[index].app_id; - - std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); - std::string path = device_base_path_ + file_name; + const int index = GetParam(); + const std::string app_id = + (index >= 0) ? kUsageInfoTestData[index].app_id : ""; + const std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); + const std::string path = device_base_path_ + file_name; + // Use the file info which contains all usage info sessions for the + // current |app_id|. size_t max_index_by_app_id = 0; for (size_t i = 0; i < ArraySize(kUsageInfoTestData); ++i) { if (app_id == kUsageInfoTestData[i].app_id) max_index_by_app_id = i; } - std::string file_data = + const std::string& file_data = (index < 0) ? kEmptyUsageInfoFileData : kUsageInfoTestData[max_index_by_app_id].file_data; - std::string provider_session_token = kUsageInfoTestData[index < 0 ? 0 : index] - .usage_data.provider_session_token; + const std::string& provider_session_token = + kUsageInfoTestData[index < 0 ? 0 : index] + .usage_data.provider_session_token; EXPECT_CALL(file_system, Exists(StrEq(path))).WillOnce(Return(true)); EXPECT_CALL(file_system, FileSize(StrEq(path))) @@ -5571,17 +6235,16 @@ TEST_P(DeviceFilesUsageInfoTest, RetrieveByProviderSessionToken) { } else { EXPECT_TRUE(device_files.RetrieveUsageInfo( file_name, provider_session_token, &usage_data)); + const DeviceFiles::CdmUsageData& expected_usage_data = + kUsageInfoTestData[index].usage_data; - EXPECT_EQ(kUsageInfoTestData[index].usage_data.provider_session_token, + EXPECT_EQ(expected_usage_data.provider_session_token, usage_data.provider_session_token); - EXPECT_EQ(kUsageInfoTestData[index].usage_data.license_request, - usage_data.license_request); - EXPECT_EQ(kUsageInfoTestData[index].usage_data.license, usage_data.license); - EXPECT_EQ(kUsageInfoTestData[index].usage_data.key_set_id, - usage_data.key_set_id); - EXPECT_EQ(kUsageInfoTestData[index].usage_data.usage_entry, - usage_data.usage_entry); - EXPECT_EQ(kUsageInfoTestData[index].usage_data.usage_entry_number, + EXPECT_EQ(expected_usage_data.license_request, usage_data.license_request); + EXPECT_EQ(expected_usage_data.license, usage_data.license); + EXPECT_EQ(expected_usage_data.key_set_id, usage_data.key_set_id); + EXPECT_EQ(expected_usage_data.usage_entry, usage_data.usage_entry); + EXPECT_EQ(expected_usage_data.usage_entry_number, usage_data.usage_entry_number); } } @@ -5591,49 +6254,50 @@ TEST_P(DeviceFilesUsageInfoTest, UpdateUsageInfo) { // Call to Open will return a unique_ptr, freeing this object. MockFile* file = new MockFile(); - int index = GetParam(); - - std::string app_id; - if (index >= 0) app_id = kUsageInfoTestData[index].app_id; - - std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); - std::string path = device_base_path_ + file_name; + const int index = GetParam(); + const std::string app_id = + (index >= 0) ? kUsageInfoTestData[index].app_id : ""; + const std::string file_name = DeviceFiles::GetUsageInfoFileName(app_id); + const std::string path = device_base_path_ + file_name; + // Fields expected to be written back when usage info is updated. std::vector usage_data_fields; size_t max_index_by_app_id = 0; for (size_t i = 0; i < ArraySize(kUsageInfoTestData); ++i) { - if (app_id == kUsageInfoTestData[i].app_id) { - max_index_by_app_id = i; - - if ((int)i != index) { - usage_data_fields.push_back( - kUsageInfoTestData[i].usage_data.provider_session_token); - usage_data_fields.push_back( - kUsageInfoTestData[i].usage_data.license_request); - usage_data_fields.push_back(kUsageInfoTestData[i].usage_data.license); - usage_data_fields.push_back( - kUsageInfoTestData[i].usage_data.key_set_id); - usage_data_fields.push_back( - kUsageInfoTestData[i].usage_data.usage_entry); - } - } + if (app_id != kUsageInfoTestData[i].app_id) continue; + max_index_by_app_id = i; + // Skip the entry that will be overwritten. + if ((int)i == index) continue; + usage_data_fields.push_back( + kUsageInfoTestData[i].usage_data.provider_session_token); + usage_data_fields.push_back( + kUsageInfoTestData[i].usage_data.license_request); + usage_data_fields.push_back(kUsageInfoTestData[i].usage_data.license); + usage_data_fields.push_back(kUsageInfoTestData[i].usage_data.key_set_id); + usage_data_fields.push_back(kUsageInfoTestData[i].usage_data.usage_entry); } + DeviceFiles::CdmUsageData updated_entry = kUsageInfoUpdateTestData; + if (index >= 0) { - usage_data_fields.push_back( - kUsageInfoTestData[index].usage_data.provider_session_token); - usage_data_fields.push_back(kUsageInfoUpdateTestData.license_request); - usage_data_fields.push_back(kUsageInfoUpdateTestData.license); - usage_data_fields.push_back(kUsageInfoUpdateTestData.key_set_id); - usage_data_fields.push_back(kUsageInfoUpdateTestData.usage_entry); + // Updated entry must keep the same PST and key set ID. + updated_entry.provider_session_token = + kUsageInfoTestData[index].usage_data.provider_session_token; + updated_entry.key_set_id = kUsageInfoTestData[index].usage_data.key_set_id; + + usage_data_fields.push_back(updated_entry.provider_session_token); + usage_data_fields.push_back(updated_entry.license_request); + usage_data_fields.push_back(updated_entry.license); + usage_data_fields.push_back(updated_entry.key_set_id); + usage_data_fields.push_back(updated_entry.usage_entry); + usage_data_fields.push_back(updated_entry.drm_certificate); + usage_data_fields.push_back(updated_entry.wrapped_private_key.key()); } - std::string file_data = + const std::string& file_data = (index < 0) ? kEmptyUsageInfoFileData : kUsageInfoTestData[max_index_by_app_id].file_data; - std::string provider_session_token = kUsageInfoTestData[index < 0 ? 0 : index] - .usage_data.provider_session_token; EXPECT_CALL(file_system, Exists(StrEq(path))) .Times(2) @@ -5644,7 +6308,6 @@ TEST_P(DeviceFilesUsageInfoTest, UpdateUsageInfo) { .WillOnce(DoAll(SetArrayArgument<0>(file_data.begin(), file_data.end()), Return(file_data.size()))); - bool write_called = false; if (index < 0) { EXPECT_CALL(file_system, Open(StrEq(path), _)) .WillOnce(Return(ByMove(std::unique_ptr(file)))); @@ -5654,28 +6317,19 @@ TEST_P(DeviceFilesUsageInfoTest, UpdateUsageInfo) { .Times(2) .WillOnce(Return(ByMove(std::unique_ptr(file)))) .WillOnce(Return(ByMove(std::unique_ptr(next_file)))); - ON_CALL(*file, Write(_, _)) + + EXPECT_CALL(*next_file, Write(_, _)) .With(AllArgs(StrAndLenContains(usage_data_fields))) - .WillByDefault(DoAll(InvokeWithoutArgs([&write_called]() -> void { - write_called = true; - }), - ReturnArg<1>())); - ON_CALL(*next_file, Write(_, _)) - .With(AllArgs(StrAndLenContains(usage_data_fields))) - .WillByDefault(DoAll(InvokeWithoutArgs([&write_called]() -> void { - write_called = true; - }), - ReturnArg<1>())); + .WillOnce(ReturnArg<1>()); } DeviceFiles device_files(&file_system); EXPECT_TRUE(device_files.Init(kSecurityLevelL1)); - - bool expected_result = index >= 0; - EXPECT_EQ(expected_result, - device_files.UpdateUsageInfo(file_name, provider_session_token, - kUsageInfoUpdateTestData)); - if (index >= 0) EXPECT_TRUE(write_called); + if (index < 0) { + EXPECT_FALSE(device_files.UpdateUsageInfo(file_name, updated_entry)); + } else { + EXPECT_TRUE(device_files.UpdateUsageInfo(file_name, updated_entry)); + } } INSTANTIATE_TEST_SUITE_P(UsageInfo, DeviceFilesUsageInfoTest, diff --git a/core/test/duration_use_case_test.cpp b/core/test/duration_use_case_test.cpp index 31b8fd7b..35978242 100644 --- a/core/test/duration_use_case_test.cpp +++ b/core/test/duration_use_case_test.cpp @@ -139,6 +139,14 @@ class CdmDurationTest : public WvCdmTestBaseWithEngine, // All times in the license are relative to the rental clock. start_of_rental_clock_ = wvutil::Clock().GetCurrentTime(); license_holder_.FetchLicense(); + // Record the time it took to fetch the license. This will be used as + // some extra fudge when looking for playback cutoff at the end of the + // rental window. + extra_fudge_time_ = CurrentRentalTime(); + if (extra_fudge_time_ > kRoundTripTime) { + LOGE("FetchLicense took a long time: %" PRIu64 " seconds", + extra_fudge_time_); + } } void TearDown() override { @@ -180,16 +188,8 @@ class CdmDurationTest : public WvCdmTestBaseWithEngine, // Sleep until the specified time on the rental clock. void SleepUntil(uint64_t desired_rental_time) { - const uint64_t rental_time = CurrentRentalTime(); - if (desired_rental_time >= rental_time) { - const unsigned int sleep_time = - static_cast(desired_rental_time - rental_time); - wvutil::TestSleep::Sleep(sleep_time); - } else { - LOGW("Test Clock skew sleeping from rental clock time %" PRIu64 - " to %" PRIu64, - rental_time, desired_rental_time); - } + // We use rental clock in this file, but TestSleep uses the system clock. + wvutil::TestSleep::SleepUntil(desired_rental_time + start_of_rental_clock_); cdm_engine_.OnTimerEvent(); } @@ -230,7 +230,10 @@ class CdmDurationTest : public WvCdmTestBaseWithEngine, // a green check mark. Both |start| and |stop| are all system times. void AllowPlayback(uint64_t start, uint64_t stop) { ASSERT_LT(start, stop); - SleepUntil(start); + // If now is before start, then sleep until start. + // If we are already after start, don't try to sleep or a warning will be + // logged. Instead, we'll just start playback as soon as we can. + if (start > CurrentRentalTime()) SleepUntil(start); Decrypt(); const uint64_t mid = (start + stop) / 2; SleepUntil(mid); @@ -276,11 +279,21 @@ class CdmDurationTest : public WvCdmTestBaseWithEngine, void AllowLenience() { allow_lenience_ = true; } void Decrypt() { - const uint64_t now = CurrentRentalTime(); + const uint64_t start = CurrentRentalTime(); EXPECT_EQ(NO_ERROR, license_holder_.Decrypt(kKeyId)) - << "Failed to decrypt when rental clock = " << now + << "Failed to decrypt when rental clock = " << start << ", and playback clock = " - << ((now < start_of_playback_) ? 0 : (now - start_of_playback_)); + << ((start < start_of_playback_) ? 0 : (start - start_of_playback_)); + const uint64_t fudge = CurrentRentalTime() - start; + if (fudge > kFudge) { + LOGE("Decrypt took a long time: %" PRIu64 " seconds", fudge); + } + // We need extra_fudge_time_ to be at least as big as the first decrypt to + // allow extra fudge when looking for playback cutoff at the end of the + // playback window. + if (fudge > extra_fudge_time_) { + extra_fudge_time_ = fudge; + } } void FailDecrypt() { @@ -309,10 +322,15 @@ class CdmDurationTest : public WvCdmTestBaseWithEngine, << now << ", and playback clock = " << (now < start_of_playback_ ? 0 : now - start_of_playback_); // However, for those cases decided above, we also allow success. - EXPECT_TRUE(allow_success) + if (allow_success) return; + // Try again after allowing for the extra fudge time. See comment at the + // definition of extra_fudge_time_ for an explanation. + wvutil::TestSleep::Sleep(static_cast(extra_fudge_time_)); + ASSERT_EQ(NEED_KEY, license_holder_.Decrypt(kKeyId)) << "Device was unexpectedly lenient when rental clock = " << now << ", and playback clock = " - << (now < start_of_playback_ ? 0 : now - start_of_playback_); + << (now < start_of_playback_ ? 0 : now - start_of_playback_) + << ", extra fudge = " << extra_fudge_time_; } LicenseHolder license_holder_; @@ -329,6 +347,16 @@ class CdmDurationTest : public WvCdmTestBaseWithEngine, // If this is set, then the next time we expect a playback to be terminated, // we will allow lenient failure. bool allow_lenience_; + // Extra fudge accounts for the amount of extra time it takes to perform an + // operation that starts a clock. In some test environments under high load, + // creating the license request might take a second or more. The rental clock + // starts at the time the license request is signed -- this extra fudge + // accounts for the question of whether we mean at the beginning or the end of + // the siging operation. Similarly the playback clock starts at the first + // decrypt. This value, extra_fudge_time_, is the maximum of the license + // request time and the first decrypt time, so it can be used for testing + // cutoff for either rental duration or playback duration. + uint64_t extra_fudge_time_ = 0; }; /*****************************************************************************/ diff --git a/core/test/http_socket.cpp b/core/test/http_socket.cpp index eaff0520..9760a65e 100644 --- a/core/test/http_socket.cpp +++ b/core/test/http_socket.cpp @@ -328,14 +328,13 @@ bool HttpSocket::Connect(int timeout_in_ms) { } else { if (GetError() != ERROR_ASYNC_COMPLETE) { // failed right away. - LOGE("cannot connect to %s, errno = %d", domain_name_.c_str(), - GetError()); + LOGE("cannot connect to %s, errno = %d", url().c_str(), GetError()); CloseSocket(); return false; } else { // in progress. block until timeout expired or connection established. if (!Wait(/* for_read */ false, timeout_in_ms)) { - LOGE("cannot connect to %s", domain_name_.c_str()); + LOGE("cannot connect to %s", url().c_str()); CloseSocket(); return false; } diff --git a/core/test/http_socket.h b/core/test/http_socket.h index f32612a1..ae5761d6 100644 --- a/core/test/http_socket.h +++ b/core/test/http_socket.h @@ -32,6 +32,9 @@ class HttpSocket { const std::string& domain_name() const { return domain_name_; } int port() const { return atoi(port_.c_str()); } const std::string& resource_path() const { return resource_path_; } + std::string url() const { + return scheme_ + "://" + domain_name_ + ":" + port_ + resource_path_; + } int ReadAndLogErrors(char* data, int len, int timeout_in_ms); int WriteAndLogErrors(const char* data, int len, int timeout_in_ms); diff --git a/core/test/keybox_ota_test.cpp b/core/test/keybox_ota_test.cpp index cc3e1580..efffd785 100644 --- a/core/test/keybox_ota_test.cpp +++ b/core/test/keybox_ota_test.cpp @@ -10,6 +10,7 @@ #include "create_test_file_system.h" #include "crypto_session.h" #include "properties.h" +#include "provisioning_holder.h" #include "test_base.h" #include "test_printers.h" #include "test_sleep.h" @@ -43,47 +44,10 @@ class CdmOtaKeyboxTest : public ::testing::Test { void Provision(TestCdmEngine* cdm_engine) { ConfigTestEnv config = *WvCdmTestBase::default_config_; + ProvisioningHolder provisioner(cdm_engine, config); CdmCertificateType cert_type = kCertificateWidevine; - std::string cert_authority; - CdmProvisioningRequest prov_request; - std::string provisioning_server_url; - CdmResponseType result = CERT_PROVISIONING_NONCE_GENERATION_ERROR; - // Get a provisioning request. We might need one retry if there is a nonce - // flood failure. - for (int i = 0; i < 2; i++) { - result = cdm_engine->GetProvisioningRequest( - cert_type, cert_authority, config.provisioning_service_certificate(), - kLevelDefault, &prov_request, &provisioning_server_url); - if (result == CERT_PROVISIONING_NONCE_GENERATION_ERROR) { - wvutil::TestSleep::Sleep(2); - continue; - } - break; - } - ASSERT_EQ(NO_ERROR, result); - LOGV("Provisioning request: req = %s", prov_request.c_str()); - - // Ignore URL provided by CdmEngine. Use ours, as configured - // for test vs. production server. - provisioning_server_url.assign(config.provisioning_server()); - - // Make request. - UrlRequest url_request(provisioning_server_url); - if (!url_request.is_connected()) { - LOGE("Failed to connect to provisioning server: url = %s", - provisioning_server_url.c_str()); - } - url_request.PostCertRequestInQueryString(prov_request); - - // Receive and parse response. - std::string http_message; - ASSERT_TRUE(url_request.GetResponse(&http_message)) - << "Failed to get provisioning response"; - LOGV("http_message: \n%s\n", http_message.c_str()); - - std::string cert, wrapped_key; - ASSERT_EQ(NO_ERROR, cdm_engine->HandleProvisioningResponse( - http_message, kLevelDefault, &cert, &wrapped_key)); + constexpr bool binary_provisioning = false; + provisioner.Provision(cert_type, binary_provisioning); } }; diff --git a/core/test/license_holder.cpp b/core/test/license_holder.cpp index 140029de..20e80d7e 100644 --- a/core/test/license_holder.cpp +++ b/core/test/license_holder.cpp @@ -5,12 +5,12 @@ #include "license_holder.h" #include "license_request.h" +#include "message_dumper.h" #include "oec_device_features.h" #include "test_base.h" namespace wvcdm { namespace { -constexpr int kHttpOk = 200; const std::string kCencMimeType = "cenc"; } // namespace @@ -38,8 +38,14 @@ void LicenseHolder::FetchLicense() { CdmKeyRequest key_request; ASSERT_NO_FATAL_FAILURE(GenerateKeyRequest(init_data, &key_request)) << "Failed for " << content_id(); + if (config_.dump_golden_data()) { + MessageDumper::DumpLicenseRequest(key_request); + } ASSERT_NO_FATAL_FAILURE(GetKeyResponse(key_request)) << "Failed for " << content_id(); + if (config_.dump_golden_data()) { + MessageDumper::DumpLicense(key_response_); + } } void LicenseHolder::LoadLicense() { @@ -69,6 +75,9 @@ void LicenseHolder::GenerateAndPostRenewalRequest( const CdmResponseType result = cdm_engine_->GenerateRenewalRequest(session_id_, &request); ASSERT_EQ(KEY_MESSAGE, result) << "Failed for " << content_id(); + if (config_.dump_golden_data()) { + MessageDumper::DumpRenewalRequest(request); + } const std::string url = MakeUrl(config_.renewal_server(), policy_id); renewal_in_flight_.reset(new UrlRequest(url)); ASSERT_TRUE(renewal_in_flight_->is_connected()) @@ -77,15 +86,17 @@ void LicenseHolder::GenerateAndPostRenewalRequest( } void LicenseHolder::FetchRenewal() { ASSERT_NE(renewal_in_flight_, nullptr) << "Failed for " << content_id(); - ASSERT_TRUE(renewal_in_flight_->GetResponse(&renewal_response_)) - << "Failed for " << content_id(); - int status_code = renewal_in_flight_->GetStatusCode(renewal_response_); - ASSERT_EQ(kHttpOk, status_code) << "Failed for " << content_id(); + ASSERT_NO_FATAL_FAILURE( + renewal_in_flight_->AssertOkResponse(&renewal_response_)) + << "Renewal failed for " << content_id(); } void LicenseHolder::LoadRenewal() { LicenseRequest license_request; license_request.GetDrmMessage(renewal_response_, renewal_message_); + if (config_.dump_golden_data()) { + MessageDumper::DumpRenewal(renewal_message_); + } EXPECT_EQ(KEY_ADDED, cdm_engine_->RenewKey(session_id_, renewal_message_)) << "Failed for " << content_id(); } @@ -214,12 +225,8 @@ void LicenseHolder::GetKeyResponse(const CdmKeyRequest& key_request) { std::string http_response; url_request.PostRequest(key_request.message); - ASSERT_TRUE(url_request.GetResponse(&http_response)); - int status_code = url_request.GetStatusCode(http_response); - ASSERT_EQ(kHttpOk, status_code) << "Error with url = " << url << "\n" - << "content_id = " << content_id() << "\n" - << "response = " << http_response; - + ASSERT_NO_FATAL_FAILURE(url_request.AssertOkResponse(&http_response)) + << "Failed for " << content_id(); LicenseRequest license_request; license_request.GetDrmMessage(http_response, key_response_); } diff --git a/core/test/message_dumper.cpp b/core/test/message_dumper.cpp new file mode 100644 index 00000000..8548833e --- /dev/null +++ b/core/test/message_dumper.cpp @@ -0,0 +1,202 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. + +#include "message_dumper.h" + +#include "license_request.h" +#include "odk.h" +#include "odk_message.h" +#include "odk_serialize.h" +#include "odk_structs.h" +#include "odk_structs_priv.h" +#include "oec_device_features.h" +#include "test_base.h" + +using video_widevine::ClientIdentification; +using video_widevine::License; +using video_widevine::License_KeyContainer; +using video_widevine::LicenseRequest; +using video_widevine::LicenseRequest_ContentIdentification; +using video_widevine::SignedMessage; +using video_widevine::SignedProvisioningMessage; +using video_widevine::WidevinePsshData_EntitledKey; + +namespace wvcdm { +namespace { +void DumpHeader(std::ofstream* out, const std::string& type) { + const ::testing::TestInfo* const test_info = + ::testing::UnitTest::GetInstance()->current_test_info(); + const std::string suite = test_info->test_case_name(); + const std::string name = test_info->name(); + std::string new_test_name = suite + "_" + name; + // Replace the slashes with underscores so we can use it as a name again. + std::replace(new_test_name.begin(), new_test_name.end(), '/', '_'); + *out << "\nTEST_F(ODKGolden" << type << "V" << ODK_MAJOR_VERSION << ", " + << new_test_name << ") {\n"; +} + +void DumpHex(std::ofstream* out, const std::string& name, + const std::string& value) { + *out << "const uint8_t " << name << "_raw[] = {\n"; + *out << " "; + for (unsigned int i = 0; i < value.length(); i++) { + if ((i > 0) && (i % 10 == 0)) *out << "\n "; + uint8_t c = value[i]; + *out << "0x" << std::hex << std::setw(2) << std::setfill('0') << int(c) + << ", "; + } + *out << "\n};\n"; + *out << name << "_ = std::string (\n" + << " reinterpret_cast(" << name << "_raw), \n" + << " sizeof(" << name << "_raw));\n"; + *out << std::dec; // Turn off hex when we're done. +} +} // namespace + +std::ofstream MessageDumper::license_file; +std::ofstream MessageDumper::renewal_file; +std::ofstream MessageDumper::provision_file; + +void MessageDumper::SetUp() { + LOGD("Creating golden data files for ODK golden data tests."); + license_file.open("license_data.cpp"); + if (!license_file) LOGE("Could not open dump file license_data.cpp"); + renewal_file.open("renewal_data.cpp"); + if (!renewal_file) LOGE("Could not open dump file renewal_data.cpp"); + provision_file.open("provision_data.cpp"); + if (!provision_file) LOGE("Could not open dump file provision_data.cpp"); +} + +void MessageDumper::TearDown() { + LOGD("Closing golden data files."); + license_file.close(); + renewal_file.close(); + provision_file.close(); +} + +void MessageDumper::DumpLicenseRequest(const CdmKeyRequest& request) { + SignedMessage signed_message; + DumpHeader(&license_file, "License"); + EXPECT_TRUE(signed_message.ParseFromString(request.message)); + EXPECT_TRUE(signed_message.has_oemcrypto_core_message()); + DumpHex(&license_file, "core_request", + signed_message.oemcrypto_core_message()); + // Since this is run within a test, we can also verify that the + // request is valid. + video_widevine::LicenseRequest license_request; + EXPECT_TRUE(license_request.ParseFromString(signed_message.msg())); +} + +void MessageDumper::DumpLicense(const std::string& response) { + SignedMessage signed_response; + EXPECT_TRUE(signed_response.ParseFromString(response)); + EXPECT_TRUE(signed_response.has_oemcrypto_core_message()); + DumpHex(&license_file, "core_response", + signed_response.oemcrypto_core_message()); + + video_widevine::License license; + EXPECT_TRUE(license.ParseFromString(signed_response.msg())); + DumpHex(&license_file, "serialized_license", signed_response.msg()); + + std::string message = + signed_response.oemcrypto_core_message() + signed_response.msg(); + ODK_Message odk_msg = ODK_Message_Create( + reinterpret_cast(const_cast(message.c_str())), + message.length()); + ODK_Message_SetSize(&odk_msg, + signed_response.oemcrypto_core_message().length()); + ODK_ParsedLicense odk_parsed_license = {}; + ODK_LicenseResponse odk_license_response = {}; + odk_license_response.parsed_license = &odk_parsed_license; + Unpack_ODK_LicenseResponse(&odk_msg, &odk_license_response); + EXPECT_EQ(ODK_Message_GetStatus(&odk_msg), MESSAGE_STATUS_OK); + // Valid hash is only needed for v16 messages. + std::string hash(' ', ODK_SHA256_HASH_SIZE); + DumpHex(&license_file, "core_request_sha256", hash); + license_file << " nonce_required_ = " + << (odk_parsed_license.nonce_required ? "true" : "false") + << ";\n"; + license_file << " RunTest();\n"; + license_file << "}\n\n"; +} + +void MessageDumper::DumpRenewalRequest(const CdmKeyRequest& request) { + DumpHeader(&renewal_file, "Renewal"); + SignedMessage signed_message; + EXPECT_TRUE(signed_message.ParseFromString(request.message)); + EXPECT_TRUE(signed_message.has_oemcrypto_core_message()); + DumpHex(&renewal_file, "core_request", + signed_message.oemcrypto_core_message()); + + video_widevine::LicenseRequest renewal_request; + EXPECT_TRUE(renewal_request.ParseFromString(signed_message.msg())); +} + +void MessageDumper::DumpRenewal(const std::string& response) { + SignedMessage signed_response; + EXPECT_TRUE(signed_response.ParseFromString(response)) + << "Response = " << wvutil::b2a_hex(response); + EXPECT_TRUE(signed_response.has_oemcrypto_core_message()); + DumpHex(&renewal_file, "core_response", + signed_response.oemcrypto_core_message()); + + video_widevine::License renewal; + EXPECT_TRUE(renewal.ParseFromString(signed_response.msg())); + DumpHex(&renewal_file, "renewal", signed_response.msg()); + + std::string message = + signed_response.oemcrypto_core_message() + signed_response.msg(); + ODK_Message odk_msg = ODK_Message_Create( + reinterpret_cast(const_cast(message.c_str())), + message.length()); + ODK_Message_SetSize(&odk_msg, + signed_response.oemcrypto_core_message().length()); + ODK_RenewalResponse odk_renewal_response = {}; + Unpack_ODK_RenewalResponse(&odk_msg, &odk_renewal_response); + EXPECT_EQ(ODK_Message_GetStatus(&odk_msg), MESSAGE_STATUS_OK); + renewal_file << " renewal_duration_seconds_ = " + << odk_renewal_response.renewal_duration_seconds << ";\n"; + renewal_file << " RunTest();\n"; + renewal_file << "}\n\n"; +} + +void MessageDumper::DumpProvisioningRequest( + const CdmProvisioningRequest& request) { + if (wvoec::global_features.derive_key_method == + wvoec::DeviceFeatures::TEST_PROVISION_40) { + LOGD("Provisioning 4.0 does not have a v17 core message."); + } else { + DumpHeader(&provision_file, "Provision"); + SignedProvisioningMessage signed_message; + EXPECT_TRUE(signed_message.ParseFromString(request)) + << "Request = " << wvutil::b2a_hex(request); + EXPECT_TRUE(signed_message.has_oemcrypto_core_message()); + DumpHex(&provision_file, "core_request", + signed_message.oemcrypto_core_message()); + } +} + +void MessageDumper::DumpProvisioning(const CdmProvisioningResponse& response) { + if (wvoec::global_features.derive_key_method == + wvoec::DeviceFeatures::TEST_PROVISION_40) { + LOGD("Provisioning 4.0 does not have a v17 core message."); + } else { + SignedProvisioningMessage signed_response; + if (!signed_response.ParseFromString(response)) { + // A binary provisioning response is buried within a json structure. + std::string extracted_message; + EXPECT_TRUE(CertificateProvisioning::ExtractAndDecodeSignedMessage( + response, &extracted_message)); + EXPECT_TRUE(signed_response.ParseFromString(extracted_message)); + } + EXPECT_TRUE(signed_response.has_oemcrypto_core_message()); + DumpHex(&provision_file, "core_response", + signed_response.oemcrypto_core_message()); + DumpHex(&provision_file, "provisioning_response", + signed_response.message()); + provision_file << " RunTest();\n"; + provision_file << "}\n\n"; + } +} +} // namespace wvcdm diff --git a/core/test/message_dumper.h b/core/test/message_dumper.h new file mode 100644 index 00000000..61843d2a --- /dev/null +++ b/core/test/message_dumper.h @@ -0,0 +1,39 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. + +#ifndef WVCDM_CORE_TEST_MESSAGE_DUMPER_H_ +#define WVCDM_CORE_TEST_MESSAGE_DUMPER_H_ + +#include +#include +#include + +#include + +#include "log.h" +#include "wv_cdm_types.h" + +namespace wvcdm { + +class MessageDumper : public ::testing::Environment { + // This dumps messages to a file so that the data can easily be turned + // into golden data tests for the ODK library. + public: + ~MessageDumper() override {} + void SetUp() override; + void TearDown() override; + + static void DumpLicenseRequest(const CdmKeyRequest& request); + static void DumpLicense(const std::string& response); + static void DumpRenewalRequest(const CdmKeyRequest& request); + static void DumpRenewal(const std::string& response); + static void DumpProvisioningRequest(const CdmProvisioningRequest& request); + static void DumpProvisioning(const CdmProvisioningResponse& response); + static std::ofstream license_file; + static std::ofstream renewal_file; + static std::ofstream provision_file; +}; +} // namespace wvcdm + +#endif // WVCDM_CORE_TEST_MESSAGE_DUMPER_H_ diff --git a/core/test/parallel_operations_test.cpp b/core/test/parallel_operations_test.cpp index 2439c61e..bf47fa1e 100644 --- a/core/test/parallel_operations_test.cpp +++ b/core/test/parallel_operations_test.cpp @@ -37,7 +37,7 @@ using HttpHeaderFields = std::map; constexpr const int kHttpOk = 200; const std::string kCencMimeType = "cenc"; -constexpr const auto kMaxThreadExecutionTime = std::chrono::seconds(30); +constexpr const auto kMaxThreadExecutionTime = std::chrono::seconds(60); constexpr const auto kMinimumWait = std::chrono::nanoseconds(1); constexpr const int kRepetitions = 10; diff --git a/core/test/policy_integration_test.cpp b/core/test/policy_integration_test.cpp index 2135b951..2b626249 100644 --- a/core/test/policy_integration_test.cpp +++ b/core/test/policy_integration_test.cpp @@ -6,6 +6,9 @@ // would do. They verify that policies specified on UAT are honored on the // device. +#include +#include +#include #include #include @@ -16,9 +19,9 @@ #include "license_holder.h" #include "log.h" #include "oec_device_features.h" +#include "provisioning_holder.h" #include "test_base.h" #include "test_printers.h" - #include "wv_cdm_types.h" namespace wvcdm { @@ -109,4 +112,69 @@ TEST_F(CorePIGTest, OfflineHWSecureRequired) { ASSERT_NO_FATAL_FAILURE(holder.CloseSession()); } +TEST_F(CorePIGTest, CastReceiverProvisioningUsingCdm) { + const std::string digest_hex_str = + // digest info header + "3021300906052b0e03021a05000414" + // sha1 of kMessage + "d2662f893aaec72f3ca6decc2aa942f3949e8b21"; + const auto digest = wvutil::a2b_hex(digest_hex_str); + + if (!wvoec::global_features.cast_receiver) { + GTEST_SKIP() << "OEMCrypto does not support CAST Receiver functionality"; + } + + // Provision x509 cert for CAST Receiver. + ProvisioningHolder provisioner(&cdm_engine_, config_); + provisioner.Provision(kCertificateX509, binary_provisioning_); + + // cdm_engine_.SignRsa + std::string signature_str; + const std::string digest_str(digest.begin(), digest.end()); + ASSERT_EQ(NO_ERROR, cdm_engine_.SignRsa(provisioner.wrapped_key(), digest_str, + &signature_str, kSign_PKCS1_Block1)); + + // Verify the generated signature + const std::vector signature(signature_str.begin(), signature_str.end()); + LOGI("digest.size(): %zu, signature.size(): %zu", digest.size(), + signature.size()); + + const std::string cert = provisioner.certificate(); + const char* const cert_str_ptr = cert.c_str(); + LOGI("cert: %s", cert_str_ptr); + + // Extract the public key from the x509 cert chain + std::unique_ptr bio(BIO_new(BIO_s_mem()), BIO_free_all); + ASSERT_NE(bio, nullptr); + ASSERT_GT(BIO_puts(bio.get(), cert_str_ptr), 0); + std::unique_ptr x509( + PEM_read_bio_X509(bio.get(), nullptr, nullptr, nullptr), X509_free); + ASSERT_NE(x509, nullptr); + std::unique_ptr pubkey( + X509_get_pubkey(x509.get()), EVP_PKEY_free); + ASSERT_NE(pubkey, nullptr); + + // remove digest info header for verification + // SHA1 is 20 bytes long + const std::vector sha1_digest(digest.begin() + digest.size() - 20, digest.end()); + + // Modified from openssl example + // https://www.openssl.org/docs/man3.0/man3/EVP_PKEY_verify_init.html + // Set RSA padding as RSA_PKCS1_PADDING and digest algo to SHA1. + const unsigned char* const md = sha1_digest.data(); + const unsigned char* const sig = signature.data(); + const size_t mdlen = sha1_digest.size(); + const size_t siglen = signature.size(); + + std::unique_ptr ctx( + EVP_PKEY_CTX_new(pubkey.get(), nullptr /* no engine */), EVP_PKEY_CTX_free); + + ASSERT_NE(ctx, nullptr); + ASSERT_GT(EVP_PKEY_verify_init(ctx.get()), 0); + ASSERT_GT(EVP_PKEY_CTX_set_rsa_padding(ctx.get(), RSA_PKCS1_PADDING), 0); + ASSERT_GT(EVP_PKEY_CTX_set_signature_md(ctx.get(), EVP_sha1()), 0); + + /* Perform operation */ + EXPECT_EQ(1, EVP_PKEY_verify(ctx.get(), sig, siglen, md, mdlen)); +} } // namespace wvcdm diff --git a/core/test/provisioning_holder.cpp b/core/test/provisioning_holder.cpp new file mode 100644 index 00000000..963b8670 --- /dev/null +++ b/core/test/provisioning_holder.cpp @@ -0,0 +1,206 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. + +#include "provisioning_holder.h" + +#include + +#include "cdm_engine.h" +#include "config_test_env.h" + +#include "log.h" +#include "message_dumper.h" +#include "oec_device_features.h" +#include "test_printers.h" +#include "test_sleep.h" +#include "url_request.h" + +namespace wvcdm { + +void ProvisioningHolder::Provision(CdmCertificateType cert_type, + bool binary_provisioning) { + CdmProvisioningRequest request; + std::string provisioning_server_url; + std::string cert_authority; + + CdmSessionId session_id; + + if (cert_type == kCertificateX509) { + cert_authority = "cast.google.com"; + } + LOGV("Provision with type %s.", CdmCertificateTypeToString(cert_type)); + CdmResponseType result(CERT_PROVISIONING_NONCE_GENERATION_ERROR); + // Get a provisioning request. We might need one retry if there is a nonce + // flood failure. + for (int i = 0; i < 2 && result == CERT_PROVISIONING_NONCE_GENERATION_ERROR; + i++) { + result = cdm_engine_->GetProvisioningRequest( + cert_type, cert_authority, provisioning_service_certificate_, + kLevelDefault, &request, &provisioning_server_url); + if (result == CERT_PROVISIONING_NONCE_GENERATION_ERROR) { + wvutil::TestSleep::Sleep(2); + } + } + ASSERT_EQ(NO_ERROR, result); + LOGV("cert_authority = %s", cert_authority.c_str()); + + if (binary_provisioning) { + request = wvutil::Base64SafeEncodeNoPad(request); + } + if (config_.dump_golden_data()) { + std::vector binary_request = wvutil::Base64SafeDecode(request); + CdmProvisioningRequest binary_request_string(binary_request.begin(), + binary_request.end()); + MessageDumper::DumpProvisioningRequest(binary_request_string); + } + LOGV("Provisioning request: req = %s", request.c_str()); + + // Ignore URL provided by CdmEngine. Use ours, as configured + // for test vs. production server. + provisioning_server_url.assign(provisioning_server_url_); + + // Make request. + UrlRequest url_request(provisioning_server_url); + if (!url_request.is_connected()) { + LOGE("Failed to connect to provisioning server: url = %s", + provisioning_server_url.c_str()); + } + url_request.PostCertRequestInQueryString(request); + + // Receive and parse response. + std::string response; + ASSERT_NO_FATAL_FAILURE(url_request.AssertOkResponse(&response)) + << "Failed to fetch provisioning response. " + << DumpProvAttempt(request, response, cert_type); + + if (binary_provisioning) { + // extract provisioning response from received message + // Extracts signed response from JSON string, result is serialized + // protobuf. + std::string protobuf_response; + const bool extract_ok = ExtractSignedMessage(response, &protobuf_response); + ASSERT_TRUE(extract_ok) << "Failed to extract signed serialized " + "response from JSON response"; + LOGV("Extracted response message: \n%s\n", protobuf_response.c_str()); + + ASSERT_FALSE(protobuf_response.empty()) + << "Protobuf response is unexpectedly empty"; + + // base64 decode response to yield binary protobuf + const std::vector response_vec( + wvutil::Base64SafeDecode(protobuf_response)); + ASSERT_FALSE(response_vec.empty()) + << "Failed to decode base64 of response: response = " + << protobuf_response; + + const std::string binary_protobuf_response(response_vec.begin(), + response_vec.end()); + + ASSERT_EQ(NO_ERROR, cdm_engine_->HandleProvisioningResponse( + binary_protobuf_response, kLevelDefault, + &certificate_, &wrapped_key_)) + << "Binary provisioning failed. " + << DumpProvAttempt(request, response, cert_type); + if (config_.dump_golden_data()) { + MessageDumper::DumpProvisioning(binary_protobuf_response); + } + } else { + ASSERT_EQ(NO_ERROR, + cdm_engine_->HandleProvisioningResponse( + response, kLevelDefault, &certificate_, &wrapped_key_)) + << "Non-binary provisioning failed. " + << DumpProvAttempt(request, response, cert_type); + if (config_.dump_golden_data()) { + MessageDumper::DumpProvisioning(response); + } + } +} + +bool ProvisioningHolder::ExtractSignedMessage(const std::string& response, + std::string* result) { + static const std::string kMessageStart = "\"signedResponse\": \""; + static const std::string kMessageEnd = "\""; + std::string response_string; + size_t start = response.find(kMessageStart); + + if (start == response.npos) { + // Assume serialized protobuf message. + result->assign(response); + } else { + // Assume JSON-wrapped protobuf. + size_t end = response.find(kMessageEnd, start + kMessageStart.length()); + if (end == response.npos) { + LOGE("ExtractSignedMessage cannot locate end substring"); + result->clear(); + return false; + } + size_t result_string_size = end - start - kMessageStart.length(); + result->assign(response, start + kMessageStart.length(), + result_string_size); + } + + if (result->empty()) { + LOGE("ExtractSignedMessage: Response message is empty"); + return false; + } + return true; +} + +std::string ProvisioningHolder::DumpProvAttempt(const std::string& request, + const std::string& response, + CdmCertificateType cert_type) { + std::stringstream info; + info << "Cert Type: "; + PrintTo(cert_type, &info); + info << "\n"; + info << "Provisioning url: " << provisioning_server_url_ << "\n"; + info << "Provisioning Request: " << request << "\n\n"; + info << "Provisioning Response: " << response << "\n\n"; + std::string system_id; + cdm_engine_->QueryStatus(kLevelDefault, QUERY_KEY_SYSTEM_ID, &system_id); + info << "system id: " << system_id << "\n"; + if (wvoec::global_features.derive_key_method == + wvoec::DeviceFeatures::TEST_PROVISION_30) { + std::vector cert; + size_t cert_length = 0; + OEMCryptoResult result = OEMCrypto_GetOEMPublicCertificate( + cert.data(), &cert_length, kLevelDefault); + if (result == OEMCrypto_ERROR_SHORT_BUFFER) { + cert.resize(cert_length); + result = OEMCrypto_GetOEMPublicCertificate(cert.data(), &cert_length, + kLevelDefault); + } + if (result != OEMCrypto_SUCCESS) { + info << "--- ERROR GETTING CERT. result=" << result; + } else { + info << "OEM Cert = (len=" << cert_length << ") " + << wvutil::unlimited_b2a_hex(cert); + } + } + if (wvoec::global_features.derive_key_method == + wvoec::DeviceFeatures::TEST_PROVISION_40) { + std::vector bcc; + size_t bcc_length = 0; + std::vector signature; + size_t signature_length = 0; + OEMCryptoResult result = OEMCrypto_GetBootCertificateChain( + bcc.data(), &bcc_length, signature.data(), &signature_length); + if (result == OEMCrypto_ERROR_SHORT_BUFFER) { + bcc.resize(bcc_length); + signature.resize(signature_length); + result = OEMCrypto_GetBootCertificateChain( + bcc.data(), &bcc_length, signature.data(), &signature_length); + } + if (result != OEMCrypto_SUCCESS) { + info << "--- ERROR GETTING BCC. result=" << result; + } else { + info << "BCC = (len=" << bcc_length << ") " + << wvutil::unlimited_b2a_hex(bcc) << "\n" + << "Additional Sig = (len=" << signature_length << ") " + << wvutil::unlimited_b2a_hex(signature) << "\n"; + } + } + return info.str(); +} +} // namespace wvcdm diff --git a/core/test/provisioning_holder.h b/core/test/provisioning_holder.h new file mode 100644 index 00000000..f42bacba --- /dev/null +++ b/core/test/provisioning_holder.h @@ -0,0 +1,49 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. + +#ifndef WVCDM_CORE_TEST_PROVISIONING_HOLDER_H_ +#define WVCDM_CORE_TEST_PROVISIONING_HOLDER_H_ + +#include "test_base.h" + +#include + +namespace wvcdm { + +class ProvisioningHolder { + public: + ProvisioningHolder(TestCdmEngine* cdm_engine, const ConfigTestEnv& config) + : cdm_engine_(cdm_engine), + config_(config), + provisioning_server_url_(config.provisioning_server()), + provisioning_service_certificate_( + config.provisioning_service_certificate()) {} + void Provision(CdmCertificateType cert_type, bool binary_provisioning); + std::string certificate() const { return certificate_; } + std::string wrapped_key() const { return wrapped_key_; } + + protected: + TestCdmEngine* cdm_engine_; + const ConfigTestEnv& config_; + std::string provisioning_server_url_; + std::string provisioning_service_certificate_; + std::string certificate_; + std::string wrapped_key_; + + // Locate the portion of the server's provisioning response message that is + // between the strings jason_start_substr and json_end_substr. Returns the + // string through *result. If the start substring match fails, assume the + // entire string represents a serialized protobuf mesaage and return true with + // the entire string. If the end_substring match fails, return false with an + // empty *result. + bool ExtractSignedMessage(const std::string& response, std::string* result); + // Dump request and response information for use in a debug or failure log. + std::string DumpProvAttempt(const std::string& request, + const std::string& response, + CdmCertificateType cert_type); +}; + +} // namespace wvcdm + +#endif // WVCDM_CORE_TEST_PROVISIONING_HOLDER_H_ diff --git a/core/test/reboot_test.cpp b/core/test/reboot_test.cpp index 32950f7b..39e208b2 100644 --- a/core/test/reboot_test.cpp +++ b/core/test/reboot_test.cpp @@ -223,9 +223,11 @@ void RebootTest::SetUp() { EXPECT_EQ(read, file_size) << "Error reading persistent data file."; EXPECT_TRUE(ParseDump(dump, &persistent_data_)); } + TestSleep::SyncFakeClock(); } void RebootTest::TearDown() { + TestSleep::SyncFakeClock(); auto file = file_system_->Open(persistent_data_filename_, FileSystem::kCreate | FileSystem::kTruncate); ASSERT_TRUE(file) << "Failed to open file: " << persistent_data_filename_; @@ -405,6 +407,7 @@ class OfflineLicense { // Fetch and load the license. The session is left open. void LoadLicense() { license_holder_.OpenSession(); + TestSleep::SyncFakeClock(); start_of_rental_clock_ = wvutil::Clock().GetCurrentTime(); license_holder_.FetchLicense(); license_holder_.LoadLicense(); @@ -434,6 +437,7 @@ class OfflineLicense { // Verify that the license may be used to decrypt content. void Decrypt() { + TestSleep::SyncFakeClock(); if (start_of_playback_ == 0) { start_of_playback_ = wvutil::Clock().GetCurrentTime(); } @@ -451,6 +455,7 @@ class OfflineLicense { // Verify that the license has expired, and may not be used to decrypt // content. void FailDecrypt() { + TestSleep::SyncFakeClock(); const KeyId key_id = "0000000000000000"; EXPECT_EQ(NEED_KEY, license_holder_.Decrypt(key_id)) << "Decrypt should have failed for " << content_id_ @@ -629,6 +634,7 @@ class OfflineLicenseTest : public RebootTest { int decrypt_count = 0; int fail_count = 0; for (auto time : interesting_times_) { + TestSleep::SyncFakeClock(); int64_t now = wvutil::Clock().GetCurrentTime(); int64_t delta = (time - now); // It is not necessarily an error for the delta to be negative. But it is @@ -673,6 +679,7 @@ class OfflineLicenseTest : public RebootTest { for (size_t i = first_valid_[n] + 1; i < test_case_[n].size(); i++) { OfflineLicense* license = test_case_[n][i].get(); ASSERT_NO_FATAL_FAILURE(license->ReloadLicense()); + TestSleep::SyncFakeClock(); int64_t now = wvutil::Clock().GetCurrentTime(); if (now <= license->cutoff() - kFudge) { license->Decrypt(); diff --git a/core/test/test_base.cpp b/core/test/test_base.cpp index 51470ace..7baa6694 100644 --- a/core/test/test_base.cpp +++ b/core/test/test_base.cpp @@ -21,10 +21,12 @@ #include "file_store.h" #include "license.h" #include "log.h" +#include "message_dumper.h" #include "oec_device_features.h" #include "oec_test_data.h" #include "platform.h" #include "properties.h" +#include "provisioning_holder.h" #include "test_printers.h" #include "test_sleep.h" #include "url_request.h" @@ -111,6 +113,11 @@ void show_menu(const char* prog_name, const std::string& extra_help_text) { << " configure the provisioning server url, please include http[s]" << " in the url" << std::endl << std::endl; + std::cout << " --server_version=N" << std::endl; + std::cout << " specify the server version. Tests that are not expected " + << "to pass" << std::endl + << " on this server version will be skipped." << std::endl + << std::endl; std::cout << " --qa_provisioning" << std::endl; std::cout << " use the QA provisioning cert and QA test keybox" @@ -135,48 +142,12 @@ void show_menu(const char* prog_name, const std::string& extra_help_text) { std::cout << " --test_data_path=" << std::endl; std::cout << " Where to store test data for reboot tests." << std::endl; + std::cout << " --dump_golden_data" << std::endl; + std::cout << " Dump the license request and response from the server." + << std::endl; + std::cout << extra_help_text << std::endl; } - -/* - * Locate the portion of the server's response message that is between - * the strings jason_start_substr and json_end_substr. Returns the string - * through *result. If the start substring match fails, assume the entire - * string represents a serialized protobuf mesaage and return true with - * the entire string. If the end_substring match fails, return false with - * an empty *result. - */ -bool ExtractSignedMessage(const std::string& response, - const std::string& json_start_substr, - const std::string& json_end_substr, - std::string* result) { - std::string response_string; - size_t start = response.find(json_start_substr); - - if (start == response.npos) { - // Assume serialized protobuf message. - result->assign(response); - } else { - // Assume JSON-wrapped protobuf. - size_t end = - response.find(json_end_substr, start + json_start_substr.length()); - if (end == response.npos) { - LOGE("ExtractSignedMessage cannot locate end substring"); - result->clear(); - return false; - } - size_t result_string_size = end - start - json_start_substr.length(); - result->assign(response, start + json_start_substr.length(), - result_string_size); - } - - if (result->empty()) { - LOGE("ExtractSignedMessage: Response message is empty"); - return false; - } - return true; -} - } // namespace std::unique_ptr WvCdmTestBase::default_config_; @@ -317,105 +288,12 @@ WvCdmTestBase::WvCdmTestBase() } void WvCdmTestBase::Provision() { - CdmProvisioningRequest prov_request; - std::string provisioning_server_url; - CdmCertificateType cert_type = kCertificateWidevine; - std::string cert_authority; - std::string cert, wrapped_key; - - CdmSessionId session_id; + const CdmCertificateType cert_type = kCertificateWidevine; std::unique_ptr file_system(CreateTestFileSystem()); - - if (config_.provisioning_server() == "fake") { - LOGD("Using fake provisioning server."); - - TestCdmEngine cdm_engine(file_system.get(), - std::shared_ptr(new EngineMetrics)); - FakeProvisioningServer server; - CdmResponseType result = cdm_engine.GetProvisioningRequest( - cert_type, cert_authority, server.service_certificate(), kLevelDefault, - &prov_request, &provisioning_server_url); - ASSERT_EQ(NO_ERROR, result); - if (!binary_provisioning_) { - std::vector prov_request_v = - wvutil::Base64SafeDecode(prov_request); - prov_request = std::string(prov_request_v.begin(), prov_request_v.end()); - } - std::string response; - ASSERT_TRUE(server.MakeResponse(prov_request, &response)) - << "Fake provisioning server could not provision"; - result = cdm_engine.HandleProvisioningResponse(response, kLevelDefault, - &cert, &wrapped_key); - EXPECT_EQ(NO_ERROR, result); - } else { - // TODO(fredgc): provision for different SPOIDs. - TestCdmEngine cdm_engine(file_system.get(), - std::shared_ptr(new EngineMetrics)); - - CdmResponseType result = cdm_engine.GetProvisioningRequest( - cert_type, cert_authority, config_.provisioning_service_certificate(), - kLevelDefault, &prov_request, &provisioning_server_url); - ASSERT_EQ(NO_ERROR, result); - - if (binary_provisioning_) { - prov_request = wvutil::Base64SafeEncodeNoPad(prov_request); - } - - LOGV("Provisioning request: req = %s", prov_request.c_str()); - - // Ignore URL provided by CdmEngine. Use ours, as configured - // for test vs. production server. - provisioning_server_url.assign(config_.provisioning_server()); - - // Make request. - UrlRequest url_request(provisioning_server_url); - if (!url_request.is_connected()) { - LOGE("Failed to connect to provisioning server: url = %s", - provisioning_server_url.c_str()); - } - url_request.PostCertRequestInQueryString(prov_request); - - // Receive and parse response. - std::string http_message; - ASSERT_TRUE(url_request.GetResponse(&http_message)) - << "Failed to get provisioning response"; - LOGV("http_message: \n%s\n", http_message.c_str()); - - if (binary_provisioning_) { - // extract provisioning response from received message - // Extracts signed response from JSON string, result is serialized - // protobuf. - static const std::string kMessageStart = "\"signedResponse\": \""; - static const std::string kMessageEnd = "\""; - std::string protobuf_response; - const bool extract_ok = ExtractSignedMessage( - http_message, kMessageStart, kMessageEnd, &protobuf_response); - ASSERT_TRUE(extract_ok) << "Failed to extract signed serialized " - "response from JSON response"; - LOGV("Extracted response message: \n%s\n", protobuf_response.c_str()); - - ASSERT_FALSE(protobuf_response.empty()) - << "Protobuf response is unexpectedly empty"; - - // base64 decode response to yield binary protobuf - const std::vector response_vec( - wvutil::Base64SafeDecode(protobuf_response)); - ASSERT_FALSE(response_vec.empty()) - << "Failed to decode base64 of response: response = " - << protobuf_response; - - const std::string binary_protobuf_response(response_vec.begin(), - response_vec.end()); - - ASSERT_EQ(NO_ERROR, cdm_engine.HandleProvisioningResponse( - binary_protobuf_response, kLevelDefault, &cert, - &wrapped_key)); - } else { - ASSERT_EQ(NO_ERROR, - cdm_engine.HandleProvisioningResponse( - http_message, kLevelDefault, &cert, &wrapped_key)); - } - } + TestCdmEngine cdm_engine(file_system.get(), + std::shared_ptr(new EngineMetrics)); + ProvisioningHolder provisioner(&cdm_engine, config_); + provisioner.Provision(cert_type, binary_provisioning_); } // TODO(fredgc): Replace this with a pre-defined DRM certificate. We could do @@ -489,6 +367,9 @@ bool WvCdmTestBase::Initialize(int argc, const char* const argv[], } else if (arg.find("--gtest") == 0) { // gtest arguments will be passed to gtest by the main program. continue; + } else if (arg == "--dump_golden_data") { + default_config_->set_dump_golden_data(true); + testing::AddGlobalTestEnvironment(new MessageDumper); } else { const auto index = arg.find('='); if (index == std::string::npos) { @@ -541,6 +422,8 @@ bool WvCdmTestBase::Initialize(int argc, const char* const argv[], } } else if (arg_prefix == "--test_data_path") { default_config_->set_test_data_path(arg_value); + } else if (arg_prefix == "--server_version") { + default_config_->set_server_version(atoi(arg_value.c_str())); } else { std::cerr << "Unknown argument " << arg_prefix << std::endl; show_usage = true; @@ -564,8 +447,12 @@ bool WvCdmTestBase::Initialize(int argc, const char* const argv[], << std::endl; std::cout << "Default Renewal Server: " << default_config_->renewal_server() << std::endl; - std::cout << "Default KeyID: " << default_config_->key_id() << std::endl - << std::endl; + std::cout << "Default KeyID: " << default_config_->key_id() << std::endl; + if (default_config_->server_version() != 0) { + std::cout << "Server Version: " << default_config_->server_version() + << std::endl; + } + std::cout << std::endl; // Figure out which tests are appropriate for OEMCrypto, based on features // supported. diff --git a/core/test/test_base.h b/core/test/test_base.h index 9119363e..ec2056e2 100644 --- a/core/test/test_base.h +++ b/core/test/test_base.h @@ -88,6 +88,7 @@ class TestCdmEngine : public CdmEngine { TestCdmEngine(wvutil::FileSystem* file_system, std::shared_ptr metrics) : CdmEngine(file_system, metrics) {} + const CdmSession* GetCdmSession(std::string sessionId) const; }; class WvCdmTestBaseWithEngine : public WvCdmTestBase { diff --git a/core/test/test_printers.cpp b/core/test/test_printers.cpp index 1386bc06..0f167270 100644 --- a/core/test/test_printers.cpp +++ b/core/test/test_printers.cpp @@ -994,6 +994,39 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) { case PROVISIONING_4_FAILED_TO_INITIALIZE_DEVICE_FILES_3: *os << "PROVISIONING_4_FAILED_TO_INITIALIZE_DEVICE_FILES_3"; break; + case GET_SIGNATURE_HASH_ALGORITHM_ERROR_1: + *os << "GET_SIGNATURE_HASH_ALGORITHM_ERROR_1"; + break; + case GET_SIGNATURE_HASH_ALGORITHM_ERROR_2: + *os << "GET_SIGNATURE_HASH_ALGORITHM_ERROR_2"; + break; + case GET_SIGNATURE_HASH_ALGORITHM_ERROR_3: + *os << "GET_SIGNATURE_HASH_ALGORITHM_ERROR_3"; + break; + case UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_1: + *os << "UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_1"; + break; + case UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_2: + *os << "UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_2"; + break; + case UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_3: + *os << "UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_3"; + break; + case UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_4: + *os << "UNSUPPORTED_SIGNATURE_HASH_ALGORITHM_4"; + break; + case STORE_ATSC_LICENSE_DEVICE_FILES_INIT_ERROR: + *os << "STORE_ATSC_LICENSE_DEVICE_FILES_INIT_ERROR"; + break; + case STORE_ATSC_LICENSE_ERROR: + *os << "STORE_ATSC_LICENSE_ERROR"; + break; + case SESSION_NOT_FOUND_GENERIC_CRYPTO: + *os << "SESSION_NOT_FOUND_GENERIC_CRYPTO"; + break; + case SESSION_NOT_FOUND_24: + *os << "SESSION_NOT_FOUND_24"; + break; default: *os << "Unknown CdmResponseType"; break; diff --git a/core/test/url_request.cpp b/core/test/url_request.cpp index fc4b755e..dc81da8d 100644 --- a/core/test/url_request.cpp +++ b/core/test/url_request.cpp @@ -6,6 +6,7 @@ #include +#include #include #include "http_socket.h" @@ -21,6 +22,7 @@ const int kReadBufferSize = 1024; const int kConnectTimeoutMs = 15000; const int kWriteTimeoutMs = 12000; const int kReadTimeoutMs = 12000; +constexpr int kHttpOk = 200; const std::string kGoogleHeaderUpper("X-Google"); const std::string kGoogleHeaderLower("x-google"); @@ -92,7 +94,7 @@ void UrlRequest::Reconnect() { is_connected_ = true; } else { LOGE("Failed to connect: url = %s, port = %d, attempt = %u", - socket_.domain_name().c_str(), socket_.port(), i); + socket_.url().c_str(), socket_.port(), i); } } } @@ -119,12 +121,20 @@ bool UrlRequest::GetResponse(std::string* message) { } ConcatenateChunkedResponse(response, message); - LOGV("HTTP response from %s://%s:%d%s: (%zu): %s", socket_.scheme().c_str(), - socket_.domain_name().c_str(), socket_.port(), - socket_.resource_path().c_str(), message->size(), message->c_str()); + LOGV("HTTP response from %s: (%zu): %s", socket_.url().c_str(), + message->size(), message->c_str()); return true; } +void UrlRequest::AssertOkResponse(std::string* message) { + ASSERT_TRUE(message); + ASSERT_TRUE(GetResponse(message)); + const int status_code = GetStatusCode(*message); + ASSERT_EQ(kHttpOk, status_code) << "HTTP response from " << socket_.url() + << ": (" << message->size() << ") :\n" + << *message; +} + // static int UrlRequest::GetStatusCode(const std::string& response) { const std::string kHttpVersion("HTTP/1.1 "); @@ -191,6 +201,7 @@ bool UrlRequest::PostRequestWithPath(const std::string& path, request.append("Connection: close\r\n"); request.append("User-Agent: Widevine CDM v1.0\r\n"); + request.append("X-Return-Encrypted-Headers: request_and_response\r\n"); // buffer to store length of data as a string char data_size_buffer[32] = {0}; @@ -206,8 +217,8 @@ bool UrlRequest::PostRequestWithPath(const std::string& path, const int ret = socket_.WriteAndLogErrors( request.c_str(), static_cast(request.size()), kWriteTimeoutMs); - LOGV("HTTP request: (%zu): %s", request.size(), - wvutil::b2a_hex(request).c_str()); + LOGV("HTTP request: (%zu): %s", request.size(), request.c_str()); + LOGV("HTTP request hex: %s", wvutil::b2a_hex(request).c_str()); return ret != -1; } diff --git a/core/test/url_request.h b/core/test/url_request.h index 0d6e4623..c2d0d35e 100644 --- a/core/test/url_request.h +++ b/core/test/url_request.h @@ -28,6 +28,8 @@ class UrlRequest { bool GetResponse(std::string* message); static int GetStatusCode(const std::string& response); + // Get the response, and expect the status is OK. + void AssertOkResponse(std::string* message); static bool GetDebugHeaderFields( const std::string& response, diff --git a/core/test/usage_table_header_unittest.cpp b/core/test/usage_table_header_unittest.cpp index 98464e29..5ab81e2a 100644 --- a/core/test/usage_table_header_unittest.cpp +++ b/core/test/usage_table_header_unittest.cpp @@ -398,7 +398,7 @@ class MockDeviceFiles : public DeviceFiles { (const CdmUsageTableHeader&, const std::vector&), (override)); - MOCK_METHOD(bool, DeleteUsageInfo, (const std::string&, const std::string&), + MOCK_METHOD(bool, DeleteUsageInfo, (const std::string&, const CdmKeySetId&), (override)); MOCK_METHOD(bool, DeleteMultipleUsageInfoByKeySetIds, (const std::string&, const std::vector&), diff --git a/oem_certificate_generator/README.md b/oem_certificate_generator/README.md index 92b4c5eb..a9fd4830 100644 --- a/oem_certificate_generator/README.md +++ b/oem_certificate_generator/README.md @@ -16,7 +16,7 @@ OEM certificate generation tool ## Usage -Run `python oem_certificate.py --help` to see available commands. +Run `python3 oem_certificate.py --help` to see available commands. The arguments can be partially or fully loaded from a configuration file, for example, if file "location.cfg" is, @@ -32,14 +32,14 @@ example, if file "location.cfg" is, A command of ```bash - python oem_certificate.py generate_csr @location.cfg -CN TestDevice1 \ + python3 oem_certificate.py generate_csr @location.cfg -CN TestDevice1 \ --output_csr_file=csr.pem --output_private_key_file=key.der ``` is equivalent to ```bash - python oem_certificate.py generate_csr -CN TestDevice1 -C=US -ST=CA \ + python3 oem_certificate.py generate_csr -CN TestDevice1 -C=US -ST=CA \ -L=Kirkland -O='Some Company' -OU='Some Unit' --output_csr_file=csr.pem \ --output_private_key_file=key.der. ``` diff --git a/oem_certificate_generator/oem_certificate.py b/oem_certificate_generator/oem_certificate.py index 71e77895..cf4e9e18 100755 --- a/oem_certificate_generator/oem_certificate.py +++ b/oem_certificate_generator/oem_certificate.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # Copyright 2017 Google LLC. All Rights Reserved. """OEM certificate generation tool. @@ -26,10 +26,10 @@ example, if file "location.cfg" is, -OU=Some Unit A command of - "python oem_certificate.py generate_csr @location.cfg -CN TestDevice1 " + "python3 oem_certificate.py generate_csr @location.cfg -CN TestDevice1 " "--output_csr_file=csr.pem --output_private_key_file=key.der", is equivalent to - "python oem_certificate.py generate_csr -CN TestDevice1 -C=US -ST=CA " + "python3 oem_certificate.py generate_csr -CN TestDevice1 -C=US -ST=CA " "-L=Kirkland -O='Some Company' -OU='Some Unit' --output_csr_file=csr.pem " "--output_private_key_file=key.der". diff --git a/oemcrypto/include/OEMCryptoCENC.h b/oemcrypto/include/OEMCryptoCENC.h index d34b3098..018fc2d3 100644 --- a/oemcrypto/include/OEMCryptoCENC.h +++ b/oemcrypto/include/OEMCryptoCENC.h @@ -121,7 +121,7 @@ * application or the license server. * * @defgroup drm_cert DRM Certificate Provisioning API - * This section of functions are used to provision the device with an DRM + * This section of functions are used to provision the device with a DRM * certificate. This certificate is obtained by a device in the field from a * Google/Widevine provisioning server, or from a third party server running the * Google/Widevine provisioning server SDK. Since the DRM certificate may be @@ -574,6 +574,13 @@ typedef enum OEMCrypto_WatermarkingSupport { /** * Obfuscation Renames. + * + * The function signatures of each oecc obfuscated name should remain static + * across multiple versions. When we want to change the function signature of a + * function, we will give the new signature a new oecc number and keep the + * original oecc name with the original function signature. This allows us to + * maintain backwards compatibility when the CDM loads an older version of + * liboemcrypto.so using dlopen. */ // clang-format off #define OEMCrypto_Initialize _oecc01 @@ -702,6 +709,7 @@ typedef enum OEMCrypto_WatermarkingSupport { #define OEMCrypto_ReuseUsageEntry _oecc127 #define OEMCrypto_GetDTCP2Capability _oecc128 #define OEMCrypto_GetWatermarkingSupport _oecc129 +#define OEMCrypto_GetOEMKeyToken _oecc130 // clang-format on /// @addtogroup initcontrol @@ -917,6 +925,9 @@ OEMCryptoResult OEMCrypto_CloseSession(OEMCrypto_SESSION session); /** * This method creates an entitled key session. + * OEMCrypto is required to support at least one entitled key session per + * license. For CAS support, we also require that OEMCrypto support at least + * six entitled key sessions per license. * * @param[in] oec_session: handle for the OEMCrypto session to be associated * with the created entitled key session. @@ -925,6 +936,14 @@ OEMCryptoResult OEMCrypto_CloseSession(OEMCrypto_SESSION session); * @retval OEMCrypto_SUCCESS success * @retval OEMCrypto_ERROR_NOT_IMPLEMENTED * @retval OEMCrypto_ERROR_INVALID_SESSION + * @retval OEMCrypto_ERROR_TOO_MANY_SESSIONS + * + * @threading + * This is a "Session Function" and may be called simultaneously with session + * functions for other sessions but not simultaneously with other functions + * for this oec_session. It will not be called simultaneously with + * initialization or usage table functions. It is as if the CDM holds a write + * lock for this session, and a read lock on the OEMCrypto system. * * @version * This method is new in API version 17. @@ -942,6 +961,13 @@ OEMCryptoResult OEMCrypto_CreateEntitledKeySession( * @retval OEMCrypto_ERROR_NOT_IMPLEMENTED * @retval OEMCrypto_ERROR_INVALID_ENTITLED_KEY_SESSION * + * @threading + * This is a "Session Function" and may be called simultaneously with session + * functions for other sessions but not simultaneously with other functions + * for this session. It will not be called simultaneously with initialization + * or usage table functions. It is as if the CDM holds a write lock for this + * session, and a read lock on the OEMCrypto system. + * * @version * This method is new in API version 17. */ @@ -1796,18 +1822,18 @@ OEMCryptoResult OEMCrypto_LoadLicense(OEMCrypto_SESSION session, size_t signature_length); /** - * Load content keys into a session which already has entitlement keys - * loaded. This function will only be called for a session after a call to - * OEMCrypto_LoadKeys() with the parameter type license_type equal to - * OEMCrypto_EntitlementLicense. This function may be called multiple times + * Load content keys into an entitled session which is associated with an + * entitlement sessions. This function will only be called for an entitled + * session after a call to OEMCrypto_LoadLicense() has been called on the + * associated entitlement session. This function may be called multiple times * for the same session. * - * If the session does not have license_type equal to - * OEMCrypto_EntitlementLicense, return OEMCrypto_ERROR_INVALID_CONTEXT and - * perform no work. + * If the session is not an entitled session, return + * OEMCrypto_ERROR_INVALID_CONTEXT and perform no work. * * For each key object in key_array, OEMCrypto shall look up the entry in the - * key table with the corresponding entitlement_key_id. + * key table for the entitlement session with the corresponding + * entitlement_key_id. * * 1. If no entry is found, return OEMCrypto_KEY_NOT_ENTITLED. * 2. If the entry already has a content_key_id and content_key_data, that @@ -1841,12 +1867,19 @@ OEMCryptoResult OEMCrypto_LoadLicense(OEMCrypto_SESSION session, * @retval OEMCrypto_ERROR_SYSTEM_INVALIDATED * @retval OEMCrypto_ERROR_INVALID_ENTITLED_KEY_SESSION * + * @buffer_size + * OEMCrypto shall support message sizes as described in the section + * OEMCrypto_ResourceRatingTier(). + * OEMCrypto shall return OEMCrypto_ERROR_BUFFER_TOO_LARGE if the buffer is + * larger than the supported size. + * * @threading * This is a "Session Function" and may be called simultaneously with session * functions for other sessions but not simultaneously with other functions - * for this session. It will not be called simultaneously with initialization - * or usage table functions. It is as if the CDM holds a write lock for this - * session, and a read lock on the OEMCrypto system. + * for this session, or its entitlement session. It will not be called + * simultaneously with initialization or usage table functions. It is as if + * the CDM holds a write lock for this session, and a read lock on the + * OEMCrypto system. * * @version * This method changed in API version 17. @@ -3868,11 +3901,14 @@ OEMCrypto_WatermarkingSupport OEMCrypto_GetWatermarkingSupport(void); * key and signing key generated using an algorithm at least as strong as * that in GenerateDerivedKeys. * - * First, OEMCrypto shall verify the signature of the message using - * HMAC-SHA256 with the derived mac_key[server]. The signature verification - * shall use a constant-time algorithm (a signature mismatch will always take - * the same time as a successful comparison). The signature is over the - * entire message buffer starting at message with length message_length. If + * First, OEMCrypto shall verify the signature of the message using the correct + * algorithm depending on if the device supports Provisioning 2.0, 3.0 or 4.0. + * + * For Provisioning 2.0, OEMCrypto shall verify the signature of the message + * using HMAC-SHA256 with the derived mac_key[server]. The signature + * verification shall use a constant-time algorithm (a signature mismatch will + * always take the same time as a successful comparison). The signature is over + * the entire message buffer starting at message with length message_length. If * the signature verification fails, ignore all other arguments and return * OEMCrypto_ERROR_SIGNATURE_FAILURE. * @@ -3880,7 +3916,10 @@ OEMCrypto_WatermarkingSupport OEMCrypto_GetWatermarkingSupport(void); * and encrypt_key with a call to OEMCrypto_DeriveKeysFromSessionKey() or * OEMCrypto_GenerateDerivedKeys(). * - * The function ODK_ParseProvisioning is called to parse the message. If it + * For Provisioning 3.0 and 4.0, the signature is not verified. + * + * After the signature is verified, + * the function ODK_ParseProvisioning is called to parse the message. If it * returns an error, OEMCrypto shall return that error to the CDM layer. The * function ODK_ParseProvisioning is described in the document "Widevine Core * Message Serialization". @@ -4157,7 +4196,7 @@ OEMCryptoResult OEMCrypto_GenerateRSASignature( RSA_Padding_Scheme padding_scheme); /** - * OEMCrypto will use OEMCrypto_PrepAndSignProvisioningRequest(), as described + * OEMCrypto will use ODK_PrepareCoreProvisioningRequest(), as described * in the document "Widevine Core Message Serialization", to prepare the core * message. If it returns an error, the error should be returned by OEMCrypto * to the CDM layer. If it returns OEMCrypto_SUCCESS, then OEMCrypto shall @@ -4168,11 +4207,17 @@ OEMCryptoResult OEMCrypto_GenerateRSASignature( * the request with the session's derived client mac key from the previous * call to OEMCrypto_GenerateDerivedKeys(). * - * For a device that has an OEM Certificate, i.e. Provisioning 3.0, OEMCrypto - * will sign the request with the private key associated with the OEM + * For Provisioning 3.0, i.e. a device that has a baked in OEM Certificate, + * OEMCrypto will sign the request with the private key associated with the OEM * Certificate. The key shall have been loaded by a previous call to * OEMCrypto_LoadDRMPrivateKey(). * + * For Provisioning 4.0, i.e. a device that uses a Boot Chain Certificate to + * request and OEM cert, a request for an OEM cert is signed by the OEM private + * key. A request for a DRM cert is signed by the DRM private key. The DRM cert + * that was generated on the device in OEMCrypto_GenerateCertificateKeyPair() is + * signed by the OEM cert private key. + * * Refer to the Signing Messages Sent to a Server section above for more * details. * @@ -4799,11 +4844,54 @@ OEMCryptoResult OEMCrypto_GetBootCertificateChain( * key is supposed to be certified by the server. The private key is wrapped * with the encryption key so it can be stored in the file system. * - * If an OEM private key is unavailable, the request is assumed for OEM + * The |public_key_signature| output is formatted differently depending + * on whether or not an OEM private key has been loaded. + * + * If an OEM private key is unavailable, the request is assumed to be for OEM * certificate provisioning. In this case, the public key is signed by the - * device private key. If an OEM private key is available, the request is - * assumed for DRM certificate provisioning and the public key is signed by the - * OEM private key. + * device private key. The format of |public_key_signature| in this case is a + * COSE_Sign1 CBOR array. The format is described in RFC 8152 Section 4.2 and + * 4.4, as well as Android IRemotelyProvisionedComponent.aidl (under + * "SignedData") + * + * |public_key_signature|: COSE_Sign1 CBOR array + * [ + * protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / + * AlgorithmES384 }, + * unprotected: {}, + * payload: bstr .cbor Data / nil, + * signature: bstr ; PureEd25519(priv_key, Sig_structure) / + * ; ECDSA(priv_key, Sig_structure) + * ] + * + * Notes: + * 1. The payload field in the COSE_Sign1 struct is the public key generated + * by OEMCrypto_GenerateCertificateKeyPair + * 2. The signature field in the COSE_Sign1 struct is the concatenation of the + * (R,S) values from the EC/Ed signature. If either R or S is smaller than + * the key size, it is left-padded with 0 to match the key size as + * described in RFC 8152. This signature is not DER encoded. + * 3. The signature is generated by calling the selected EC signing function + * (PureEd25519 or one of the supported ECDSA algorithms) on + * `Sig_structure`, which is a CBOR array described below. The payload + * field in Sig_structure is the same as the payload in the above + * COSE_Sign1 CBOR array. + * + * Sig_structure: CBOR array + * [ + * context: "Signature1", + * protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / + * AlgorithmES384 }, + * external_aad: bstr .size 0, + * payload: bstr .cbor Data / nil, + * ] + * + * If an OEM private key is available, the request is assumed to be for DRM + * certificate provisioning and the public key is signed by the OEM private key. + * If the OEM private key is an RSA key, then |public_key_signature| is the raw + * output of the RSA sign operation with RSASSA-PSS padding. If the OEM private + * key is an ECC key, then |public_key_signature| is the ASN.1 DER-encoded (R,S) + * signature as specified in RFC 3279 2.2.3. * * @param[in] session: session id. * @param[out] public_key: pointer to the buffer that receives the public key @@ -4812,11 +4900,8 @@ OEMCryptoResult OEMCrypto_GetBootCertificateChain( * @param[in,out] public_key_length: on input, size of the caller's public_key * buffer. On output, the number of bytes written into the buffer. * @param[out] public_key_signature: pointer to the buffer that receives the - * signature of the public key. - * If an OEM private key is unavailable: it is signed by the device private - * key. The signature must be in COSE_SIGN1 format as specified in RFC 8152. - * If an OEM private key is available: it is signed by the OEM private key. - * The signature must be raw signature bytes. + * signature of the public key. The format depends on whether an OEM private + * key has been loaded. * @param[in,out] public_key_signature_length: on input, size of the caller's * public_key_signature buffer. On output, the number of bytes written into * the buffer. @@ -5114,11 +5199,9 @@ OEMCryptoResult OEMCrypto_InstallOemPrivateKey( * @retval OEMCrypto_ERROR_INVALID_SESSION * * @threading - * This is a "Session Function" and may be called simultaneously with session - * functions for other sessions but not simultaneously with other functions - * for this session. It will not be called simultaneously with initialization - * or usage table functions. It is as if the CDM holds a write lock for this - * session, and a read lock on the OEMCrypto system. + * This is a "Session Initialization Function" and will not be called + * simultaneously with any other function, as if the CDM holds a write lock + * on the OEMCrypto system. * * @version * This method is new in API version 17. @@ -5306,6 +5389,31 @@ OEMCryptoResult OEMCrypto_ProcessOTAKeybox(OEMCrypto_SESSION session, const uint8_t* buffer, size_t buffer_length, uint32_t use_test_key); +/** + * Retrieves the key token associated with the input entitled key session. This + * method is currently used only by CAS, where key token is a means to share + * vendor specific crypto info with other frameworks (e.g. Descrambler in + * Android TunerHAL) that are also under control of the vendor. + * + * @param[in] key_session: handle for the entitled key session to be used. + * @param[out] key_token: where the key token is stored. + * @param[in,out] key_token_length: length of the key token, in bytes. + * + * @retval OEMCrypto_SUCCESS on success + * @retval OEMCrypto_ERROR_SHORT_BUFFER if buffer_length is too small. + * @retval OEMCrypto_ERROR_NOT_IMPLEMENTED + * + * @threading + * This is an "Initialization and Termination Function" and will not be called + * simultaneously with any other function, as if the CDM holds a write lock on + * the OEMCrypto system. + * + * @version + * This method is new in API version 17. + */ +OEMCryptoResult OEMCrypto_GetOEMKeyToken(OEMCrypto_SESSION key_session, + uint8_t* key_token, + size_t* key_token_length); /****************************************************************************/ /****************************************************************************/ diff --git a/oemcrypto/odk/include/OEMCryptoCENCCommon.h b/oemcrypto/odk/include/OEMCryptoCENCCommon.h index ce51b8d0..e94f1774 100644 --- a/oemcrypto/odk/include/OEMCryptoCENCCommon.h +++ b/oemcrypto/odk/include/OEMCryptoCENCCommon.h @@ -139,6 +139,7 @@ typedef enum OEMCrypto_LicenseType { typedef enum OEMCrypto_PrivateKeyType { OEMCrypto_RSA_Private_Key = 0, OEMCrypto_ECC_Private_Key = 1, + OEMCrypto_PrivateKeyType_MaxValue = OEMCrypto_ECC_Private_Key, } OEMCrypto_PrivateKeyType; /** diff --git a/oemcrypto/odk/include/core_message_features.h b/oemcrypto/odk/include/core_message_features.h index 16289c6b..42c41ba9 100644 --- a/oemcrypto/odk/include/core_message_features.h +++ b/oemcrypto/odk/include/core_message_features.h @@ -25,10 +25,9 @@ struct CoreMessageFeatures { // This is the published version of the ODK Core Message library. The default // behavior is for the server to restrict messages to at most this version - // number. The default is 16.5, the last version used by Chrome. This will - // change to 17.0 when v17 has been released. + // number. The default is 17.2. uint32_t maximum_major_version = 17; - uint32_t maximum_minor_version = 0; + uint32_t maximum_minor_version = 2; bool operator==(const CoreMessageFeatures &other) const; bool operator!=(const CoreMessageFeatures &other) const { diff --git a/oemcrypto/odk/include/odk_message.h b/oemcrypto/odk/include/odk_message.h index 075f28cc..cdbf26b4 100644 --- a/oemcrypto/odk/include/odk_message.h +++ b/oemcrypto/odk/include/odk_message.h @@ -36,10 +36,12 @@ extern "C" { #if defined(__GNUC__) || defined(__clang__) #define ALIGNED __attribute__((aligned)) +#elif _MSC_VER +#define ALIGNED __declspec(align(8)) #else #define ALIGNED #error ODK_Message must be aligned to the maximum useful alignment of the \ - machine you are compiling for. Define the ALIGNED macro accordingly. + machine you are compiling for. Define the ALIGNED macro accordingly. #endif typedef struct { @@ -61,7 +63,8 @@ typedef enum { MESSAGE_STATUS_NOT_INITIALIZED = 0x2990b6c6, MESSAGE_STATUS_OUT_OF_MEMORY = 0x7c5c64cc, MESSAGE_STATUS_MAP_SHARED_MEMORY_FAILED = 0x7afecacf, - MESSAGE_STATUS_SECURE_BUFFER_ERROR = 0x78f0e873 + MESSAGE_STATUS_SECURE_BUFFER_ERROR = 0x78f0e873, + MESSAGE_STATUS_BUFFER_TOO_LARGE = 0x5bfcfb21 } ODK_MessageStatus; /* diff --git a/oemcrypto/odk/include/odk_structs.h b/oemcrypto/odk/include/odk_structs.h index fba3c3aa..78e8b6a7 100644 --- a/oemcrypto/odk/include/odk_structs.h +++ b/oemcrypto/odk/include/odk_structs.h @@ -16,10 +16,10 @@ extern "C" { /* The version of this library. */ #define ODK_MAJOR_VERSION 17 -#define ODK_MINOR_VERSION 1 +#define ODK_MINOR_VERSION 2 /* ODK Version string. Date changed automatically on each release. */ -#define ODK_RELEASE_DATE "ODK v17.1 2022-06-17" +#define ODK_RELEASE_DATE "ODK v17.2 2022-11-21" /* The lowest version number for an ODK message. */ #define ODK_FIRST_VERSION 16 diff --git a/oemcrypto/odk/src/core_message_features.cpp b/oemcrypto/odk/src/core_message_features.cpp index 615e4779..60431f7d 100644 --- a/oemcrypto/odk/src/core_message_features.cpp +++ b/oemcrypto/odk/src/core_message_features.cpp @@ -23,7 +23,7 @@ CoreMessageFeatures CoreMessageFeatures::DefaultFeatures( features.maximum_minor_version = 5; // 16.5 break; case 17: - features.maximum_minor_version = 1; // 17.1 + features.maximum_minor_version = 2; // 17.2 break; default: features.maximum_minor_version = 0; diff --git a/oemcrypto/odk/src/odk_endian.h b/oemcrypto/odk/src/odk_endian.h index 1e9f50d2..58a2fd70 100644 --- a/oemcrypto/odk/src/odk_endian.h +++ b/oemcrypto/odk/src/odk_endian.h @@ -25,6 +25,14 @@ extern "C" { #define oemcrypto_be32toh OSSwapBigToHostInt32 #define oemcrypto_htobe64 OSSwapHostToBigInt64 #define oemcrypto_be64toh OSSwapBigToHostInt64 +#elif defined(_WIN32) +#include +#define oemcrypto_htobe16 htons +#define oemcrypto_be16toh ntohs +#define oemcrypto_htobe32 htonl +#define oemcrypto_be32toh ntohl +#define oemcrypto_htobe64 htonll +#define oemcrypto_be64toh ntohll #else /* defined(__linux__) || defined(__ANDROID__) */ uint32_t oemcrypto_htobe16(uint16_t u16); uint32_t oemcrypto_be16toh(uint16_t u16); diff --git a/oemcrypto/odk/src/odk_serialize.c b/oemcrypto/odk/src/odk_serialize.c index 5c582000..537eefe2 100644 --- a/oemcrypto/odk/src/odk_serialize.c +++ b/oemcrypto/odk/src/odk_serialize.c @@ -212,7 +212,7 @@ static void Unpack_ODK_ParsedLicense(ODK_Message* msg, ODK_ParsedLicense* obj) { Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys); Unpack_OEMCrypto_Substring(msg, &obj->pst); Unpack_OEMCrypto_Substring(msg, &obj->srm_restriction_data); - obj->license_type = (OEMCrypto_LicenseType)Unpack_enum(msg); + Unpack_OEMCrypto_LicenseType(msg, &obj->license_type); Unpack_bool(msg, &obj->nonce_required); Unpack_ODK_TimerLimits(msg, &obj->timer_limits); Unpack_uint32_t(msg, &obj->watermarking); @@ -270,7 +270,7 @@ static void Unpack_ODK_ParsedLicenseV16(ODK_Message* msg, Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys); Unpack_OEMCrypto_Substring(msg, &obj->pst); Unpack_OEMCrypto_Substring(msg, &obj->srm_restriction_data); - obj->license_type = (OEMCrypto_LicenseType)Unpack_enum(msg); + Unpack_OEMCrypto_LicenseType(msg, &obj->license_type); Unpack_bool(msg, &obj->nonce_required); Unpack_ODK_TimerLimits(msg, &obj->timer_limits); Unpack_uint32_t(msg, &obj->key_array_length); @@ -286,7 +286,7 @@ static void Unpack_ODK_ParsedLicenseV16(ODK_Message* msg, static void Unpack_ODK_ParsedProvisioning(ODK_Message* msg, ODK_ParsedProvisioning* obj) { - obj->key_type = (OEMCrypto_PrivateKeyType)Unpack_enum(msg); + Unpack_OEMCrypto_PrivateKeyType(msg, &obj->key_type); Unpack_OEMCrypto_Substring(msg, &obj->enc_private_key); Unpack_OEMCrypto_Substring(msg, &obj->enc_private_key_iv); Unpack_OEMCrypto_Substring(msg, &obj->encrypted_message_key); diff --git a/oemcrypto/odk/src/serialization_base.c b/oemcrypto/odk/src/serialization_base.c index 30af34cf..2ea30654 100644 --- a/oemcrypto/odk/src/serialization_base.c +++ b/oemcrypto/odk/src/serialization_base.c @@ -108,10 +108,28 @@ static void UnpackBytes(ODK_Message* message, uint8_t* ptr, size_t count) { } } -int Unpack_enum(ODK_Message* message) { - uint32_t v32; +void Unpack_OEMCrypto_LicenseType(ODK_Message* message, + OEMCrypto_LicenseType* value) { + assert(value); + uint32_t v32 = 0; Unpack_uint32_t(message, &v32); - return (int)v32; + if (v32 <= OEMCrypto_LicenseType_MaxValue) { + *value = (OEMCrypto_LicenseType)v32; + } else { + ODK_Message_SetStatus(message, MESSAGE_STATUS_PARSE_ERROR); + } +} + +void Unpack_OEMCrypto_PrivateKeyType(ODK_Message* message, + OEMCrypto_PrivateKeyType* value) { + assert(value); + uint32_t v32 = 0; + Unpack_uint32_t(message, &v32); + if (v32 <= OEMCrypto_PrivateKeyType_MaxValue) { + *value = (OEMCrypto_PrivateKeyType)v32; + } else { + ODK_Message_SetStatus(message, MESSAGE_STATUS_PARSE_ERROR); + } } void Unpack_bool(ODK_Message* message, bool* value) { diff --git a/oemcrypto/odk/src/serialization_base.h b/oemcrypto/odk/src/serialization_base.h index 7b69e11f..f3979376 100644 --- a/oemcrypto/odk/src/serialization_base.h +++ b/oemcrypto/odk/src/serialization_base.h @@ -25,7 +25,10 @@ void PackArray(ODK_Message* message, const uint8_t* base, size_t size); void Pack_OEMCrypto_Substring(ODK_Message* message, const OEMCrypto_Substring* obj); -int Unpack_enum(ODK_Message* message); +void Unpack_OEMCrypto_LicenseType(ODK_Message* message, + OEMCrypto_LicenseType* value); +void Unpack_OEMCrypto_PrivateKeyType(ODK_Message* message, + OEMCrypto_PrivateKeyType* value); void Unpack_bool(ODK_Message* message, bool* value); void Unpack_uint8_t(ODK_Message* message, uint8_t* value); void Unpack_uint16_t(ODK_Message* message, uint16_t* value); diff --git a/oemcrypto/odk/test/odk_golden_v16.cpp b/oemcrypto/odk/test/odk_golden_v16.cpp new file mode 100644 index 00000000..ba0e6aa9 --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v16.cpp @@ -0,0 +1,4134 @@ +// Copyright 2022 Google LLC. All rights reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "odk.h" + +#include +#include + +#include + +#include "gtest/gtest.h" + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.h" +#include "odk_structs.h" +#include "odk_structs_priv.h" + +namespace wvodk_test { + +namespace { + +using oemcrypto_core_message::ODK_LicenseRequest; +using oemcrypto_core_message::ODK_ProvisioningRequest; +using oemcrypto_core_message::ODK_RenewalRequest; + +using oemcrypto_core_message::deserialize::CoreLicenseRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreProvisioningRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreRenewalRequestFromMessage; +using oemcrypto_core_message::features::CoreMessageFeatures; +using oemcrypto_core_message::serialize::CreateCoreLicenseResponseFromProto; +using oemcrypto_core_message::serialize:: + CreateCoreProvisioningResponseFromProto; +using oemcrypto_core_message::serialize::CreateCoreRenewalResponse; + +class ODKGoldenProvisionV16 : public ::testing::Test { + protected: + void RunTest() { + ODK_ProvisioningRequest core_provisioning_request; + EXPECT_TRUE(CoreProvisioningRequestFromMessage(core_request_, + &core_provisioning_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreProvisioningResponseFromProto( + features, provisioning_response_, core_provisioning_request, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + std::string core_request_; + std::string core_response_; + std::string provisioning_response_; +}; + +class ODKGoldenLicenseV16 : public ::testing::Test { + protected: + void RunTest() { + ODK_LicenseRequest core_license_request; + EXPECT_TRUE( + CoreLicenseRequestFromMessage(core_request_, &core_license_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreLicenseResponseFromProto( + features, serialized_license_, core_license_request, + core_request_sha256_, nonce_required_, uses_padding_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + bool nonce_required_; + // TODO(fredgc): padding is removed in protocol 2.2. + bool uses_padding_ = true; + std::string core_request_; + std::string core_response_; + std::string serialized_license_; + std::string core_request_sha256_; +}; + +class ODKGoldenRenewalV16 : public ::testing::Test { + protected: + void RunTest() { + ODK_RenewalRequest core_renewal_request; + EXPECT_TRUE( + CoreRenewalRequestFromMessage(core_request_, &core_renewal_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreRenewalResponse(features, core_renewal_request, + renewal_duration_seconds_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + uint64_t renewal_duration_seconds_; + std::string core_request_; + std::string core_response_; + std::string renewal_; +}; + +// README (for ODK maintainers): Set the environment variable DUMP_LICENSE="yes" +// Then set the environment variable GTEST_FILTER to the test you want to run. +// Run the script for the platform we want. E.g. run_fake_l1_tests, +// run_prov30_tests or run_prov40_tests. Look for the autogenerated code in +// $CDM_DIR/out/testbed/debug/*_data.cpp. If you are updating the ODK library, +// and you have to change the code above, then you're fine. If you have to +// change the code below then there is probably a backwards compatibility +// problem. + +////////////////////////////////////////////////////////////////////// +// Provisioning tests. +// One provisioning example from fake-l1 (with keybox) and one +// from prov30. +// GTEST_FILTER='*CorePIGTest.OfflineNoNonce*" +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenProvisionV16, CorePIGTest_OfflineNoNonce_prov20) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x00, 0x04, 0x00, + 0x10, 0x57, 0x32, 0xd5, 0x9a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, + 0x00, 0x20, 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, + 0x65, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, + 0x6f, 0x78, 0x30, 0x30, 0x30, 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, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x00, 0x04, 0x00, 0x10, + 0x57, 0x32, 0xd5, 0x9a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, + 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, 0x6f, 0x78, 0x30, 0x30, + 0x30, 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, 0x03, + 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0x1b, 0x3b, 0x96, 0x96, 0x44, 0x40, 0x39, 0x09, 0x20, + 0xee, 0x78, 0x96, 0x7e, 0xe0, 0x07, 0xfb, 0x8a, 0xb8, 0x22, 0x22, 0x06, + 0x96, 0xfa, 0x5d, 0x9b, 0x00, 0xac, 0x16, 0x90, 0x3e, 0xae, 0xa3, 0xfb, + 0xd2, 0x0c, 0xa0, 0x5d, 0x4e, 0xbf, 0xff, 0xe1, 0x7e, 0x55, 0x52, 0x50, + 0xad, 0x47, 0xeb, 0xe5, 0x0d, 0xb7, 0xca, 0x14, 0xa8, 0xdf, 0x31, 0x6c, + 0xf3, 0x2d, 0x35, 0x31, 0x31, 0xee, 0x26, 0xa5, 0xa9, 0x3f, 0x4e, 0xcd, + 0xe4, 0x52, 0x15, 0x49, 0x33, 0xfc, 0x8f, 0x27, 0x23, 0x60, 0x48, 0xe0, + 0x1c, 0x64, 0xc3, 0xf8, 0x13, 0x9f, 0x69, 0xb2, 0x6b, 0x80, 0xb5, 0x48, + 0x42, 0x8f, 0x45, 0xc4, 0x28, 0x79, 0xf1, 0x33, 0xa9, 0x54, 0x76, 0x93, + 0xcc, 0x77, 0x7f, 0x5e, 0x37, 0x5e, 0xa6, 0xd3, 0x02, 0xcc, 0x57, 0x44, + 0xab, 0x73, 0x55, 0x78, 0x2b, 0x26, 0x05, 0xc1, 0x13, 0xa9, 0xf5, 0xc3, + 0x7d, 0x70, 0x95, 0x24, 0x98, 0x46, 0xee, 0x5c, 0x80, 0xbf, 0xff, 0xc6, + 0x81, 0x7c, 0xb9, 0xd0, 0x4a, 0xbf, 0xcd, 0x96, 0x8c, 0x39, 0xf2, 0xfd, + 0x0f, 0x60, 0xfd, 0x3b, 0xe4, 0x62, 0x09, 0x10, 0xb1, 0x85, 0x5e, 0x38, + 0xcf, 0x69, 0x85, 0x9b, 0x5d, 0x56, 0x0b, 0x45, 0xb3, 0x40, 0xe5, 0x30, + 0xed, 0xb0, 0x3c, 0x0c, 0x90, 0x08, 0xd4, 0xae, 0xf5, 0xa6, 0x13, 0xb6, + 0x57, 0x85, 0x08, 0x96, 0x56, 0x47, 0x7d, 0xc1, 0x62, 0xd9, 0xfe, 0x27, + 0xca, 0x2b, 0x75, 0x24, 0x78, 0x0d, 0xf5, 0x07, 0x7f, 0xb8, 0x6c, 0xcf, + 0x8a, 0xff, 0xfd, 0x1e, 0x09, 0xef, 0xfb, 0x28, 0x28, 0x9e, 0x95, 0x8d, + 0xdc, 0xcd, 0x9b, 0x3b, 0xb9, 0x8f, 0xc2, 0x71, 0x4f, 0xf2, 0x50, 0x6e, + 0x06, 0xb9, 0x61, 0x8e, 0xb9, 0x97, 0xce, 0xb5, 0x41, 0x6f, 0x9c, 0xdf, + 0x37, 0xb5, 0x2f, 0x8b, 0x36, 0x62, 0x4c, 0x99, 0x94, 0x6b, 0x22, 0xb7, + 0x3d, 0xf4, 0xe5, 0x1a, 0x3b, 0x3b, 0x32, 0x08, 0x28, 0xdb, 0x66, 0xcb, + 0x27, 0x93, 0x94, 0x46, 0xe7, 0x3a, 0xe6, 0xcb, 0xfd, 0x8a, 0xd4, 0x31, + 0x17, 0xa4, 0x72, 0x1a, 0x78, 0x8c, 0xad, 0xd4, 0x2e, 0xa3, 0xf9, 0x34, + 0x69, 0x39, 0xdf, 0xab, 0x85, 0x6d, 0xad, 0xbf, 0x52, 0x79, 0x1d, 0xf7, + 0x5d, 0x24, 0x5c, 0x4c, 0x14, 0x29, 0x66, 0x9b, 0xec, 0x37, 0x3f, 0x28, + 0xab, 0x89, 0x92, 0x14, 0xaa, 0x83, 0x63, 0x95, 0x95, 0x73, 0x72, 0x16, + 0x63, 0xe6, 0x13, 0x60, 0x19, 0x27, 0xbf, 0xa5, 0x95, 0xdd, 0xad, 0xf4, + 0xe1, 0x5c, 0x93, 0x47, 0xa1, 0xaf, 0x3b, 0x4f, 0x08, 0x4a, 0x9d, 0x63, + 0x8d, 0x33, 0x2a, 0x34, 0xe7, 0xa7, 0xa9, 0x67, 0xac, 0xec, 0x74, 0xee, + 0xff, 0x40, 0x24, 0x3d, 0x9d, 0x28, 0xe4, 0xdf, 0x6d, 0xdb, 0x69, 0xac, + 0x21, 0x90, 0x8d, 0x1e, 0x94, 0xa1, 0x95, 0xd9, 0xe7, 0x48, 0xb4, 0xd7, + 0xad, 0x29, 0xf8, 0x07, 0xc6, 0xbe, 0x1b, 0xd9, 0xe6, 0x2c, 0x20, 0xd3, + 0x33, 0x88, 0xd1, 0xb0, 0xe9, 0x63, 0xb1, 0x9c, 0x2f, 0x08, 0xeb, 0x59, + 0x37, 0xd9, 0x65, 0x4e, 0x53, 0xf1, 0x8e, 0xdb, 0x30, 0x3d, 0xf4, 0xa7, + 0xbe, 0xfe, 0x3c, 0xc5, 0x5c, 0xf1, 0x50, 0x5d, 0x1f, 0x29, 0x00, 0xec, + 0x17, 0x20, 0xed, 0x24, 0x29, 0xd8, 0xee, 0xe0, 0xc5, 0x13, 0x9d, 0x77, + 0xa4, 0x8d, 0x00, 0x96, 0xba, 0x58, 0x54, 0x00, 0x52, 0x3f, 0xce, 0x64, + 0x39, 0x5c, 0x64, 0x9b, 0x4c, 0x77, 0x3e, 0x4c, 0x6d, 0xfe, 0xe3, 0xf7, + 0xeb, 0x8b, 0xa0, 0xfc, 0x6e, 0x19, 0xe0, 0xeb, 0xed, 0x8b, 0x6e, 0x5f, + 0x6d, 0x2c, 0xb2, 0x3a, 0xae, 0xca, 0x85, 0x38, 0x7f, 0xb9, 0xd0, 0xf6, + 0x0a, 0x11, 0x10, 0x5a, 0x48, 0x58, 0x30, 0x0c, 0x2e, 0xb4, 0x84, 0xf2, + 0x92, 0x8e, 0xe1, 0x12, 0x42, 0x06, 0x81, 0x03, 0x7f, 0x18, 0x38, 0xfc, + 0xc1, 0x7c, 0xed, 0x67, 0x08, 0x86, 0xb1, 0xbb, 0xa7, 0xdb, 0x00, 0xfa, + 0x59, 0xfa, 0xea, 0xb5, 0x30, 0x5d, 0x4d, 0x8f, 0xff, 0xc3, 0xb1, 0x5f, + 0x7e, 0xcb, 0x2d, 0x7c, 0xe4, 0x32, 0x07, 0x7c, 0x38, 0xe8, 0xe5, 0x29, + 0x3c, 0xe4, 0x7e, 0xc8, 0xbc, 0x6f, 0x25, 0xcf, 0xbb, 0x2e, 0xb3, 0x75, + 0xf0, 0x6e, 0x49, 0x3a, 0x70, 0x8f, 0x5c, 0xcf, 0x22, 0x61, 0x70, 0x3c, + 0x0b, 0xe9, 0xfd, 0x51, 0xc0, 0xe9, 0x37, 0x67, 0x61, 0xd8, 0x75, 0xc3, + 0x0a, 0x09, 0xac, 0xd9, 0xe1, 0x83, 0xa4, 0xec, 0x63, 0x81, 0x47, 0x61, + 0xe1, 0x1e, 0xe1, 0xa9, 0xac, 0xe4, 0x37, 0x12, 0x4e, 0xf7, 0xdc, 0xd9, + 0xee, 0x33, 0x75, 0x93, 0x9b, 0xbe, 0x25, 0xb9, 0x71, 0x78, 0x7f, 0xb8, + 0xda, 0x0b, 0x8d, 0xd9, 0x29, 0x85, 0x16, 0x35, 0x23, 0x31, 0x53, 0x96, + 0x3b, 0x58, 0xb9, 0xf6, 0xcc, 0x95, 0x92, 0x1a, 0x5b, 0xf4, 0xb2, 0xac, + 0x8f, 0x23, 0x1a, 0x31, 0xd6, 0xd9, 0x2a, 0xd6, 0x5c, 0xeb, 0xca, 0x6f, + 0x57, 0x58, 0x0c, 0xa8, 0x23, 0x55, 0xa3, 0x6c, 0xc4, 0x82, 0x9d, 0x07, + 0x8b, 0xec, 0xe1, 0x55, 0xa2, 0xc7, 0x02, 0x8d, 0x3f, 0x58, 0xcb, 0x5f, + 0x16, 0x13, 0xaf, 0x1e, 0xe8, 0xc3, 0xbd, 0x8a, 0x94, 0xad, 0xec, 0xe1, + 0x12, 0x55, 0xd5, 0x72, 0x61, 0xfa, 0xa1, 0x6a, 0xfb, 0xfb, 0x4b, 0xdd, + 0x2a, 0x0c, 0x39, 0x50, 0xff, 0x0b, 0x58, 0x44, 0x0b, 0x93, 0x34, 0xa6, + 0x05, 0x43, 0x28, 0xd8, 0x6c, 0xd0, 0xc9, 0x5d, 0xf6, 0xaf, 0x74, 0x7c, + 0xc7, 0xc0, 0x45, 0xfc, 0x5a, 0x27, 0xc8, 0x7b, 0x39, 0xab, 0x41, 0x1a, + 0x00, 0x43, 0xcc, 0x4e, 0x57, 0xb2, 0xba, 0x98, 0xd2, 0x49, 0xab, 0xe7, + 0xf4, 0x0b, 0x0c, 0x00, 0x8a, 0x1e, 0x9e, 0x61, 0x86, 0xec, 0xb8, 0x15, + 0x1e, 0x7f, 0x85, 0xf3, 0xba, 0xce, 0x04, 0xf3, 0x60, 0x96, 0xd3, 0x08, + 0x54, 0x51, 0xcc, 0x28, 0xac, 0x37, 0x98, 0x01, 0xac, 0xdc, 0xf1, 0x43, + 0xcc, 0x35, 0xfe, 0xde, 0x62, 0x4e, 0x7c, 0x7b, 0xb6, 0xe1, 0xea, 0x22, + 0x35, 0x6c, 0x8a, 0x9a, 0x7e, 0xc6, 0x8a, 0x77, 0xa9, 0x8d, 0x97, 0x5a, + 0xb3, 0x0f, 0xfb, 0x31, 0x1b, 0x39, 0x28, 0x7d, 0x08, 0x66, 0x1b, 0x0d, + 0xf1, 0x38, 0x24, 0x8b, 0x6e, 0x23, 0xdf, 0xa4, 0xf0, 0x1c, 0xad, 0xc6, + 0x48, 0xa8, 0x99, 0xdd, 0x9a, 0xe3, 0x2e, 0xcc, 0xd3, 0x4d, 0x93, 0x81, + 0x35, 0x07, 0xae, 0x4d, 0xeb, 0xfe, 0x0c, 0x4a, 0x4d, 0x66, 0x4a, 0x39, + 0x1c, 0x92, 0x85, 0x2a, 0x59, 0x0c, 0x81, 0x00, 0xb5, 0x9c, 0xd4, 0x34, + 0xac, 0x53, 0xd8, 0xbd, 0x90, 0xcc, 0x44, 0x44, 0x42, 0xf1, 0x0d, 0x3b, + 0xf5, 0x28, 0xc4, 0xf9, 0xc1, 0x40, 0x79, 0x95, 0xcc, 0x36, 0x05, 0x4c, + 0x2d, 0x64, 0x8d, 0xbf, 0xf8, 0x42, 0x81, 0x94, 0xdf, 0x16, 0xf9, 0x11, + 0xeb, 0xe1, 0x46, 0xdc, 0x15, 0xb3, 0x52, 0x02, 0xb6, 0xef, 0x6a, 0x9d, + 0xcb, 0x21, 0x5c, 0xb4, 0xec, 0x74, 0x7e, 0x27, 0xd7, 0x94, 0x9e, 0xd7, + 0x6b, 0x82, 0xc0, 0x55, 0x74, 0x0e, 0x05, 0xb2, 0xcc, 0xe5, 0xc6, 0x1f, + 0x09, 0x9a, 0x28, 0x41, 0x54, 0x46, 0xc8, 0x06, 0xf7, 0x28, 0xa0, 0xb1, + 0x84, 0x98, 0x7f, 0xcf, 0x7c, 0x9e, 0x32, 0x7e, 0x9a, 0xd3, 0x8e, 0x42, + 0x6a, 0x93, 0x45, 0x52, 0x8f, 0x8a, 0x43, 0x77, 0x23, 0x1f, 0x44, 0x74, + 0x97, 0x69, 0x61, 0xa2, 0x8a, 0x83, 0xf4, 0x2a, 0x82, 0xbf, 0xd5, 0x42, + 0x71, 0x49, 0x70, 0xf7, 0xb9, 0xa5, 0x3b, 0x1b, 0xe0, 0x9d, 0x23, 0xbf, + 0x27, 0x7f, 0xdf, 0xe9, 0xf6, 0x30, 0x4b, 0xc4, 0x77, 0xce, 0x59, 0x21, + 0xe4, 0xea, 0x10, 0x74, 0x91, 0xf1, 0xcc, 0x57, 0x69, 0xb3, 0x7e, 0xbc, + 0xd1, 0xfd, 0xdc, 0xd3, 0x6a, 0xdd, 0xd3, 0xd1, 0xec, 0x3b, 0x20, 0x1d, + 0xb7, 0x77, 0xe7, 0x07, 0x26, 0xfa, 0x17, 0x6d, 0xc0, 0x98, 0xcb, 0x78, + 0xe3, 0x99, 0xf0, 0x0e, 0xc3, 0xdf, 0xcb, 0xce, 0x67, 0x56, 0xe9, 0xed, + 0xe3, 0x31, 0xf7, 0x6f, 0x4c, 0x69, 0x8c, 0x70, 0xed, 0x9a, 0x21, 0x44, + 0x45, 0xde, 0xd0, 0x78, 0x51, 0xc5, 0x5f, 0x79, 0x49, 0x77, 0x38, 0x14, + 0x8b, 0xff, 0x2b, 0x7b, 0xe3, 0x42, 0x0a, 0xf8, 0x8a, 0x63, 0x71, 0x65, + 0x15, 0x3a, 0x07, 0x2f, 0xcb, 0x43, 0x75, 0xea, 0xcf, 0xad, 0x15, 0x43, + 0x40, 0x62, 0x5b, 0x31, 0x26, 0x44, 0x4a, 0x6e, 0x96, 0xae, 0x31, 0xb7, + 0x3a, 0xc3, 0x2a, 0x04, 0xaa, 0x42, 0x23, 0x18, 0x01, 0xa3, 0xa1, 0x5a, + 0x3f, 0x2c, 0x0d, 0x7d, 0x63, 0xce, 0x0c, 0xf2, 0x76, 0x0e, 0x1a, 0xbb, + 0x41, 0xfc, 0xda, 0x39, 0x67, 0x7b, 0x95, 0x20, 0x7e, 0x8e, 0x80, 0xb0, + 0x97, 0xbb, 0xc0, 0xe4, 0xcb, 0xd6, 0x67, 0x52, 0x3c, 0x86, 0x7b, 0x0b, + 0x01, 0x13, 0x9c, 0xc2, 0x55, 0xe9, 0x5c, 0x5d, 0x9f, 0x27, 0x6b, 0xee, + 0xa5, 0xd3, 0xe2, 0x12, 0x94, 0xe1, 0xda, 0x1c, 0x91, 0xe0, 0x57, 0xe2, + 0x01, 0x79, 0x54, 0x31, 0x64, 0x86, 0xc9, 0x8f, 0x8e, 0x8b, 0xad, 0x1b, + 0x17, 0x55, 0x29, 0xd8, 0x64, 0xd9, 0xed, 0x12, 0x6e, 0x02, 0x9c, 0x12, + 0x10, 0x14, 0xf2, 0x0f, 0x97, 0x27, 0x97, 0x03, 0xee, 0x45, 0xfc, 0x77, + 0xf7, 0xf9, 0x32, 0x2a, 0x3d, 0x1a, 0xa8, 0x0b, 0x0a, 0xeb, 0x03, 0x08, + 0x02, 0x12, 0x10, 0x7c, 0xb4, 0x9f, 0x98, 0x7a, 0x63, 0x5e, 0x1e, 0x0a, + 0x52, 0x18, 0x46, 0x94, 0x58, 0x2d, 0x6e, 0x18, 0x8b, 0x8e, 0x86, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xc5, 0xc3, 0x6b, 0x93, 0xa8, 0x1d, 0x66, 0xa4, 0xdf, 0xaf, 0x17, + 0xde, 0x95, 0x15, 0x57, 0x53, 0x69, 0x66, 0x20, 0x2f, 0x09, 0x3f, 0xaa, + 0x5b, 0xcf, 0x01, 0x35, 0x1c, 0x92, 0x2e, 0x08, 0xbd, 0x9e, 0x5c, 0xdd, + 0x29, 0xa7, 0xad, 0x7d, 0xca, 0x9d, 0x50, 0x61, 0xfe, 0xc5, 0xa9, 0xc5, + 0x04, 0x8e, 0x64, 0x9d, 0x48, 0x0f, 0xaf, 0x50, 0xa6, 0x1c, 0x51, 0x64, + 0xbe, 0xf9, 0x13, 0xbc, 0xf8, 0x7f, 0x13, 0x5b, 0x52, 0x8e, 0x21, 0x62, + 0x33, 0xd8, 0xb2, 0x4f, 0xab, 0xb1, 0x9e, 0xc6, 0xd8, 0xc6, 0x83, 0x6a, + 0x47, 0x98, 0xa8, 0x76, 0x2b, 0x75, 0xa0, 0x41, 0x56, 0xe6, 0xa4, 0xd9, + 0x26, 0x1f, 0x3f, 0x4c, 0x18, 0xb0, 0xd4, 0xd9, 0x81, 0xec, 0x72, 0xed, + 0x86, 0xf5, 0x36, 0x92, 0xdf, 0xeb, 0x71, 0x94, 0xbd, 0x4a, 0x01, 0x25, + 0xe3, 0x2a, 0x3a, 0x74, 0x60, 0x6c, 0x94, 0x4d, 0x7f, 0x8a, 0x58, 0x18, + 0x5e, 0xdc, 0x62, 0xf5, 0x4c, 0xb1, 0x67, 0x47, 0xc5, 0x1d, 0xde, 0x4e, + 0x8b, 0xd8, 0x60, 0x5d, 0xb9, 0xe6, 0x9a, 0xb4, 0xc4, 0x20, 0xbd, 0xc8, + 0x71, 0x28, 0x60, 0xe0, 0xd7, 0x76, 0x25, 0xd8, 0x57, 0xe6, 0x96, 0x8a, + 0x4c, 0x61, 0xb5, 0x60, 0x23, 0xff, 0xbc, 0x7c, 0x03, 0xce, 0xab, 0xad, + 0xa7, 0x5d, 0xeb, 0xb6, 0xc5, 0x96, 0xe1, 0x13, 0xad, 0x57, 0xd9, 0x81, + 0x92, 0x04, 0x9c, 0x53, 0x5e, 0x05, 0x69, 0xf4, 0x66, 0xd7, 0x55, 0xfb, + 0x14, 0x25, 0xd2, 0x6d, 0xf6, 0x3d, 0x8d, 0x1a, 0x79, 0x41, 0xae, 0xa2, + 0xe9, 0x69, 0xbc, 0x13, 0xe1, 0xbb, 0xc9, 0x99, 0x63, 0x03, 0x10, 0x9d, + 0x7e, 0xcf, 0xc3, 0xe9, 0xdb, 0x34, 0xdd, 0x5f, 0x40, 0xd1, 0x83, 0x26, + 0x5b, 0x89, 0x05, 0xc4, 0xea, 0xa6, 0x13, 0x7c, 0x50, 0xb2, 0x2d, 0x3a, + 0xd9, 0xd0, 0xbd, 0x1d, 0xab, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x52, 0xaa, 0x01, 0x08, 0x01, 0x10, 0x00, + 0x1a, 0x81, 0x01, 0x04, 0x0f, 0x67, 0xa1, 0x95, 0xf6, 0x14, 0xb4, 0x73, + 0x19, 0xf1, 0x56, 0x2c, 0xcd, 0x7d, 0x8b, 0x59, 0x9c, 0xd4, 0x78, 0xca, + 0x7f, 0x56, 0xe4, 0x85, 0xe8, 0x2c, 0xa5, 0xa6, 0xb9, 0xd6, 0x8a, 0xa3, + 0x40, 0xb3, 0xc5, 0xc4, 0x37, 0xac, 0x52, 0x2b, 0x23, 0x48, 0x9e, 0x9b, + 0x29, 0x92, 0x70, 0x3e, 0xda, 0xa1, 0x9c, 0x9e, 0x93, 0xf2, 0x18, 0x2b, + 0x7a, 0x34, 0x89, 0x71, 0x1b, 0x46, 0x85, 0x5b, 0x1b, 0x34, 0xb9, 0xd9, + 0x16, 0x5d, 0x64, 0x4a, 0x5f, 0x22, 0xa5, 0x2c, 0x53, 0x25, 0x30, 0x89, + 0xcd, 0x42, 0x09, 0x89, 0xbd, 0xe6, 0xb1, 0xb2, 0x18, 0x24, 0xc2, 0xfb, + 0xa5, 0xa8, 0xd6, 0x93, 0x13, 0x4c, 0xeb, 0x1b, 0x40, 0xd3, 0x95, 0x09, + 0xcc, 0x7d, 0x96, 0x9d, 0x66, 0xf7, 0x5c, 0xdd, 0x71, 0x44, 0x1e, 0xa0, + 0x5c, 0x54, 0x6a, 0xf2, 0x3d, 0xaf, 0x46, 0x4f, 0x4a, 0x63, 0x40, 0xd5, + 0x22, 0x20, 0x48, 0xe7, 0x2e, 0x9f, 0xfd, 0x5e, 0x7a, 0x8f, 0x43, 0x96, + 0xdb, 0x01, 0xbe, 0xcf, 0xc4, 0x9a, 0x6f, 0xf6, 0x5b, 0x4e, 0x29, 0x5d, + 0x5b, 0x6d, 0x0a, 0x84, 0x88, 0xdb, 0xaf, 0x99, 0x66, 0xd7, 0x12, 0x80, + 0x02, 0x83, 0x54, 0x90, 0x9d, 0x0d, 0x96, 0x49, 0xb2, 0x68, 0x7c, 0x3f, + 0xe5, 0x6b, 0xa5, 0x9a, 0x96, 0xf1, 0xdf, 0x2d, 0xbe, 0x9a, 0x78, 0x20, + 0xbc, 0xdc, 0x67, 0xc0, 0x5a, 0xa2, 0x8f, 0xf7, 0x74, 0xf9, 0x33, 0x9e, + 0x45, 0x87, 0x7a, 0x73, 0x9c, 0x6b, 0xc0, 0x0a, 0x3e, 0xdb, 0x77, 0xdf, + 0xe9, 0xf0, 0x83, 0xe1, 0x2e, 0xf7, 0xf3, 0xd3, 0x3a, 0xf1, 0x20, 0x14, + 0xe4, 0x9a, 0x89, 0xb5, 0x39, 0x02, 0xf4, 0xb6, 0xbe, 0x6c, 0x2c, 0xee, + 0x00, 0xb4, 0x5e, 0x07, 0x40, 0x45, 0xfb, 0x47, 0xf4, 0xc6, 0xff, 0x02, + 0xaa, 0xcb, 0x1e, 0x88, 0xe1, 0xcd, 0xcc, 0x7b, 0x40, 0x6f, 0x53, 0xfc, + 0xd7, 0x12, 0x27, 0x5d, 0x6d, 0x56, 0xf1, 0x97, 0x65, 0xd5, 0x45, 0xd9, + 0x1e, 0x8f, 0x7e, 0x7d, 0xa1, 0x86, 0x45, 0x59, 0x2e, 0x12, 0xf3, 0x29, + 0x49, 0x3b, 0x22, 0x31, 0xee, 0xe3, 0x3e, 0x47, 0x4d, 0xfe, 0xf3, 0xf6, + 0x98, 0xa2, 0xcb, 0x47, 0xe8, 0x41, 0xf7, 0xb3, 0x74, 0x5c, 0xfb, 0xa3, + 0x0a, 0xab, 0x64, 0x40, 0xc5, 0x65, 0x50, 0x2d, 0x36, 0x30, 0xf9, 0xf3, + 0xa2, 0xf6, 0xb2, 0xb5, 0x0c, 0x09, 0x3b, 0x56, 0xeb, 0x05, 0x2b, 0x56, + 0x18, 0xd4, 0xaa, 0x5d, 0xef, 0x11, 0x66, 0x1a, 0x08, 0xe3, 0x26, 0x6c, + 0x2e, 0x6d, 0x63, 0x04, 0x2a, 0x58, 0x78, 0x3d, 0x63, 0xae, 0x76, 0xfc, + 0x0b, 0x7d, 0x06, 0x91, 0xfa, 0xb2, 0x62, 0x3d, 0x2b, 0x44, 0xc0, 0xbc, + 0x75, 0x79, 0xdb, 0xae, 0x62, 0xae, 0x58, 0xe2, 0x2b, 0x45, 0xc2, 0x80, + 0xcc, 0x2b, 0x38, 0x7a, 0xdf, 0x43, 0xf3, 0x57, 0xfe, 0xb2, 0xf0, 0x77, + 0x37, 0x21, 0xcb, 0x98, 0xed, 0xd0, 0x4f, 0x92, 0x78, 0xeb, 0x04, 0xab, + 0x7d, 0xbb, 0x47, 0x6d, 0x64, 0xa2, 0x0a, 0x83, 0x58, 0xdf, 0xad, 0xc8, + 0x0f, 0x44, 0x76, 0x4a, 0x20, 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, + 0x01, 0x12, 0x10, 0x65, 0x80, 0x2c, 0x9b, 0x62, 0x5e, 0x5a, 0x31, 0x9c, + 0x33, 0xdc, 0x1c, 0xb7, 0xc3, 0xc6, 0xd4, 0x18, 0xe3, 0xa5, 0xbd, 0xd0, + 0x05, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xb8, 0x05, 0x02, 0x04, 0x3c, 0x2a, 0x8a, 0x0f, 0xd8, 0xd2, 0x5c, + 0x61, 0x3e, 0x1e, 0x3e, 0x3b, 0x5e, 0x34, 0x9f, 0x33, 0x2f, 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, 0x23, + 0x40, 0x4f, 0x2b, 0xf1, 0xfc, 0xa1, 0x6f, 0xd0, 0xa4, 0xb9, 0x82, 0x63, + 0x4d, 0xb6, 0x24, 0x07, 0xf8, 0xf1, 0x4a, 0xca, 0xe3, 0xb0, 0x5a, 0x03, + 0x8b, 0xd3, 0xe4, 0xbb, 0xba, 0xe4, 0x39, 0x1b, 0xbf, 0xa7, 0xa4, 0x7f, + 0xb9, 0xd0, 0x1d, 0xe8, 0x57, 0xea, 0x88, 0xe5, 0xe3, 0x6e, 0xe3, 0x6e, + 0x24, 0x58, 0x59, 0xfc, 0x0f, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x12, 0x80, 0x03, 0x7e, 0x06, 0x58, 0x1a, 0x01, 0x91, 0x84, 0xab, + 0x57, 0x2a, 0xfd, 0xca, 0xdd, 0xd0, 0x3f, 0x16, 0x1c, 0xe6, 0x82, 0x00, + 0xf8, 0xe6, 0xf8, 0xad, 0x16, 0x19, 0x47, 0x36, 0x0b, 0xc8, 0xd4, 0x9c, + 0x0d, 0x68, 0x00, 0x9b, 0x1c, 0x46, 0x44, 0xf9, 0xb3, 0xf3, 0xfb, 0x6d, + 0xdf, 0xd9, 0x2e, 0xf9, 0x2d, 0xe6, 0x2d, 0x41, 0xd4, 0x59, 0xd2, 0x9d, + 0x81, 0xbf, 0xae, 0xf3, 0x97, 0x0a, 0x3a, 0x39, 0xd2, 0x5b, 0x26, 0x62, + 0xec, 0xb0, 0x3b, 0x2d, 0xa7, 0xb6, 0x83, 0x02, 0xfa, 0xa6, 0xdd, 0x98, + 0xd9, 0x5a, 0x14, 0x3c, 0xc8, 0xc1, 0xcb, 0x6a, 0xdd, 0xa7, 0x6d, 0x2e, + 0xe9, 0xc3, 0x72, 0x3f, 0xaf, 0x95, 0xa2, 0x9c, 0xdc, 0x3e, 0x96, 0x8b, + 0x68, 0x21, 0xa9, 0x1c, 0x05, 0x1c, 0xa2, 0x80, 0xa8, 0x66, 0x69, 0x71, + 0x0a, 0x1a, 0xd7, 0xa4, 0x4b, 0xf9, 0x21, 0x80, 0x27, 0x46, 0x0d, 0xf6, + 0x94, 0xe2, 0xe9, 0x27, 0x03, 0x96, 0xdf, 0x22, 0x19, 0x63, 0xf2, 0x1e, + 0xe6, 0xaa, 0x22, 0x0a, 0x5e, 0xe4, 0xa4, 0xd0, 0xfe, 0xb3, 0xd5, 0x3e, + 0xb5, 0x73, 0x2f, 0x8f, 0x91, 0xe9, 0xa9, 0x6b, 0x3b, 0x8b, 0xe2, 0x84, + 0xc5, 0x13, 0x39, 0xea, 0x28, 0x4d, 0x4d, 0x0e, 0xdd, 0x55, 0xb6, 0xad, + 0x56, 0xf7, 0x41, 0x64, 0x20, 0xe0, 0x5e, 0x05, 0x9f, 0x97, 0x34, 0xa9, + 0x6b, 0xe2, 0x5a, 0xa4, 0x45, 0x60, 0xdb, 0xa8, 0xc3, 0x87, 0x55, 0xa4, + 0x2a, 0x82, 0xbd, 0x7f, 0x88, 0xed, 0xd1, 0x9d, 0xf3, 0x46, 0xa6, 0x67, + 0xb3, 0x3b, 0x81, 0x14, 0xc7, 0x6a, 0x88, 0x38, 0xc4, 0x23, 0xd8, 0x24, + 0xa5, 0x0b, 0x23, 0x25, 0x1a, 0x08, 0x81, 0x36, 0xd6, 0xe8, 0xf4, 0x75, + 0x29, 0x9d, 0x2a, 0xfd, 0x46, 0xce, 0xa5, 0x1b, 0x5c, 0xbd, 0xf7, 0x89, + 0xa5, 0x72, 0x12, 0x5c, 0xd2, 0x4f, 0xbb, 0x81, 0x3b, 0x38, 0x7a, 0x10, + 0xcd, 0x2a, 0x30, 0xe3, 0x44, 0x76, 0x34, 0xab, 0x34, 0x08, 0xf9, 0x6b, + 0x9c, 0xf3, 0xd9, 0x88, 0x96, 0xd4, 0x05, 0xf3, 0xf5, 0x40, 0xd9, 0xc5, + 0x79, 0x62, 0x76, 0x0f, 0xcd, 0x17, 0x7c, 0xdd, 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, 0x22, 0x04, 0x9a, 0xd5, 0x32, 0x57, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + RunTest(); +} + +TEST_F(ODKGoldenProvisionV16, CorePIGTest_OfflineNoNonce_prov30) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x00, 0x04, 0x00, + 0x10, 0x9f, 0x93, 0xae, 0xf4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, + 0x00, 0x20, 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, + 0x65, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, + 0x6f, 0x78, 0x30, 0x30, 0x30, 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, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x00, 0x04, 0x00, 0x10, + 0x9f, 0x93, 0xae, 0xf4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, + 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, 0x6f, 0x78, 0x30, 0x30, + 0x30, 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, 0x03, + 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x09, 0xec, 0x00, 0x00, 0x01, 0x00, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0x55, 0x0b, 0x58, 0xb0, 0x83, 0x56, 0x14, 0xbe, 0xe7, + 0xaa, 0x78, 0x00, 0x55, 0xab, 0xb9, 0x64, 0x31, 0x13, 0x61, 0x9a, 0x4e, + 0xc5, 0x29, 0x07, 0x01, 0x3f, 0xef, 0xe9, 0x7f, 0x3e, 0x62, 0x95, 0xbc, + 0x3c, 0xe5, 0x87, 0xde, 0xc2, 0x24, 0xad, 0x2e, 0x34, 0xa8, 0x9c, 0x0b, + 0x0c, 0x93, 0x5e, 0xa0, 0xaa, 0x56, 0x85, 0x9f, 0x14, 0xbd, 0xf8, 0x11, + 0x81, 0x49, 0x32, 0xb1, 0x64, 0x20, 0xb2, 0x33, 0xfd, 0xb6, 0x7a, 0x61, + 0xdf, 0xec, 0x9a, 0xf6, 0x54, 0x7e, 0x66, 0x97, 0x85, 0xe9, 0x12, 0xaf, + 0x82, 0x5a, 0xae, 0x48, 0xe8, 0xb3, 0xfa, 0xa1, 0x93, 0x92, 0x09, 0x6c, + 0x1e, 0x12, 0x12, 0x4a, 0x33, 0xe5, 0x1e, 0x80, 0x53, 0xce, 0xfa, 0x87, + 0x9c, 0xe0, 0xfb, 0xdd, 0x55, 0x1a, 0x51, 0x81, 0xa7, 0x3d, 0xe4, 0xd5, + 0xf1, 0x69, 0x43, 0x5f, 0x4b, 0xf9, 0xb0, 0x42, 0x46, 0x44, 0x1a, 0x93, + 0x74, 0x2c, 0x83, 0x17, 0x82, 0xb4, 0xf4, 0x85, 0x86, 0xf6, 0xfe, 0x3d, + 0x57, 0xf8, 0x7b, 0x33, 0x8e, 0x42, 0xbc, 0x48, 0x24, 0x03, 0xc5, 0xfd, + 0x97, 0x47, 0xe3, 0x73, 0xab, 0x2d, 0x79, 0x14, 0xc3, 0x3f, 0x20, 0xc4, + 0x02, 0xbf, 0x23, 0x24, 0x28, 0x05, 0x43, 0x09, 0x59, 0x91, 0x98, 0xed, + 0xcb, 0xeb, 0x8b, 0xca, 0xa5, 0x04, 0x2f, 0x8b, 0xf8, 0xa0, 0xaa, 0x42, + 0x61, 0x61, 0x24, 0x69, 0x6c, 0x04, 0xdc, 0xb5, 0x99, 0x4c, 0x9b, 0x3d, + 0x3a, 0x2c, 0x84, 0xcb, 0x14, 0x5a, 0x55, 0x10, 0xd7, 0x94, 0x17, 0x97, + 0xd9, 0xfe, 0x61, 0xfb, 0xd0, 0x2a, 0xac, 0xb9, 0xb5, 0x0e, 0xc7, 0x5d, + 0x94, 0x76, 0xcb, 0x31, 0xd8, 0xa8, 0x4e, 0x16, 0x0c, 0x04, 0xee, 0x64, + 0x9b, 0x18, 0x2e, 0x1b, 0xf5, 0xb6, 0x38, 0x8f, 0xd8, 0x5e, 0x96, 0x2e, + 0xd7, 0x5b, 0x50, 0x77, 0xdc, 0x5e, 0x12, 0x60, 0x40, 0x39, 0x51, 0x8b, + 0x73, 0x9f, 0xb5, 0x88, 0x30, 0x9d, 0xac, 0x8e, 0x3b, 0x5e, 0x75, 0x34, + 0x9c, 0x2d, 0x74, 0xa2, 0x60, 0x2a, 0x1f, 0x35, 0x4f, 0xbd, 0x3e, 0x21, + 0xc4, 0x8f, 0xdf, 0x54, 0x25, 0x2d, 0x92, 0x7f, 0xfb, 0x56, 0x8f, 0x18, + 0xc0, 0xcb, 0xc7, 0x64, 0xec, 0x88, 0x25, 0x3f, 0xb5, 0xd6, 0x27, 0x6c, + 0x2a, 0x10, 0x9f, 0x0e, 0x0e, 0x1d, 0xef, 0xb1, 0x53, 0x81, 0x96, 0xb4, + 0x4c, 0x15, 0xed, 0x2e, 0x46, 0xc5, 0x5e, 0x2f, 0xa3, 0x12, 0x5f, 0x47, + 0x37, 0x85, 0x45, 0xa5, 0x05, 0x39, 0xc4, 0xb3, 0xc2, 0x69, 0x59, 0xc0, + 0xe8, 0x87, 0x88, 0xca, 0xd4, 0xc7, 0xcc, 0xea, 0x18, 0x5b, 0xa9, 0xe9, + 0x34, 0x68, 0x5e, 0x7b, 0x6c, 0x42, 0xcd, 0xd1, 0xd9, 0xd0, 0x36, 0x1d, + 0xe7, 0x8d, 0xc8, 0xb2, 0x3c, 0x76, 0x7d, 0x9a, 0xac, 0x42, 0x29, 0x80, + 0x05, 0x53, 0x09, 0xce, 0xe8, 0x08, 0x8d, 0x3d, 0x0f, 0x5f, 0x90, 0xed, + 0xcd, 0x1d, 0xd2, 0x5d, 0x47, 0xad, 0x59, 0xc4, 0x54, 0x5d, 0x76, 0x66, + 0x72, 0x0d, 0xd7, 0xbc, 0x28, 0x89, 0x6b, 0xc8, 0x38, 0x45, 0x3f, 0x43, + 0x84, 0xb7, 0x09, 0xff, 0xf0, 0xc3, 0xb3, 0x68, 0x1c, 0x4c, 0x72, 0x75, + 0xf7, 0x0a, 0x9a, 0x77, 0x73, 0xe1, 0xfd, 0xeb, 0x40, 0x2c, 0x7c, 0x4c, + 0x6e, 0x8b, 0x61, 0x32, 0xcd, 0x91, 0xd4, 0x4e, 0xb6, 0xec, 0xdb, 0x51, + 0xb6, 0x3d, 0x3a, 0xcf, 0x53, 0x23, 0x07, 0xc0, 0x08, 0x66, 0x4b, 0x49, + 0x40, 0x25, 0x27, 0x18, 0x4f, 0xdf, 0x25, 0x68, 0x1c, 0x53, 0x63, 0x1d, + 0x51, 0x54, 0x4f, 0xd8, 0x2b, 0x70, 0x7b, 0x5c, 0xf6, 0xb9, 0x8c, 0xae, + 0x5b, 0x29, 0x41, 0x35, 0x94, 0x25, 0x44, 0x99, 0x49, 0xdc, 0x35, 0xa9, + 0x68, 0x32, 0x67, 0x17, 0x73, 0xa0, 0xea, 0x7c, 0x06, 0xd1, 0xe6, 0xd6, + 0xe8, 0xb1, 0x5b, 0x65, 0xff, 0x8f, 0xcd, 0x81, 0x4c, 0x00, 0x87, 0x46, + 0xd6, 0x25, 0x60, 0x39, 0x14, 0x61, 0x5f, 0x6f, 0x7a, 0xda, 0xd7, 0x1c, + 0x7b, 0x40, 0xd3, 0x11, 0x98, 0x78, 0xf4, 0xea, 0x75, 0xd9, 0x30, 0xdf, + 0x38, 0x8d, 0x3f, 0x6e, 0x7d, 0x35, 0xd5, 0x81, 0xf3, 0x5e, 0x49, 0x91, + 0x54, 0x33, 0x67, 0x33, 0x66, 0x9e, 0xe0, 0x6a, 0x97, 0xdd, 0x37, 0x97, + 0x43, 0xcd, 0x87, 0xff, 0x22, 0x37, 0x6e, 0x8a, 0xf9, 0xda, 0xea, 0x0d, + 0x90, 0x56, 0x2f, 0xd6, 0xe5, 0x24, 0xb6, 0xae, 0x34, 0x2a, 0x5d, 0x68, + 0x61, 0x2c, 0xb1, 0xed, 0x09, 0x65, 0x32, 0x1b, 0x4c, 0x96, 0x16, 0xdc, + 0x09, 0xc4, 0xc7, 0x33, 0x98, 0xe8, 0xe2, 0x30, 0x42, 0x55, 0x5f, 0xdf, + 0x87, 0x5e, 0xf6, 0xd4, 0x12, 0x30, 0x7e, 0x09, 0x54, 0xe7, 0x4f, 0x75, + 0x48, 0xf6, 0x82, 0x08, 0x27, 0xf5, 0x86, 0x34, 0xd8, 0x0d, 0x95, 0xcd, + 0xdb, 0xaf, 0xcd, 0xff, 0xd4, 0x69, 0xd4, 0x0f, 0x08, 0xdd, 0x46, 0x1a, + 0x74, 0x5f, 0x4d, 0x55, 0xf2, 0x92, 0xef, 0x27, 0x6d, 0x6d, 0x50, 0xdb, + 0x48, 0xae, 0x0a, 0x5a, 0x6f, 0xd0, 0x87, 0x78, 0x18, 0x4d, 0x94, 0x85, + 0x2e, 0x1e, 0x20, 0x5d, 0xe2, 0x79, 0xc2, 0xdc, 0x0b, 0xdc, 0x9f, 0xbf, + 0xb3, 0xa7, 0xa4, 0xbd, 0xc9, 0x6b, 0x80, 0x43, 0x7a, 0x9f, 0xf5, 0x7d, + 0x07, 0x57, 0xa9, 0x17, 0xde, 0xbb, 0x76, 0xfb, 0x23, 0x93, 0x53, 0xb2, + 0xfe, 0xa8, 0xe5, 0x72, 0xe1, 0xcd, 0xa0, 0x64, 0x5b, 0x04, 0xa5, 0x36, + 0x98, 0xc8, 0x95, 0x02, 0x0e, 0x64, 0x90, 0x91, 0xa7, 0x09, 0xca, 0xe8, + 0xe4, 0xb1, 0x94, 0x89, 0x94, 0x79, 0x70, 0xb2, 0xec, 0xde, 0x8a, 0xef, + 0xd4, 0xf9, 0x6e, 0x25, 0xc8, 0x7b, 0x60, 0xe2, 0x5f, 0x4b, 0xb8, 0x9f, + 0x12, 0x30, 0x4a, 0x47, 0x4e, 0xb3, 0x41, 0x4a, 0x8a, 0xf7, 0xbc, 0x7d, + 0xc1, 0xca, 0xb2, 0x34, 0x17, 0xd6, 0xd7, 0x68, 0x82, 0x4d, 0x1d, 0x9b, + 0x74, 0xda, 0x22, 0xaa, 0x56, 0x48, 0x32, 0x06, 0x70, 0x4a, 0x45, 0x3c, + 0x4d, 0x05, 0x25, 0xf2, 0x4b, 0x3d, 0xb2, 0x8c, 0x13, 0xe1, 0x74, 0xd3, + 0x6f, 0x92, 0xd2, 0xbd, 0x3d, 0x46, 0x57, 0xae, 0x65, 0x75, 0x26, 0xbb, + 0xd2, 0x0b, 0xb6, 0x12, 0x6b, 0x29, 0x51, 0x03, 0x15, 0x7f, 0x72, 0x5f, + 0x07, 0x09, 0xa2, 0x90, 0xbd, 0x78, 0x78, 0x7d, 0x9f, 0xb3, 0x04, 0x61, + 0xb8, 0x03, 0xb9, 0xea, 0xbf, 0x5c, 0xd0, 0x84, 0xee, 0x74, 0xb2, 0xfa, + 0xe3, 0xbf, 0x5e, 0xfb, 0x85, 0x89, 0xe6, 0x0f, 0xa1, 0xd6, 0x68, 0x73, + 0xaa, 0x36, 0x90, 0x8b, 0xf1, 0x19, 0x07, 0x74, 0xbd, 0x5f, 0x88, 0x5a, + 0x8d, 0x88, 0xfe, 0xde, 0xac, 0x29, 0xff, 0x73, 0x95, 0x9d, 0xfd, 0x4b, + 0x91, 0x9d, 0x39, 0x23, 0x61, 0x0a, 0x84, 0x5a, 0x89, 0x47, 0xb8, 0xd9, + 0x30, 0xcc, 0x6b, 0xd0, 0xfe, 0x62, 0xe2, 0x6e, 0xf7, 0x63, 0xcb, 0x5d, + 0x26, 0xf5, 0x8f, 0x29, 0x06, 0x4f, 0x03, 0xbe, 0x76, 0x3a, 0x32, 0xe3, + 0x44, 0xbb, 0x0f, 0x91, 0xe9, 0x90, 0x70, 0x41, 0xfd, 0x5b, 0x7c, 0x97, + 0x2e, 0x60, 0x54, 0xfe, 0xde, 0x6f, 0x54, 0x1e, 0x68, 0x99, 0x58, 0xd1, + 0xef, 0x87, 0x9a, 0xe1, 0x53, 0x6c, 0x16, 0xbf, 0x05, 0x56, 0xf6, 0xb3, + 0xdb, 0x73, 0x43, 0x86, 0xa2, 0xa6, 0xe1, 0x0d, 0xb9, 0xee, 0x2a, 0xa0, + 0x80, 0x11, 0x1e, 0x20, 0x7a, 0xe7, 0xf1, 0x70, 0x37, 0x31, 0xaa, 0xa1, + 0x95, 0x37, 0x00, 0xeb, 0x32, 0x3d, 0x45, 0x4d, 0xbd, 0x57, 0x1a, 0xcb, + 0x8f, 0x36, 0xd9, 0xd6, 0xac, 0x25, 0xe5, 0x38, 0xb8, 0x17, 0xf9, 0x9e, + 0x44, 0xab, 0xde, 0xb0, 0xe5, 0x03, 0xfb, 0xa7, 0x17, 0x18, 0x56, 0x87, + 0xae, 0xc6, 0xfa, 0x15, 0xbe, 0xcf, 0x48, 0x48, 0x28, 0x74, 0xd9, 0x5a, + 0x4a, 0x06, 0x83, 0x13, 0xb9, 0x15, 0x3d, 0x52, 0x44, 0x47, 0x00, 0x93, + 0x25, 0x41, 0x7b, 0x61, 0x75, 0x89, 0x8c, 0xf1, 0xf5, 0xbd, 0x3d, 0x75, + 0x35, 0xf6, 0x26, 0xce, 0xcd, 0x78, 0xda, 0x46, 0xf6, 0x41, 0xe8, 0xf0, + 0x81, 0xe0, 0xaa, 0x0e, 0x9e, 0xdf, 0x61, 0xea, 0x50, 0x74, 0xe2, 0xa2, + 0x34, 0x47, 0x85, 0x8d, 0x26, 0x5c, 0x35, 0x8e, 0x20, 0x25, 0xf1, 0x1e, + 0x4f, 0x8c, 0xd3, 0xd3, 0x21, 0xe8, 0x8d, 0x00, 0x00, 0x28, 0x1a, 0x6d, + 0x57, 0x67, 0xf4, 0x94, 0xbc, 0x24, 0x6c, 0x62, 0x7e, 0xbd, 0xb0, 0x0f, + 0x53, 0xd0, 0x4d, 0xaf, 0x49, 0x73, 0x62, 0xbc, 0x5c, 0xf7, 0x8b, 0x7e, + 0x14, 0xad, 0x94, 0xdb, 0x21, 0xd5, 0xc9, 0x6c, 0x32, 0x2e, 0x10, 0xbc, + 0x93, 0xd4, 0x91, 0xf3, 0x1b, 0xa9, 0x51, 0xcc, 0x5e, 0x37, 0x41, 0xda, + 0x46, 0x48, 0xa0, 0xf6, 0x4d, 0x8b, 0xdc, 0x3d, 0x3d, 0x4a, 0x7a, 0xcf, + 0xfd, 0x25, 0x25, 0x96, 0x9a, 0x60, 0x6c, 0x59, 0xb0, 0x24, 0x96, 0xb5, + 0xab, 0xc4, 0xda, 0xff, 0xdd, 0x1a, 0x26, 0x96, 0x52, 0x73, 0xab, 0x2a, + 0xd2, 0x44, 0x15, 0x2a, 0x68, 0x76, 0xdf, 0x95, 0x43, 0x08, 0xdf, 0x08, + 0x16, 0x46, 0xa1, 0x19, 0x47, 0xb8, 0x40, 0x97, 0x9a, 0x20, 0x35, 0x75, + 0x20, 0xda, 0x3a, 0x72, 0xe5, 0xfc, 0xcc, 0x52, 0x4a, 0x34, 0x4d, 0x12, + 0x10, 0x21, 0x5e, 0x5c, 0x13, 0xd3, 0x63, 0x2a, 0xbe, 0x0f, 0x46, 0x0b, + 0xe9, 0x62, 0x44, 0x59, 0x05, 0x1a, 0xfb, 0x09, 0x0a, 0xbe, 0x02, 0x08, + 0x02, 0x12, 0x10, 0x35, 0x7f, 0x7a, 0xfa, 0x7d, 0x33, 0x42, 0x33, 0x1c, + 0x8c, 0xd1, 0x07, 0xdd, 0xc7, 0x5a, 0x96, 0x18, 0x91, 0x8d, 0x86, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xa9, 0x95, 0xe6, 0x30, 0x45, 0x01, 0x73, 0xab, 0x29, 0x01, 0x12, + 0xa5, 0x63, 0x4d, 0x25, 0xc3, 0xca, 0xfc, 0x14, 0x0b, 0xd7, 0x06, 0xcf, + 0x9f, 0x22, 0x38, 0xc0, 0x09, 0x5d, 0x10, 0xfc, 0x2d, 0xb1, 0xcf, 0x27, + 0x6d, 0x37, 0x63, 0x78, 0xe7, 0x54, 0x95, 0xac, 0xd6, 0xd0, 0x1f, 0xc5, + 0xdb, 0x19, 0x8a, 0xf8, 0xa8, 0x3e, 0x52, 0x9e, 0x65, 0x97, 0xb0, 0xe3, + 0x8b, 0x64, 0xae, 0x7b, 0x78, 0x69, 0x90, 0x98, 0xe9, 0x4f, 0x8f, 0x01, + 0xeb, 0xec, 0x18, 0xbe, 0x19, 0x32, 0x82, 0xa0, 0x05, 0x58, 0xfa, 0xba, + 0x29, 0x73, 0x01, 0xf4, 0xb4, 0x00, 0xc7, 0x6c, 0xb0, 0x62, 0xf1, 0x30, + 0xb8, 0xeb, 0x3c, 0x7a, 0x5c, 0x5b, 0xb2, 0xc5, 0xcf, 0x3c, 0x55, 0x65, + 0x09, 0x72, 0xc0, 0x52, 0xa0, 0x2e, 0x32, 0xaa, 0x96, 0x52, 0x51, 0x4e, + 0x4d, 0x86, 0x62, 0x34, 0xfd, 0x2b, 0x78, 0x64, 0xb4, 0xa0, 0x1e, 0xb7, + 0xe2, 0x01, 0xa1, 0x0c, 0xc5, 0x31, 0xe7, 0xb6, 0x7e, 0x2a, 0xa9, 0xa9, + 0xf7, 0x57, 0x60, 0xa5, 0xb7, 0x39, 0x85, 0xd6, 0xb5, 0x1a, 0xae, 0xba, + 0xf8, 0x11, 0xeb, 0xb1, 0x95, 0xe4, 0xb5, 0xae, 0xd4, 0x00, 0xc9, 0x6b, + 0x10, 0x5c, 0xaf, 0xe8, 0x36, 0xd5, 0xe1, 0x47, 0xfa, 0x89, 0x42, 0xe9, + 0x12, 0x4a, 0x1d, 0xf0, 0x16, 0x65, 0x41, 0x29, 0x2e, 0x42, 0x07, 0xe3, + 0x42, 0xf6, 0x9c, 0xed, 0xd1, 0xa9, 0x5d, 0x10, 0xdd, 0x86, 0xc6, 0xd2, + 0xe2, 0x1a, 0xe4, 0xa8, 0xd9, 0xb7, 0xcf, 0xce, 0x6c, 0x2e, 0x00, 0x1e, + 0xa7, 0x9c, 0x36, 0x84, 0x50, 0x92, 0x87, 0xbb, 0x62, 0xd5, 0x33, 0x44, + 0x61, 0x6f, 0x95, 0x57, 0x17, 0xf0, 0x37, 0xf5, 0x99, 0x7a, 0xce, 0xf6, + 0x1f, 0xdd, 0x67, 0x87, 0xec, 0xad, 0xc7, 0x76, 0x32, 0x0b, 0x83, 0x12, + 0x4f, 0xaa, 0xa4, 0x67, 0x0b, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x12, 0x80, 0x02, 0x0d, 0x38, 0xb8, 0x44, + 0x8b, 0xd0, 0x35, 0x1b, 0x5c, 0xda, 0x4c, 0x50, 0xcf, 0x10, 0x3b, 0x29, + 0x95, 0xb2, 0x98, 0x34, 0xfa, 0xcb, 0x50, 0x34, 0xce, 0x10, 0x47, 0xa8, + 0x3d, 0xaa, 0xa1, 0xbc, 0x84, 0xd6, 0x6f, 0x8b, 0x3b, 0xf5, 0xe3, 0xef, + 0x9a, 0x67, 0xaf, 0x8d, 0xd7, 0x10, 0x15, 0x5f, 0x8d, 0x9b, 0x6a, 0x0d, + 0x98, 0xb1, 0x2f, 0x2d, 0x7a, 0xbd, 0x57, 0xe5, 0x39, 0x1a, 0xb5, 0x54, + 0x42, 0x18, 0x30, 0x7d, 0x44, 0xbd, 0xc7, 0x6a, 0xa6, 0x5c, 0x46, 0x2a, + 0x3e, 0xef, 0x45, 0x3c, 0xd1, 0xdc, 0x7e, 0xa4, 0xfd, 0x86, 0x40, 0x19, + 0xe6, 0x87, 0x5e, 0xf0, 0x9d, 0xb6, 0x4d, 0xa0, 0xb9, 0x6d, 0xc1, 0xd5, + 0x91, 0x7b, 0x35, 0xae, 0x31, 0x18, 0xb7, 0x51, 0x84, 0x62, 0x26, 0x57, + 0x90, 0x74, 0x59, 0x11, 0x0d, 0xf2, 0xe8, 0x0b, 0x9f, 0xc3, 0x0e, 0x91, + 0xd6, 0xc6, 0xbe, 0x23, 0xe2, 0x75, 0x3f, 0x61, 0x91, 0x0a, 0x6c, 0xb4, + 0x9f, 0x9f, 0x20, 0x70, 0xdf, 0x80, 0xb8, 0x5d, 0x06, 0x4c, 0x84, 0x96, + 0xf3, 0xde, 0x66, 0x76, 0x96, 0x46, 0xe3, 0xf9, 0xb6, 0xee, 0x3a, 0x7f, + 0x21, 0x3a, 0x77, 0x6a, 0xd9, 0xa4, 0x6b, 0x32, 0xc9, 0x33, 0x0d, 0x61, + 0xa5, 0x60, 0xc8, 0xd8, 0xc3, 0x20, 0x15, 0x77, 0xe5, 0x17, 0xfd, 0x33, + 0xc1, 0xa2, 0x00, 0xd1, 0x67, 0x45, 0x24, 0x8e, 0xaa, 0x8a, 0x23, 0x29, + 0xbc, 0x3d, 0x9d, 0x0b, 0x82, 0x69, 0x06, 0xc3, 0x9f, 0xab, 0x8d, 0x4e, + 0x60, 0xaf, 0x26, 0xc0, 0xcc, 0xc7, 0x3a, 0x16, 0x9e, 0xe9, 0x06, 0x9a, + 0xa2, 0xe2, 0x2a, 0x4c, 0xcf, 0x7d, 0xd6, 0x0d, 0x29, 0x1b, 0x57, 0x6e, + 0x4b, 0x15, 0x8d, 0x1c, 0xd9, 0x1f, 0x00, 0x15, 0x07, 0x53, 0x96, 0xcf, + 0x26, 0xca, 0xe7, 0x19, 0x30, 0xf8, 0x2c, 0x5e, 0x05, 0xbe, 0x50, 0x68, + 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, 0x01, 0x12, 0x10, 0x6b, 0x99, + 0x4c, 0x4a, 0x94, 0x73, 0x2e, 0x0c, 0x81, 0xca, 0xcc, 0x34, 0x71, 0xcf, + 0x8a, 0x63, 0x18, 0xe1, 0xa7, 0xbd, 0xd0, 0x05, 0x22, 0x8e, 0x02, 0x30, + 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbc, 0xfa, 0x43, 0x1b, + 0xaa, 0xbb, 0xd9, 0xb7, 0x5b, 0xb8, 0xec, 0xf6, 0xf0, 0xb6, 0xb1, 0xa6, + 0xc3, 0xd1, 0x45, 0xb8, 0x6e, 0x40, 0x85, 0xa0, 0xcf, 0x24, 0x68, 0x91, + 0xc2, 0x45, 0x8d, 0x4e, 0xf2, 0x42, 0x9e, 0xaa, 0x72, 0xed, 0x86, 0xdc, + 0xfb, 0x85, 0x29, 0x3f, 0x90, 0xb0, 0xc5, 0x12, 0x4e, 0x42, 0x0b, 0xce, + 0xfa, 0x0f, 0x83, 0x1a, 0x4c, 0xe9, 0xc9, 0xc1, 0x0b, 0x12, 0xeb, 0xc7, + 0xc5, 0x1a, 0xd5, 0xa1, 0x8d, 0x26, 0x6d, 0x78, 0x87, 0x2d, 0xc2, 0x63, + 0x84, 0x6c, 0x5e, 0x78, 0xd8, 0x0a, 0x78, 0x68, 0xc2, 0x82, 0x40, 0x0a, + 0xf7, 0x02, 0x63, 0x97, 0xec, 0x1c, 0x08, 0x91, 0x2b, 0xc2, 0xa7, 0xe9, + 0x17, 0xb8, 0x7b, 0x84, 0xed, 0xdc, 0x5c, 0x6c, 0x11, 0x38, 0xb4, 0x18, + 0xff, 0x11, 0x32, 0xd4, 0x34, 0x48, 0xc0, 0xa0, 0x47, 0x2d, 0x81, 0xe2, + 0xb6, 0x41, 0xe9, 0xd4, 0x5a, 0xf1, 0x75, 0x3d, 0x94, 0xf7, 0xb7, 0xf6, + 0x3b, 0x35, 0x78, 0x9c, 0x72, 0x7b, 0x12, 0xe0, 0x73, 0xd9, 0x92, 0x3d, + 0x23, 0xe6, 0xa2, 0x50, 0x95, 0xcc, 0xbc, 0x8b, 0xef, 0xa3, 0x09, 0x85, + 0x85, 0xb8, 0x74, 0xa8, 0x10, 0xab, 0x0a, 0x18, 0x35, 0x7d, 0x27, 0x5c, + 0x6a, 0x52, 0x0e, 0x5b, 0xb9, 0xa9, 0x2c, 0xee, 0xdf, 0x6e, 0xa3, 0x49, + 0xbf, 0x32, 0x3a, 0x6a, 0xe2, 0x72, 0xe4, 0xdd, 0x6f, 0xfb, 0x89, 0xf3, + 0xdf, 0xa6, 0x4a, 0x52, 0x8a, 0x9d, 0xd5, 0x49, 0x04, 0x33, 0xd2, 0xa2, + 0xca, 0x74, 0x3b, 0x2c, 0x34, 0xf1, 0x12, 0x2f, 0x85, 0xc3, 0x3c, 0x4f, + 0x73, 0x1f, 0x2c, 0x8a, 0xd2, 0x6f, 0xa4, 0xb7, 0x91, 0xf9, 0x5f, 0x79, + 0x04, 0x9c, 0x69, 0xe6, 0x62, 0xab, 0x15, 0x91, 0x23, 0x0e, 0x62, 0xbc, + 0x80, 0x1f, 0x97, 0x5f, 0x33, 0xe7, 0x33, 0x9e, 0x91, 0xf6, 0xdc, 0xfb, + 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, 0x3d, 0x12, 0x80, 0x03, 0x0e, + 0x78, 0x2b, 0x14, 0x53, 0x5c, 0x82, 0x9a, 0x00, 0x8d, 0x49, 0x18, 0x5e, + 0x21, 0xb6, 0xfb, 0xeb, 0xa7, 0xee, 0x10, 0x26, 0x75, 0x6f, 0xcd, 0x45, + 0xe8, 0x64, 0x72, 0x56, 0x9e, 0x39, 0x3d, 0x7e, 0x6a, 0x70, 0x5d, 0xf1, + 0x4a, 0xc0, 0x23, 0x66, 0x07, 0x04, 0x4c, 0x8d, 0x18, 0xf7, 0xa7, 0xc5, + 0xc3, 0x18, 0x3f, 0x72, 0xf4, 0xfd, 0xad, 0xb5, 0xc6, 0x8b, 0x77, 0x2e, + 0x20, 0xfb, 0xe4, 0x7b, 0xef, 0x79, 0xef, 0xcd, 0x7f, 0x21, 0x9c, 0x32, + 0xcf, 0xf4, 0xc8, 0xee, 0xfa, 0x81, 0x38, 0x7e, 0x36, 0xec, 0xdd, 0x29, + 0x94, 0xc3, 0xb7, 0x25, 0x6e, 0x77, 0x90, 0x81, 0xbe, 0x6c, 0x16, 0x75, + 0x83, 0x33, 0x41, 0x78, 0x74, 0xb3, 0x54, 0xa4, 0xe6, 0x1c, 0x95, 0xa2, + 0x1c, 0x2b, 0x93, 0x6c, 0xb7, 0xd3, 0x37, 0x31, 0x57, 0xa8, 0x95, 0xce, + 0x0e, 0x16, 0xc0, 0xbb, 0x4e, 0x23, 0xca, 0x23, 0x2a, 0x66, 0x4c, 0xe5, + 0xac, 0xc3, 0x0a, 0xe3, 0x31, 0x32, 0x53, 0xad, 0x2c, 0x70, 0x1d, 0x5a, + 0x20, 0x27, 0xf2, 0x6f, 0x0c, 0x53, 0x7b, 0x71, 0x77, 0x94, 0x5c, 0x28, + 0xc3, 0xf3, 0x3e, 0x48, 0x5f, 0x1a, 0xa2, 0x18, 0xf3, 0x53, 0xb4, 0xa5, + 0x3c, 0xb1, 0x9c, 0x67, 0x39, 0x68, 0x8d, 0xfa, 0x96, 0x8f, 0x6f, 0xdd, + 0x29, 0x35, 0xbc, 0x2c, 0x0d, 0xe5, 0xd7, 0xff, 0x25, 0x2d, 0xcd, 0x3f, + 0xdc, 0xb9, 0xa0, 0xaf, 0x5a, 0x41, 0x3c, 0xce, 0xa9, 0xab, 0x75, 0xee, + 0xf2, 0xbe, 0xee, 0xa8, 0x3b, 0x29, 0xaf, 0x07, 0xbf, 0x84, 0xbd, 0xdd, + 0xe3, 0x83, 0x42, 0xd5, 0x40, 0x8d, 0x39, 0xcf, 0x4d, 0xa9, 0xa3, 0x0c, + 0xd8, 0xbc, 0xfc, 0x32, 0xa5, 0x03, 0x63, 0x22, 0x82, 0xde, 0x3d, 0x1d, + 0xd9, 0x54, 0xd8, 0xcc, 0x57, 0x10, 0x8b, 0xbe, 0xc3, 0xae, 0x52, 0xbc, + 0xaf, 0x17, 0x62, 0xe7, 0x9f, 0x42, 0x75, 0xb8, 0x92, 0x7f, 0x61, 0xd8, + 0x08, 0x57, 0x40, 0x10, 0x2c, 0x85, 0x96, 0x97, 0x48, 0x14, 0xde, 0xb0, + 0x5f, 0xf9, 0xc6, 0xde, 0xfc, 0x25, 0x9c, 0x4d, 0x6e, 0x52, 0x54, 0xf0, + 0xa2, 0xa5, 0xfc, 0x32, 0x45, 0x75, 0x94, 0xbe, 0xe9, 0x57, 0x2a, 0xb8, + 0x6e, 0xab, 0x0f, 0xf5, 0x0c, 0x9a, 0xf9, 0x29, 0x06, 0x65, 0x54, 0xd8, + 0x93, 0x98, 0x3a, 0x5c, 0x71, 0x52, 0x0d, 0xf3, 0x4b, 0xc4, 0xc5, 0xbd, + 0x34, 0xb3, 0x58, 0xcf, 0x83, 0x94, 0xf0, 0x60, 0xb7, 0x91, 0x56, 0xff, + 0x21, 0x7d, 0x03, 0xeb, 0xc9, 0x09, 0x0c, 0x45, 0x6d, 0xa0, 0xaa, 0xd3, + 0x58, 0xc6, 0xea, 0x9d, 0x2c, 0xfc, 0xd3, 0x0a, 0x43, 0x62, 0x66, 0x4d, + 0xdc, 0x25, 0xe2, 0x7f, 0x7e, 0x39, 0x33, 0x82, 0x97, 0x30, 0xfe, 0xdd, + 0x4d, 0x64, 0x56, 0xff, 0xf1, 0x76, 0xc2, 0x78, 0x0b, 0xce, 0xb3, 0x22, + 0x04, 0xf4, 0xae, 0x93, 0x9f, 0x2a, 0x80, 0x02, 0x37, 0x6c, 0x07, 0x7f, + 0x9f, 0x8b, 0xca, 0x0e, 0xea, 0x0d, 0xe4, 0x29, 0x16, 0x0b, 0x7b, 0xd9, + 0x6a, 0xc3, 0xa7, 0xa6, 0xc6, 0xfa, 0x51, 0x14, 0xb9, 0x84, 0xa7, 0x84, + 0xbf, 0xc6, 0x8b, 0x6d, 0xc9, 0xf6, 0x38, 0xc4, 0x3e, 0x63, 0xdf, 0xf9, + 0x9f, 0x55, 0x45, 0xe2, 0xb4, 0x5e, 0x54, 0xf2, 0x88, 0x0d, 0x00, 0x8b, + 0x21, 0x19, 0x2e, 0x10, 0x2d, 0x3c, 0x28, 0x19, 0x6a, 0x8c, 0x2a, 0xef, + 0x1a, 0xc1, 0x94, 0x79, 0x29, 0xe5, 0xc6, 0x27, 0x92, 0x64, 0xc6, 0x59, + 0x5e, 0x04, 0x65, 0xf2, 0x20, 0x00, 0x2e, 0xaf, 0x65, 0xa2, 0x88, 0xf9, + 0x64, 0x80, 0xe1, 0x47, 0xe9, 0xaa, 0x9c, 0x6a, 0x20, 0xf4, 0xed, 0xbe, + 0x03, 0x51, 0x7c, 0xe4, 0x6b, 0x51, 0xc7, 0x3d, 0x48, 0x3e, 0x0d, 0xe0, + 0x27, 0x2a, 0x3a, 0xe6, 0x7a, 0x37, 0xa7, 0x07, 0x63, 0x8e, 0x93, 0x9a, + 0x92, 0x8c, 0xdb, 0xf0, 0x88, 0xc7, 0xac, 0xc7, 0xba, 0x47, 0x71, 0xb2, + 0xd8, 0xff, 0x04, 0xa3, 0xf8, 0x3a, 0xa6, 0x70, 0xbf, 0x45, 0x45, 0x5c, + 0x97, 0x1b, 0xf1, 0x48, 0xd4, 0x5f, 0xdd, 0xb3, 0xb2, 0x6c, 0x3e, 0xba, + 0xa1, 0x8e, 0x6d, 0x59, 0xd5, 0xb2, 0x01, 0xf5, 0xf5, 0x4c, 0xae, 0x7c, + 0xf3, 0xb5, 0xc6, 0x61, 0x1c, 0xd8, 0x10, 0x1f, 0x9a, 0xc1, 0x3b, 0x8f, + 0xb1, 0x28, 0x9b, 0x41, 0x47, 0xb5, 0x97, 0x9e, 0xc3, 0x5c, 0xe6, 0x14, + 0x3f, 0x54, 0xc6, 0x17, 0xc6, 0x50, 0xd0, 0xa7, 0x37, 0xc1, 0x00, 0x89, + 0x52, 0xc3, 0x25, 0x08, 0x4e, 0x7b, 0xd9, 0x66, 0x37, 0xfa, 0x76, 0x05, + 0x10, 0x99, 0xae, 0x4d, 0xc6, 0x6a, 0x14, 0x77, 0x28, 0x35, 0x15, 0x97, + 0x5b, 0x29, 0x73, 0x5c, 0x6d, 0x21, 0xfa, 0x2a, 0x52, 0xcc, 0xe9, 0x03, + 0x3c, 0xc8, 0x40, 0xa5, 0xb2, 0x17, 0x28, 0x5f, 0x9e, 0xd0, 0x91, 0xe1, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +// License tests. +// All license requests from fake_l1, +// GTEST_FILTER="*PIG*:*CdmUseCase*Case1*" +////////////////////////////////////////////////////////////////////// + +TEST_F(ODKGoldenLicenseV16, CorePIGTest_OfflineNoNonce) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xf5, 0xa0, 0xec, 0x80, 0x00, 0x00, 0x00, 0x08, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x04, 0x00, 0x10, + 0xf5, 0xa0, 0xec, 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x50, + 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, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x43, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x21, 0x00, 0x00, 0x00, 0x20, + 0xdd, 0xe0, 0xee, 0x17, 0xa1, 0xc8, 0xbf, 0xa3, 0x70, 0x90, 0x3e, 0xe7, + 0x4a, 0xf6, 0x02, 0x32, 0x78, 0x72, 0x06, 0x9a, 0x70, 0x4d, 0xfd, 0x14, + 0x04, 0x5d, 0xb3, 0xee, 0x90, 0x6e, 0x18, 0x4b, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x31, 0x33, 0x44, 0x43, 0x39, 0x42, 0x38, 0x45, + 0x35, 0x36, 0x33, 0x35, 0x39, 0x45, 0x37, 0x32, 0x30, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x31, 0x33, 0x44, 0x43, 0x39, 0x42, 0x38, 0x45, 0x35, 0x36, + 0x33, 0x35, 0x39, 0x45, 0x37, 0x32, 0x30, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xaa, 0x92, + 0x86, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0x92, 0xbf, 0x5e, 0x8e, 0x95, 0x68, 0xcb, 0x04, 0xe7, 0x3a, 0xaa, 0x2b, + 0xcb, 0x2e, 0x3d, 0x93, 0x1a, 0x50, 0x43, 0x99, 0x90, 0x18, 0x73, 0x90, + 0xd5, 0xbd, 0xd2, 0xa5, 0x8d, 0x0d, 0x9c, 0x78, 0x88, 0xf6, 0xc3, 0xb2, + 0xa1, 0xdc, 0x08, 0xab, 0x8c, 0x17, 0x31, 0x0d, 0xc6, 0xa4, 0x72, 0xd4, + 0xf4, 0xc6, 0x26, 0x7a, 0xd2, 0xb0, 0x36, 0xcc, 0x1e, 0x6c, 0xe6, 0x93, + 0xc5, 0x11, 0x7f, 0x1a, 0x94, 0x07, 0x18, 0xb8, 0xed, 0x3a, 0xc6, 0x94, + 0xc9, 0xd8, 0x24, 0x5b, 0x75, 0x70, 0xeb, 0x50, 0x4f, 0xd3, 0x1e, 0xbe, + 0x9f, 0x79, 0x52, 0x33, 0xa3, 0x23, 0xeb, 0x1c, 0xef, 0x53, 0xfd, 0x86, + 0xf5, 0x98, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x12, 0x10, 0x1b, 0x44, 0x5b, 0xbe, 0xfd, 0x78, 0xd8, 0x77, 0x65, + 0xa7, 0xf1, 0xc1, 0x7d, 0x81, 0xdd, 0x5b, 0x1a, 0x20, 0x8d, 0xe3, 0xa1, + 0x2c, 0x78, 0x92, 0xdc, 0x04, 0xcc, 0xd2, 0x2c, 0xcb, 0x0c, 0x8d, 0x63, + 0xa1, 0xdd, 0x11, 0x83, 0xb8, 0x68, 0x94, 0xf5, 0x2b, 0xbe, 0x41, 0xf4, + 0x3f, 0x69, 0x26, 0x9b, 0xe8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x94, 0x16, 0x5d, 0x21, 0x3e, 0xe5, 0xbf, 0x51, 0x71, 0xfe, 0x0e, + 0xaf, 0x00, 0xe3, 0x56, 0x46, 0x41, 0x8d, 0x60, 0x8f, 0x30, 0xbe, 0x94, + 0xee, 0x1c, 0x1d, 0xb7, 0x6f, 0x53, 0xaa, 0x93, 0x6d, 0x12, 0x10, 0x48, + 0x35, 0x34, 0x82, 0x21, 0xe5, 0x00, 0x3d, 0x50, 0x67, 0x6b, 0xf9, 0x93, + 0xa8, 0xea, 0x2b, 0x62, 0x00, 0x20, 0xaa, 0x92, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xdd, 0xe0, 0xee, 0x17, 0xa1, 0xc8, 0xbf, 0xa3, 0x70, 0x90, 0x3e, + 0xe7, 0x4a, 0xf6, 0x02, 0x32, 0x78, 0x72, 0x06, 0x9a, 0x70, 0x4d, + 0xfd, 0x14, 0x04, 0x5d, 0xb3, 0xee, 0x90, 0x6e, 0x18, 0x4b, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = false; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, CorePIGTest_OfflineWithPST) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xe7, 0x13, 0x78, 0x95, 0x00, 0x00, 0x00, 0x0b, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x04, 0x00, 0x10, + 0xe7, 0x13, 0x78, 0x95, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x05, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4f, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2d, 0x00, 0x00, 0x00, 0x20, + 0xb3, 0x6c, 0xbc, 0x52, 0x2c, 0xed, 0x63, 0xdb, 0x21, 0x5b, 0x09, 0xcf, + 0x31, 0xe3, 0xc9, 0x00, 0x26, 0x09, 0x08, 0xd0, 0xe9, 0x6f, 0xb6, 0xdd, + 0x3c, 0x30, 0x6b, 0x86, 0x8a, 0xbd, 0x4b, 0xf9, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x43, 0x44, 0x33, 0x31, 0x46, 0x30, 0x46, 0x41, + 0x44, 0x43, 0x41, 0x39, 0x35, 0x45, 0x37, 0x41, 0x30, 0x37, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x44, 0x33, 0x31, 0x46, 0x30, 0x46, 0x41, 0x44, 0x43, + 0x41, 0x39, 0x35, 0x45, 0x37, 0x41, 0x30, 0x37, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x49, 0x4b, 0x20, 0x84, 0x52, 0xe6, + 0x3f, 0x63, 0xc2, 0xd6, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xaa, 0x92, + 0x86, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0xc6, 0x60, 0x20, 0x63, 0x8d, 0x31, 0x3d, 0x4c, 0x4a, 0xaa, 0xa6, 0x5e, + 0xec, 0x42, 0xdb, 0xf7, 0x1a, 0x50, 0x56, 0x27, 0x79, 0x84, 0x07, 0xce, + 0xa6, 0xfd, 0x9e, 0xdd, 0xf1, 0x42, 0x7d, 0x1d, 0x44, 0x1f, 0x12, 0x48, + 0xe2, 0x4d, 0xc1, 0xc7, 0xfc, 0x7a, 0x3e, 0x1f, 0xb0, 0xb4, 0x30, 0xe8, + 0x64, 0x7e, 0xcf, 0xdc, 0xff, 0x60, 0xb9, 0xfa, 0x83, 0xff, 0xdb, 0xf7, + 0x8c, 0x76, 0xa6, 0x93, 0xc0, 0x80, 0x86, 0xc8, 0x57, 0xc6, 0xae, 0x8f, + 0x95, 0x92, 0x45, 0x97, 0x03, 0xdd, 0x70, 0x5e, 0xb8, 0x53, 0x0b, 0x9a, + 0x62, 0x5f, 0x82, 0xbc, 0x9a, 0x94, 0x9f, 0xb9, 0x42, 0x5a, 0xfc, 0x6c, + 0x30, 0x9d, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x12, 0x10, 0xad, 0xb3, 0xd4, 0x23, 0x0c, 0xbe, 0x91, 0x94, 0x87, + 0xe3, 0x5c, 0xf5, 0x92, 0x2e, 0x9e, 0xcf, 0x1a, 0x20, 0x75, 0x3b, 0x5b, + 0x48, 0x7f, 0x45, 0x6f, 0x89, 0x12, 0xa1, 0xa2, 0x42, 0xf4, 0xfe, 0x19, + 0x24, 0xaf, 0x7f, 0x2d, 0x8c, 0x06, 0x8d, 0xf1, 0x84, 0x77, 0x22, 0xe4, + 0x0f, 0xe7, 0x85, 0xbc, 0xac, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xb7, 0x46, 0x7c, 0x37, 0x8b, 0xf9, 0xca, 0xc6, 0x80, 0xde, 0xc4, + 0xad, 0x33, 0x71, 0xd4, 0xcf, 0x8f, 0x6c, 0x49, 0xd3, 0xc7, 0x38, 0x1e, + 0xa3, 0x35, 0x11, 0x7d, 0xb1, 0x03, 0x4b, 0xf4, 0xec, 0x12, 0x10, 0x98, + 0x7a, 0x5a, 0x06, 0xf5, 0xc5, 0x2e, 0xba, 0xa5, 0x15, 0x15, 0xb2, 0xc2, + 0xef, 0x91, 0xb6, 0x62, 0x00, 0x20, 0xaa, 0x92, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xb3, 0x6c, 0xbc, 0x52, 0x2c, 0xed, 0x63, 0xdb, 0x21, 0x5b, 0x09, + 0xcf, 0x31, 0xe3, 0xc9, 0x00, 0x26, 0x09, 0x08, 0xd0, 0xe9, 0x6f, + 0xb6, 0xdd, 0x3c, 0x30, 0x6b, 0x86, 0x8a, 0xbd, 0x4b, 0xf9, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, CorePIGTest_OfflineHWSecureRequired) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xb6, 0x1d, 0x85, 0xc2, 0x00, 0x00, 0x00, 0x0e, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x04, 0x00, 0x10, + 0xb6, 0x1d, 0x85, 0xc2, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xe1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x05, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4f, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2d, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x66, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb2, + 0x00, 0x00, 0x00, 0x20, 0x66, 0x9c, 0x2c, 0x8f, 0xe5, 0x50, 0x66, 0x1c, + 0xa7, 0xb7, 0xd5, 0x50, 0xc9, 0x06, 0xbd, 0x40, 0xb7, 0x35, 0x3d, 0x46, + 0xa7, 0x2d, 0x09, 0xcd, 0x16, 0x4b, 0x25, 0x19, 0xaf, 0x64, 0x37, 0x8f, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x37, 0x41, 0x33, 0x30, 0x30, 0x34, 0x46, 0x36, + 0x34, 0x35, 0x41, 0x34, 0x38, 0x38, 0x41, 0x35, 0x30, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x41, 0x33, 0x30, 0x30, 0x34, 0x46, 0x36, 0x34, 0x35, + 0x41, 0x34, 0x38, 0x38, 0x41, 0x35, 0x30, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x73, 0xc1, 0xa5, 0xa6, 0xda, 0x47, + 0x74, 0x7a, 0x86, 0xcc, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xaa, 0x92, + 0x86, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0x47, 0x52, 0xef, 0x4b, 0x0e, 0xda, 0x94, 0xbe, 0x90, 0xa9, 0x92, 0x5a, + 0x04, 0x2a, 0xca, 0xee, 0x1a, 0x50, 0x77, 0xce, 0xe5, 0xd8, 0x5d, 0xbf, + 0x52, 0x2f, 0xe4, 0xcd, 0x29, 0x87, 0x72, 0xc2, 0xb4, 0x82, 0xd1, 0x5c, + 0xd0, 0x9d, 0x9a, 0xa2, 0x89, 0x78, 0xb0, 0x6b, 0xf6, 0x77, 0x16, 0x1c, + 0xaf, 0xb8, 0x96, 0xb3, 0xac, 0x8d, 0x94, 0xbe, 0x85, 0x81, 0xc6, 0x04, + 0x71, 0xa8, 0xb7, 0x59, 0xd5, 0x91, 0x7d, 0x10, 0x20, 0xfe, 0x3d, 0xb3, + 0x6a, 0x1e, 0xf5, 0x6f, 0x9a, 0x97, 0x74, 0xa6, 0xcd, 0x39, 0x40, 0x09, + 0x3e, 0x12, 0x6c, 0xe1, 0x7c, 0xab, 0xd2, 0x94, 0xfb, 0xc1, 0x62, 0xf3, + 0x85, 0x86, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x12, 0x10, 0xb4, 0xbd, 0x15, 0x1c, 0xa8, 0x0f, 0xf9, 0xae, 0x20, + 0x0b, 0xcd, 0xf1, 0xd2, 0x6a, 0x64, 0x2b, 0x1a, 0x20, 0xa2, 0xb9, 0xc0, + 0x01, 0xc8, 0x5f, 0x56, 0x55, 0x62, 0x47, 0x39, 0xc3, 0x5d, 0x02, 0x65, + 0x35, 0xfd, 0x61, 0xdb, 0xd0, 0xd9, 0x64, 0x35, 0x33, 0xc8, 0xaf, 0xd5, + 0x87, 0xa9, 0xa3, 0xe3, 0xf8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xad, 0x3d, 0x88, 0x90, 0x38, 0x69, 0x6c, 0x81, 0x08, 0x4f, 0xb1, + 0xa8, 0x3c, 0xa9, 0xab, 0xe4, 0xcb, 0x8b, 0xe5, 0xb7, 0x99, 0x0c, 0x39, + 0x58, 0x32, 0xaf, 0xe9, 0x6c, 0x50, 0xa0, 0xe1, 0xca, 0x12, 0x10, 0xa3, + 0xd8, 0xf9, 0xaa, 0xdb, 0xb9, 0x5c, 0xe7, 0x68, 0x0d, 0x1b, 0x97, 0xa2, + 0x61, 0xde, 0xfe, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x12, 0x10, 0x5d, 0x69, 0xdb, 0x6e, 0x3c, 0x33, 0xc1, 0x50, + 0x82, 0x9d, 0x34, 0x89, 0x06, 0x4e, 0xbc, 0xca, 0x1a, 0x20, 0x4c, 0x42, + 0xe7, 0x3e, 0x04, 0x56, 0xcb, 0xe0, 0xba, 0x69, 0x85, 0x5a, 0x37, 0x26, + 0xed, 0xaa, 0xe3, 0x8e, 0x86, 0x8a, 0x51, 0x53, 0x02, 0xf4, 0x7d, 0xd6, + 0x51, 0x55, 0xb8, 0xc3, 0xf2, 0x0c, 0x20, 0x02, 0x28, 0x05, 0x42, 0x34, + 0x0a, 0x20, 0xd8, 0x75, 0x0d, 0x0c, 0xc9, 0xed, 0x8d, 0x8d, 0x7a, 0x75, + 0xe4, 0x10, 0xa3, 0x17, 0x06, 0xb4, 0xb8, 0xab, 0x93, 0x0f, 0xb3, 0xe4, + 0x86, 0xae, 0xc8, 0x91, 0xd4, 0x9a, 0xbe, 0x53, 0x2c, 0x51, 0x12, 0x10, + 0x39, 0x21, 0x26, 0x26, 0xc1, 0x63, 0x34, 0x5f, 0xeb, 0x6a, 0x9d, 0x4a, + 0x1d, 0x8e, 0x14, 0x62, 0x62, 0x00, 0x20, 0xaa, 0x92, 0x86, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x66, 0x9c, 0x2c, 0x8f, 0xe5, 0x50, 0x66, 0x1c, 0xa7, 0xb7, 0xd5, + 0x50, 0xc9, 0x06, 0xbd, 0x40, 0xb7, 0x35, 0x3d, 0x46, 0xa7, 0x2d, + 0x09, 0xcd, 0x16, 0x4b, 0x25, 0x19, 0xaf, 0x64, 0x37, 0x8f, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_Streaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x88, 0xb0, 0x57, 0x9c, 0x00, 0x00, 0x00, 0x11, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x88, 0xb0, 0x57, 0x9c, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xcf, 0x93, 0x33, 0x09, 0xe6, 0xa9, 0x5b, 0xae, + 0xc3, 0xf0, 0x71, 0x53, 0xc0, 0x55, 0x78, 0xb6, 0x68, 0x50, 0x30, 0xbe, + 0xac, 0x4b, 0x6e, 0x8b, 0x3e, 0x25, 0x7e, 0xea, 0xfb, 0x90, 0x00, 0x9a, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x35, 0x34, 0x35, 0x42, 0x44, 0x41, 0x38, 0x30, + 0x44, 0x46, 0x32, 0x45, 0x41, 0x30, 0x45, 0x43, 0x30, 0x44, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x35, 0x34, 0x35, 0x42, 0x44, 0x41, 0x38, 0x30, 0x44, 0x46, + 0x32, 0x45, 0x41, 0x30, 0x45, 0x43, 0x30, 0x44, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x28, 0x40, 0x00, 0x48, 0xaa, 0x92, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xda, 0x6b, + 0x41, 0xc8, 0x8b, 0x78, 0x6d, 0x83, 0x43, 0x30, 0x7e, 0x4a, 0xff, 0xe6, + 0xef, 0xc8, 0x1a, 0x50, 0x32, 0xe9, 0xe6, 0x7e, 0x8c, 0x43, 0x04, 0x23, + 0x09, 0xe2, 0x05, 0x2b, 0x63, 0x44, 0x74, 0xf8, 0x3d, 0xc1, 0x59, 0x06, + 0x6b, 0x77, 0xf3, 0xb5, 0x05, 0x38, 0x82, 0x4c, 0x09, 0x60, 0x3d, 0xa6, + 0xde, 0x1a, 0x4e, 0xe8, 0xf4, 0x68, 0x70, 0x58, 0xef, 0x53, 0x21, 0x99, + 0x56, 0xcc, 0xc7, 0xa3, 0xda, 0x3c, 0x2a, 0x58, 0xe4, 0x91, 0x28, 0xa1, + 0x51, 0xe6, 0xbd, 0xf1, 0x9c, 0x31, 0xa4, 0x20, 0x69, 0x3f, 0xc9, 0xfb, + 0xbb, 0x36, 0x9e, 0xaf, 0x92, 0xa3, 0xc1, 0x64, 0x7f, 0x6f, 0xb3, 0x7f, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x5b, 0xa9, 0xfe, 0xf9, 0x43, 0x67, 0xaf, 0x15, 0xf2, 0x70, 0x82, + 0xd7, 0x31, 0x2c, 0xfe, 0xef, 0x1a, 0x20, 0x5d, 0x1f, 0xc1, 0x9c, 0x27, + 0xd6, 0x97, 0x50, 0x0e, 0x13, 0x84, 0x63, 0x19, 0x7d, 0x03, 0x99, 0xf0, + 0x84, 0x22, 0x89, 0x48, 0xb7, 0x09, 0x63, 0xfc, 0xab, 0xe0, 0x07, 0x52, + 0x94, 0xb8, 0xf2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x50, + 0xeb, 0x1d, 0x9f, 0x11, 0xd4, 0x27, 0xe8, 0x5d, 0x84, 0xda, 0xf0, 0xda, + 0x72, 0xe6, 0x2a, 0xc2, 0xf8, 0x24, 0x04, 0x8f, 0xd4, 0x48, 0xc2, 0x46, + 0x18, 0x76, 0xba, 0x44, 0x14, 0xdb, 0x09, 0x12, 0x10, 0x36, 0x77, 0x48, + 0xc9, 0x4d, 0x2e, 0x25, 0xa0, 0x73, 0x61, 0xc4, 0x39, 0xba, 0x40, 0xa5, + 0x77, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x8e, 0x62, 0xdf, 0xf9, 0x3b, 0xf3, 0xb3, 0xa2, 0x4b, 0x5c, + 0xda, 0x14, 0xbc, 0xc7, 0xec, 0xee, 0x1a, 0x20, 0x2a, 0x8e, 0x34, 0xd8, + 0x17, 0x87, 0x8f, 0x74, 0xff, 0x73, 0xb3, 0x0c, 0x3f, 0xc8, 0x37, 0x03, + 0x5b, 0xc4, 0x39, 0x82, 0x00, 0x7a, 0x52, 0x8f, 0x43, 0xfe, 0x95, 0x5d, + 0x67, 0x2c, 0x0d, 0xfc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xa7, 0x00, 0xfc, 0x43, 0xd8, 0xf2, 0xcb, 0xac, 0x55, 0x66, 0x98, 0xa9, + 0x0a, 0xd0, 0x96, 0xc1, 0x4d, 0x1f, 0xc3, 0x1d, 0x46, 0xfc, 0xf3, 0xcb, + 0xf3, 0x2e, 0xc3, 0xec, 0x0c, 0x87, 0x7f, 0x09, 0x12, 0x10, 0x8b, 0x1f, + 0xe8, 0x6b, 0x40, 0xf0, 0xfc, 0x86, 0x9c, 0x65, 0xab, 0x24, 0x29, 0x69, + 0x49, 0xeb, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x8f, 0x21, 0x3a, 0xe6, 0x29, 0xf5, 0xb2, 0x81, 0x3d, + 0x9a, 0xe8, 0xd2, 0xfb, 0x5e, 0x37, 0xcc, 0x1a, 0x20, 0x9d, 0xc7, 0x6f, + 0xc1, 0xb8, 0xc8, 0x9a, 0xcd, 0x06, 0x63, 0x20, 0x64, 0x96, 0x2e, 0x21, + 0xc2, 0xf8, 0x31, 0xbf, 0x25, 0xa8, 0xad, 0xb1, 0x3b, 0x80, 0xb4, 0xb8, + 0x7e, 0x20, 0x63, 0xb7, 0x10, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x22, 0x41, 0xd5, 0x85, 0x2a, 0x1d, 0xd5, 0x80, 0xb0, 0xab, 0x0f, + 0x56, 0x6c, 0xcd, 0xbb, 0x9c, 0x3d, 0x15, 0xc6, 0x50, 0xa3, 0x7a, 0xa6, + 0xa3, 0xf4, 0xc7, 0xa1, 0x83, 0x41, 0x93, 0x34, 0x11, 0x12, 0x10, 0xc9, + 0xcc, 0x7e, 0x99, 0x25, 0xa8, 0x1d, 0x75, 0x10, 0x7a, 0xd6, 0x90, 0x15, + 0xee, 0xb0, 0xe7, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xbf, 0x1b, 0x1a, 0xd3, 0xc8, 0xfd, 0x56, 0x71, + 0x29, 0xf5, 0x95, 0xcf, 0x67, 0x2a, 0x8a, 0x4b, 0x1a, 0x20, 0x69, 0x32, + 0x4d, 0xce, 0xdf, 0xc1, 0xc2, 0xe8, 0xe5, 0x55, 0x3e, 0xac, 0xb2, 0x5d, + 0x46, 0x8d, 0xa3, 0xa0, 0x0b, 0x77, 0x2e, 0x1f, 0x64, 0x1c, 0x6d, 0x2b, + 0xc5, 0x54, 0xd6, 0xcf, 0x53, 0x1e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xc2, 0xe0, 0xc6, 0x78, 0x35, 0x2d, 0xee, 0x68, 0x5a, 0x28, + 0x98, 0x18, 0x34, 0x43, 0x37, 0x6a, 0xe7, 0xa1, 0xe6, 0xc3, 0xce, 0x3b, + 0x59, 0x1b, 0xf8, 0xae, 0xbb, 0x41, 0x04, 0x90, 0x64, 0xcb, 0x12, 0x10, + 0x19, 0x20, 0xc2, 0x1e, 0xea, 0x31, 0xb1, 0x41, 0x62, 0xa2, 0xff, 0x0a, + 0x08, 0x74, 0x4f, 0xcc, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xd9, 0xcb, 0xee, 0x44, 0xd0, 0x99, 0x7c, + 0x9a, 0x5b, 0xa4, 0x00, 0x19, 0x4d, 0xd7, 0xdf, 0x58, 0x1a, 0x20, 0x5e, + 0x2f, 0x98, 0xc7, 0x90, 0x33, 0x29, 0x2b, 0x7d, 0x51, 0x97, 0x37, 0xac, + 0x76, 0x95, 0x8d, 0xf2, 0x82, 0x74, 0x19, 0xac, 0x5f, 0x25, 0xb5, 0x01, + 0x0b, 0xba, 0xde, 0x65, 0x17, 0x66, 0x47, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x22, 0x2e, 0xea, 0x73, 0xa7, 0x01, 0x07, 0x27, 0xad, + 0xa5, 0x24, 0x40, 0x4e, 0xa9, 0xd0, 0x35, 0x38, 0x30, 0x25, 0x9b, 0x5c, + 0x63, 0xf5, 0x46, 0x5b, 0xc2, 0x29, 0x4b, 0x0e, 0x92, 0xd9, 0x0d, 0x12, + 0x10, 0x67, 0x38, 0x64, 0x5f, 0xcb, 0x63, 0xba, 0xe0, 0x44, 0x9e, 0x6c, + 0x5c, 0x32, 0xd5, 0x0d, 0xf1, 0x62, 0x00, 0x20, 0xaa, 0x92, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xcf, 0x93, 0x33, 0x09, 0xe6, 0xa9, 0x5b, 0xae, 0xc3, 0xf0, 0x71, + 0x53, 0xc0, 0x55, 0x78, 0xb6, 0x68, 0x50, 0x30, 0xbe, 0xac, 0x4b, + 0x6e, 0x8b, 0x3e, 0x25, 0x7e, 0xea, 0xfb, 0x90, 0x00, 0x9a, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_Streaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x43, 0x21, 0x87, 0x8c, 0x00, 0x00, 0x00, 0x13, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x43, 0x21, 0x87, 0x8c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0xdc, 0xe3, 0xb7, 0x9a, 0x96, 0x2d, 0xa6, 0x61, + 0xe5, 0xa4, 0x26, 0x74, 0x77, 0x4c, 0x56, 0x70, 0xb3, 0x32, 0x01, 0xbc, + 0x1f, 0x05, 0x9f, 0xbd, 0x71, 0xdd, 0xe6, 0x02, 0xb5, 0xc1, 0xb2, 0xd7, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x42, 0x38, 0x34, 0x42, 0x33, 0x43, 0x36, + 0x37, 0x37, 0x46, 0x38, 0x36, 0x35, 0x33, 0x41, 0x30, 0x46, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x42, 0x38, 0x34, 0x42, 0x33, 0x43, 0x36, 0x37, 0x37, + 0x46, 0x38, 0x36, 0x35, 0x33, 0x41, 0x30, 0x46, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x17, 0xbb, 0x00, 0x75, 0xf5, 0xdb, + 0x49, 0x21, 0x41, 0xd7, 0x38, 0x28, 0x40, 0x00, 0x48, 0xd0, 0x92, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x22, 0x03, + 0xae, 0x71, 0xe2, 0xef, 0x7d, 0x1c, 0x74, 0x82, 0xdd, 0x32, 0x5d, 0x74, + 0x2a, 0x55, 0x1a, 0x50, 0x33, 0xf9, 0x19, 0xac, 0xd3, 0x62, 0xf5, 0xe5, + 0x98, 0x19, 0xa0, 0xe0, 0x2a, 0x3d, 0xb8, 0x2b, 0x49, 0x8e, 0x87, 0xb4, + 0x88, 0x9f, 0x08, 0x83, 0x6f, 0x97, 0xfc, 0x0f, 0x3c, 0xa0, 0x4f, 0x1c, + 0x6c, 0xc3, 0x40, 0x77, 0xcb, 0x0a, 0x5a, 0x7c, 0x9c, 0x0c, 0xbe, 0xb0, + 0x8b, 0xf2, 0x18, 0xd3, 0x19, 0x4b, 0xb2, 0xef, 0x55, 0x2f, 0x0c, 0xae, + 0x58, 0x8a, 0x80, 0x75, 0x0e, 0x3b, 0xbc, 0x64, 0x8c, 0x1b, 0x9e, 0x16, + 0xa4, 0xfb, 0x4a, 0x32, 0x09, 0xd9, 0x8c, 0x15, 0x81, 0x62, 0xa5, 0x4b, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xd6, 0xc0, 0x03, 0xd5, 0x5e, 0x10, 0xc5, 0xf3, 0x30, 0xb8, 0xa5, + 0xc2, 0xd5, 0xc7, 0xda, 0xee, 0x1a, 0x20, 0xdc, 0x87, 0x65, 0x3c, 0xe5, + 0x11, 0x59, 0x19, 0xad, 0x12, 0x5a, 0xca, 0x62, 0x6b, 0x8c, 0x7c, 0x8d, + 0x10, 0xef, 0x6f, 0x9d, 0x60, 0xd0, 0x89, 0x04, 0x8f, 0xee, 0x1e, 0xe6, + 0x8b, 0x8e, 0x8e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x64, + 0x3b, 0xb3, 0xc4, 0xbf, 0x8c, 0x6b, 0x2f, 0x1f, 0xfd, 0x9f, 0x6e, 0x9c, + 0xe7, 0x50, 0x45, 0x5b, 0xd3, 0x5e, 0x3c, 0x8e, 0x0c, 0x64, 0xe4, 0xe1, + 0x66, 0x86, 0x79, 0x70, 0x90, 0x0f, 0xc5, 0x12, 0x10, 0xd6, 0xa1, 0x0f, + 0x7a, 0x5a, 0x9b, 0x99, 0xf2, 0x27, 0x57, 0x6c, 0x45, 0x92, 0x2c, 0x46, + 0x2d, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x93, 0x53, 0x06, 0xa9, 0xcf, 0xe3, 0x70, 0xe5, 0xb2, 0x01, + 0x6d, 0xc5, 0xa1, 0x4c, 0xf0, 0x12, 0x1a, 0x20, 0x91, 0xc8, 0xe8, 0x44, + 0xcf, 0xb0, 0xca, 0x56, 0x02, 0x0d, 0xbe, 0x7f, 0xad, 0x89, 0x52, 0x9e, + 0xa0, 0x17, 0x50, 0xad, 0x1f, 0x52, 0xf7, 0x64, 0xeb, 0xd7, 0xa2, 0x0e, + 0x41, 0xd4, 0xb4, 0x33, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x90, 0x2a, 0x9a, 0xb3, 0x85, 0xd7, 0xc6, 0x87, 0x6d, 0x38, 0x2f, 0x57, + 0xe1, 0xef, 0xc9, 0xda, 0x59, 0x79, 0xfc, 0x97, 0x29, 0x08, 0xcf, 0x55, + 0x15, 0x6e, 0xed, 0xc1, 0x5c, 0xbd, 0x95, 0x20, 0x12, 0x10, 0xac, 0x8f, + 0x6c, 0x0f, 0xec, 0x01, 0x30, 0x36, 0x3a, 0x0e, 0x37, 0x0b, 0x00, 0x23, + 0x6a, 0x70, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x0f, 0xfb, 0xac, 0x68, 0x59, 0x29, 0x13, 0x09, 0x8d, + 0x8d, 0xb3, 0x74, 0x86, 0x12, 0xd6, 0x44, 0x1a, 0x20, 0xab, 0x99, 0x1c, + 0x07, 0x79, 0x12, 0xd1, 0xae, 0xb5, 0x2a, 0xeb, 0xaa, 0x9b, 0xce, 0xb0, + 0xd3, 0x08, 0xb7, 0x2f, 0x1f, 0x99, 0xd2, 0x9c, 0x0f, 0xa4, 0x50, 0x6c, + 0xe0, 0xf3, 0x57, 0xe5, 0xfe, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x73, 0x9e, 0x48, 0x21, 0x65, 0x7f, 0xdc, 0x46, 0x42, 0x51, 0x19, + 0x62, 0x14, 0x7f, 0x9d, 0xd4, 0xe6, 0x01, 0x32, 0x56, 0x63, 0x30, 0x0b, + 0x1a, 0x69, 0xd8, 0xb2, 0x4e, 0xe6, 0x1b, 0x18, 0x5e, 0x12, 0x10, 0xfa, + 0x2a, 0x88, 0x25, 0x4c, 0x3a, 0xb5, 0xb8, 0xf1, 0xae, 0xf5, 0x73, 0x7b, + 0x8a, 0xd8, 0xcb, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x7d, 0xb0, 0xf1, 0x4e, 0xdb, 0xe9, 0x32, 0x1b, + 0x72, 0xc6, 0x00, 0xdd, 0x7c, 0x8f, 0x11, 0x25, 0x1a, 0x20, 0x8b, 0xd5, + 0x7d, 0xb3, 0x09, 0xf3, 0x51, 0xc2, 0x33, 0x99, 0x90, 0xd2, 0xda, 0x4b, + 0xaf, 0x1c, 0x89, 0x88, 0x59, 0xdd, 0xc8, 0x89, 0xee, 0xa8, 0x82, 0xd7, + 0x62, 0xe7, 0x15, 0xeb, 0x9b, 0xc3, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x45, 0xde, 0x20, 0xf1, 0xab, 0xe0, 0xaf, 0x02, 0xbd, 0xa4, + 0xed, 0xb6, 0x57, 0x13, 0x39, 0x0d, 0x62, 0x3b, 0x4b, 0x33, 0xe2, 0x1e, + 0x51, 0xbd, 0xfc, 0x5b, 0xf2, 0x89, 0x08, 0xfa, 0x82, 0x5c, 0x12, 0x10, + 0xe7, 0xc8, 0xa7, 0x14, 0x59, 0x28, 0x3d, 0xf1, 0x4f, 0xf9, 0x60, 0x1c, + 0x54, 0x6d, 0xb5, 0xe7, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x4d, 0xe9, 0xbd, 0x13, 0xbc, 0x59, 0x30, + 0xb7, 0x7c, 0x99, 0x25, 0xfe, 0x62, 0x0d, 0xe1, 0x6f, 0x1a, 0x20, 0x26, + 0x4e, 0x67, 0x1c, 0x28, 0x19, 0x2f, 0xf2, 0x9d, 0xa5, 0x98, 0x9f, 0xb5, + 0x11, 0xb2, 0x12, 0x75, 0x87, 0xea, 0xc7, 0x4a, 0x34, 0xbb, 0x55, 0x1c, + 0x58, 0x92, 0x43, 0x5e, 0x6a, 0x51, 0x80, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0xbd, 0xe1, 0x7f, 0xe6, 0x79, 0xeb, 0x97, 0x75, 0x88, + 0xa8, 0x1a, 0x84, 0x77, 0xa6, 0xae, 0x71, 0xb8, 0x6d, 0x11, 0x7f, 0xdd, + 0x22, 0x76, 0xa3, 0x21, 0xcd, 0x13, 0x39, 0x20, 0xd5, 0x46, 0xf3, 0x12, + 0x10, 0x90, 0x44, 0x91, 0x0f, 0x60, 0x37, 0x47, 0x74, 0xeb, 0x27, 0xa9, + 0xba, 0x06, 0xbf, 0x7f, 0x9a, 0x62, 0x00, 0x20, 0xd0, 0x92, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xdc, 0xe3, 0xb7, 0x9a, 0x96, 0x2d, 0xa6, 0x61, 0xe5, 0xa4, 0x26, + 0x74, 0x77, 0x4c, 0x56, 0x70, 0xb3, 0x32, 0x01, 0xbc, 0x1f, 0x05, + 0x9f, 0xbd, 0x71, 0xdd, 0xe6, 0x02, 0xb5, 0xc1, 0xb2, 0xd7, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_StreamingQuickStart_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xf5, 0xfc, 0xaf, 0x59, 0x00, 0x00, 0x00, 0x15, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xf5, 0xfc, 0xaf, 0x59, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xfe, 0x9f, 0xdf, 0x03, 0x71, 0xe0, 0xc5, 0x34, + 0x37, 0xcf, 0x26, 0x50, 0x7a, 0xf6, 0x28, 0x68, 0x37, 0xfa, 0xf5, 0x53, + 0xa2, 0x3f, 0x8b, 0xc0, 0xd1, 0xed, 0xfc, 0x9c, 0x83, 0x52, 0x5c, 0x0f, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x30, 0x43, 0x33, 0x39, 0x36, 0x43, 0x45, 0x41, + 0x31, 0x37, 0x32, 0x44, 0x33, 0x34, 0x33, 0x41, 0x31, 0x31, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x43, 0x33, 0x39, 0x36, 0x43, 0x45, 0x41, 0x31, 0x37, + 0x32, 0x44, 0x33, 0x34, 0x33, 0x41, 0x31, 0x31, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x14, 0x40, 0x28, 0x48, 0xf6, 0x92, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x0b, 0x8d, + 0x7b, 0x4c, 0xbc, 0x3b, 0xdd, 0xbd, 0xf2, 0x0e, 0x77, 0x2f, 0x0f, 0x6d, + 0x14, 0x3d, 0x1a, 0x50, 0x4f, 0x2a, 0x8c, 0x2a, 0x13, 0xca, 0x7e, 0x42, + 0x49, 0x64, 0x37, 0x2c, 0x42, 0x67, 0x18, 0xd4, 0xea, 0xde, 0xda, 0x51, + 0xc8, 0xdf, 0xe4, 0x35, 0x35, 0xd6, 0x16, 0x7d, 0xcc, 0x8f, 0x93, 0xc1, + 0xb6, 0x74, 0x37, 0x63, 0xe1, 0x0a, 0x1a, 0x00, 0x16, 0xa1, 0x18, 0x1d, + 0xda, 0x48, 0xa9, 0xfe, 0xa6, 0x05, 0x3a, 0x9b, 0x18, 0xf9, 0xab, 0x37, + 0x93, 0x62, 0x0a, 0xe6, 0x26, 0xf3, 0x88, 0x1d, 0x3c, 0x03, 0x22, 0xab, + 0xe0, 0x4b, 0x8d, 0x39, 0x15, 0xdf, 0xb1, 0xd9, 0x08, 0xfb, 0xbd, 0x14, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x4b, 0xb3, 0x86, 0xd2, 0xeb, 0xd8, 0x25, 0x4d, 0x56, 0x45, 0xc3, + 0xec, 0x4f, 0xe5, 0x27, 0x4e, 0x1a, 0x20, 0x17, 0x8f, 0x41, 0x0f, 0x58, + 0x26, 0xb5, 0xbf, 0x8b, 0x18, 0x18, 0x34, 0x04, 0x5d, 0xc7, 0xd0, 0x35, + 0x7e, 0x65, 0x7c, 0x2c, 0x9f, 0x28, 0xe9, 0x6c, 0x5a, 0xe7, 0x4b, 0xa1, + 0xed, 0x99, 0xbc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x96, + 0x57, 0x12, 0x26, 0x9b, 0xdb, 0xc2, 0x65, 0xe8, 0x09, 0x0e, 0xc5, 0x41, + 0x25, 0x70, 0x86, 0x72, 0xd3, 0xe3, 0x91, 0x57, 0xce, 0x55, 0x69, 0xc9, + 0xb1, 0x06, 0x34, 0x40, 0x31, 0xd7, 0xda, 0x12, 0x10, 0x23, 0xa7, 0x45, + 0xc1, 0x14, 0x67, 0x02, 0x00, 0x50, 0xd3, 0x5a, 0x0d, 0xa7, 0x87, 0x28, + 0x6f, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x4d, 0x67, 0xf6, 0xc2, 0xf8, 0x00, 0x2f, 0x5b, 0xc7, 0x73, + 0x82, 0x86, 0x99, 0x13, 0xd4, 0xe3, 0x1a, 0x20, 0x2e, 0x6d, 0xce, 0x8c, + 0xef, 0x3a, 0xd3, 0x80, 0x27, 0x8e, 0x9a, 0xc4, 0xf5, 0x7b, 0x34, 0x15, + 0xbd, 0x24, 0xcd, 0x2b, 0xeb, 0xf8, 0x4a, 0x87, 0x44, 0x23, 0x63, 0xc3, + 0xf3, 0x6a, 0x8c, 0xa5, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xcf, 0x56, 0x43, 0xb2, 0x02, 0x89, 0x04, 0xbd, 0x58, 0x22, 0x00, 0x47, + 0xd7, 0xc7, 0x96, 0xe1, 0x9a, 0x19, 0x89, 0x7c, 0x5b, 0xe9, 0x4f, 0x31, + 0xa8, 0xf5, 0x1d, 0x73, 0xe5, 0x07, 0x4d, 0xfc, 0x12, 0x10, 0xcf, 0x5e, + 0xa4, 0x3b, 0xea, 0x50, 0x24, 0xc3, 0xcc, 0xca, 0xdc, 0xc1, 0xfe, 0x18, + 0x92, 0xb2, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xe6, 0x04, 0x13, 0x8d, 0xa2, 0xbd, 0x1d, 0x33, 0x6d, + 0xa6, 0x9b, 0xc8, 0xb3, 0x27, 0x16, 0x67, 0x1a, 0x20, 0x7a, 0xe1, 0xb2, + 0x14, 0xa0, 0xa8, 0xb3, 0x3b, 0x63, 0x2a, 0x51, 0xf2, 0xc2, 0x26, 0xdc, + 0xc3, 0xc6, 0x01, 0x33, 0xa2, 0xe3, 0xe4, 0x0c, 0x9f, 0xc2, 0xb1, 0x8a, + 0x9b, 0x90, 0x5d, 0xc2, 0xcf, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xa8, 0x3e, 0x7f, 0x5c, 0xc7, 0xf4, 0x72, 0x43, 0x33, 0x9f, 0xef, + 0x4b, 0x2f, 0xad, 0x12, 0x0c, 0x58, 0x56, 0x97, 0x2f, 0xbe, 0x5e, 0x06, + 0xc6, 0xe9, 0x97, 0x8d, 0xe8, 0x9f, 0x03, 0x01, 0x59, 0x12, 0x10, 0xc2, + 0x61, 0x73, 0xe3, 0x9b, 0x55, 0x53, 0x2c, 0xe7, 0xd0, 0x55, 0x60, 0x76, + 0xa4, 0x27, 0x8a, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xd7, 0xd2, 0x43, 0xb7, 0x4f, 0xc3, 0xaa, 0x7a, + 0x3d, 0x2c, 0x2b, 0x19, 0xf7, 0x73, 0xc6, 0xa9, 0x1a, 0x20, 0x5c, 0x3c, + 0x52, 0x5f, 0xba, 0xdc, 0x10, 0x35, 0x16, 0x12, 0x40, 0x9e, 0xde, 0xe6, + 0xd5, 0x01, 0x8f, 0x85, 0x19, 0x2e, 0xc2, 0x8d, 0x50, 0x61, 0xdb, 0xdf, + 0x3f, 0xe1, 0x08, 0x2a, 0x7e, 0xc9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x6a, 0x07, 0xa7, 0xb4, 0xdf, 0xe8, 0x53, 0xb1, 0x9b, 0xc8, + 0x50, 0x99, 0x14, 0xde, 0x27, 0xea, 0x1f, 0xab, 0x12, 0x53, 0xb7, 0xb6, + 0x79, 0xe9, 0x2d, 0x8b, 0x19, 0x9a, 0x03, 0x6d, 0x61, 0xfb, 0x12, 0x10, + 0x6b, 0xaa, 0x39, 0x62, 0x6e, 0xee, 0xb3, 0x31, 0x98, 0x29, 0x1b, 0x94, + 0xfd, 0x00, 0xaf, 0x52, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x5f, 0x92, 0x79, 0xa9, 0xe9, 0xd7, 0xba, + 0xdf, 0xbe, 0xb6, 0x08, 0xc1, 0x67, 0xbf, 0x35, 0x09, 0x1a, 0x20, 0x5b, + 0x49, 0x04, 0xac, 0x55, 0x42, 0x4a, 0x97, 0xe5, 0xb0, 0xb5, 0x50, 0x24, + 0x19, 0x81, 0xd5, 0xe9, 0xec, 0x9d, 0x6c, 0x54, 0x61, 0x35, 0x42, 0x4a, + 0xe6, 0xb5, 0x4b, 0xb5, 0x7f, 0xac, 0x9c, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x74, 0xe7, 0xb5, 0xc8, 0xd6, 0x12, 0xce, 0x98, 0x2f, + 0x4b, 0x79, 0xb5, 0xe8, 0xe6, 0xa3, 0xeb, 0x57, 0x12, 0xcc, 0x73, 0x6f, + 0xf4, 0xcf, 0x76, 0xdb, 0x21, 0xc6, 0xbc, 0xb7, 0x98, 0x01, 0x5a, 0x12, + 0x10, 0x9c, 0x2f, 0x6a, 0x83, 0xc6, 0x82, 0x27, 0x8d, 0x94, 0xca, 0x8a, + 0xd0, 0x67, 0x47, 0xc6, 0x31, 0x62, 0x00, 0x20, 0xf6, 0x92, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xfe, 0x9f, 0xdf, 0x03, 0x71, 0xe0, 0xc5, 0x34, 0x37, 0xcf, 0x26, + 0x50, 0x7a, 0xf6, 0x28, 0x68, 0x37, 0xfa, 0xf5, 0x53, 0xa2, 0x3f, + 0x8b, 0xc0, 0xd1, 0xed, 0xfc, 0x9c, 0x83, 0x52, 0x5c, 0x0f, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_StreamingQuickStart_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x0f, 0x34, 0xb7, 0x46, 0x00, 0x00, 0x00, 0x17, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x0f, 0x34, 0xb7, 0x46, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x45, 0x19, 0xca, 0xef, 0x49, 0x7f, 0x0e, 0x08, + 0x41, 0x55, 0x9c, 0x4a, 0x47, 0xd6, 0x69, 0x87, 0x50, 0x6c, 0xa8, 0x99, + 0x6d, 0x8b, 0x68, 0x4c, 0x61, 0x7c, 0x64, 0x43, 0x1b, 0xd3, 0x43, 0x8d, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x36, 0x38, 0x31, 0x46, 0x44, 0x41, 0x41, 0x45, + 0x46, 0x37, 0x31, 0x42, 0x35, 0x38, 0x31, 0x43, 0x31, 0x33, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x36, 0x38, 0x31, 0x46, 0x44, 0x41, 0x41, 0x45, 0x46, 0x37, + 0x31, 0x42, 0x35, 0x38, 0x31, 0x43, 0x31, 0x33, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x49, 0x36, 0xe7, 0x8b, 0x9a, 0x99, + 0x69, 0xed, 0xfb, 0xd5, 0x38, 0x14, 0x40, 0x28, 0x48, 0x8a, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x51, 0xa7, + 0x76, 0x0b, 0x66, 0xed, 0x13, 0xcd, 0x67, 0x16, 0xbf, 0x4f, 0x45, 0x60, + 0xd1, 0x2a, 0x1a, 0x50, 0x29, 0x90, 0x01, 0x28, 0xbd, 0x20, 0x57, 0x9c, + 0x81, 0x09, 0xb0, 0xfe, 0xe6, 0x7b, 0x57, 0x68, 0xb8, 0x43, 0xd1, 0xd8, + 0xad, 0xaf, 0x12, 0x05, 0xa7, 0xbf, 0xcd, 0x36, 0xdf, 0x15, 0x48, 0x60, + 0xcc, 0x5d, 0x7a, 0x49, 0x3a, 0x42, 0x38, 0xfd, 0x24, 0x6a, 0xe9, 0x1c, + 0x43, 0xfb, 0x77, 0x3d, 0x07, 0x21, 0xd7, 0xbd, 0x4e, 0xd5, 0x3a, 0x76, + 0x43, 0xfc, 0xb7, 0xe5, 0x40, 0x4b, 0x86, 0x63, 0x1e, 0xeb, 0x9e, 0x85, + 0x8c, 0x40, 0x45, 0xb7, 0xa3, 0x66, 0x84, 0x2a, 0x8e, 0xab, 0xa3, 0x5d, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xdb, 0x12, 0x46, 0x97, 0x7c, 0x65, 0xe9, 0xe9, 0x05, 0xbf, 0x1f, + 0xad, 0x4b, 0x92, 0x8e, 0x7c, 0x1a, 0x20, 0x4c, 0x19, 0x22, 0xf5, 0x63, + 0xd7, 0xbd, 0xef, 0x13, 0x78, 0x2f, 0x29, 0xfd, 0x92, 0xcb, 0x24, 0x16, + 0x26, 0x68, 0x55, 0xe1, 0x51, 0xaf, 0x19, 0xf4, 0xea, 0xe0, 0xb1, 0x41, + 0x89, 0x37, 0x07, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x78, + 0x69, 0x8b, 0x4e, 0x68, 0x9e, 0x6f, 0xc4, 0x92, 0x08, 0x48, 0x34, 0x36, + 0x51, 0xb7, 0xbc, 0xe1, 0x59, 0x93, 0x48, 0x45, 0xee, 0x0f, 0xee, 0x3e, + 0x8f, 0x11, 0xe6, 0xa2, 0x4f, 0xde, 0xf6, 0x12, 0x10, 0xe8, 0xdd, 0x6e, + 0xc7, 0x0f, 0xb0, 0xf3, 0x46, 0xac, 0x34, 0x20, 0x24, 0x7c, 0xf2, 0xff, + 0x33, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x02, 0x03, 0xce, 0xa3, 0xb2, 0x75, 0xcb, 0xc8, 0x98, 0x91, + 0x11, 0x87, 0x50, 0x34, 0x1a, 0x9b, 0x1a, 0x20, 0x15, 0x6f, 0x8b, 0x7d, + 0xf4, 0xa1, 0x98, 0x26, 0xeb, 0x98, 0xea, 0x82, 0x01, 0x30, 0x0b, 0x67, + 0x43, 0x03, 0x1e, 0xd6, 0x75, 0x6b, 0x54, 0x68, 0xd9, 0x9e, 0x0d, 0xb1, + 0x5f, 0x79, 0xf8, 0xca, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x96, 0x77, 0x70, 0x14, 0x26, 0x08, 0x1f, 0xb2, 0x6d, 0x8f, 0xab, 0xa5, + 0x1a, 0xca, 0xcb, 0xd6, 0x36, 0xbc, 0x3e, 0x34, 0x49, 0x5e, 0xd3, 0x2c, + 0xf0, 0x4a, 0x93, 0x06, 0xb3, 0x78, 0x6d, 0xd6, 0x12, 0x10, 0x6e, 0xcb, + 0x11, 0x31, 0xe2, 0x76, 0x23, 0x64, 0x2c, 0xe4, 0xd2, 0x81, 0xb5, 0xd2, + 0xbf, 0xe1, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x78, 0x14, 0x56, 0x12, 0x5d, 0x3d, 0x7b, 0xf1, 0xcc, + 0x7b, 0x22, 0xe6, 0xa3, 0x9d, 0xb4, 0x2c, 0x1a, 0x20, 0xd6, 0x06, 0xa9, + 0x72, 0x1c, 0xab, 0xf6, 0x79, 0x9d, 0x3d, 0x5c, 0x73, 0x90, 0x95, 0x35, + 0xb0, 0x46, 0xf5, 0x64, 0xfc, 0xcc, 0x89, 0x64, 0xad, 0xd1, 0x84, 0x74, + 0x11, 0x76, 0x7a, 0x94, 0xc8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xbf, 0xbd, 0xfb, 0x83, 0xc6, 0x22, 0x68, 0x41, 0xa4, 0xa9, 0xae, + 0x11, 0x95, 0xb2, 0x55, 0x30, 0x40, 0xfb, 0x42, 0x04, 0xca, 0xd7, 0x26, + 0x4e, 0xff, 0x41, 0xcb, 0xf9, 0x62, 0xd2, 0x00, 0xaf, 0x12, 0x10, 0x78, + 0x63, 0x85, 0x9c, 0xde, 0x79, 0x8d, 0xac, 0xa6, 0xcc, 0x32, 0xa5, 0x11, + 0xf6, 0x46, 0x57, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x11, 0x0c, 0xee, 0x38, 0x82, 0x13, 0xf4, 0x0a, + 0x2f, 0x65, 0x2f, 0xc9, 0xab, 0x0c, 0x04, 0xc5, 0x1a, 0x20, 0x6b, 0xbb, + 0xb5, 0x2d, 0x9b, 0x5e, 0xe9, 0x9f, 0x9c, 0x76, 0x66, 0x30, 0x38, 0x26, + 0xe4, 0xc8, 0x69, 0x10, 0x6f, 0x79, 0x25, 0xdc, 0x4b, 0x85, 0xc1, 0x3f, + 0xfd, 0xca, 0x00, 0xde, 0x04, 0xd7, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xd9, 0xd7, 0x0a, 0xf6, 0x54, 0x04, 0xc8, 0xbe, 0x46, 0x13, + 0x69, 0xd1, 0xdf, 0xff, 0x27, 0x2b, 0xed, 0x60, 0x03, 0xd2, 0x7c, 0xe5, + 0x33, 0xa1, 0x80, 0xdf, 0xa4, 0x98, 0xf8, 0x92, 0x1b, 0x6d, 0x12, 0x10, + 0xff, 0x75, 0x77, 0xfc, 0x16, 0xb3, 0xbe, 0x6a, 0xc8, 0x8e, 0xc2, 0x7c, + 0x80, 0x0d, 0xa5, 0x8c, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x23, 0x68, 0xcc, 0x59, 0x17, 0x57, 0xf9, + 0x27, 0x2a, 0x3a, 0x92, 0x27, 0x4f, 0xe8, 0x8b, 0xd4, 0x1a, 0x20, 0x6f, + 0xa8, 0xee, 0x4e, 0x18, 0xf6, 0xb7, 0x60, 0x81, 0xc3, 0x1f, 0xdc, 0xcd, + 0xf7, 0x7c, 0x5f, 0x34, 0x18, 0x48, 0x12, 0xd0, 0x98, 0x6c, 0x87, 0x72, + 0xf7, 0xbd, 0x1d, 0x58, 0xe5, 0x93, 0x97, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0xe3, 0x89, 0xa0, 0xd4, 0xad, 0x47, 0xc9, 0xfd, 0xa3, + 0x39, 0x0f, 0xbf, 0xd5, 0x82, 0x18, 0xe8, 0x41, 0x0c, 0x4e, 0x6e, 0x3e, + 0x48, 0x27, 0x1d, 0xf2, 0x81, 0xc3, 0x67, 0x4f, 0x35, 0x60, 0x0f, 0x12, + 0x10, 0x26, 0x68, 0x77, 0xf4, 0x97, 0x5a, 0x86, 0xc1, 0x6e, 0xd8, 0x38, + 0xdf, 0xc5, 0x45, 0xec, 0xce, 0x62, 0x00, 0x20, 0x8a, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x45, 0x19, 0xca, 0xef, 0x49, 0x7f, 0x0e, 0x08, 0x41, 0x55, 0x9c, + 0x4a, 0x47, 0xd6, 0x69, 0x87, 0x50, 0x6c, 0xa8, 0x99, 0x6d, 0x8b, + 0x68, 0x4c, 0x61, 0x7c, 0x64, 0x43, 0x1b, 0xd3, 0x43, 0x8d, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenHardTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x3f, 0x5b, 0x81, 0xff, 0x00, 0x00, 0x00, 0x19, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x3f, 0x5b, 0x81, 0xff, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xa1, 0xda, 0xad, 0xd2, 0xdc, 0x38, 0xbf, 0x7a, + 0x26, 0x42, 0x2b, 0x69, 0x95, 0x7a, 0xdf, 0x61, 0x98, 0x3d, 0x23, 0x79, + 0x98, 0x02, 0xb9, 0xb8, 0x74, 0x6e, 0xe2, 0x85, 0xd0, 0xbc, 0x37, 0xd3, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x36, 0x33, 0x37, 0x34, 0x31, 0x32, 0x45, 0x30, + 0x38, 0x31, 0x39, 0x41, 0x37, 0x38, 0x46, 0x33, 0x31, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x36, 0x33, 0x37, 0x34, 0x31, 0x32, 0x45, 0x30, 0x38, 0x31, + 0x39, 0x41, 0x37, 0x38, 0x46, 0x33, 0x31, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0x9e, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xa3, 0x28, + 0x15, 0x5a, 0xc8, 0xfa, 0x6d, 0x30, 0x8f, 0x9f, 0x6d, 0x85, 0x0b, 0xfd, + 0x71, 0xa9, 0x1a, 0x50, 0x7d, 0xc5, 0xa2, 0x57, 0xb8, 0xad, 0xcb, 0x9a, + 0x7c, 0x91, 0x32, 0xd3, 0x3f, 0x86, 0xdc, 0x95, 0x9e, 0x2c, 0x13, 0xdd, + 0x9b, 0x3c, 0x47, 0x7a, 0x70, 0x87, 0x6c, 0x92, 0xfc, 0xc8, 0x96, 0x30, + 0xd5, 0x84, 0x7f, 0x8b, 0x45, 0xfa, 0x9c, 0x89, 0x50, 0xf8, 0xbe, 0xd5, + 0x51, 0xe1, 0x46, 0x57, 0xcc, 0xef, 0x2b, 0x8f, 0x47, 0x9e, 0x9d, 0x6c, + 0x29, 0x21, 0x9d, 0xd2, 0x84, 0xa1, 0xb6, 0x84, 0x8d, 0x30, 0xe0, 0xd5, + 0xc6, 0x9d, 0xa8, 0xa0, 0xa9, 0x62, 0xda, 0x8a, 0x35, 0x6d, 0xcd, 0x27, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x7c, 0x84, 0xff, 0xcb, 0x17, 0x12, 0x14, 0x5d, 0x8a, 0x9c, 0x07, + 0xc6, 0x53, 0x2c, 0x69, 0x09, 0x1a, 0x20, 0x86, 0x36, 0x7d, 0x6e, 0x1d, + 0x41, 0xe6, 0x48, 0x59, 0xdf, 0xf8, 0xfd, 0x9c, 0x8b, 0xa7, 0x01, 0x34, + 0x2b, 0x53, 0x36, 0x40, 0x0d, 0xb4, 0x1e, 0x0d, 0xfb, 0x48, 0x5a, 0x64, + 0xc1, 0x25, 0x2a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x21, + 0x60, 0x16, 0x18, 0xf9, 0x64, 0x21, 0x62, 0x64, 0xd6, 0xb6, 0xd1, 0x1a, + 0x5f, 0x05, 0x38, 0x07, 0x73, 0x40, 0x4d, 0x42, 0x98, 0x5e, 0xe7, 0xd7, + 0xb4, 0xb5, 0xc1, 0x82, 0xc4, 0x37, 0x8c, 0x12, 0x10, 0x99, 0x47, 0x2f, + 0xd6, 0xc4, 0xb7, 0x4c, 0x1b, 0xb0, 0xf0, 0x1a, 0xbc, 0x27, 0x2d, 0x10, + 0x8d, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x9f, 0x66, 0x4b, 0xe9, 0x3d, 0x20, 0xf2, 0x8c, 0xe0, 0x22, + 0xba, 0x5f, 0xa6, 0xf7, 0xa9, 0x68, 0x1a, 0x20, 0x82, 0x9f, 0x80, 0x13, + 0x6e, 0x17, 0x5e, 0xaa, 0xf7, 0xca, 0x54, 0x19, 0xe9, 0x62, 0x20, 0x9a, + 0x42, 0x3b, 0x86, 0x73, 0xfa, 0x94, 0x46, 0xc4, 0x5a, 0xce, 0x45, 0xde, + 0x50, 0xc3, 0xf4, 0x78, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x74, 0x5d, 0x68, 0x04, 0xc4, 0x4a, 0x9b, 0xed, 0x32, 0x83, 0xe1, 0x38, + 0xe3, 0xa2, 0x83, 0xf3, 0xf0, 0x89, 0x1f, 0x35, 0x71, 0x94, 0x62, 0xd9, + 0xbc, 0x14, 0xcd, 0x77, 0x3c, 0x86, 0xe3, 0x3a, 0x12, 0x10, 0xf9, 0x69, + 0x59, 0x63, 0x9e, 0x89, 0xa6, 0xed, 0x92, 0x3d, 0xed, 0xde, 0xb2, 0xac, + 0x6c, 0x9f, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xe2, 0x0f, 0x44, 0x5b, 0x1a, 0xbe, 0x31, 0x6e, 0x37, + 0xc0, 0xc2, 0x08, 0x41, 0xcc, 0xbf, 0xe1, 0x1a, 0x20, 0x06, 0xd7, 0x61, + 0x0a, 0x00, 0x4f, 0xf7, 0xb2, 0xfe, 0xd7, 0xf6, 0x23, 0x8a, 0xf7, 0xe6, + 0xe7, 0x70, 0xc5, 0x53, 0xc8, 0xb5, 0x3b, 0x65, 0xb2, 0x10, 0x13, 0x07, + 0xbc, 0x9d, 0x8d, 0xd6, 0xea, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xd8, 0xa8, 0xcf, 0xa8, 0x93, 0x21, 0x17, 0x19, 0xc6, 0xc0, 0xb8, + 0xdf, 0x10, 0xc0, 0x43, 0xc0, 0xdc, 0x63, 0xfd, 0xf4, 0xac, 0xd8, 0x5a, + 0x50, 0x63, 0x92, 0x18, 0xb6, 0x6a, 0x70, 0x1a, 0x31, 0x12, 0x10, 0x75, + 0xaf, 0x43, 0x00, 0x4f, 0x35, 0x38, 0x03, 0x64, 0x35, 0x2a, 0x08, 0x61, + 0x56, 0x40, 0x17, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x21, 0xfc, 0x75, 0xc1, 0xa0, 0xd2, 0xad, 0x73, + 0x7a, 0xb0, 0xa2, 0x65, 0x29, 0x0f, 0x2f, 0x85, 0x1a, 0x20, 0xd9, 0x46, + 0xc5, 0x05, 0x85, 0xe2, 0xad, 0xba, 0x26, 0xe7, 0x75, 0x34, 0x36, 0xc7, + 0x5a, 0x7a, 0x23, 0xe4, 0x5a, 0x3e, 0x93, 0xfd, 0xc3, 0xed, 0xa9, 0x9e, + 0x25, 0x5e, 0x62, 0xf8, 0xd5, 0x50, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x73, 0x5b, 0x4b, 0x89, 0x74, 0x78, 0xc3, 0xf6, 0x58, 0x08, + 0x45, 0xad, 0x4d, 0x38, 0x3b, 0x65, 0x77, 0x9a, 0x41, 0x7a, 0xf6, 0x36, + 0xc1, 0x77, 0x58, 0x58, 0xe0, 0x34, 0xaa, 0x0a, 0x95, 0x2e, 0x12, 0x10, + 0x6f, 0x59, 0xf5, 0xa5, 0x36, 0x94, 0xe2, 0xeb, 0x8b, 0x38, 0x0d, 0x24, + 0xb2, 0xef, 0x66, 0x9c, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x79, 0xc4, 0x1a, 0x5f, 0x7b, 0x31, 0xba, + 0x20, 0x0a, 0x5a, 0x36, 0x9b, 0x8f, 0x19, 0x9d, 0x0b, 0x1a, 0x20, 0x57, + 0x51, 0xa2, 0x07, 0x02, 0xc4, 0x6b, 0x86, 0xf6, 0x8b, 0xd7, 0xd9, 0x64, + 0xde, 0x50, 0xda, 0x46, 0x0d, 0x5e, 0x5c, 0xb2, 0x9a, 0xa0, 0xc0, 0xc5, + 0x6e, 0xd7, 0x89, 0xba, 0x70, 0xa3, 0xfb, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x8c, 0x60, 0x26, 0xa0, 0x8d, 0x7e, 0x13, 0xc8, 0xb3, + 0x2f, 0xb3, 0xbe, 0x02, 0xc4, 0x47, 0x9b, 0x33, 0x46, 0x9e, 0x03, 0xad, + 0xb8, 0x0c, 0x4a, 0x20, 0x29, 0x05, 0xf5, 0xd6, 0x94, 0xde, 0xea, 0x12, + 0x10, 0xfc, 0x40, 0xe4, 0xdc, 0xd2, 0xb6, 0xe2, 0x64, 0x33, 0x82, 0x57, + 0x05, 0xc9, 0xd2, 0x66, 0x97, 0x62, 0x00, 0x20, 0x9e, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xa1, 0xda, 0xad, 0xd2, 0xdc, 0x38, 0xbf, 0x7a, 0x26, 0x42, 0x2b, + 0x69, 0x95, 0x7a, 0xdf, 0x61, 0x98, 0x3d, 0x23, 0x79, 0x98, 0x02, + 0xb9, 0xb8, 0x74, 0x6e, 0xe2, 0x85, 0xd0, 0xbc, 0x37, 0xd3, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenHardTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xee, 0x1d, 0xf8, 0x39, 0x00, 0x00, 0x00, 0x1b, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xee, 0x1d, 0xf8, 0x39, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x71, 0x43, 0xb1, 0x83, 0x27, 0x37, 0xde, 0x60, + 0x3d, 0x17, 0x70, 0x20, 0x38, 0x81, 0x73, 0x4e, 0x3c, 0xb0, 0xdf, 0xdb, + 0x4f, 0xca, 0x85, 0xdc, 0xaf, 0x82, 0x81, 0x74, 0x55, 0xcb, 0x08, 0x7c, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x43, 0x34, 0x44, 0x42, 0x37, 0x30, 0x30, 0x41, + 0x33, 0x46, 0x41, 0x30, 0x37, 0x46, 0x31, 0x45, 0x31, 0x37, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x34, 0x44, 0x42, 0x37, 0x30, 0x30, 0x41, 0x33, 0x46, + 0x41, 0x30, 0x37, 0x46, 0x31, 0x45, 0x31, 0x37, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x57, 0x66, 0x8a, 0x39, 0x11, 0xb6, + 0x77, 0x19, 0xe9, 0x17, 0x38, 0x64, 0x40, 0x32, 0x48, 0xb6, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x4a, 0xd0, + 0x7d, 0x8b, 0x08, 0x44, 0xfa, 0x02, 0x9b, 0x96, 0xfe, 0x9d, 0xef, 0x0e, + 0x4e, 0xe1, 0x1a, 0x50, 0xd4, 0xe4, 0xba, 0x5b, 0xcb, 0xbe, 0xc1, 0xbf, + 0x16, 0x47, 0x58, 0x8e, 0x99, 0x27, 0x53, 0xf9, 0x15, 0xf8, 0xd9, 0xbc, + 0xb3, 0xb8, 0x93, 0x6e, 0xef, 0x44, 0x73, 0x72, 0xd6, 0x48, 0x00, 0xba, + 0x34, 0xdd, 0x83, 0x49, 0x28, 0x7b, 0x2f, 0xad, 0x99, 0x8d, 0xf7, 0x62, + 0xe5, 0x9f, 0x8c, 0x4e, 0xe5, 0xb9, 0xb4, 0xdc, 0x66, 0x4e, 0xf3, 0xb4, + 0xd0, 0x6b, 0xd9, 0x70, 0x49, 0xa9, 0xa1, 0x8a, 0xba, 0xeb, 0xe9, 0xad, + 0x8f, 0xa6, 0x82, 0x1a, 0xd8, 0x86, 0x90, 0xeb, 0x44, 0x78, 0x81, 0x5c, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x0b, 0xc4, 0x91, 0x6d, 0x22, 0x44, 0x1c, 0x65, 0xfc, 0xd9, 0xe5, + 0x42, 0x4a, 0x4a, 0x5f, 0xc8, 0x1a, 0x20, 0xca, 0xee, 0x3a, 0x29, 0xc4, + 0xe6, 0x83, 0x55, 0x50, 0x15, 0x04, 0x76, 0xaa, 0xa5, 0xd9, 0xff, 0x1e, + 0x62, 0xbc, 0x90, 0x08, 0x5b, 0xed, 0x39, 0x90, 0x09, 0xa4, 0xfc, 0x4c, + 0xe0, 0xd0, 0x73, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x9e, + 0xbf, 0x10, 0x61, 0xc8, 0x85, 0x9f, 0x76, 0x56, 0x11, 0xef, 0x64, 0x17, + 0x66, 0x47, 0xdd, 0x6b, 0x17, 0x72, 0x39, 0x95, 0xad, 0xd4, 0x16, 0x85, + 0x58, 0x9a, 0x96, 0xd4, 0x45, 0x70, 0xbd, 0x12, 0x10, 0x66, 0xf6, 0xfc, + 0x24, 0x70, 0x0b, 0xd5, 0x02, 0x84, 0x43, 0xb1, 0x07, 0x14, 0x9c, 0xec, + 0x71, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x15, 0x0e, 0x88, 0xf7, 0xc1, 0x33, 0xfc, 0xf6, 0x41, 0xe5, + 0xca, 0x50, 0x62, 0x00, 0x66, 0x1a, 0x1a, 0x20, 0xd9, 0x67, 0x4f, 0xc6, + 0x14, 0x3c, 0xd8, 0x1c, 0x07, 0xd4, 0x97, 0xfa, 0x86, 0x7f, 0xf2, 0x4b, + 0xcf, 0xaf, 0xfe, 0xd5, 0xd4, 0x1f, 0xd0, 0x84, 0xca, 0x87, 0x82, 0x1a, + 0xa6, 0x8b, 0x18, 0x94, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xca, 0x37, 0x48, 0xf3, 0xb6, 0x3b, 0xf8, 0xee, 0xfd, 0x7a, 0x81, 0x76, + 0xcb, 0x7b, 0x72, 0xb5, 0xd6, 0x5b, 0x6d, 0x29, 0xab, 0x45, 0xab, 0xbf, + 0x13, 0xc0, 0x9c, 0xf0, 0xd1, 0x7f, 0xcd, 0x1b, 0x12, 0x10, 0xf5, 0xef, + 0x74, 0xa1, 0x2c, 0xcb, 0x61, 0x58, 0xe6, 0xd9, 0xd9, 0x82, 0x2f, 0x04, + 0x2b, 0x8f, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x1d, 0x3d, 0x87, 0x74, 0x17, 0x76, 0x84, 0xf6, 0xa6, + 0xb2, 0xe4, 0x09, 0x40, 0x2f, 0xe3, 0x28, 0x1a, 0x20, 0x74, 0xf3, 0x9d, + 0x93, 0xfc, 0x7d, 0x96, 0xef, 0x38, 0x7f, 0x83, 0xcb, 0xef, 0xd4, 0xbb, + 0xd8, 0xac, 0xcf, 0x53, 0x73, 0x89, 0x79, 0x15, 0x84, 0x96, 0x1e, 0x1e, + 0x40, 0xc7, 0x97, 0xb6, 0xde, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xb0, 0x28, 0xc2, 0xcb, 0xd0, 0x3e, 0x8f, 0x9a, 0x71, 0xba, 0x3a, + 0xc4, 0xb4, 0x82, 0xe4, 0x5a, 0x0b, 0x3a, 0xea, 0xde, 0x95, 0xfe, 0x2c, + 0xa4, 0x84, 0xae, 0xd8, 0xa6, 0x37, 0xaf, 0x80, 0xe6, 0x12, 0x10, 0xc4, + 0xf5, 0x0f, 0x8b, 0xd0, 0x01, 0x55, 0xbf, 0xf4, 0xe0, 0xc8, 0xc9, 0x8a, + 0xdb, 0x08, 0xcc, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xfc, 0x73, 0x94, 0xdf, 0x09, 0xb0, 0x95, 0x27, + 0xdc, 0x8b, 0x8f, 0x2a, 0xca, 0xce, 0xfe, 0x0b, 0x1a, 0x20, 0xe1, 0x95, + 0xc9, 0x66, 0xbd, 0x7e, 0x0e, 0x91, 0x30, 0x4e, 0xa8, 0x87, 0xeb, 0xb0, + 0x4e, 0x3c, 0xa4, 0xe6, 0x20, 0x58, 0xb4, 0x4a, 0x5c, 0x3b, 0xc8, 0x1b, + 0x1c, 0x70, 0xc3, 0x47, 0x54, 0x9b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xe4, 0xe0, 0x3f, 0xf8, 0xf5, 0x8d, 0x04, 0xde, 0x3c, 0x9b, + 0x35, 0x29, 0x41, 0xde, 0x89, 0xff, 0xd2, 0x85, 0x3a, 0x25, 0xd6, 0x6a, + 0xfe, 0x6d, 0x6f, 0xcd, 0x8a, 0x86, 0xcf, 0x0c, 0x11, 0x6c, 0x12, 0x10, + 0xeb, 0xdf, 0x43, 0x6f, 0x70, 0xd7, 0xd4, 0xc4, 0xea, 0x4c, 0x26, 0x66, + 0xc3, 0x29, 0x85, 0x32, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xff, 0x74, 0x4b, 0x1a, 0x40, 0x30, 0x36, + 0x57, 0xd6, 0xf4, 0xfe, 0x17, 0xa7, 0xf7, 0x55, 0x5c, 0x1a, 0x20, 0x98, + 0x2a, 0x05, 0x45, 0xad, 0xbc, 0x78, 0xa0, 0xaa, 0x27, 0x58, 0xb7, 0x8b, + 0xfa, 0xb4, 0x69, 0x3a, 0xcf, 0x3f, 0xd3, 0x4d, 0x24, 0x47, 0xee, 0x62, + 0xbc, 0xd1, 0x94, 0xe1, 0x1c, 0x4a, 0x44, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x26, 0x6e, 0x71, 0xdc, 0xea, 0x2f, 0x2d, 0xab, 0xab, + 0x6a, 0x41, 0x46, 0xeb, 0x61, 0xdd, 0xf0, 0x65, 0x91, 0x23, 0x44, 0x33, + 0xd2, 0xcf, 0x7d, 0x3e, 0x48, 0xf6, 0x51, 0x03, 0xb6, 0x13, 0x2c, 0x12, + 0x10, 0x8a, 0x55, 0xc8, 0xc6, 0x0d, 0xd3, 0x5d, 0x1c, 0xbc, 0x1d, 0xa2, + 0x05, 0x2e, 0xdf, 0x0a, 0xd3, 0x62, 0x00, 0x20, 0xb6, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x71, 0x43, 0xb1, 0x83, 0x27, 0x37, 0xde, 0x60, 0x3d, 0x17, 0x70, + 0x20, 0x38, 0x81, 0x73, 0x4e, 0x3c, 0xb0, 0xdf, 0xdb, 0x4f, 0xca, + 0x85, 0xdc, 0xaf, 0x82, 0x81, 0x74, 0x55, 0xcb, 0x08, 0x7c, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenHardTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xfc, 0xe4, 0x61, 0x5a, 0x00, 0x00, 0x00, 0x1d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xfc, 0xe4, 0x61, 0x5a, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0x0f, 0x80, 0xfd, 0x7a, 0xcd, 0x94, 0x85, 0x49, + 0xa4, 0xf8, 0xfa, 0xc4, 0x3c, 0x16, 0x3e, 0xae, 0x45, 0x43, 0x1f, 0xde, + 0x67, 0x80, 0x60, 0x07, 0xca, 0xcf, 0x90, 0x69, 0x32, 0xd6, 0x2f, 0xaa, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x41, 0x38, 0x30, 0x44, 0x32, 0x35, 0x34, 0x30, + 0x42, 0x43, 0x42, 0x32, 0x39, 0x31, 0x44, 0x44, 0x31, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x41, 0x38, 0x30, 0x44, 0x32, 0x35, 0x34, 0x30, 0x42, 0x43, + 0x42, 0x32, 0x39, 0x31, 0x44, 0x44, 0x31, 0x39, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xce, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xd7, 0x15, + 0x55, 0xd3, 0x0d, 0x37, 0xeb, 0x93, 0xc0, 0xb3, 0x80, 0x4b, 0x0d, 0x16, + 0x90, 0x8a, 0x1a, 0x50, 0xd5, 0xdf, 0xff, 0xad, 0x0d, 0xb3, 0x37, 0x0e, + 0x37, 0xaa, 0xfc, 0x71, 0xd0, 0xfb, 0x60, 0xf8, 0xdd, 0x14, 0x13, 0xa8, + 0x1c, 0x6f, 0x76, 0x13, 0xba, 0xe6, 0x91, 0xf3, 0x36, 0x06, 0x27, 0xf2, + 0xb0, 0x86, 0xaa, 0xb2, 0xa6, 0xd5, 0x02, 0x38, 0x31, 0x84, 0x72, 0xc0, + 0xd1, 0xe3, 0x56, 0x21, 0x84, 0xf4, 0xff, 0xe6, 0xd2, 0x27, 0xe9, 0x71, + 0x39, 0x29, 0x24, 0xf4, 0xd6, 0x43, 0x04, 0xbb, 0x9e, 0xe5, 0x7c, 0x16, + 0x6e, 0xa9, 0x01, 0x33, 0x05, 0xf0, 0x26, 0x22, 0x5f, 0x2e, 0x40, 0x4a, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xe9, 0x02, 0x22, 0x11, 0x37, 0x09, 0x6c, 0x60, 0xda, 0x14, 0x4b, + 0x40, 0xa5, 0x27, 0x17, 0x49, 0x1a, 0x20, 0xaa, 0x82, 0x59, 0xc9, 0x51, + 0x0b, 0xf2, 0x3c, 0x03, 0x0b, 0xaf, 0xe5, 0x38, 0x9c, 0x5a, 0x22, 0xd1, + 0xe6, 0x93, 0x47, 0x49, 0xe1, 0x61, 0xd1, 0x8e, 0x24, 0xc3, 0x8e, 0xba, + 0x40, 0x8e, 0xc0, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xf1, + 0xdc, 0x54, 0x6a, 0x68, 0x71, 0x8e, 0x24, 0x08, 0xef, 0xf9, 0x05, 0x70, + 0x88, 0x09, 0xe1, 0xf2, 0x0b, 0x52, 0xef, 0x21, 0x0e, 0x10, 0x03, 0x75, + 0xb0, 0x34, 0x1a, 0x80, 0x0b, 0xff, 0x96, 0x12, 0x10, 0x61, 0x66, 0xdb, + 0x5d, 0x32, 0xc3, 0x13, 0x75, 0xe2, 0x33, 0xa0, 0xf1, 0xe4, 0xd1, 0x80, + 0xc2, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x1d, 0x46, 0xff, 0x55, 0xf7, 0x4a, 0xc7, 0x9a, 0xa7, 0x06, + 0xc4, 0xfb, 0x4e, 0x13, 0x80, 0xac, 0x1a, 0x20, 0x43, 0x33, 0x9b, 0x99, + 0x2a, 0xe2, 0x0e, 0x15, 0x75, 0x5f, 0x16, 0xc3, 0x86, 0x80, 0xd1, 0x84, + 0xa1, 0x28, 0x10, 0xd6, 0xd7, 0x5a, 0x5d, 0x21, 0xf7, 0xba, 0x16, 0xb5, + 0x78, 0x5c, 0xd0, 0x71, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x7b, 0xcb, 0x38, 0xc6, 0x79, 0xc8, 0x58, 0x28, 0xf3, 0x2c, 0x6d, 0x77, + 0xca, 0x24, 0xe0, 0x48, 0x5d, 0xaa, 0x67, 0xd1, 0x03, 0x74, 0x98, 0x3c, + 0xf9, 0xd8, 0x9a, 0x96, 0xaf, 0x43, 0xad, 0xe6, 0x12, 0x10, 0x07, 0xb9, + 0xec, 0x1d, 0x87, 0x24, 0x4f, 0x6c, 0x84, 0x9d, 0x32, 0x9c, 0xd5, 0xb4, + 0x34, 0xf1, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x74, 0x73, 0x42, 0xb3, 0x99, 0x90, 0xe0, 0xf4, 0xde, + 0xd8, 0xae, 0x6a, 0x63, 0x55, 0x0a, 0xeb, 0x1a, 0x20, 0x21, 0xe8, 0xcc, + 0xfc, 0xa1, 0x4b, 0xf6, 0xc6, 0xd6, 0xd4, 0xaf, 0xa7, 0x1f, 0x51, 0xe3, + 0x11, 0x5d, 0xdc, 0x79, 0x91, 0xa3, 0xc8, 0xc8, 0x0f, 0xbb, 0xc1, 0x80, + 0xd1, 0xc9, 0xd5, 0x4b, 0x95, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x6e, 0x4d, 0x4b, 0x4f, 0x3b, 0xd9, 0x24, 0x6a, 0x7c, 0x66, 0xd4, + 0xe8, 0x05, 0xcb, 0xff, 0x49, 0x5d, 0x20, 0xd7, 0x99, 0xa0, 0x3d, 0x70, + 0x8b, 0x77, 0xc4, 0x10, 0x41, 0xc0, 0x41, 0xa8, 0x08, 0x12, 0x10, 0xa9, + 0x91, 0x20, 0xfd, 0x85, 0x2e, 0x0f, 0xe1, 0xab, 0x44, 0x8a, 0x15, 0xcf, + 0x25, 0x97, 0xb3, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xbd, 0xb0, 0x07, 0x40, 0x92, 0x6d, 0x6c, 0xda, + 0x13, 0x5d, 0x3e, 0xcb, 0xc2, 0x06, 0x57, 0xa5, 0x1a, 0x20, 0x79, 0xd7, + 0x2d, 0x0e, 0x34, 0x14, 0xbf, 0x0e, 0x06, 0xac, 0x29, 0xa0, 0xc2, 0x1e, + 0xee, 0xb0, 0xbe, 0x66, 0x77, 0x2c, 0x4f, 0x6b, 0xfa, 0x4c, 0x13, 0x06, + 0x15, 0x34, 0xc2, 0xaf, 0x9e, 0x07, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x5d, 0xf5, 0x4a, 0xc7, 0x2e, 0x21, 0x9a, 0xef, 0x60, 0xa6, + 0x20, 0xc8, 0xbc, 0xb5, 0xf5, 0x83, 0xeb, 0xe3, 0xef, 0x0f, 0xcd, 0xd7, + 0x7c, 0x76, 0xe9, 0xbc, 0x4d, 0x68, 0xe8, 0x91, 0xe5, 0x33, 0x12, 0x10, + 0xa2, 0xfd, 0x01, 0x4e, 0x14, 0xeb, 0x64, 0xc2, 0x22, 0x95, 0xcb, 0xd1, + 0x96, 0xcb, 0x55, 0xcf, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xe9, 0x78, 0xdb, 0x2f, 0xf4, 0x7c, 0x7d, + 0xc3, 0x58, 0x27, 0x66, 0xa6, 0xa2, 0x8d, 0x52, 0xd4, 0x1a, 0x20, 0x9e, + 0x9d, 0x2c, 0xec, 0xd6, 0x26, 0x01, 0xd6, 0xfe, 0x61, 0x65, 0x71, 0xd1, + 0x22, 0x20, 0xff, 0x4a, 0x15, 0x1a, 0xb0, 0x45, 0x0b, 0x1d, 0x3b, 0x4c, + 0xd1, 0x14, 0x98, 0x05, 0xe7, 0xc9, 0x10, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x71, 0x0f, 0xb7, 0xde, 0x04, 0x2f, 0x8a, 0xa9, 0x93, + 0xf9, 0xd9, 0x67, 0x1e, 0xdc, 0xd2, 0x6d, 0x5e, 0xa6, 0xec, 0xe0, 0xb7, + 0x96, 0x35, 0x70, 0x10, 0x3a, 0x5d, 0x47, 0x19, 0xf6, 0x7c, 0x07, 0x12, + 0x10, 0x84, 0xea, 0x58, 0xb7, 0x69, 0x3e, 0x60, 0x3c, 0x3c, 0x5c, 0x0f, + 0x7f, 0x1e, 0x32, 0xb4, 0x8f, 0x62, 0x00, 0x20, 0xce, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x0f, 0x80, 0xfd, 0x7a, 0xcd, 0x94, 0x85, 0x49, 0xa4, 0xf8, 0xfa, + 0xc4, 0x3c, 0x16, 0x3e, 0xae, 0x45, 0x43, 0x1f, 0xde, 0x67, 0x80, + 0x60, 0x07, 0xca, 0xcf, 0x90, 0x69, 0x32, 0xd6, 0x2f, 0xaa, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenHardTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x4e, 0x8a, 0xc3, 0x44, 0x00, 0x00, 0x00, 0x1f, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x4e, 0x8a, 0xc3, 0x44, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x94, 0x16, 0x0c, 0x7d, 0x78, 0x8f, 0xd9, 0x6b, + 0x26, 0x18, 0xf2, 0xe5, 0x71, 0xd1, 0x9c, 0x91, 0xc0, 0x7e, 0x8c, 0x31, + 0xd9, 0xca, 0x93, 0x68, 0x2c, 0xaa, 0x96, 0xe7, 0x02, 0x55, 0x98, 0x80, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x32, 0x45, 0x36, 0x31, 0x46, 0x32, 0x38, 0x44, + 0x38, 0x44, 0x36, 0x44, 0x33, 0x45, 0x41, 0x42, 0x31, 0x42, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x32, 0x45, 0x36, 0x31, 0x46, 0x32, 0x38, 0x44, 0x38, 0x44, + 0x36, 0x44, 0x33, 0x45, 0x41, 0x42, 0x31, 0x42, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x8f, 0xc3, 0x52, 0x78, 0xd6, 0x7f, + 0x3f, 0x36, 0x4d, 0xfa, 0x38, 0x64, 0x40, 0x32, 0x48, 0xe6, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x4b, 0x3a, + 0x33, 0xf3, 0xb0, 0x1c, 0x81, 0x92, 0xb5, 0x71, 0x7c, 0xa3, 0xde, 0x3c, + 0x8b, 0x24, 0x1a, 0x50, 0x88, 0xe4, 0x84, 0x16, 0x64, 0x85, 0xc1, 0x57, + 0x59, 0xc6, 0x74, 0x91, 0xb7, 0x57, 0x18, 0x7e, 0x99, 0xb0, 0x52, 0x1b, + 0xce, 0x35, 0x02, 0xdb, 0xf5, 0xb6, 0x10, 0xad, 0x2d, 0x07, 0x39, 0xee, + 0x76, 0x6f, 0x0e, 0x33, 0xee, 0xb5, 0x1a, 0x88, 0x90, 0x58, 0x6f, 0x20, + 0xed, 0x12, 0x6b, 0x74, 0xe0, 0xbe, 0x45, 0x8e, 0x7c, 0x19, 0xde, 0xeb, + 0xea, 0x00, 0xf1, 0x2c, 0x1f, 0x97, 0x06, 0xf5, 0x94, 0x3a, 0x31, 0xa5, + 0x9e, 0xac, 0x5d, 0xe0, 0x65, 0x61, 0x22, 0x36, 0xbb, 0x4a, 0xc7, 0xac, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xc2, 0xf1, 0xb5, 0x5a, 0xa3, 0xb7, 0x71, 0xe8, 0x92, 0x27, 0x8c, + 0x2f, 0x10, 0xf5, 0x1e, 0x81, 0x1a, 0x20, 0xcb, 0x99, 0xdd, 0xc9, 0x56, + 0x2e, 0x99, 0xb1, 0x20, 0x5e, 0x4d, 0x3a, 0xdf, 0xd2, 0x3c, 0x60, 0xd7, + 0x05, 0xa4, 0x61, 0x1d, 0xf9, 0x84, 0xc4, 0x15, 0xd2, 0x23, 0x89, 0x85, + 0xb5, 0xd6, 0x63, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xbd, + 0xd7, 0x09, 0xad, 0x66, 0xb5, 0x47, 0x76, 0x5f, 0xc4, 0x8a, 0x56, 0x15, + 0x91, 0x39, 0xc8, 0x46, 0x07, 0xd2, 0xe0, 0x01, 0x1d, 0xe4, 0x28, 0xf0, + 0x30, 0xc5, 0xa1, 0xae, 0x18, 0xee, 0x27, 0x12, 0x10, 0x9e, 0x1a, 0xef, + 0x44, 0x95, 0x86, 0x4a, 0x4a, 0xa6, 0x18, 0x81, 0x72, 0x4f, 0x6c, 0x60, + 0x34, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xe3, 0xfb, 0x51, 0x35, 0xb5, 0xef, 0x13, 0x15, 0x72, 0xa9, + 0xe6, 0x4a, 0xb2, 0x0b, 0xe9, 0x9e, 0x1a, 0x20, 0x17, 0xca, 0xfc, 0xa0, + 0x7c, 0xb3, 0xfd, 0x1c, 0x33, 0xde, 0x6d, 0x9a, 0x7c, 0xd5, 0xb4, 0x27, + 0xf2, 0xb8, 0x66, 0x4f, 0xa2, 0xa2, 0xc2, 0xb0, 0x5b, 0xdb, 0xc0, 0xec, + 0x16, 0x6f, 0x41, 0x49, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x28, 0xda, 0x1f, 0x75, 0x54, 0xb5, 0x19, 0x14, 0xcb, 0xc7, 0xd6, 0x55, + 0x9a, 0x42, 0x25, 0x3c, 0x11, 0xc6, 0x0d, 0x4f, 0x58, 0xc2, 0x82, 0x24, + 0xb5, 0x70, 0x3d, 0x4e, 0x9f, 0x9e, 0x65, 0xb3, 0x12, 0x10, 0xbb, 0xbe, + 0xdd, 0xf9, 0x9c, 0x87, 0x46, 0xa9, 0xc5, 0xf4, 0xf1, 0xba, 0x17, 0xb0, + 0x57, 0xc2, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x52, 0x8b, 0xa5, 0x14, 0xa3, 0x6e, 0x61, 0x25, 0xfd, + 0x1f, 0x81, 0xab, 0xf9, 0xa0, 0xb4, 0x8d, 0x1a, 0x20, 0xdd, 0xf7, 0x6a, + 0xfb, 0x24, 0x52, 0x04, 0x35, 0x04, 0x0e, 0xba, 0x7e, 0xa8, 0x6a, 0x2f, + 0x47, 0xc7, 0x97, 0xa2, 0x4b, 0x11, 0xd0, 0x68, 0x16, 0x89, 0x6b, 0x7e, + 0x14, 0xc4, 0x96, 0x53, 0x81, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x13, 0x3d, 0x3e, 0x8e, 0x56, 0x3e, 0xdf, 0xb6, 0x3a, 0x66, 0x01, + 0x87, 0xfe, 0x7d, 0xb1, 0x8d, 0x5d, 0xbd, 0x55, 0xca, 0x64, 0x65, 0x30, + 0xda, 0x19, 0xcb, 0x00, 0x9d, 0xa8, 0x48, 0x7c, 0x12, 0x12, 0x10, 0x3e, + 0xfc, 0x52, 0xec, 0xe3, 0x3c, 0x51, 0x7e, 0x06, 0x85, 0x0e, 0xe7, 0xcb, + 0x12, 0xb4, 0x63, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x76, 0x44, 0x2c, 0xf7, 0x31, 0x85, 0xd8, 0xc4, + 0xbe, 0xe4, 0x62, 0xbc, 0x3d, 0xc6, 0x0d, 0x9e, 0x1a, 0x20, 0x47, 0xe0, + 0xd6, 0xb2, 0xd8, 0x72, 0xa9, 0x74, 0x85, 0x5c, 0x9a, 0x01, 0x44, 0xf7, + 0x18, 0x13, 0xba, 0x12, 0xce, 0x85, 0xb8, 0xd4, 0xf3, 0xc6, 0x43, 0x35, + 0xb9, 0x4d, 0xe5, 0x29, 0x9a, 0x30, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xbe, 0x1e, 0xa8, 0x86, 0xfa, 0x05, 0xc5, 0xd5, 0x6e, 0xfb, + 0x3f, 0xb5, 0x24, 0x27, 0x02, 0x01, 0x1c, 0x3f, 0x4d, 0xa5, 0x54, 0x24, + 0x5a, 0xca, 0x0c, 0xb6, 0xd3, 0xc4, 0x6a, 0xcd, 0x08, 0x50, 0x12, 0x10, + 0xa0, 0x2b, 0xe6, 0x6c, 0xad, 0x18, 0xe8, 0xb5, 0xcf, 0x12, 0x74, 0x7a, + 0xc0, 0x88, 0x06, 0x5a, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xc8, 0xdb, 0x06, 0x9c, 0x18, 0x16, 0x4d, + 0xc0, 0xbb, 0x97, 0xbe, 0x9e, 0x29, 0x92, 0xec, 0xbd, 0x1a, 0x20, 0x01, + 0x17, 0x9d, 0xfb, 0x0d, 0x6e, 0x7f, 0x87, 0x89, 0xd9, 0x12, 0x86, 0x2c, + 0xf4, 0xc8, 0xe6, 0x02, 0xba, 0xdb, 0x3e, 0x22, 0xba, 0x68, 0xbc, 0xaa, + 0xd2, 0xcb, 0xca, 0x42, 0x68, 0x68, 0x93, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x8e, 0x1e, 0x19, 0x6d, 0x80, 0xb6, 0x0a, 0x72, 0x74, + 0x40, 0x24, 0xe5, 0x96, 0x8b, 0x1f, 0x83, 0xb7, 0x5b, 0xb7, 0xa3, 0x96, + 0xf1, 0xe3, 0x54, 0x68, 0xc3, 0x6b, 0x8e, 0x4f, 0x64, 0x4d, 0x78, 0x12, + 0x10, 0x41, 0xf4, 0xee, 0x15, 0x04, 0xf5, 0x50, 0x3b, 0x56, 0xae, 0xd9, + 0x5f, 0x48, 0xe6, 0x5a, 0x01, 0x62, 0x00, 0x20, 0xe6, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x94, 0x16, 0x0c, 0x7d, 0x78, 0x8f, 0xd9, 0x6b, 0x26, 0x18, 0xf2, + 0xe5, 0x71, 0xd1, 0x9c, 0x91, 0xc0, 0x7e, 0x8c, 0x31, 0xd9, 0xca, + 0x93, 0x68, 0x2c, 0xaa, 0x96, 0xe7, 0x02, 0x55, 0x98, 0x80, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenSoftTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xb7, 0x3c, 0x29, 0x2b, 0x00, 0x00, 0x00, 0x21, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xb7, 0x3c, 0x29, 0x2b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xbc, 0x8a, 0xed, 0x13, 0x8e, 0x2a, 0x7a, 0x2f, + 0x2f, 0x42, 0x58, 0x27, 0x80, 0x8b, 0xf1, 0xd3, 0xb6, 0xc6, 0x25, 0x1b, + 0x08, 0x4a, 0x91, 0x8f, 0xf1, 0xf6, 0x30, 0xbf, 0xd3, 0x2c, 0x54, 0x6f, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x42, 0x42, 0x30, 0x32, 0x46, 0x31, 0x38, 0x41, + 0x34, 0x35, 0x42, 0x36, 0x35, 0x39, 0x46, 0x45, 0x31, 0x44, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x42, 0x30, 0x32, 0x46, 0x31, 0x38, 0x41, 0x34, 0x35, + 0x42, 0x36, 0x35, 0x39, 0x46, 0x45, 0x31, 0x44, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xfe, 0x93, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x92, 0x63, + 0x08, 0xf8, 0xf7, 0x97, 0x3b, 0xac, 0x40, 0x20, 0x16, 0x44, 0x51, 0x4e, + 0xef, 0xc0, 0x1a, 0x50, 0xe2, 0x88, 0x54, 0xed, 0x2c, 0x6f, 0xb4, 0xd5, + 0x07, 0xc5, 0x8b, 0x48, 0x21, 0x08, 0xb1, 0x37, 0x6a, 0x32, 0xa5, 0x2a, + 0x95, 0xad, 0x44, 0xa6, 0xcc, 0xa8, 0x3e, 0xe7, 0xcb, 0x47, 0x82, 0x81, + 0x9a, 0x1e, 0x8a, 0x2d, 0xaa, 0xe5, 0xd8, 0xec, 0xe5, 0x4b, 0x19, 0x51, + 0x8f, 0x3f, 0x47, 0xf8, 0xe8, 0xbc, 0xe1, 0x2e, 0xca, 0x75, 0x2b, 0xe0, + 0x33, 0xdf, 0x6a, 0xba, 0xb8, 0x47, 0x5f, 0x34, 0x55, 0x93, 0x2e, 0x71, + 0x4a, 0x10, 0x1d, 0xd0, 0x5f, 0xb3, 0x13, 0xff, 0x1f, 0xc0, 0x21, 0x63, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x6d, 0x6c, 0xd3, 0x3d, 0xe3, 0x05, 0x1a, 0xee, 0x3d, 0x84, 0x43, + 0xe0, 0xb1, 0xea, 0x03, 0x40, 0x1a, 0x20, 0xfc, 0xed, 0xeb, 0xb9, 0x18, + 0x01, 0xf4, 0x97, 0x76, 0x6b, 0x8f, 0x64, 0x18, 0x57, 0x45, 0x46, 0x81, + 0x7a, 0xd0, 0x24, 0xf7, 0xc4, 0x98, 0x5d, 0xe4, 0xa2, 0x9f, 0x0b, 0x36, + 0x79, 0xbc, 0x94, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x92, + 0x7b, 0x02, 0x5b, 0xd6, 0xad, 0x1c, 0x44, 0xea, 0xaa, 0xba, 0xc7, 0x04, + 0xf7, 0xd8, 0x59, 0xe2, 0x0c, 0xfa, 0x60, 0x61, 0xcb, 0x6c, 0xe4, 0x0c, + 0x19, 0x6b, 0x84, 0x3e, 0x94, 0x9c, 0x8c, 0x12, 0x10, 0x49, 0xc6, 0x25, + 0x52, 0x60, 0xa8, 0xb0, 0x56, 0xfc, 0xa8, 0x93, 0x3e, 0x28, 0x48, 0x86, + 0x77, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x90, 0x2f, 0x95, 0x8b, 0xb1, 0x1a, 0x5d, 0xfa, 0xa1, 0xdb, + 0x5c, 0x0b, 0x6d, 0x63, 0x7e, 0x37, 0x1a, 0x20, 0xa0, 0xbc, 0x36, 0x16, + 0x3e, 0x5b, 0x3b, 0xf9, 0x91, 0x13, 0xd7, 0x16, 0xfc, 0x6f, 0xb0, 0xce, + 0x77, 0xb4, 0xa4, 0x94, 0x5a, 0xc3, 0xe9, 0x06, 0x07, 0xa6, 0xca, 0x65, + 0x71, 0xc0, 0x99, 0xee, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x7d, 0xe7, 0x3e, 0x33, 0xb1, 0x83, 0x69, 0x8c, 0xb2, 0xc5, 0x24, 0x00, + 0xbb, 0x03, 0xf8, 0x14, 0x9d, 0x3c, 0x2b, 0x06, 0x97, 0x93, 0xc4, 0x1a, + 0x14, 0x9e, 0xa7, 0x07, 0xb3, 0x49, 0x1e, 0xc3, 0x12, 0x10, 0xc0, 0xf7, + 0x85, 0x08, 0x8e, 0xdc, 0xe7, 0xaa, 0x9f, 0x58, 0x0f, 0xbb, 0x17, 0x5f, + 0x41, 0x12, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x69, 0xb3, 0x06, 0x50, 0x61, 0xf8, 0xac, 0x8c, 0x92, + 0xcb, 0x00, 0xa2, 0x5c, 0xbb, 0x93, 0x22, 0x1a, 0x20, 0xf1, 0xcf, 0x47, + 0x27, 0x71, 0xbe, 0xb4, 0xc9, 0x22, 0xea, 0x72, 0xf4, 0x7d, 0x43, 0x3a, + 0xf5, 0xc1, 0x57, 0xcc, 0x83, 0xce, 0xfa, 0xc5, 0x89, 0x6c, 0x32, 0xbd, + 0xf7, 0xf0, 0xfc, 0xcf, 0x52, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xbb, 0xc4, 0x7e, 0x6d, 0xd8, 0x97, 0x49, 0x8f, 0xc1, 0xea, 0x10, + 0xd4, 0x69, 0x23, 0x84, 0xff, 0xcb, 0x24, 0xdd, 0x8d, 0x18, 0xc0, 0xf3, + 0xc7, 0xe1, 0x07, 0x3f, 0x09, 0x7c, 0x43, 0x2a, 0xe6, 0x12, 0x10, 0x09, + 0x0d, 0x66, 0xb9, 0xe3, 0xf6, 0x09, 0x92, 0x4b, 0xe8, 0x61, 0xdc, 0x89, + 0xcf, 0x51, 0x87, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xfa, 0x6e, 0x0e, 0x12, 0x3c, 0x83, 0x86, 0x5b, + 0x75, 0x73, 0xce, 0xcf, 0xf5, 0x3a, 0x4a, 0xd8, 0x1a, 0x20, 0xd6, 0x5b, + 0xbf, 0xb7, 0x30, 0x93, 0xeb, 0x69, 0x7e, 0xab, 0x6d, 0x6c, 0xb7, 0x54, + 0xb2, 0x96, 0x4c, 0xcf, 0x5d, 0x5e, 0xe5, 0x65, 0x8e, 0x40, 0x19, 0xd1, + 0x58, 0x02, 0x6c, 0x0f, 0x64, 0x68, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x05, 0x97, 0xc6, 0xf4, 0x16, 0xe4, 0x0b, 0x87, 0x4a, 0xc4, + 0xdb, 0x66, 0x56, 0x47, 0x01, 0x18, 0xee, 0x5b, 0x56, 0x2e, 0xde, 0x8a, + 0x9f, 0x2c, 0x1a, 0x81, 0x49, 0xba, 0x63, 0xdc, 0x75, 0xfb, 0x12, 0x10, + 0x6a, 0x26, 0x99, 0x34, 0x94, 0x25, 0x65, 0xf2, 0x26, 0xf3, 0xba, 0x20, + 0x2c, 0x02, 0x76, 0x08, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x0a, 0x21, 0x35, 0xd9, 0x86, 0xd6, 0x18, + 0x2d, 0x23, 0xa3, 0xad, 0x7f, 0xe9, 0xdd, 0xa5, 0xb4, 0x1a, 0x20, 0xe0, + 0xd5, 0xa0, 0xfc, 0x7e, 0xfd, 0xf2, 0xaa, 0xd1, 0x6a, 0xe8, 0x7d, 0xa3, + 0x44, 0x36, 0xd0, 0xed, 0xe4, 0x23, 0xca, 0x01, 0x9a, 0x72, 0xf5, 0x7c, + 0x10, 0x67, 0x2c, 0xec, 0x3c, 0x14, 0xba, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0xc8, 0xd9, 0xa2, 0x1a, 0xa1, 0x4f, 0x0a, 0x5a, 0x7f, + 0x07, 0x1d, 0x3d, 0xd3, 0x3a, 0x49, 0xc3, 0x88, 0x43, 0x6f, 0xb6, 0x27, + 0x96, 0xd3, 0xfb, 0xd6, 0x69, 0xfa, 0x36, 0x4b, 0xb6, 0xf9, 0x29, 0x12, + 0x10, 0xbe, 0xac, 0x8b, 0x87, 0x64, 0x70, 0xe4, 0x6a, 0x16, 0x33, 0x33, + 0xac, 0x49, 0x58, 0xb0, 0x80, 0x62, 0x00, 0x20, 0xfe, 0x93, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xbc, 0x8a, 0xed, 0x13, 0x8e, 0x2a, 0x7a, 0x2f, 0x2f, 0x42, 0x58, + 0x27, 0x80, 0x8b, 0xf1, 0xd3, 0xb6, 0xc6, 0x25, 0x1b, 0x08, 0x4a, + 0x91, 0x8f, 0xf1, 0xf6, 0x30, 0xbf, 0xd3, 0x2c, 0x54, 0x6f, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenSoftTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xb0, 0x3b, 0xbe, 0xbe, 0x00, 0x00, 0x00, 0x23, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xb0, 0x3b, 0xbe, 0xbe, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x7b, 0x3f, 0x25, 0xae, 0x8c, 0x6b, 0x9a, 0x5f, + 0x77, 0xb9, 0xc2, 0x9e, 0xed, 0xcf, 0xb1, 0x44, 0xe3, 0x1f, 0x65, 0xf7, + 0x0f, 0x3e, 0x6f, 0x6a, 0xe9, 0x25, 0xa6, 0x84, 0xfa, 0x68, 0x54, 0x88, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x42, 0x34, 0x30, 0x43, 0x33, 0x39, 0x35, + 0x33, 0x43, 0x44, 0x35, 0x30, 0x32, 0x42, 0x34, 0x31, 0x46, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x42, 0x34, 0x30, 0x43, 0x33, 0x39, 0x35, 0x33, 0x43, + 0x44, 0x35, 0x30, 0x32, 0x42, 0x34, 0x31, 0x46, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x22, 0x24, 0x62, 0xda, 0x63, 0x87, + 0x90, 0x27, 0xf9, 0x5e, 0x38, 0x64, 0x40, 0x32, 0x48, 0x96, 0x94, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x32, 0xf1, + 0xaa, 0x8f, 0xae, 0x98, 0x56, 0x5c, 0xf0, 0x6a, 0x1e, 0xc3, 0x70, 0x8f, + 0x2a, 0x1c, 0x1a, 0x50, 0x8a, 0xd6, 0x1a, 0xd2, 0xb8, 0x71, 0x4e, 0xe1, + 0xb3, 0xcf, 0xe4, 0x4d, 0xfd, 0xe4, 0xf2, 0xe9, 0xa9, 0x54, 0x6c, 0x22, + 0x0a, 0xb6, 0x96, 0x53, 0x3c, 0x67, 0x3a, 0x42, 0x33, 0x9e, 0x04, 0xfd, + 0x2a, 0x36, 0x5b, 0x32, 0xd0, 0x3f, 0x53, 0x47, 0x2c, 0xfe, 0x88, 0x66, + 0x39, 0x39, 0xdb, 0x55, 0x24, 0x47, 0x46, 0xf2, 0x4b, 0xec, 0xa0, 0x38, + 0x00, 0x3f, 0xbc, 0x1e, 0x90, 0x8f, 0x5d, 0x13, 0x66, 0xae, 0xd4, 0x45, + 0x2f, 0xf0, 0x59, 0xb2, 0x26, 0x77, 0xff, 0xbf, 0x05, 0xc1, 0xef, 0x2e, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x97, 0x3c, 0x0c, 0xe7, 0x36, 0x26, 0xec, 0x31, 0x69, 0x61, 0xc7, + 0x07, 0x13, 0x28, 0xf3, 0x7b, 0x1a, 0x20, 0xa1, 0xa7, 0xc7, 0x11, 0x58, + 0xd2, 0x9a, 0x01, 0xaa, 0xca, 0x13, 0x71, 0x62, 0x3b, 0xcb, 0x07, 0xde, + 0x51, 0x0f, 0x4a, 0x16, 0xed, 0xef, 0x15, 0xb0, 0x04, 0x12, 0x5b, 0xd6, + 0x45, 0xeb, 0x0b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x79, + 0x30, 0x57, 0xcd, 0x15, 0x65, 0x0e, 0x51, 0xc3, 0x77, 0x53, 0xf0, 0x3d, + 0xb2, 0x6b, 0x3a, 0x82, 0xb3, 0x21, 0xe1, 0xc8, 0x30, 0x71, 0x04, 0xa3, + 0x1e, 0x17, 0x4b, 0x98, 0x94, 0x49, 0x79, 0x12, 0x10, 0x5d, 0x87, 0xa9, + 0xa3, 0x19, 0xf9, 0x04, 0x76, 0x67, 0x06, 0xc7, 0x3b, 0xf0, 0x25, 0x8e, + 0xcf, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x37, 0x76, 0x5d, 0xbd, 0xec, 0xf6, 0xe8, 0x27, 0x98, 0xa9, + 0x25, 0x99, 0xaa, 0x06, 0xa7, 0xfd, 0x1a, 0x20, 0xbb, 0x8d, 0x11, 0x51, + 0x93, 0x12, 0x68, 0xcd, 0x06, 0x43, 0x58, 0xd1, 0x3c, 0x35, 0xb7, 0xcb, + 0x1f, 0xc7, 0x99, 0x09, 0x72, 0xc4, 0x71, 0xe9, 0x2c, 0x50, 0x63, 0x59, + 0x79, 0x3b, 0x4c, 0xe0, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x2c, 0x51, 0xc9, 0xae, 0x8d, 0x26, 0xfc, 0xd4, 0xc7, 0x8e, 0xb3, 0xf7, + 0x17, 0x10, 0x39, 0x7f, 0xf7, 0xbd, 0x99, 0x83, 0x5f, 0x7e, 0xf3, 0x48, + 0x62, 0xaa, 0x9c, 0x78, 0xd5, 0xfb, 0x3c, 0x5e, 0x12, 0x10, 0x89, 0xdd, + 0xf2, 0x8c, 0xe2, 0xa0, 0x25, 0xc0, 0x10, 0x99, 0x88, 0x0a, 0x5a, 0xd3, + 0xcc, 0x00, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xe4, 0x53, 0x34, 0xb3, 0x64, 0x16, 0xe8, 0x2b, 0x2c, + 0x34, 0x58, 0x8e, 0x6a, 0x78, 0x18, 0xe7, 0x1a, 0x20, 0xea, 0x84, 0xde, + 0xe4, 0x54, 0x55, 0xb8, 0x48, 0x0c, 0xe1, 0xb2, 0x90, 0x4f, 0x69, 0xe0, + 0x13, 0xc9, 0xd0, 0x76, 0xfa, 0xd5, 0x99, 0x52, 0x9d, 0x30, 0xdb, 0x64, + 0x46, 0x5e, 0x6c, 0x29, 0x6d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x88, 0x6c, 0x53, 0x39, 0x49, 0x22, 0x4b, 0x58, 0x67, 0x73, 0x23, + 0x82, 0xa7, 0x19, 0xd0, 0x36, 0x4c, 0xfd, 0x4e, 0x9a, 0x74, 0x4d, 0xd5, + 0xb2, 0x22, 0xe0, 0x8e, 0x08, 0x55, 0xe6, 0x67, 0x0d, 0x12, 0x10, 0xf9, + 0xd2, 0xba, 0x30, 0xad, 0xc7, 0xfd, 0x52, 0x20, 0x63, 0x42, 0x29, 0x22, + 0x9d, 0x92, 0x39, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x29, 0x0c, 0x6e, 0x61, 0x58, 0xef, 0xcb, 0x9a, + 0xbd, 0x33, 0x0a, 0x01, 0x3a, 0xf8, 0xc0, 0x02, 0x1a, 0x20, 0x8f, 0xb7, + 0x32, 0xaf, 0x35, 0xc7, 0xc5, 0x99, 0xef, 0xb6, 0x0f, 0xf5, 0xba, 0x19, + 0x98, 0xcc, 0x88, 0x7f, 0x76, 0x87, 0xa9, 0x3a, 0x01, 0x58, 0x90, 0x05, + 0x73, 0x63, 0x9f, 0x02, 0x93, 0x37, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x17, 0x3f, 0xa1, 0x36, 0x19, 0xf8, 0xed, 0x13, 0x3a, 0x59, + 0xc7, 0x31, 0x5a, 0x00, 0x0b, 0xdb, 0xda, 0xfd, 0x61, 0xf9, 0x00, 0x62, + 0xa9, 0x3c, 0x46, 0x3c, 0x64, 0x4c, 0x85, 0x04, 0x61, 0xa6, 0x12, 0x10, + 0x6a, 0x22, 0x3d, 0x1c, 0xe8, 0xbb, 0x7a, 0x0d, 0x4b, 0x0f, 0xb1, 0x94, + 0xb0, 0xb1, 0x53, 0xbe, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xcb, 0xbf, 0x7e, 0x6f, 0xfa, 0x46, 0xc3, + 0xcd, 0xb1, 0x8e, 0x52, 0xfd, 0x4b, 0xa8, 0xe9, 0x36, 0x1a, 0x20, 0x89, + 0x72, 0x49, 0xde, 0xb5, 0xfe, 0x41, 0x23, 0x8f, 0x86, 0x71, 0x5a, 0x98, + 0xeb, 0xda, 0xde, 0x7a, 0x40, 0xc5, 0xbd, 0xea, 0xce, 0x0d, 0x0d, 0xda, + 0xd6, 0xb1, 0x2f, 0x20, 0xbf, 0x8c, 0xce, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x5b, 0xd5, 0x1a, 0x74, 0xfa, 0x7b, 0x4a, 0x78, 0x04, + 0xe7, 0x74, 0x84, 0x9e, 0x8c, 0x33, 0xb0, 0xdc, 0x9d, 0xef, 0x5b, 0x5f, + 0xa4, 0x11, 0xd2, 0xe6, 0x90, 0xae, 0x51, 0x44, 0x94, 0x92, 0x5f, 0x12, + 0x10, 0x48, 0x71, 0x2c, 0xdd, 0x7a, 0x07, 0x75, 0xf1, 0x00, 0x4c, 0x5d, + 0x0d, 0x80, 0x13, 0xf3, 0x60, 0x62, 0x00, 0x20, 0x96, 0x94, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x7b, 0x3f, 0x25, 0xae, 0x8c, 0x6b, 0x9a, 0x5f, 0x77, 0xb9, 0xc2, + 0x9e, 0xed, 0xcf, 0xb1, 0x44, 0xe3, 0x1f, 0x65, 0xf7, 0x0f, 0x3e, + 0x6f, 0x6a, 0xe9, 0x25, 0xa6, 0x84, 0xfa, 0x68, 0x54, 0x88, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenSoftTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xf7, 0x25, 0xba, 0x99, 0x00, 0x00, 0x00, 0x25, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xf7, 0x25, 0xba, 0x99, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0xeb, 0x4a, 0xf9, 0x73, 0xeb, 0x36, 0x7c, 0xac, + 0xa2, 0xbd, 0x5a, 0x82, 0x82, 0x8d, 0xa0, 0xf8, 0x7d, 0x33, 0x03, 0x44, + 0xd0, 0x1f, 0xc5, 0x13, 0x9c, 0x78, 0x1f, 0x38, 0xf1, 0x66, 0xf2, 0x33, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x37, 0x31, 0x46, 0x46, 0x44, 0x43, 0x36, 0x42, + 0x32, 0x44, 0x42, 0x37, 0x45, 0x37, 0x39, 0x43, 0x32, 0x31, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x31, 0x46, 0x46, 0x44, 0x43, 0x36, 0x42, 0x32, 0x44, + 0x42, 0x37, 0x45, 0x37, 0x39, 0x43, 0x32, 0x31, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xae, 0x94, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x3f, 0x5a, + 0xa5, 0xb9, 0x05, 0x88, 0xa7, 0x2e, 0x2b, 0xb1, 0x4a, 0xea, 0xbb, 0xaf, + 0x8e, 0x4b, 0x1a, 0x50, 0xcc, 0xad, 0xcb, 0x6b, 0xf6, 0xf6, 0x18, 0xb7, + 0xae, 0xee, 0xd9, 0xfe, 0x2d, 0x11, 0x48, 0x23, 0x12, 0x0f, 0xa4, 0x14, + 0x0c, 0xf3, 0xf1, 0x83, 0xa1, 0x47, 0x51, 0xf0, 0xa5, 0xfb, 0xa6, 0x71, + 0xaa, 0x3b, 0xa5, 0x9a, 0x7e, 0xdb, 0x93, 0x84, 0xdd, 0x0e, 0xf5, 0x18, + 0xc8, 0xf8, 0xd4, 0x15, 0x65, 0x15, 0x05, 0xeb, 0xd7, 0xae, 0x76, 0x05, + 0xd0, 0xb3, 0xf0, 0xd3, 0x0b, 0x87, 0xea, 0x0c, 0x35, 0x43, 0xa6, 0x59, + 0xe2, 0x3a, 0xa8, 0x91, 0xb8, 0xa1, 0xdb, 0xff, 0xcd, 0x2b, 0xc4, 0xc0, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xbc, 0x3e, 0xb7, 0xc9, 0xf4, 0xd3, 0xa5, 0xa1, 0x1e, 0x89, 0x49, + 0xdd, 0x0b, 0x26, 0x34, 0xaf, 0x1a, 0x20, 0x8a, 0x26, 0x61, 0x81, 0x62, + 0xd0, 0x41, 0x4e, 0xb7, 0xbe, 0x6c, 0x90, 0xad, 0xdf, 0x03, 0xa5, 0x91, + 0x6c, 0xa0, 0xfb, 0x7f, 0xfc, 0x29, 0x4a, 0x4c, 0x61, 0x18, 0xf6, 0x06, + 0x43, 0x17, 0xba, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xdf, + 0x85, 0xd9, 0x1c, 0x64, 0x12, 0x08, 0xf8, 0x43, 0x09, 0xb6, 0xe7, 0xc4, + 0xac, 0x83, 0x44, 0xdd, 0x8a, 0xe8, 0x92, 0x64, 0xdc, 0x8a, 0x81, 0xde, + 0xdc, 0xc3, 0x11, 0xa2, 0xba, 0x32, 0x16, 0x12, 0x10, 0x17, 0xb6, 0xd3, + 0xe7, 0x49, 0x02, 0xfb, 0xab, 0x28, 0xc9, 0xa4, 0x1f, 0xea, 0x6d, 0x1c, + 0x49, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x67, 0x69, 0x04, 0xc6, 0xee, 0x95, 0x20, 0xa2, 0x3f, 0x16, + 0x59, 0x8b, 0x8c, 0x27, 0xd1, 0x1a, 0x1a, 0x20, 0xb2, 0x7c, 0xd8, 0xa2, + 0x87, 0xa5, 0x5e, 0x73, 0x89, 0x9d, 0xc0, 0xcd, 0x8f, 0x9c, 0xf9, 0xb7, + 0x2f, 0x65, 0x91, 0xfb, 0xb6, 0xa4, 0x3a, 0x37, 0x59, 0x7c, 0xd5, 0x54, + 0x85, 0xe3, 0xa8, 0x55, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x33, 0x18, 0x3e, 0x5e, 0x7a, 0xcf, 0x99, 0xe3, 0xe2, 0x84, 0xc3, 0x78, + 0x44, 0x80, 0xcd, 0x8b, 0x6e, 0xcf, 0x51, 0x44, 0xc3, 0xcf, 0xdb, 0x96, + 0x08, 0x92, 0xe3, 0x73, 0xa1, 0x51, 0x95, 0xfc, 0x12, 0x10, 0x67, 0x88, + 0x61, 0x24, 0xfc, 0xe8, 0x2d, 0x9e, 0x2b, 0x07, 0x1f, 0x61, 0x42, 0xe6, + 0x2b, 0xba, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xa1, 0x11, 0x78, 0xc0, 0x02, 0x56, 0xea, 0x9c, 0xfb, + 0xc5, 0xaa, 0xc7, 0xd2, 0x86, 0x68, 0x98, 0x1a, 0x20, 0x9a, 0x69, 0x2d, + 0x33, 0x1a, 0x66, 0x9f, 0xa0, 0x21, 0xfc, 0xc0, 0x1a, 0x78, 0x61, 0x9c, + 0xb7, 0x5a, 0x07, 0x6b, 0x17, 0x47, 0xf0, 0xac, 0x85, 0x6a, 0x9f, 0x32, + 0xf0, 0x8f, 0xe6, 0x24, 0x56, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xe8, 0xbc, 0xaa, 0xea, 0x07, 0xc4, 0x7a, 0xd5, 0x69, 0xfd, 0x76, + 0xd7, 0x6a, 0x35, 0xd6, 0xa7, 0x32, 0xc4, 0x7e, 0x74, 0xf5, 0x6d, 0xaf, + 0x55, 0xa6, 0x01, 0xfa, 0x03, 0x7b, 0x45, 0xe1, 0x24, 0x12, 0x10, 0xe5, + 0xf4, 0x9c, 0x6e, 0x11, 0xdd, 0x32, 0x26, 0x31, 0x2f, 0xa1, 0x30, 0x4b, + 0x47, 0x44, 0x4c, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xba, 0x6b, 0x06, 0x89, 0xbc, 0xf8, 0x78, 0x49, + 0x8a, 0xea, 0x8f, 0x40, 0x7b, 0x87, 0xe3, 0x82, 0x1a, 0x20, 0x58, 0x05, + 0xc9, 0x79, 0xdd, 0x0b, 0xda, 0xb8, 0xf2, 0x20, 0xd1, 0x99, 0x5a, 0x6d, + 0xa8, 0x76, 0x63, 0x4f, 0xd7, 0xf2, 0x00, 0xfb, 0x19, 0xbb, 0xb8, 0x92, + 0xe0, 0x12, 0x96, 0x17, 0xf9, 0xfa, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xd7, 0xdf, 0x2c, 0x08, 0xf6, 0x32, 0xb0, 0xbf, 0xbf, 0xdb, + 0xb3, 0x06, 0xad, 0x20, 0xcf, 0x4a, 0xa8, 0x6b, 0x11, 0xae, 0x09, 0xfb, + 0x4d, 0xf4, 0x02, 0x39, 0xfb, 0x3c, 0xc9, 0x30, 0x35, 0xfd, 0x12, 0x10, + 0x32, 0xbc, 0x05, 0x0b, 0x83, 0x2b, 0x84, 0x40, 0x87, 0x20, 0xc5, 0xbb, + 0x73, 0x59, 0x94, 0x31, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x87, 0x36, 0xfd, 0x3b, 0xe0, 0xaf, 0xe8, + 0x3a, 0xa0, 0xc5, 0x99, 0x69, 0x5b, 0x81, 0x94, 0x7d, 0x1a, 0x20, 0xe2, + 0xc0, 0x87, 0x29, 0x7d, 0x03, 0xc5, 0xe9, 0x3f, 0xd9, 0x2e, 0x80, 0x22, + 0x4c, 0xb7, 0x4b, 0xda, 0x6a, 0x6b, 0xda, 0x7a, 0xe1, 0x5c, 0xe3, 0x16, + 0x59, 0x52, 0x9c, 0xb0, 0x2f, 0x44, 0x7f, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x36, 0x74, 0xd0, 0xed, 0xb5, 0x87, 0x13, 0xf5, 0x00, + 0x7f, 0x42, 0x39, 0x39, 0x87, 0xf0, 0xb3, 0xe5, 0xe1, 0x3f, 0x0a, 0xec, + 0x68, 0xb3, 0x4c, 0x1d, 0xf2, 0x0d, 0x13, 0x4d, 0x8e, 0x33, 0x62, 0x12, + 0x10, 0x8f, 0x32, 0x1c, 0x99, 0x18, 0x53, 0xda, 0x49, 0x99, 0x0d, 0xa7, + 0xe5, 0x98, 0x08, 0xa3, 0x82, 0x62, 0x00, 0x20, 0xae, 0x94, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xeb, 0x4a, 0xf9, 0x73, 0xeb, 0x36, 0x7c, 0xac, 0xa2, 0xbd, 0x5a, + 0x82, 0x82, 0x8d, 0xa0, 0xf8, 0x7d, 0x33, 0x03, 0x44, 0xd0, 0x1f, + 0xc5, 0x13, 0x9c, 0x78, 0x1f, 0x38, 0xf1, 0x66, 0xf2, 0x33, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_SevenSoftTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xa0, 0xdd, 0x28, 0x57, 0x00, 0x00, 0x00, 0x27, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xa0, 0xdd, 0x28, 0x57, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0x4b, 0x5f, 0x8c, 0xf1, 0x52, 0xfa, 0xb8, 0x6e, + 0x92, 0xd6, 0xed, 0x38, 0x82, 0x16, 0x40, 0x46, 0x7c, 0x2b, 0x0f, 0x8d, + 0x70, 0x05, 0xd0, 0x4f, 0x83, 0x35, 0x6e, 0x8f, 0x2b, 0x97, 0x5a, 0xfa, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x44, 0x36, 0x46, 0x42, 0x34, 0x30, 0x32, 0x39, + 0x32, 0x44, 0x35, 0x37, 0x31, 0x34, 0x42, 0x43, 0x32, 0x33, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x44, 0x36, 0x46, 0x42, 0x34, 0x30, 0x32, 0x39, 0x32, 0x44, + 0x35, 0x37, 0x31, 0x34, 0x42, 0x43, 0x32, 0x33, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x28, 0x73, 0xf4, 0x4c, 0x7f, 0xc3, + 0xd0, 0x82, 0x54, 0x9b, 0x38, 0x64, 0x40, 0x32, 0x48, 0xc6, 0x94, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x5a, 0xc9, + 0x32, 0x59, 0xf2, 0x88, 0x50, 0x16, 0xd2, 0xe0, 0xa0, 0xef, 0x8a, 0x48, + 0xbe, 0xf9, 0x1a, 0x50, 0x8b, 0xf2, 0x01, 0x32, 0x71, 0x07, 0x24, 0x49, + 0x63, 0xca, 0xe7, 0xf3, 0x81, 0x95, 0x13, 0xb1, 0xba, 0x28, 0x8c, 0x8f, + 0xe3, 0xd3, 0xc1, 0x29, 0x33, 0x08, 0x40, 0x8b, 0xfe, 0x59, 0x61, 0x48, + 0xc4, 0x79, 0x5e, 0x31, 0x5f, 0x7b, 0x66, 0x67, 0x15, 0x04, 0x8d, 0xe2, + 0x99, 0x3f, 0xfe, 0x65, 0x1a, 0xa4, 0x08, 0x5d, 0x12, 0x3f, 0xf1, 0x07, + 0xdf, 0x85, 0x6f, 0x62, 0x8b, 0xd9, 0xa6, 0x80, 0xe0, 0x8a, 0xc5, 0xfb, + 0x45, 0x39, 0xd4, 0x1f, 0x82, 0xf0, 0xd4, 0x79, 0xe4, 0xcb, 0xdb, 0x00, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0x76, 0x77, 0xfa, 0xdc, 0xa7, 0x9a, 0x6f, 0x85, 0xd1, 0xb2, 0x13, + 0x10, 0x02, 0x75, 0x0e, 0x77, 0x1a, 0x20, 0x4f, 0x0f, 0x8f, 0xa3, 0x1d, + 0x14, 0x0c, 0x60, 0x45, 0x86, 0xce, 0xef, 0xba, 0x30, 0x2d, 0x4c, 0x18, + 0x18, 0x53, 0xa4, 0x04, 0x82, 0x9e, 0xd9, 0x68, 0xf7, 0x04, 0x90, 0x4b, + 0x11, 0x22, 0xaf, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x0f, + 0x05, 0x2a, 0x19, 0xaa, 0x4f, 0x56, 0x6a, 0xe4, 0x5a, 0x32, 0x67, 0x78, + 0x52, 0x53, 0xfb, 0x11, 0x59, 0xed, 0xf7, 0x3c, 0xc3, 0xf6, 0x27, 0x74, + 0x72, 0x32, 0xc2, 0x34, 0x96, 0x63, 0xc4, 0x12, 0x10, 0x98, 0x92, 0xde, + 0x17, 0xcf, 0x62, 0x0d, 0x40, 0x45, 0x4a, 0x04, 0x3e, 0x7d, 0xab, 0xf5, + 0xe9, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x08, 0xcf, 0xdf, 0x7a, 0xb7, 0x43, 0xa5, 0xd3, 0xd1, 0x82, + 0xb4, 0x52, 0xb0, 0xa1, 0x47, 0x49, 0x1a, 0x20, 0xbe, 0xa8, 0x90, 0xbe, + 0x67, 0x2b, 0x5d, 0x93, 0xe3, 0xe9, 0xbd, 0x7f, 0xe3, 0xf3, 0x68, 0xb2, + 0x8f, 0x62, 0x0a, 0x76, 0xd7, 0xaf, 0xaa, 0x4f, 0x64, 0xad, 0xe3, 0x7c, + 0x1e, 0x23, 0xcf, 0x61, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x03, 0x19, 0x9e, 0x38, 0x65, 0x70, 0x7b, 0x19, 0x2e, 0xa0, 0x0f, 0x6c, + 0x82, 0xeb, 0xf2, 0x76, 0x45, 0xb8, 0x6e, 0x92, 0xfd, 0x09, 0x85, 0x2b, + 0xb8, 0xf3, 0xd8, 0x26, 0x58, 0xfd, 0xf3, 0x6f, 0x12, 0x10, 0xcf, 0xd3, + 0x7a, 0xa8, 0x8d, 0xe4, 0x9e, 0x0f, 0xcc, 0x56, 0xb4, 0xe2, 0xd7, 0xc6, + 0x72, 0xa6, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x61, 0x91, 0xe3, 0xfe, 0xe8, 0x72, 0xdb, 0xbb, 0xa6, + 0xc0, 0x8b, 0x5c, 0x50, 0xb2, 0xb1, 0x43, 0x1a, 0x20, 0x9e, 0x4c, 0x46, + 0xcf, 0x02, 0xb1, 0xce, 0x9c, 0xf1, 0xcf, 0x61, 0x9e, 0x40, 0x69, 0x5c, + 0xee, 0x26, 0xe5, 0xc6, 0x68, 0x36, 0x71, 0x6d, 0x76, 0x1e, 0x2c, 0x07, + 0x57, 0xec, 0x5c, 0xe8, 0xff, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xc1, 0x91, 0x6b, 0xb2, 0x50, 0xb3, 0xa2, 0x8a, 0x32, 0xa6, 0xab, + 0x89, 0xf8, 0xef, 0x3d, 0x40, 0xcf, 0xa3, 0xbe, 0x02, 0xa7, 0xd6, 0xfc, + 0xe2, 0x89, 0xd9, 0x29, 0x2e, 0x81, 0x8a, 0xb8, 0x38, 0x12, 0x10, 0x77, + 0x97, 0x95, 0x17, 0x57, 0x6e, 0x6d, 0xd7, 0x4c, 0x01, 0xe5, 0x49, 0x28, + 0x13, 0xb3, 0x98, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x97, 0x2b, 0xec, 0x3c, 0x26, 0x83, 0x01, 0xbe, + 0xa2, 0xa7, 0x47, 0x50, 0x3b, 0xb7, 0x5b, 0x23, 0x1a, 0x20, 0x06, 0x1a, + 0xee, 0x9b, 0x3a, 0xa3, 0xf3, 0x31, 0x54, 0x6f, 0x73, 0x01, 0x5e, 0xd3, + 0xb4, 0x37, 0x1d, 0x12, 0x28, 0xde, 0x67, 0xc7, 0x1c, 0xbf, 0x7c, 0xfd, + 0x01, 0xdb, 0xb4, 0xf2, 0xdf, 0x17, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xf9, 0xd6, 0xc3, 0xdd, 0xe1, 0xb0, 0x64, 0xc2, 0xc9, 0xe9, + 0x8a, 0x71, 0xea, 0x0a, 0xf6, 0x1d, 0x65, 0x42, 0x5c, 0x35, 0xea, 0xd2, + 0xdc, 0x00, 0x4f, 0xb3, 0x8f, 0xc9, 0x37, 0xa0, 0x52, 0x05, 0x12, 0x10, + 0xa9, 0x03, 0xb3, 0xf9, 0xc2, 0x31, 0xbe, 0x7b, 0xb1, 0x7f, 0x24, 0x3e, + 0x28, 0x0a, 0xdb, 0x3b, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xf9, 0xda, 0x79, 0x05, 0xfe, 0xf9, 0x04, + 0x87, 0x18, 0x93, 0x51, 0xc1, 0x5a, 0x02, 0x28, 0xef, 0x1a, 0x20, 0x11, + 0x57, 0x19, 0xdb, 0xe6, 0x9a, 0xed, 0x99, 0x6f, 0x93, 0xac, 0x56, 0x04, + 0x5f, 0x01, 0x6e, 0x8d, 0x57, 0xa5, 0x96, 0xaa, 0x85, 0xee, 0x22, 0x22, + 0xe1, 0xcf, 0x5d, 0x4e, 0x9e, 0x9c, 0x51, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0xd1, 0xa0, 0x80, 0x83, 0x9c, 0x30, 0xf1, 0xc1, 0x6e, + 0x39, 0xaf, 0x20, 0x05, 0x9c, 0x22, 0x5b, 0x5b, 0xa4, 0x80, 0xa8, 0x1a, + 0x5c, 0x39, 0x8f, 0x16, 0x0d, 0x63, 0xb8, 0x14, 0x4e, 0x14, 0x15, 0x12, + 0x10, 0xb2, 0xc4, 0x4d, 0xd8, 0x55, 0x03, 0x6f, 0x54, 0x39, 0xdb, 0x52, + 0xe7, 0x17, 0x73, 0xdd, 0xc3, 0x62, 0x00, 0x20, 0xc6, 0x94, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x4b, 0x5f, 0x8c, 0xf1, 0x52, 0xfa, 0xb8, 0x6e, 0x92, 0xd6, 0xed, + 0x38, 0x82, 0x16, 0x40, 0x46, 0x7c, 0x2b, 0x0f, 0x8d, 0x70, 0x05, + 0xd0, 0x4f, 0x83, 0x35, 0x6e, 0x8f, 0x2b, 0x97, 0x5a, 0xfa, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LicenseWithRenewal_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xc4, 0x49, 0x50, 0x65, 0x00, 0x00, 0x00, 0x29, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xc4, 0x49, 0x50, 0x65, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x47, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x25, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x82, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xaa, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x07, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x51, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x2f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd6, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb4, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x11, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x39, + 0x00, 0x00, 0x00, 0x20, 0xf7, 0x77, 0xaa, 0x58, 0x2c, 0x65, 0x49, 0x60, + 0x08, 0x37, 0xee, 0xc6, 0x3a, 0xbd, 0x4f, 0x4b, 0xd5, 0x97, 0x33, 0x13, + 0x8a, 0xb6, 0x49, 0x0d, 0x8d, 0x1d, 0x14, 0x5b, 0xeb, 0x2e, 0xe9, 0x35, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x34, 0x30, 0x35, 0x45, 0x45, 0x31, 0x33, 0x32, + 0x45, 0x31, 0x42, 0x46, 0x41, 0x44, 0x38, 0x32, 0x32, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x30, 0x35, 0x45, 0x45, 0x31, 0x33, 0x32, 0x45, 0x31, + 0x42, 0x46, 0x41, 0x44, 0x38, 0x32, 0x32, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xde, 0x94, + 0x86, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x45, 0x6a, 0xf4, 0xab, 0x55, 0xad, 0x03, 0xe6, + 0x03, 0x80, 0xd8, 0x1a, 0xed, 0x57, 0xf8, 0x5e, 0x1a, 0x50, 0x61, 0x07, + 0x45, 0x2d, 0xe5, 0x18, 0x30, 0x68, 0x5c, 0x28, 0x54, 0x98, 0x47, 0x89, + 0xb7, 0x0e, 0x18, 0x82, 0x0f, 0xd4, 0xd2, 0xac, 0xf9, 0x62, 0x71, 0x40, + 0xf8, 0xd3, 0x38, 0xd5, 0x7f, 0x66, 0x3a, 0x54, 0x45, 0x2a, 0xcf, 0xe5, + 0x9d, 0x69, 0xa1, 0x39, 0xed, 0x5b, 0xf0, 0x37, 0x5a, 0x3b, 0x96, 0x02, + 0x10, 0xe5, 0x77, 0xc8, 0x00, 0x74, 0xc8, 0x00, 0x39, 0xb5, 0x0f, 0xc0, + 0x2a, 0xe5, 0x5b, 0xc5, 0x89, 0xb8, 0x23, 0xce, 0xef, 0xed, 0x3c, 0x0b, + 0x36, 0x8e, 0x04, 0xaa, 0x0f, 0xd8, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x72, 0x6e, 0x6b, 0xdb, 0xb2, + 0xa5, 0xe1, 0x7c, 0x1c, 0x08, 0x18, 0x36, 0x70, 0x43, 0x1f, 0x8d, 0x1a, + 0x20, 0x62, 0xbd, 0xab, 0xeb, 0x3f, 0x12, 0xc4, 0xa5, 0x8a, 0x64, 0xcf, + 0xf8, 0x34, 0x56, 0xd4, 0x8e, 0x77, 0xce, 0xcb, 0xdd, 0xef, 0x97, 0x9d, + 0x09, 0x85, 0xd2, 0x4d, 0x03, 0x73, 0xc5, 0x83, 0xa8, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0x64, 0x9e, 0xd4, 0x2c, 0x57, 0xae, 0x75, + 0x71, 0xec, 0xee, 0x04, 0xe2, 0x28, 0xe2, 0x04, 0xae, 0x9a, 0x0b, 0x78, + 0xa8, 0x69, 0x05, 0x37, 0x42, 0x26, 0x78, 0x3d, 0x76, 0x67, 0x7a, 0x80, + 0x39, 0x12, 0x10, 0x6c, 0x37, 0xa4, 0xfd, 0xed, 0xf5, 0x35, 0xd5, 0x2f, + 0xa4, 0x15, 0xda, 0x3c, 0xab, 0xe7, 0xcf, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x50, 0xb1, 0x7b, 0x32, + 0xdd, 0x61, 0x40, 0xbe, 0xfe, 0xa9, 0x94, 0xa6, 0x3f, 0x84, 0x93, 0x2b, + 0x1a, 0x20, 0x7a, 0x4e, 0x4f, 0xa3, 0xd1, 0xe3, 0x98, 0xf6, 0xf1, 0x16, + 0x5b, 0x60, 0x77, 0x79, 0xdb, 0x6a, 0x4c, 0x3a, 0x6d, 0x1d, 0x2f, 0xb7, + 0x40, 0xc9, 0x58, 0x7a, 0xc0, 0xb2, 0x28, 0x2f, 0xcc, 0x4f, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xea, 0x4f, 0xd0, 0xfe, 0x01, 0xf4, + 0xd7, 0x99, 0xa4, 0x55, 0x65, 0x95, 0xae, 0x91, 0xee, 0xeb, 0xd6, 0xdb, + 0xc8, 0x1f, 0x0d, 0x86, 0xbd, 0x3c, 0x0d, 0xf1, 0xb7, 0xb6, 0xb6, 0x4c, + 0x82, 0x9f, 0x12, 0x10, 0x0e, 0x06, 0x05, 0x24, 0xcd, 0x4f, 0x69, 0xc3, + 0x62, 0xb3, 0x16, 0x8b, 0xff, 0x02, 0x44, 0x2e, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xd1, 0x77, 0xd8, + 0x2a, 0x56, 0x50, 0xc3, 0x94, 0xbd, 0x8b, 0x49, 0x2c, 0x99, 0x12, 0x4b, + 0x57, 0x1a, 0x20, 0x4a, 0x3b, 0x3e, 0x72, 0x34, 0xd1, 0x03, 0x77, 0xb7, + 0x93, 0x36, 0x82, 0xaf, 0x3b, 0x4c, 0xa2, 0xe9, 0x1d, 0xe2, 0xd7, 0xa8, + 0x27, 0x24, 0xbb, 0x67, 0x92, 0xf5, 0x08, 0x8d, 0x08, 0x4d, 0xe1, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x1d, 0xd6, 0x37, 0xea, 0x97, + 0xa2, 0x41, 0x77, 0x69, 0xaf, 0x42, 0x54, 0x93, 0x57, 0x1e, 0x56, 0x47, + 0xe9, 0x42, 0x4d, 0x99, 0xa9, 0xf9, 0x80, 0x39, 0x0c, 0xac, 0xe2, 0xa6, + 0xdc, 0x8e, 0x4f, 0x12, 0x10, 0x0f, 0x6a, 0x62, 0xfa, 0x00, 0xd0, 0x25, + 0x1d, 0x91, 0xcb, 0x7f, 0x69, 0x38, 0x4c, 0x8b, 0xb8, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x46, 0x13, + 0xc4, 0x95, 0x3a, 0x58, 0x37, 0x53, 0x25, 0x74, 0xf7, 0xa0, 0x76, 0x35, + 0x79, 0x42, 0x1a, 0x20, 0xde, 0xd9, 0xa8, 0x64, 0x70, 0x98, 0x51, 0x74, + 0xac, 0x27, 0xe9, 0x20, 0x7a, 0x24, 0x3d, 0x08, 0x03, 0x1e, 0x85, 0x8c, + 0xcb, 0x5a, 0xf3, 0x66, 0x37, 0x8c, 0x2a, 0x58, 0x6b, 0x9a, 0x61, 0x3c, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x54, 0x4c, 0x4e, 0x7e, + 0xcc, 0xe4, 0x9b, 0x58, 0xbb, 0x36, 0x5b, 0x26, 0x44, 0xc9, 0x0d, 0x7e, + 0xaa, 0x1b, 0x47, 0x79, 0x14, 0x73, 0x2e, 0x1e, 0xee, 0xf6, 0x79, 0x9d, + 0x23, 0x51, 0x52, 0xc3, 0x12, 0x10, 0x95, 0xde, 0x65, 0xd1, 0x42, 0x0a, + 0x1c, 0xfc, 0x25, 0xd9, 0x40, 0x86, 0xd2, 0xb1, 0xd1, 0x57, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x22, + 0x4a, 0xcb, 0x8c, 0x15, 0x25, 0x14, 0x98, 0x2f, 0x49, 0xf1, 0x8f, 0xda, + 0x31, 0xe1, 0x63, 0x1a, 0x20, 0x93, 0x72, 0x91, 0x02, 0xf6, 0xc8, 0x6e, + 0x74, 0x89, 0x1d, 0x19, 0xfc, 0x39, 0x88, 0x2e, 0x5d, 0x54, 0x45, 0x03, + 0xf9, 0x95, 0x35, 0x19, 0xea, 0x8c, 0x0e, 0x2c, 0xc6, 0xd1, 0xd9, 0x19, + 0x60, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x4a, 0x8d, 0x5f, + 0xc0, 0x90, 0x82, 0xba, 0x0a, 0x00, 0x10, 0x8c, 0x94, 0xe6, 0xa5, 0xfb, + 0x46, 0x54, 0x10, 0xa1, 0xe8, 0xd1, 0xdd, 0x24, 0xb2, 0xec, 0x82, 0x4d, + 0x47, 0xe6, 0x24, 0x1f, 0x82, 0x12, 0x10, 0x81, 0xa8, 0xd7, 0x6a, 0xe6, + 0x48, 0x7a, 0xca, 0xb2, 0xa0, 0x15, 0x86, 0x34, 0x05, 0xeb, 0x66, 0x62, + 0x00, 0x20, 0xde, 0x94, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xf7, 0x77, 0xaa, 0x58, 0x2c, 0x65, 0x49, 0x60, 0x08, 0x37, 0xee, + 0xc6, 0x3a, 0xbd, 0x4f, 0x4b, 0xd5, 0x97, 0x33, 0x13, 0x8a, 0xb6, + 0x49, 0x0d, 0x8d, 0x1d, 0x14, 0x5b, 0xeb, 0x2e, 0xe9, 0x35, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LicenseWithRenewal_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x11, 0x59, 0x42, 0x00, 0x00, 0x00, 0x00, 0x2b, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x11, 0x59, 0x42, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xe5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x53, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x8e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb6, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x13, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x3b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xc0, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x1d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x45, + 0x00, 0x00, 0x00, 0x20, 0x33, 0xfd, 0x9a, 0x6e, 0x04, 0xb0, 0xb7, 0x1a, + 0xbe, 0x04, 0xdb, 0x46, 0xb1, 0xe6, 0xd1, 0x3b, 0xd6, 0xc5, 0xe8, 0xaa, + 0x6d, 0xec, 0x27, 0x0e, 0x2e, 0x37, 0x73, 0xc4, 0x5c, 0xec, 0xae, 0x0a, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x38, 0x34, 0x42, 0x32, 0x32, 0x33, 0x35, 0x39, + 0x39, 0x32, 0x35, 0x33, 0x34, 0x31, 0x46, 0x30, 0x32, 0x37, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x38, 0x34, 0x42, 0x32, 0x32, 0x33, 0x35, 0x39, 0x39, 0x32, + 0x35, 0x33, 0x34, 0x31, 0x46, 0x30, 0x32, 0x37, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xb5, 0x57, 0xaf, 0x5c, 0x87, 0xd0, + 0x3a, 0x2a, 0xe2, 0xd1, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xd1, 0x95, + 0x86, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0xc9, 0x37, 0xac, 0x66, 0xa0, 0x2f, 0xe6, 0xe5, + 0x66, 0xed, 0xf9, 0xfa, 0xaf, 0x75, 0xb8, 0xb5, 0x1a, 0x50, 0x4f, 0x4a, + 0xec, 0xe1, 0x8b, 0x6c, 0x69, 0x9b, 0x03, 0x2b, 0xdf, 0x5f, 0x68, 0x71, + 0x0c, 0xbd, 0x43, 0x3e, 0x59, 0x51, 0xa2, 0x10, 0xb2, 0xbe, 0x17, 0xe2, + 0xcf, 0x98, 0x03, 0x5f, 0xe6, 0xb8, 0x11, 0x24, 0xc2, 0x7e, 0xb0, 0xc8, + 0xc7, 0x1e, 0xf2, 0xf9, 0xc4, 0x07, 0xd7, 0xe0, 0x88, 0xc5, 0xd6, 0xfc, + 0x6c, 0x95, 0xb8, 0xbd, 0xe5, 0x3f, 0x49, 0x3d, 0x32, 0x1f, 0x7e, 0xdf, + 0xfb, 0xb2, 0x12, 0x56, 0xa7, 0x37, 0xd8, 0xe5, 0xc9, 0x41, 0xe7, 0xb1, + 0x45, 0xfa, 0xac, 0xdf, 0x3d, 0x92, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xd9, 0xd3, 0xa5, 0x78, 0x70, + 0x42, 0x80, 0x5f, 0x8d, 0x05, 0x93, 0x04, 0xdf, 0x4e, 0x21, 0x80, 0x1a, + 0x20, 0x59, 0x96, 0x77, 0x74, 0xb0, 0xbe, 0x5f, 0x9a, 0xa5, 0xad, 0xce, + 0xb3, 0x98, 0xc7, 0xe5, 0x21, 0x75, 0xff, 0x76, 0x72, 0x09, 0x83, 0x48, + 0x14, 0xcf, 0xe3, 0x71, 0x22, 0x65, 0x20, 0xa2, 0x3e, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0xf8, 0xe8, 0x10, 0x14, 0x38, 0xbe, 0x92, + 0xfd, 0x96, 0xea, 0x22, 0xe8, 0xed, 0x08, 0x02, 0x48, 0x8d, 0xbf, 0xee, + 0xbe, 0x71, 0x11, 0xb0, 0x07, 0xe0, 0x34, 0xa1, 0x9e, 0x98, 0x46, 0x5a, + 0x30, 0x12, 0x10, 0xdd, 0xcb, 0x53, 0x36, 0x5f, 0xdf, 0xa1, 0xb4, 0xd5, + 0x1c, 0x69, 0x53, 0x95, 0x88, 0xf0, 0xbe, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x2c, 0x03, 0xc0, 0xf4, + 0x04, 0xf2, 0xe5, 0xad, 0xd6, 0x31, 0xf9, 0x75, 0xb7, 0x43, 0xce, 0x48, + 0x1a, 0x20, 0x4c, 0x8d, 0x9b, 0x8e, 0x23, 0x74, 0xa7, 0x52, 0xdc, 0x37, + 0xdc, 0xa8, 0x50, 0x0d, 0xeb, 0xcd, 0x05, 0xef, 0x41, 0x71, 0xe5, 0xb2, + 0xfb, 0x9c, 0x94, 0xeb, 0x41, 0x90, 0x79, 0xca, 0xe2, 0xf3, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xb9, 0x77, 0xed, 0x3c, 0xd6, 0x2b, + 0x94, 0x35, 0x85, 0xec, 0x95, 0xf0, 0x6e, 0xfa, 0xd2, 0x0c, 0x07, 0x4f, + 0x59, 0xef, 0x8d, 0xf4, 0x26, 0x3f, 0xba, 0xa5, 0x58, 0x41, 0x54, 0x8e, + 0x91, 0xc4, 0x12, 0x10, 0xf6, 0xc5, 0x89, 0xef, 0x31, 0x14, 0x21, 0xdc, + 0x20, 0x51, 0x20, 0x95, 0x7c, 0x76, 0xe7, 0xd7, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xc0, 0x0a, 0x94, + 0x98, 0xc1, 0x7a, 0xfc, 0xd5, 0x99, 0x46, 0xf4, 0x2b, 0x39, 0x87, 0x68, + 0x96, 0x1a, 0x20, 0x86, 0xa6, 0x92, 0xae, 0xf9, 0xfd, 0x79, 0xd8, 0xdd, + 0xc5, 0x8c, 0x8f, 0xa4, 0x7a, 0xec, 0x3b, 0xdb, 0x67, 0xdb, 0xdd, 0x07, + 0x4c, 0xe9, 0x24, 0xdb, 0x1b, 0x35, 0xb5, 0x1a, 0xfa, 0x7b, 0x20, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xe7, 0x85, 0x47, 0x65, 0xbe, + 0x31, 0xdc, 0x17, 0x30, 0x0e, 0x40, 0xbb, 0x24, 0x70, 0xbc, 0x74, 0x7b, + 0x3e, 0xbb, 0xf8, 0xa0, 0x73, 0x0e, 0xe4, 0xa1, 0x9e, 0xc7, 0xb1, 0xf0, + 0x78, 0x47, 0x8a, 0x12, 0x10, 0x7a, 0xf1, 0x8f, 0xfd, 0xec, 0xcf, 0x57, + 0xaf, 0xbb, 0x06, 0x9e, 0x17, 0x15, 0xf3, 0x5c, 0x11, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0xc1, 0x28, + 0x6f, 0xa0, 0x12, 0x52, 0x5b, 0x6a, 0x5a, 0x11, 0x8c, 0x75, 0x5c, 0xa6, + 0x6b, 0xdb, 0x1a, 0x20, 0xfa, 0x0f, 0xb0, 0x94, 0xbd, 0x8d, 0x96, 0x55, + 0xe5, 0x46, 0xf9, 0xbe, 0x68, 0x89, 0xd3, 0x5e, 0xef, 0xf1, 0x5c, 0x19, + 0x7f, 0x16, 0x5e, 0xb6, 0xba, 0xc5, 0x79, 0x53, 0xf4, 0xe5, 0xf5, 0x94, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xcc, 0xbf, 0xd1, 0xeb, + 0xb9, 0xf3, 0xf3, 0x17, 0xee, 0xa6, 0x21, 0x26, 0xba, 0x7a, 0x7f, 0x0b, + 0xac, 0xe7, 0xa2, 0x3c, 0xcd, 0x5e, 0x7a, 0xaf, 0x0e, 0x4a, 0xf8, 0x0b, + 0xfb, 0x07, 0x06, 0x8d, 0x12, 0x10, 0x7c, 0x69, 0x13, 0xd3, 0x06, 0x31, + 0xec, 0x82, 0x97, 0x83, 0x2c, 0x5e, 0x18, 0xa8, 0x67, 0x8d, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xd9, + 0x75, 0xfb, 0x80, 0xb5, 0xa7, 0xec, 0x37, 0x69, 0x28, 0x33, 0x9e, 0x88, + 0x94, 0x16, 0x54, 0x1a, 0x20, 0x04, 0x06, 0xf7, 0x58, 0xe8, 0x18, 0xd3, + 0xe2, 0x71, 0xb1, 0x8e, 0x0f, 0x94, 0xf3, 0xc8, 0xdb, 0x53, 0x42, 0xfb, + 0x6c, 0xbc, 0x4f, 0x8d, 0x24, 0x15, 0x0f, 0x69, 0x49, 0x1f, 0x94, 0x11, + 0xd9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xbc, 0x2a, 0x6e, + 0xe9, 0xdb, 0x63, 0x9e, 0x61, 0xb2, 0x6e, 0x20, 0x8f, 0x35, 0xc6, 0xc9, + 0x66, 0x6a, 0xcf, 0xf2, 0x46, 0xae, 0x3d, 0x45, 0x81, 0x4a, 0xa6, 0xbd, + 0x3c, 0x33, 0xb0, 0x7c, 0x00, 0x12, 0x10, 0xde, 0x3f, 0xcf, 0xad, 0x81, + 0xa8, 0x09, 0x17, 0x73, 0x1f, 0xa0, 0x65, 0x3a, 0xaf, 0xa7, 0x33, 0x62, + 0x00, 0x20, 0xd1, 0x95, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x33, 0xfd, 0x9a, 0x6e, 0x04, 0xb0, 0xb7, 0x1a, 0xbe, 0x04, 0xdb, + 0x46, 0xb1, 0xe6, 0xd1, 0x3b, 0xd6, 0xc5, 0xe8, 0xaa, 0x6d, 0xec, + 0x27, 0x0e, 0x2e, 0x37, 0x73, 0xc4, 0x5c, 0xec, 0xae, 0x0a, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x8a, 0xf6, 0xf2, 0xa5, 0x00, 0x00, 0x00, 0x2d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x8a, 0xf6, 0xf2, 0xa5, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 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, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x47, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x25, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x82, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xaa, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x07, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x51, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x2f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd6, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb4, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x11, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x39, + 0x00, 0x00, 0x00, 0x20, 0x65, 0xef, 0xf6, 0x41, 0x52, 0x83, 0x4f, 0x95, + 0xd8, 0xf0, 0xf1, 0x88, 0xb4, 0xa7, 0x2b, 0xc5, 0xf0, 0x1d, 0xa0, 0x6f, + 0x0c, 0x2f, 0x1c, 0xe9, 0x43, 0x31, 0xe2, 0x9a, 0x31, 0xcf, 0xab, 0x87, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x46, 0x43, 0x32, 0x34, 0x32, 0x30, 0x30, 0x31, + 0x42, 0x36, 0x31, 0x39, 0x42, 0x36, 0x31, 0x32, 0x32, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x46, 0x43, 0x32, 0x34, 0x32, 0x30, 0x30, 0x31, 0x42, 0x36, + 0x31, 0x39, 0x42, 0x36, 0x31, 0x32, 0x32, 0x39, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0xc4, 0x96, + 0x86, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0xe1, 0x3b, 0x6e, 0x3c, 0xe3, 0xe7, 0xad, 0x30, + 0xbd, 0x12, 0xb7, 0x53, 0x95, 0xcb, 0x54, 0x81, 0x1a, 0x50, 0xf4, 0x7e, + 0x07, 0x67, 0xeb, 0xd6, 0x1b, 0xe8, 0xb5, 0x97, 0x5a, 0x57, 0x11, 0xd9, + 0x94, 0x5b, 0x34, 0x08, 0x1f, 0x62, 0xd3, 0xc3, 0x63, 0xce, 0x54, 0x1c, + 0xd6, 0x92, 0x6a, 0x45, 0x47, 0xbe, 0x9d, 0x15, 0x47, 0x30, 0x9b, 0x79, + 0x4a, 0x5c, 0x24, 0xa6, 0x8c, 0xa8, 0xb7, 0x4a, 0x01, 0xa7, 0x8c, 0x8d, + 0x7b, 0xbf, 0xa7, 0x3a, 0x56, 0x88, 0x12, 0x5e, 0x14, 0x5d, 0x1d, 0x27, + 0x17, 0x24, 0xfe, 0xe9, 0x32, 0x9f, 0xaf, 0xa6, 0x86, 0x26, 0x39, 0xdc, + 0xaa, 0x9f, 0xa9, 0x9b, 0x66, 0xaf, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x7f, 0x5d, 0xae, 0xe5, 0xf4, + 0xa4, 0x78, 0xd4, 0x8f, 0x76, 0x28, 0x9e, 0x12, 0xb3, 0xed, 0x60, 0x1a, + 0x20, 0xd9, 0x14, 0x27, 0x71, 0x02, 0xb1, 0x84, 0x98, 0xb5, 0x84, 0x05, + 0x2d, 0x9c, 0xeb, 0x43, 0x7d, 0x1b, 0x08, 0xc7, 0x1d, 0x5e, 0xc6, 0xc8, + 0x6d, 0x54, 0x32, 0xef, 0xf9, 0x55, 0xbb, 0x3d, 0x23, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0xee, 0x32, 0x40, 0xd6, 0xed, 0xd8, 0x42, + 0x4c, 0xbe, 0x79, 0x25, 0xc0, 0xd9, 0x31, 0xe9, 0x07, 0x96, 0xcc, 0xad, + 0x58, 0x48, 0x87, 0xe3, 0xa8, 0x33, 0x51, 0xd2, 0x92, 0x1b, 0x8c, 0xbb, + 0xe3, 0x12, 0x10, 0xe6, 0x27, 0x86, 0xb5, 0x5a, 0x5e, 0x42, 0xcd, 0xc8, + 0x78, 0x07, 0x47, 0x09, 0xf1, 0xee, 0x00, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0xed, 0x4e, 0x7c, 0x9e, + 0x80, 0x42, 0xb8, 0x7e, 0x10, 0xff, 0xd8, 0xb2, 0x64, 0x43, 0xeb, 0xa2, + 0x1a, 0x20, 0x06, 0xd4, 0x49, 0x59, 0x7b, 0x25, 0x14, 0x30, 0x98, 0xee, + 0xaf, 0xb4, 0xbe, 0x5a, 0xf0, 0xf5, 0xad, 0x2f, 0xf6, 0x72, 0x1e, 0x6f, + 0xac, 0xcf, 0x1f, 0x44, 0x48, 0x92, 0x30, 0x84, 0xb0, 0x33, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x6f, 0xd0, 0x6b, 0x80, 0x41, 0xb1, + 0x50, 0xbc, 0x0f, 0xf0, 0x1f, 0x40, 0x00, 0xa4, 0x8a, 0x0e, 0xe6, 0x47, + 0xe2, 0xb1, 0xf3, 0xca, 0x8a, 0x27, 0xe3, 0xae, 0x32, 0x47, 0x70, 0x66, + 0x95, 0x66, 0x12, 0x10, 0x8f, 0xe9, 0xd7, 0x6a, 0x32, 0x09, 0xb8, 0xa5, + 0x3c, 0x68, 0x9c, 0x90, 0x01, 0xd7, 0x8b, 0x91, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x0e, 0xc0, 0x2a, + 0x24, 0x26, 0xe7, 0x6b, 0x84, 0x6a, 0x14, 0x55, 0x0a, 0x10, 0xbd, 0x0a, + 0xd8, 0x1a, 0x20, 0xc2, 0x96, 0xc5, 0x0f, 0x08, 0xf8, 0x1e, 0xe5, 0xcd, + 0x4e, 0x29, 0xf4, 0xde, 0x94, 0x45, 0xaf, 0x50, 0xbe, 0xb0, 0x8d, 0x8b, + 0xe1, 0x76, 0x2b, 0xbd, 0xe4, 0xdf, 0x49, 0x1c, 0x42, 0x96, 0x95, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x31, 0x54, 0xd0, 0xc9, 0xbf, + 0x63, 0x0d, 0x85, 0x51, 0x51, 0x4e, 0xe7, 0x3e, 0x2f, 0xc8, 0x10, 0x5e, + 0x60, 0xd7, 0x1c, 0x5c, 0xfa, 0x73, 0xc1, 0x0e, 0x7c, 0x49, 0xdb, 0xa4, + 0xaf, 0xbf, 0x23, 0x12, 0x10, 0xcb, 0x50, 0xee, 0x0b, 0x8e, 0x99, 0x6e, + 0x2d, 0x29, 0x81, 0xcf, 0x1d, 0x95, 0x11, 0xf0, 0xd2, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x21, 0xff, + 0x6a, 0x61, 0x96, 0xe2, 0x94, 0xff, 0x0c, 0x1f, 0x05, 0xf9, 0x27, 0xda, + 0x26, 0xb4, 0x1a, 0x20, 0x19, 0x7a, 0x7f, 0xff, 0xf1, 0x51, 0xf5, 0xbf, + 0x71, 0x55, 0xd6, 0x33, 0x9d, 0x69, 0xf9, 0x76, 0x1f, 0x86, 0xb0, 0xb5, + 0x9f, 0xb6, 0x5a, 0xca, 0xfe, 0x07, 0xa8, 0x7c, 0x57, 0xf7, 0xed, 0x57, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x70, 0xcb, 0x43, 0x2f, + 0xd0, 0xaa, 0xc8, 0xf8, 0xf3, 0x12, 0x10, 0xde, 0x2f, 0xc5, 0x3b, 0x8b, + 0x5c, 0xc2, 0x32, 0x23, 0x3f, 0x5d, 0x71, 0xee, 0x83, 0x92, 0xa7, 0x3e, + 0x2a, 0xe0, 0x96, 0x67, 0x12, 0x10, 0x31, 0xb2, 0x53, 0xaa, 0x17, 0x29, + 0x61, 0x76, 0xa2, 0xc6, 0x55, 0x54, 0xd5, 0x24, 0x3d, 0x44, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xa4, + 0x52, 0x6d, 0x50, 0x3b, 0xf5, 0x41, 0x91, 0x13, 0x00, 0x86, 0x3c, 0xe2, + 0x58, 0xc7, 0xb5, 0x1a, 0x20, 0xb2, 0xed, 0x5c, 0x30, 0x87, 0xa0, 0x81, + 0xb6, 0x76, 0xad, 0xd9, 0x9d, 0xfb, 0xea, 0xaa, 0x5e, 0x25, 0x2e, 0xb6, + 0x1f, 0xb4, 0xc9, 0xfe, 0xc7, 0xe6, 0xf9, 0x93, 0xdb, 0xfc, 0xcb, 0x84, + 0x5d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x67, 0xce, 0xaf, + 0x93, 0x9a, 0x5f, 0x29, 0x7b, 0x32, 0x40, 0x9b, 0x5b, 0x4a, 0x25, 0xcf, + 0x7e, 0x97, 0x79, 0xc5, 0x25, 0x5b, 0x19, 0xe2, 0x41, 0x3c, 0xc5, 0x6d, + 0x0d, 0xd7, 0xcf, 0xd6, 0x07, 0x12, 0x10, 0x68, 0x61, 0x64, 0x5f, 0x29, + 0xf1, 0xf4, 0x97, 0x6b, 0xb8, 0xe7, 0x80, 0x48, 0x95, 0x14, 0xcd, 0x62, + 0x00, 0x20, 0xc4, 0x96, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x65, 0xef, 0xf6, 0x41, 0x52, 0x83, 0x4f, 0x95, 0xd8, 0xf0, 0xf1, + 0x88, 0xb4, 0xa7, 0x2b, 0xc5, 0xf0, 0x1d, 0xa0, 0x6f, 0x0c, 0x2f, + 0x1c, 0xe9, 0x43, 0x31, 0xe2, 0x9a, 0x31, 0xcf, 0xab, 0x87, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xd0, 0x2d, 0x48, 0x46, 0x00, 0x00, 0x00, 0x2f, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xd0, 0x2d, 0x48, 0x46, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 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, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xe5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x53, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x8e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb6, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x13, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x3b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xc0, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x1d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x45, + 0x00, 0x00, 0x00, 0x20, 0x99, 0xf3, 0x24, 0xda, 0x42, 0x21, 0x14, 0xf6, + 0x21, 0xba, 0x64, 0xec, 0x87, 0x1e, 0x86, 0x52, 0x2f, 0x81, 0x78, 0x23, + 0x0b, 0xea, 0xfb, 0xbe, 0x5e, 0xa7, 0x1a, 0xd2, 0x57, 0x23, 0xc6, 0xbe, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x41, 0x38, 0x35, 0x45, 0x42, 0x34, 0x31, 0x37, + 0x44, 0x39, 0x37, 0x38, 0x32, 0x46, 0x39, 0x32, 0x32, 0x42, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x41, 0x38, 0x35, 0x45, 0x42, 0x34, 0x31, 0x37, 0x44, 0x39, + 0x37, 0x38, 0x32, 0x46, 0x39, 0x32, 0x32, 0x42, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xf3, 0x8c, 0xf8, 0xb7, 0x38, 0xc2, + 0x2a, 0x89, 0x72, 0xad, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0xb7, 0x97, + 0x86, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x0a, 0x16, 0xbb, 0xb7, 0x16, 0x34, 0xf4, 0x9a, + 0x63, 0x64, 0xce, 0x02, 0xe3, 0x75, 0xb4, 0xf8, 0x1a, 0x50, 0x5e, 0x3c, + 0xeb, 0x1d, 0x7c, 0x99, 0x7e, 0x6d, 0x4a, 0x40, 0x79, 0x30, 0xd1, 0x5f, + 0x5e, 0xe9, 0xbe, 0xae, 0x5c, 0xff, 0x4e, 0x69, 0x2b, 0x0f, 0x16, 0xc1, + 0x50, 0xf1, 0x6a, 0x33, 0x89, 0x2a, 0x49, 0x7c, 0xa6, 0x9c, 0x1a, 0x54, + 0xe0, 0xb7, 0x37, 0x88, 0x06, 0x29, 0x0e, 0x42, 0xc8, 0x9d, 0xc1, 0xc1, + 0xea, 0x80, 0xfd, 0x27, 0x2b, 0x16, 0xc8, 0xed, 0x79, 0x2d, 0x1d, 0x1d, + 0xe6, 0x97, 0xb8, 0xa5, 0x19, 0xe8, 0x2a, 0x13, 0xc5, 0x55, 0xa1, 0x64, + 0x80, 0xb2, 0x5c, 0xd1, 0x23, 0xbd, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xd1, 0xc0, 0x0d, 0xf4, 0x96, + 0xcb, 0x6f, 0x2b, 0x90, 0x3e, 0xa8, 0x65, 0x86, 0x74, 0x28, 0x95, 0x1a, + 0x20, 0x7b, 0xf5, 0xcc, 0x8d, 0x96, 0xca, 0xe2, 0xf6, 0x8a, 0xce, 0x1b, + 0x0d, 0x1c, 0x1b, 0x9c, 0x5f, 0x35, 0xe0, 0xfa, 0x3a, 0xcc, 0xa1, 0x9e, + 0xcb, 0x5d, 0x1c, 0x0f, 0x68, 0x67, 0x10, 0x49, 0xa8, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0xc4, 0x48, 0x4d, 0xa3, 0x2b, 0x86, 0x76, + 0xf7, 0xfa, 0xc5, 0x1c, 0xfc, 0xc9, 0x18, 0x7c, 0xcb, 0xde, 0x21, 0x5c, + 0x56, 0xc1, 0x91, 0x5d, 0x27, 0xc6, 0x1f, 0x12, 0xe1, 0x26, 0xd8, 0x1e, + 0x5f, 0x12, 0x10, 0xc8, 0x92, 0x8e, 0x9f, 0x17, 0x05, 0x8e, 0xf6, 0x10, + 0xa6, 0xaf, 0x1c, 0x6e, 0xe0, 0x99, 0x68, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0xea, 0xcd, 0x01, 0xd8, + 0x0c, 0xc4, 0x56, 0xeb, 0x77, 0x5e, 0x90, 0x3c, 0xad, 0xfa, 0xdb, 0x1f, + 0x1a, 0x20, 0x13, 0xad, 0x5e, 0x1b, 0x17, 0x3d, 0x2f, 0x79, 0x46, 0xbf, + 0x51, 0x26, 0xe6, 0x21, 0xf9, 0x50, 0x30, 0x89, 0x49, 0x8d, 0xc7, 0xf6, + 0x48, 0x52, 0x04, 0x12, 0xd0, 0xca, 0xce, 0x73, 0x4e, 0x11, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x62, 0x1f, 0x0a, 0x9c, 0x91, 0x30, + 0x5d, 0x33, 0x23, 0x26, 0xca, 0xb1, 0xf7, 0x7f, 0x18, 0xfd, 0xb4, 0xa9, + 0xbc, 0x47, 0x45, 0xb2, 0x79, 0xca, 0x47, 0xb8, 0x09, 0x83, 0xad, 0xe2, + 0xdb, 0xdf, 0x12, 0x10, 0x3c, 0xa2, 0x1d, 0x13, 0xf1, 0xc4, 0x68, 0xc7, + 0xb0, 0x60, 0xbb, 0x10, 0x3f, 0x91, 0x25, 0xfd, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x44, 0xd1, 0xfb, + 0x8d, 0xb8, 0xee, 0xb3, 0x1d, 0x4d, 0x8c, 0x1e, 0x1c, 0xb7, 0xa4, 0x2f, + 0x8c, 0x1a, 0x20, 0x3b, 0xa9, 0xd6, 0xa4, 0x37, 0x22, 0x23, 0x5b, 0x4d, + 0xb6, 0x1f, 0xb3, 0x37, 0xea, 0x0f, 0x5d, 0x0d, 0xd2, 0xa8, 0xcc, 0x6b, + 0x52, 0x82, 0x10, 0x2c, 0x1a, 0xfb, 0xfc, 0xbc, 0xaa, 0x90, 0x69, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xa1, 0x85, 0x45, 0x27, 0x5d, + 0xfe, 0x68, 0x09, 0x58, 0x6e, 0xcb, 0x3c, 0xc4, 0xe8, 0xf3, 0xc2, 0xbe, + 0x02, 0x91, 0x7b, 0xe8, 0x8a, 0xdf, 0x75, 0xc2, 0xe8, 0xa3, 0x3f, 0xb4, + 0x55, 0x9f, 0x70, 0x12, 0x10, 0xf8, 0x4a, 0xef, 0xc3, 0x6b, 0xf4, 0x2c, + 0xd9, 0x0e, 0x5e, 0x23, 0xa4, 0x1c, 0xd5, 0xaf, 0x31, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x10, 0xd9, + 0x2f, 0x79, 0x3b, 0xcd, 0x46, 0x18, 0xdf, 0x24, 0xc0, 0x06, 0xfd, 0x48, + 0xb0, 0xc5, 0x1a, 0x20, 0xba, 0x0a, 0x03, 0xc7, 0xdc, 0x4e, 0xa2, 0xf9, + 0xde, 0x4e, 0x5e, 0xab, 0x88, 0xbe, 0x23, 0x5c, 0xe6, 0xe8, 0x36, 0xed, + 0x76, 0x5a, 0x28, 0xa0, 0x55, 0x4c, 0xac, 0x3e, 0xb8, 0x92, 0xf2, 0x9d, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xab, 0x04, 0xa7, 0x47, + 0x6d, 0xc3, 0xcd, 0xdf, 0xd3, 0xf6, 0xaa, 0x84, 0x56, 0x4c, 0x8b, 0x11, + 0xbc, 0x32, 0xc1, 0xff, 0xa3, 0x29, 0x43, 0xef, 0x27, 0x1d, 0x84, 0x12, + 0x32, 0x6f, 0x6a, 0xd5, 0x12, 0x10, 0x43, 0x24, 0x3b, 0x28, 0x55, 0xfb, + 0x08, 0x87, 0xef, 0x7c, 0x65, 0x44, 0x0c, 0x0d, 0x49, 0x5f, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xe4, + 0x3f, 0x6c, 0x0e, 0x3d, 0x86, 0x77, 0xca, 0xe6, 0x51, 0xd0, 0x03, 0x9a, + 0x6d, 0x26, 0x21, 0x1a, 0x20, 0xb8, 0xd8, 0x8a, 0xfb, 0x3c, 0x6b, 0x39, + 0xad, 0xf2, 0x87, 0x1c, 0xca, 0xa8, 0x0d, 0xf9, 0x4e, 0xcf, 0x4b, 0xba, + 0xe0, 0x54, 0x96, 0x1f, 0x67, 0xc9, 0xd2, 0xaf, 0xb0, 0xa9, 0x50, 0xc6, + 0xd4, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xdb, 0xc2, 0x08, + 0x01, 0xc7, 0xaf, 0x03, 0x35, 0xc0, 0x66, 0x7f, 0xfa, 0xb0, 0xda, 0x0e, + 0xe0, 0xb8, 0x85, 0x25, 0x76, 0x21, 0xae, 0xc2, 0x41, 0xe7, 0x17, 0x36, + 0x50, 0xd0, 0x76, 0xb7, 0x72, 0x12, 0x10, 0xae, 0xd8, 0x7e, 0x09, 0xf8, + 0x9e, 0x95, 0x2e, 0x1f, 0x07, 0x86, 0xe2, 0x38, 0xd4, 0xac, 0x19, 0x62, + 0x00, 0x20, 0xb7, 0x97, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x99, 0xf3, 0x24, 0xda, 0x42, 0x21, 0x14, 0xf6, 0x21, 0xba, 0x64, + 0xec, 0x87, 0x1e, 0x86, 0x52, 0x2f, 0x81, 0x78, 0x23, 0x0b, 0xea, + 0xfb, 0xbe, 0x5e, 0xa7, 0x1a, 0xd2, 0x57, 0x23, 0xc6, 0xbe, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LimitedDurationLicense_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x04, 0x86, 0x99, 0x78, 0x00, 0x00, 0x00, 0x31, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x04, 0x86, 0x99, 0x78, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x47, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x25, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x82, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xaa, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x07, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x51, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x2f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd6, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb4, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x11, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x39, + 0x00, 0x00, 0x00, 0x20, 0x62, 0xac, 0x80, 0x29, 0xf6, 0xff, 0x57, 0x2e, + 0x15, 0x2f, 0x44, 0x00, 0xe3, 0x27, 0x04, 0x53, 0x7f, 0xa5, 0xfc, 0x64, + 0x49, 0xdf, 0x21, 0x76, 0xa2, 0x39, 0x17, 0xdd, 0x9b, 0x2b, 0x2a, 0x1e, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x31, 0x36, 0x44, 0x34, 0x33, 0x44, 0x39, 0x43, + 0x34, 0x43, 0x32, 0x42, 0x30, 0x34, 0x43, 0x44, 0x32, 0x44, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x31, 0x36, 0x44, 0x34, 0x33, 0x44, 0x39, 0x43, 0x34, 0x43, + 0x32, 0x42, 0x30, 0x34, 0x43, 0x44, 0x32, 0x44, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xaa, 0x98, 0x86, + 0xa2, 0x06, 0x12, 0x14, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, 0x0f, + 0x28, 0x3c, 0x38, 0x0f, 0x48, 0x05, 0x58, 0x01, 0x70, 0x00, 0x78, 0x01, + 0x1a, 0x66, 0x12, 0x10, 0x72, 0xed, 0xd2, 0x04, 0x7c, 0xcf, 0x83, 0x76, + 0xfd, 0x15, 0x18, 0xba, 0xfe, 0xfe, 0x75, 0xd2, 0x1a, 0x50, 0x3f, 0x81, + 0x1e, 0x08, 0xd7, 0x1f, 0x03, 0xbb, 0x14, 0x8d, 0xd3, 0x3d, 0x7c, 0xc0, + 0x76, 0xc8, 0x37, 0x59, 0x33, 0xbe, 0xae, 0xce, 0xf0, 0x40, 0x59, 0x05, + 0x90, 0xeb, 0x58, 0x23, 0x5d, 0x78, 0xf0, 0x89, 0xef, 0x79, 0x1d, 0x89, + 0xfc, 0x25, 0xe8, 0xb4, 0x5f, 0xc1, 0xf9, 0x7e, 0x45, 0x7e, 0x27, 0x79, + 0x09, 0x0e, 0xbc, 0x00, 0x8e, 0xcf, 0x7a, 0xed, 0xcc, 0xd7, 0x3f, 0x21, + 0xa6, 0x47, 0xfc, 0xde, 0xd8, 0x3a, 0x5d, 0x86, 0x9a, 0xfe, 0x5e, 0xab, + 0x22, 0x7c, 0x51, 0xe3, 0xc9, 0x07, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x37, 0x47, 0xc4, 0x60, 0x7f, + 0x32, 0x70, 0x23, 0x08, 0x96, 0xe2, 0xec, 0xbd, 0x55, 0xea, 0x2f, 0x1a, + 0x20, 0x0f, 0x68, 0xdb, 0x84, 0xb7, 0x6e, 0x51, 0xc8, 0x85, 0xea, 0x9e, + 0x67, 0xb8, 0x58, 0xbe, 0xa4, 0x84, 0x25, 0xfd, 0xc9, 0xed, 0x71, 0x6c, + 0x2e, 0x20, 0xdc, 0x23, 0xad, 0x07, 0x6b, 0x91, 0xe0, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0xfa, 0xfd, 0x7d, 0x5b, 0x7c, 0xcf, 0xc8, + 0x21, 0xa7, 0x4e, 0x69, 0x28, 0x01, 0x17, 0x6a, 0xa9, 0x3a, 0x62, 0x2d, + 0xe6, 0x04, 0xc9, 0x67, 0xa1, 0x74, 0x60, 0xe2, 0x73, 0xec, 0x6d, 0xf6, + 0xa2, 0x12, 0x10, 0xb1, 0x5f, 0x21, 0x34, 0x58, 0x98, 0xbb, 0x88, 0x2f, + 0x8d, 0x18, 0x7c, 0x10, 0x01, 0xdb, 0x75, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x65, 0x66, 0x55, 0xf7, + 0x0a, 0xef, 0x27, 0x33, 0x74, 0xbf, 0x04, 0x98, 0x9b, 0x77, 0x5d, 0x0b, + 0x1a, 0x20, 0x24, 0x30, 0x55, 0x74, 0xe6, 0x86, 0x62, 0x6c, 0x2b, 0x99, + 0x63, 0x84, 0xab, 0xed, 0x0f, 0x8f, 0xc5, 0x49, 0x2e, 0xa0, 0x76, 0xd2, + 0xe4, 0xc2, 0x27, 0x1d, 0x18, 0x6b, 0xb3, 0x6e, 0xf3, 0xf2, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xcc, 0x0b, 0x57, 0x83, 0x11, 0xf3, + 0xf2, 0x50, 0x4b, 0x0e, 0x4c, 0x45, 0x91, 0xa0, 0x2f, 0x26, 0x45, 0x31, + 0xb4, 0xde, 0x3e, 0x60, 0xb4, 0x3c, 0x11, 0x92, 0xd9, 0xc2, 0x42, 0xb0, + 0x7e, 0x19, 0x12, 0x10, 0x27, 0xcd, 0xf1, 0x85, 0x21, 0x4f, 0x77, 0x95, + 0x0b, 0x76, 0x0f, 0x79, 0x2a, 0x06, 0x3f, 0xf8, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x50, 0xda, 0x14, + 0xd6, 0xc2, 0x9c, 0x37, 0x2c, 0xdd, 0x6e, 0x03, 0x9b, 0xed, 0x4c, 0xd3, + 0x97, 0x1a, 0x20, 0x44, 0x78, 0x41, 0xff, 0x48, 0x54, 0x83, 0x05, 0x7c, + 0x57, 0xf1, 0xcb, 0x88, 0xf8, 0x29, 0x56, 0xd4, 0x5e, 0x68, 0xc2, 0x60, + 0x56, 0xe5, 0x56, 0x0d, 0x09, 0xbc, 0xc6, 0xe4, 0x94, 0xd8, 0x3e, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x03, 0xbd, 0x8d, 0xf3, 0x80, + 0x38, 0x58, 0x72, 0xa6, 0x8a, 0xd4, 0x7a, 0xb4, 0x4d, 0xa4, 0xea, 0x89, + 0x1c, 0xee, 0x46, 0xc6, 0x30, 0xca, 0xe9, 0xf1, 0x36, 0x15, 0x60, 0xf5, + 0x6c, 0x98, 0x15, 0x12, 0x10, 0x09, 0xc7, 0x7c, 0x1b, 0x72, 0x20, 0xc2, + 0x27, 0xf0, 0xf4, 0x7b, 0xa4, 0x3d, 0xae, 0x25, 0x68, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x15, 0x1d, + 0x3d, 0x04, 0xda, 0xc4, 0xfb, 0x03, 0xc4, 0xd4, 0x6b, 0xb0, 0xdb, 0x4c, + 0xda, 0xc6, 0x1a, 0x20, 0xfa, 0x10, 0x6a, 0x10, 0xd3, 0x5c, 0x82, 0x24, + 0xc4, 0xe3, 0xbe, 0x34, 0xe8, 0x8c, 0x37, 0xae, 0x91, 0xc5, 0xce, 0x65, + 0xc4, 0x87, 0xcb, 0xaf, 0xb2, 0x90, 0x64, 0xbc, 0x20, 0xd9, 0x3e, 0x6a, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x10, 0x6b, 0x99, 0x00, + 0x0f, 0x90, 0xae, 0x2e, 0x2d, 0x41, 0x17, 0xea, 0xd0, 0xeb, 0xf9, 0xda, + 0x8a, 0x7c, 0x5a, 0x18, 0x20, 0x1d, 0xc2, 0xd0, 0x39, 0x64, 0x01, 0x6f, + 0x7c, 0x00, 0x72, 0xf4, 0x12, 0x10, 0xe4, 0x0b, 0x34, 0xf5, 0xa3, 0xda, + 0xb7, 0xd1, 0x3f, 0x9f, 0xbe, 0x3f, 0x50, 0xfa, 0xb9, 0xea, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xc5, + 0x42, 0x49, 0xbf, 0x67, 0xf4, 0xe8, 0xdc, 0xb4, 0x45, 0x46, 0x85, 0xd2, + 0x4f, 0xed, 0x2f, 0x1a, 0x20, 0xe7, 0x32, 0xff, 0x94, 0xac, 0x0f, 0x8b, + 0xff, 0x68, 0x35, 0x68, 0x73, 0x32, 0x93, 0x66, 0x3b, 0x19, 0xf1, 0x53, + 0x1c, 0x38, 0x92, 0xa8, 0xe0, 0xc7, 0x26, 0x22, 0x4d, 0xe9, 0x09, 0x25, + 0x03, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xfa, 0x40, 0xae, + 0x3d, 0x7f, 0x00, 0x72, 0xbc, 0x9b, 0x33, 0x7d, 0xf7, 0x77, 0x6c, 0xe7, + 0x64, 0xeb, 0xb2, 0xd3, 0x5c, 0xd9, 0x3f, 0x01, 0x74, 0x6f, 0xef, 0x9c, + 0x6b, 0xd7, 0x50, 0x6a, 0x58, 0x12, 0x10, 0x19, 0x3e, 0x48, 0xb5, 0x7f, + 0x9c, 0xeb, 0xd3, 0x44, 0x07, 0xa8, 0xa3, 0x1b, 0x74, 0xd5, 0x09, 0x62, + 0x00, 0x20, 0xaa, 0x98, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x62, 0xac, 0x80, 0x29, 0xf6, 0xff, 0x57, 0x2e, 0x15, 0x2f, 0x44, + 0x00, 0xe3, 0x27, 0x04, 0x53, 0x7f, 0xa5, 0xfc, 0x64, 0x49, 0xdf, + 0x21, 0x76, 0xa2, 0x39, 0x17, 0xdd, 0x9b, 0x2b, 0x2a, 0x1e, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xaa, 0xc5, 0x58, 0x53, 0x00, 0x00, 0x00, 0x33, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xaa, 0xc5, 0x58, 0x53, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xe5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x53, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x31, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x8e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb6, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x13, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x3b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xc0, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x1d, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x67, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x45, + 0x00, 0x00, 0x00, 0x20, 0xd8, 0x37, 0x8c, 0x35, 0x70, 0x81, 0x15, 0x47, + 0x58, 0x7e, 0xf1, 0xb4, 0x31, 0x33, 0xdc, 0x63, 0x53, 0x6b, 0x03, 0x1e, + 0x16, 0x57, 0xfd, 0xaf, 0x95, 0x19, 0x51, 0x65, 0x92, 0x26, 0x53, 0x5c, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x36, 0x39, 0x46, 0x32, 0x42, 0x31, 0x46, + 0x38, 0x42, 0x36, 0x43, 0x44, 0x37, 0x42, 0x32, 0x32, 0x46, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x36, 0x39, 0x46, 0x32, 0x42, 0x31, 0x46, 0x38, 0x42, + 0x36, 0x43, 0x44, 0x37, 0x42, 0x32, 0x32, 0x46, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x41, 0x2a, 0xcc, 0xe9, 0x8c, 0xa7, + 0xb7, 0x3c, 0xfd, 0xc7, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xcb, 0x98, 0x86, + 0xa2, 0x06, 0x12, 0x14, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x0f, + 0x28, 0x3c, 0x38, 0x0f, 0x48, 0x05, 0x58, 0x01, 0x70, 0x00, 0x78, 0x01, + 0x1a, 0x66, 0x12, 0x10, 0xff, 0x7e, 0x0e, 0x6a, 0x37, 0xbb, 0x97, 0xb7, + 0x11, 0x97, 0x86, 0x1f, 0xe8, 0x4e, 0x3a, 0xb3, 0x1a, 0x50, 0xc9, 0x95, + 0xd1, 0xf3, 0x76, 0x9b, 0x87, 0x88, 0x0e, 0x56, 0x7d, 0xbb, 0xb7, 0x65, + 0x04, 0x42, 0xb9, 0x0f, 0x63, 0x50, 0xc6, 0x61, 0x0f, 0xf5, 0xa1, 0xf6, + 0x46, 0x77, 0xe8, 0x66, 0xfe, 0xdb, 0x6d, 0xc1, 0xb1, 0x96, 0x3c, 0xaa, + 0xad, 0x90, 0xf3, 0xa6, 0x50, 0xcf, 0x6a, 0x0a, 0x76, 0xe7, 0x6c, 0x06, + 0x24, 0xcc, 0xa3, 0xb6, 0x79, 0x62, 0xc3, 0xc9, 0x40, 0x86, 0x2f, 0x33, + 0x62, 0x97, 0x28, 0xbe, 0xf6, 0x94, 0xd8, 0x8f, 0xd5, 0xef, 0x18, 0x11, + 0x60, 0x01, 0x9d, 0x62, 0x05, 0xb3, 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xe6, 0xd4, 0xdc, 0xa0, 0x11, + 0x80, 0x09, 0x5a, 0x53, 0xab, 0x01, 0x41, 0x73, 0x63, 0x63, 0x02, 0x1a, + 0x20, 0xd9, 0x9b, 0xc7, 0x49, 0x88, 0x6f, 0xe9, 0x36, 0x5d, 0xd4, 0xe6, + 0x52, 0x9a, 0x4e, 0x98, 0x4a, 0x9c, 0xeb, 0x84, 0x69, 0x3a, 0xc2, 0xdd, + 0xeb, 0xfe, 0x67, 0xbb, 0x31, 0xdb, 0x8a, 0x6b, 0xfb, 0x20, 0x02, 0x28, + 0x01, 0x42, 0x34, 0x0a, 0x20, 0x0e, 0x77, 0x59, 0xd4, 0x0f, 0x4d, 0xcf, + 0x5b, 0x75, 0x24, 0xfe, 0x38, 0xf7, 0xf0, 0x50, 0x80, 0x9a, 0x13, 0x5d, + 0x41, 0x31, 0x17, 0xf8, 0x45, 0xa4, 0xb3, 0x69, 0x49, 0x83, 0x73, 0xcd, + 0xc4, 0x12, 0x10, 0xe7, 0x36, 0xa1, 0xc6, 0xe5, 0xbd, 0x94, 0x74, 0xde, + 0x56, 0xa8, 0xf8, 0xa4, 0xeb, 0xae, 0x3e, 0x62, 0x00, 0x1a, 0x82, 0x01, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x65, 0x54, 0x5c, 0x35, + 0x07, 0x2d, 0x85, 0x78, 0x9e, 0xcf, 0x84, 0x46, 0x83, 0xa1, 0x65, 0xca, + 0x1a, 0x20, 0x32, 0x50, 0x1a, 0x44, 0x67, 0x63, 0x2e, 0xd3, 0x36, 0x0f, + 0x3b, 0xab, 0x3c, 0xa0, 0x61, 0xcd, 0x55, 0xa9, 0xce, 0xdb, 0x7d, 0x3b, + 0x9c, 0x6d, 0xbc, 0xc1, 0x93, 0x3d, 0xb0, 0x16, 0x0e, 0xae, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x14, 0x1a, 0x34, 0xd0, 0x8c, 0x1f, + 0x7a, 0x6d, 0x87, 0x13, 0x96, 0x6e, 0x00, 0xfb, 0xcd, 0xd6, 0x84, 0x88, + 0xe4, 0xb3, 0xea, 0x2d, 0x3a, 0xc0, 0xb5, 0xe5, 0x12, 0xa9, 0x01, 0x29, + 0x33, 0x0f, 0x12, 0x10, 0x77, 0x98, 0x5a, 0x32, 0x60, 0xbd, 0x66, 0xd4, + 0xa8, 0x60, 0x4e, 0x79, 0xda, 0xb0, 0xff, 0x0f, 0x62, 0x00, 0x1a, 0x82, + 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xaf, 0xba, 0x47, + 0xdf, 0x34, 0xc0, 0x84, 0x5e, 0x6d, 0xc1, 0x6e, 0xb8, 0xbd, 0xd0, 0xf3, + 0xf9, 0x1a, 0x20, 0x34, 0xd6, 0xbf, 0x4b, 0x11, 0x6c, 0xe9, 0x4d, 0x66, + 0x26, 0xda, 0x14, 0x36, 0x6a, 0x88, 0x4b, 0x64, 0x1a, 0xe2, 0xab, 0x9c, + 0xd2, 0x68, 0x22, 0x06, 0x97, 0x68, 0xf2, 0x54, 0xb7, 0xa4, 0xc4, 0x20, + 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xa5, 0x1a, 0xea, 0x7f, 0x91, + 0x90, 0xdf, 0xf9, 0x86, 0x40, 0xc6, 0x54, 0x8a, 0xd8, 0xba, 0x87, 0xb2, + 0xa2, 0xe2, 0xee, 0xec, 0x3d, 0x96, 0x65, 0x38, 0xd4, 0xc8, 0x54, 0x02, + 0x0c, 0xe4, 0xe0, 0x12, 0x10, 0x12, 0xe7, 0x56, 0xf6, 0x1d, 0x51, 0x32, + 0x47, 0x80, 0xe3, 0xd3, 0xce, 0xa7, 0xf5, 0xa9, 0x83, 0x62, 0x00, 0x1a, + 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x04, 0xf6, + 0x85, 0x1d, 0xf7, 0xbc, 0xd6, 0x35, 0xaa, 0x2c, 0xc8, 0x6b, 0x66, 0x01, + 0xe5, 0x9f, 0x1a, 0x20, 0xbc, 0xef, 0xf7, 0x33, 0xbb, 0x97, 0x2e, 0x40, + 0x2d, 0x9f, 0x2a, 0x09, 0x06, 0xdf, 0x56, 0x4b, 0x30, 0x40, 0x91, 0x9d, + 0x49, 0xa6, 0xdb, 0xc7, 0x9b, 0x12, 0x0d, 0xaa, 0x8c, 0x7d, 0x9a, 0x25, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xeb, 0x54, 0x85, 0x93, + 0xc4, 0x83, 0x91, 0xda, 0xce, 0x00, 0xbd, 0xdf, 0x13, 0x6f, 0x14, 0x22, + 0xfe, 0x99, 0xd9, 0xdb, 0x31, 0x97, 0x1f, 0xb5, 0x39, 0x93, 0xdd, 0x95, + 0xc0, 0x54, 0xde, 0x7b, 0x12, 0x10, 0x2f, 0xe5, 0xd1, 0x2f, 0xd1, 0xa3, + 0x4f, 0xf0, 0x66, 0x73, 0x2f, 0xc9, 0x98, 0x4c, 0xa1, 0xf2, 0x62, 0x00, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x7d, + 0xc0, 0xde, 0x49, 0xb3, 0xd8, 0x2f, 0xc2, 0xb1, 0x9a, 0x96, 0x4f, 0x80, + 0x03, 0x84, 0x26, 0x1a, 0x20, 0x45, 0x09, 0x1d, 0x31, 0x32, 0xfb, 0xb0, + 0xa8, 0x29, 0xc0, 0xb1, 0xec, 0xb5, 0x7d, 0x0e, 0x47, 0x8b, 0x1a, 0xf1, + 0xf1, 0x44, 0x53, 0x04, 0x29, 0xcc, 0xb1, 0x70, 0x81, 0xa6, 0x2c, 0x46, + 0xa2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x02, 0x02, 0xde, + 0xe4, 0xdd, 0x18, 0x44, 0xce, 0x63, 0x11, 0x1e, 0x4c, 0x19, 0xdb, 0xf3, + 0x9f, 0x87, 0xe1, 0x10, 0x77, 0xb5, 0xe8, 0x5e, 0x09, 0xf2, 0xe3, 0xa6, + 0x0c, 0xee, 0x79, 0xef, 0x5f, 0x12, 0x10, 0xbb, 0x21, 0x1e, 0x1a, 0xb0, + 0xeb, 0x84, 0x59, 0x23, 0xe8, 0x82, 0xa2, 0x7e, 0xc6, 0xe0, 0x29, 0x62, + 0x00, 0x20, 0xcb, 0x98, 0x86, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xd8, 0x37, 0x8c, 0x35, 0x70, 0x81, 0x15, 0x47, 0x58, 0x7e, 0xf1, + 0xb4, 0x31, 0x33, 0xdc, 0x63, 0x53, 0x6b, 0x03, 0x1e, 0x16, 0x57, + 0xfd, 0xaf, 0x95, 0x19, 0x51, 0x65, 0x92, 0x26, 0x53, 0x5c, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_Heartbeat_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0xdb, 0x33, 0x2f, 0x31, 0x00, 0x00, 0x00, 0x35, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0xdb, 0x33, 0x2f, 0x31, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 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, 0x28, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3f, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1d, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x56, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa2, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x49, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x27, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x60, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xce, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xac, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf7, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x53, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x31, + 0x00, 0x00, 0x00, 0x20, 0xef, 0xec, 0x8e, 0x09, 0x39, 0x6d, 0x7f, 0x66, + 0xbc, 0xc8, 0xbe, 0xbd, 0xfe, 0xc1, 0xd9, 0xc8, 0x87, 0xf9, 0x10, 0x07, + 0x8b, 0xaa, 0x0a, 0x26, 0x60, 0x5b, 0xb0, 0xc0, 0x3e, 0xdd, 0x3f, 0xfb, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x43, 0x35, 0x42, 0x39, 0x43, 0x46, 0x45, 0x41, + 0x34, 0x34, 0x45, 0x31, 0x42, 0x33, 0x30, 0x33, 0x33, 0x31, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x35, 0x42, 0x39, 0x43, 0x46, 0x45, 0x41, 0x34, 0x34, + 0x45, 0x31, 0x42, 0x33, 0x30, 0x33, 0x33, 0x31, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xec, 0x98, 0x86, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x38, 0x1e, + 0x48, 0x0a, 0x50, 0x0a, 0x1a, 0x66, 0x12, 0x10, 0xfa, 0x05, 0x44, 0x23, + 0xe9, 0x8b, 0x03, 0x93, 0x56, 0xfb, 0xfb, 0x7c, 0xd7, 0xf0, 0xf1, 0xf7, + 0x1a, 0x50, 0xab, 0xbe, 0xdb, 0x58, 0x1a, 0x2e, 0xd4, 0xa4, 0xff, 0x2b, + 0x45, 0x47, 0xf3, 0xc4, 0x3f, 0x69, 0xf7, 0xef, 0xa4, 0x12, 0xce, 0xa5, + 0x70, 0x67, 0x8c, 0x6a, 0xde, 0x94, 0x49, 0x9c, 0xde, 0x01, 0x23, 0xb4, + 0x3c, 0x1b, 0x52, 0xab, 0x3e, 0x99, 0x53, 0xf2, 0xa6, 0x72, 0xbe, 0x46, + 0x9a, 0x49, 0x89, 0x06, 0xd6, 0x86, 0x94, 0xd7, 0xb2, 0xc1, 0x99, 0xc9, + 0x4b, 0x06, 0x71, 0xdf, 0x9e, 0xc7, 0x32, 0xf4, 0xff, 0x9f, 0x85, 0x0f, + 0x7a, 0xf4, 0x15, 0x02, 0x0b, 0x07, 0x57, 0x5c, 0x0c, 0xe0, 0x20, 0x01, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x18, + 0x78, 0x16, 0xb8, 0x23, 0xdb, 0x07, 0x96, 0xf9, 0x97, 0xf1, 0xac, 0xfb, + 0x5b, 0xf3, 0x4c, 0x1a, 0x20, 0x95, 0xe3, 0xb4, 0x09, 0xd1, 0x39, 0xc5, + 0xa2, 0x8d, 0x15, 0x07, 0x65, 0x3a, 0x9c, 0x45, 0xdf, 0x2c, 0x8a, 0x1a, + 0x1b, 0xfc, 0x31, 0x23, 0x5f, 0x81, 0xb5, 0x84, 0x34, 0xbc, 0x89, 0x2d, + 0xb2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xd4, 0x04, 0xc5, + 0xaa, 0xb0, 0xdf, 0xa9, 0xde, 0xb3, 0x27, 0xed, 0x7e, 0xff, 0xd7, 0xe0, + 0x26, 0xaf, 0xc2, 0xb1, 0xde, 0xa0, 0x44, 0xbf, 0xe0, 0x35, 0xff, 0xd6, + 0x00, 0x1f, 0x1d, 0xe4, 0x11, 0x12, 0x10, 0x18, 0x5e, 0xc5, 0xe7, 0xd2, + 0xa4, 0xbd, 0x58, 0xbe, 0x81, 0x8b, 0x91, 0x1b, 0x32, 0x8a, 0xb3, 0x62, + 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0xfd, 0x4c, 0x21, 0xa7, 0xf8, 0x5f, 0x6c, 0xb9, 0x3d, 0x87, 0x7f, 0x06, + 0xbb, 0x26, 0x8a, 0x66, 0x1a, 0x20, 0x86, 0xf2, 0x1c, 0x41, 0x81, 0xbf, + 0xbf, 0x3b, 0x77, 0x59, 0x4f, 0x9e, 0xd8, 0x8d, 0x87, 0xfd, 0xfc, 0xfb, + 0xfd, 0xd9, 0xa6, 0xbb, 0x13, 0xbd, 0x61, 0x00, 0x1f, 0x50, 0x82, 0xfb, + 0xfa, 0x79, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x5b, 0xba, + 0x69, 0x32, 0x2b, 0x88, 0xba, 0x04, 0xee, 0xf8, 0x6e, 0x52, 0x44, 0x29, + 0x86, 0x2c, 0xa8, 0xb5, 0x09, 0x3a, 0x8e, 0xe2, 0x9a, 0x34, 0xc7, 0x3e, + 0x59, 0x66, 0x5e, 0xfa, 0xd4, 0xe4, 0x12, 0x10, 0xad, 0xdb, 0x87, 0xb6, + 0xe9, 0xe4, 0x99, 0xf8, 0x7d, 0x77, 0xc6, 0xa8, 0x02, 0x7b, 0x0f, 0xb0, + 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, + 0x10, 0x64, 0x7d, 0xea, 0x75, 0xa7, 0x16, 0x01, 0xe9, 0x3b, 0x38, 0x4e, + 0x53, 0x19, 0x56, 0xb6, 0x95, 0x1a, 0x20, 0x6b, 0xba, 0x84, 0x3b, 0xc3, + 0x46, 0x13, 0xf5, 0xad, 0xae, 0x76, 0x10, 0x5e, 0xc8, 0x87, 0x8a, 0x3f, + 0xcb, 0x58, 0x41, 0x76, 0x52, 0x1c, 0x9d, 0x71, 0x7c, 0x21, 0x8b, 0x34, + 0x4a, 0x99, 0x3b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x5f, + 0x04, 0x06, 0xf6, 0x84, 0x05, 0x71, 0xba, 0x7c, 0x48, 0x47, 0xee, 0xe1, + 0xa4, 0x07, 0x57, 0x16, 0xca, 0x70, 0xee, 0x2e, 0x90, 0x36, 0xc0, 0xa9, + 0x99, 0x5e, 0x06, 0x83, 0x10, 0x9d, 0xc7, 0x12, 0x10, 0x82, 0xb5, 0x82, + 0x19, 0xb9, 0x3d, 0x96, 0x05, 0x67, 0xe3, 0x64, 0x10, 0x9c, 0xff, 0x4d, + 0x8e, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x12, 0x10, 0x74, 0x61, 0x8f, 0x5f, 0x87, 0x28, 0x54, 0xe8, 0x76, 0x58, + 0x98, 0x91, 0x4a, 0x4c, 0xa6, 0x42, 0x1a, 0x20, 0x23, 0x20, 0xd0, 0x38, + 0x36, 0x57, 0x9e, 0x28, 0x18, 0x4d, 0x28, 0x42, 0xac, 0xbb, 0x4b, 0x95, + 0x62, 0x31, 0x01, 0xb1, 0x88, 0x69, 0xbf, 0xbf, 0x8b, 0xc7, 0x7d, 0xdd, + 0x2c, 0x1c, 0xfe, 0x54, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x6e, 0xc8, 0x43, 0x53, 0x43, 0xbf, 0x82, 0x7b, 0x10, 0xe9, 0x44, 0x36, + 0xa3, 0xe0, 0x08, 0xe3, 0x05, 0x82, 0x80, 0x98, 0xd0, 0x2c, 0x2f, 0x9d, + 0x4a, 0xc5, 0x19, 0x30, 0xb5, 0x85, 0xfb, 0x60, 0x12, 0x10, 0x57, 0x3c, + 0x1b, 0x21, 0x38, 0xf7, 0xbf, 0x35, 0xbd, 0xf4, 0x5c, 0xf4, 0x8d, 0x7a, + 0x73, 0xb7, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, + 0x3d, 0x12, 0x10, 0x54, 0x51, 0x65, 0xa0, 0xeb, 0x04, 0x90, 0xc8, 0x0c, + 0x4e, 0x6a, 0x43, 0xe8, 0x98, 0xe4, 0x33, 0x1a, 0x20, 0x72, 0x9c, 0x35, + 0x1b, 0xbb, 0xdd, 0x02, 0xa3, 0x25, 0x35, 0x88, 0x04, 0x18, 0x6e, 0x8c, + 0x99, 0xb1, 0x40, 0x9f, 0xac, 0x8e, 0x8b, 0xc4, 0x4c, 0xad, 0x89, 0xa6, + 0x5f, 0x27, 0x2d, 0x91, 0x5d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x5c, 0x1d, 0x6d, 0xd4, 0x89, 0xcf, 0x18, 0x5e, 0xda, 0x1d, 0xd3, + 0x74, 0x7e, 0x88, 0xc8, 0x02, 0x47, 0xf2, 0xb5, 0xb5, 0x2c, 0xaa, 0x04, + 0x23, 0xca, 0xe0, 0xa7, 0xbc, 0xfb, 0x4d, 0xd5, 0x1e, 0x12, 0x10, 0xc0, + 0x4a, 0x24, 0xbc, 0x19, 0xbd, 0x44, 0xd3, 0x4f, 0xcb, 0xc5, 0x70, 0x59, + 0x65, 0x06, 0x4a, 0x62, 0x00, 0x20, 0xec, 0x98, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xef, 0xec, 0x8e, 0x09, 0x39, 0x6d, 0x7f, 0x66, 0xbc, 0xc8, 0xbe, + 0xbd, 0xfe, 0xc1, 0xd9, 0xc8, 0x87, 0xf9, 0x10, 0x07, 0x8b, 0xaa, + 0x0a, 0x26, 0x60, 0x5b, 0xb0, 0xc0, 0x3e, 0xdd, 0x3f, 0xfb, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_Heartbeat_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x23, 0xbd, 0x73, 0xc7, 0x00, 0x00, 0x00, 0x37, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x23, 0xbd, 0x73, 0xc7, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 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, 0x28, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdd, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x29, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x55, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x33, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xda, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb8, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x15, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3d, + 0x00, 0x00, 0x00, 0x20, 0x33, 0x0e, 0x0b, 0xbf, 0xf8, 0x28, 0x6b, 0x04, + 0x60, 0x12, 0x51, 0x0b, 0xa2, 0xca, 0x80, 0xf6, 0x06, 0x33, 0x55, 0xcf, + 0x8c, 0xe9, 0x7c, 0x6f, 0x13, 0xad, 0xa6, 0xef, 0xae, 0x7c, 0xef, 0x27, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x45, 0x37, 0x32, 0x35, 0x31, 0x38, 0x37, + 0x43, 0x45, 0x34, 0x41, 0x45, 0x38, 0x34, 0x35, 0x33, 0x33, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x45, 0x37, 0x32, 0x35, 0x31, 0x38, 0x37, 0x43, 0x45, + 0x34, 0x41, 0x45, 0x38, 0x34, 0x35, 0x33, 0x33, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x94, 0xae, 0x63, 0x92, 0x9c, 0xbe, + 0x4d, 0xe8, 0x38, 0xd7, 0x38, 0x00, 0x40, 0x00, 0x48, 0xc6, 0x99, 0x86, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x38, 0x1e, + 0x48, 0x0a, 0x50, 0x0a, 0x1a, 0x66, 0x12, 0x10, 0xfb, 0xc7, 0x9a, 0x59, + 0xb9, 0xff, 0x13, 0x4a, 0x7f, 0x80, 0x5c, 0x8f, 0xd5, 0x51, 0x36, 0xa3, + 0x1a, 0x50, 0xd1, 0xc4, 0x9b, 0x4d, 0xe4, 0xb0, 0xd1, 0xa9, 0xf4, 0xe1, + 0x06, 0x28, 0xbb, 0x22, 0xe2, 0x2e, 0xff, 0x1c, 0x73, 0x88, 0x91, 0x0c, + 0xbb, 0x54, 0x21, 0x6e, 0x76, 0x28, 0x04, 0xa9, 0x68, 0xcf, 0x7e, 0x1f, + 0x1d, 0x3e, 0x4d, 0xfc, 0x67, 0x3a, 0xb7, 0x41, 0x8b, 0xcc, 0xf4, 0xb4, + 0x14, 0xf2, 0x61, 0x64, 0xf2, 0x44, 0x09, 0xef, 0x94, 0xca, 0xf1, 0xa2, + 0x16, 0xf5, 0x99, 0x99, 0xf6, 0xae, 0xe5, 0xa7, 0x4c, 0xdf, 0x6d, 0xf6, + 0x71, 0x82, 0xbc, 0x1b, 0x69, 0x66, 0x1b, 0x20, 0x30, 0x71, 0x20, 0x01, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x5c, + 0x59, 0xfe, 0x29, 0x0f, 0x22, 0x4b, 0xbb, 0x7b, 0xbe, 0x51, 0xb1, 0x15, + 0xaf, 0x28, 0xd6, 0x1a, 0x20, 0xc5, 0x0e, 0x81, 0x80, 0x75, 0xaa, 0x6a, + 0x20, 0x01, 0x4e, 0xfa, 0x12, 0x26, 0xe3, 0x36, 0xa3, 0x04, 0x67, 0x52, + 0x3b, 0x20, 0x74, 0xe8, 0x64, 0x55, 0x98, 0xb0, 0x72, 0x8e, 0x48, 0xf9, + 0xe8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x64, 0x7e, 0xcb, + 0x64, 0xab, 0xe3, 0x4d, 0xf4, 0x6f, 0x7f, 0x59, 0x7f, 0xc5, 0x24, 0xa2, + 0x8c, 0x9f, 0xc4, 0xbe, 0xb0, 0x1f, 0x5f, 0x23, 0xef, 0x62, 0x3b, 0xeb, + 0x60, 0xb7, 0x1f, 0x27, 0xe6, 0x12, 0x10, 0x84, 0x4f, 0x2f, 0x51, 0xd4, + 0x75, 0x03, 0x03, 0xd9, 0xa1, 0x36, 0x93, 0x37, 0x71, 0xaf, 0x33, 0x62, + 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x46, 0x05, 0xf1, 0x99, 0x3c, 0x7a, 0x7b, 0x1e, 0xe2, 0xe0, 0x30, 0x9c, + 0x14, 0xcf, 0xdc, 0xab, 0x1a, 0x20, 0x04, 0xcb, 0x9d, 0xae, 0xb9, 0x62, + 0x8c, 0x28, 0x06, 0x57, 0xa5, 0x71, 0x90, 0xa5, 0x3b, 0xb5, 0x82, 0xa6, + 0x2c, 0x6d, 0xb1, 0x76, 0xc2, 0xfa, 0x76, 0x5f, 0xe5, 0xdd, 0xe7, 0xf6, + 0xdf, 0x54, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x69, 0x64, + 0x69, 0x42, 0xe9, 0xad, 0x43, 0x8a, 0xac, 0x3b, 0x5b, 0x56, 0x32, 0xb6, + 0xfd, 0xdd, 0x52, 0xd3, 0x94, 0x3e, 0x5c, 0x57, 0xe9, 0xf3, 0x16, 0xfd, + 0xfa, 0x50, 0x61, 0x1e, 0x7f, 0xef, 0x12, 0x10, 0xab, 0x54, 0x2e, 0xf1, + 0xd5, 0x19, 0x65, 0x4f, 0xbc, 0x74, 0x37, 0x80, 0x5e, 0xad, 0xcf, 0x7f, + 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, + 0x10, 0xf7, 0xab, 0x7f, 0xab, 0xa2, 0xeb, 0x92, 0x0e, 0x32, 0x5e, 0x0a, + 0x55, 0xe5, 0xfe, 0x87, 0x0e, 0x1a, 0x20, 0xec, 0x67, 0xd1, 0xe6, 0x29, + 0x1e, 0xdb, 0xaa, 0x84, 0xd2, 0xb3, 0x84, 0xe8, 0x5f, 0x47, 0x33, 0xc4, + 0xe2, 0xf9, 0x5d, 0x7d, 0xa8, 0x09, 0x4a, 0x73, 0x8f, 0x89, 0x62, 0x2d, + 0x04, 0xef, 0x01, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x57, + 0x9c, 0x13, 0x6f, 0xfc, 0x0e, 0x22, 0xcc, 0x88, 0xdd, 0xd2, 0xfb, 0xed, + 0x83, 0xdb, 0xad, 0x2f, 0xe5, 0x56, 0x3d, 0xd7, 0x75, 0xdf, 0x3f, 0x0b, + 0xa6, 0x79, 0x75, 0x85, 0xb4, 0x3c, 0xd0, 0x12, 0x10, 0x31, 0xa8, 0x83, + 0xa9, 0x43, 0xb3, 0xd9, 0xf7, 0x65, 0x93, 0xfb, 0x52, 0x70, 0x86, 0xf3, + 0xf0, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x12, 0x10, 0xb9, 0xc4, 0x7a, 0x1c, 0x7d, 0xde, 0x1f, 0xc7, 0x7d, 0xa4, + 0xc8, 0xa5, 0x4e, 0xda, 0x98, 0xc0, 0x1a, 0x20, 0x72, 0x4e, 0x94, 0x0a, + 0x7c, 0x4e, 0x31, 0x3a, 0x52, 0xcc, 0xc2, 0x6e, 0x8e, 0x10, 0x0c, 0x9a, + 0x69, 0xd4, 0xa8, 0x43, 0x9d, 0x39, 0x41, 0xc0, 0xcf, 0x9d, 0x13, 0x1b, + 0xce, 0x3a, 0x2d, 0x45, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x12, 0x4e, 0x97, 0x26, 0xad, 0x18, 0xb7, 0x0b, 0x28, 0x5c, 0xc7, 0x0b, + 0xef, 0x76, 0x68, 0x07, 0x4b, 0x24, 0xff, 0xbb, 0x2a, 0xa5, 0x3b, 0x6c, + 0x75, 0xf1, 0xe4, 0x50, 0xf5, 0x37, 0xe4, 0xd6, 0x12, 0x10, 0xa1, 0xeb, + 0x14, 0xbf, 0xa7, 0xa5, 0x74, 0x30, 0x06, 0xc8, 0xf3, 0x4e, 0x3d, 0x16, + 0x99, 0x4c, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, + 0x3d, 0x12, 0x10, 0xe7, 0x0a, 0x9c, 0x74, 0x5c, 0x9a, 0x5a, 0x48, 0xed, + 0x40, 0x58, 0xb7, 0x59, 0x8c, 0xba, 0x07, 0x1a, 0x20, 0x49, 0x70, 0x2c, + 0xf4, 0x66, 0x36, 0x69, 0xa1, 0x57, 0x41, 0xb2, 0xee, 0xe9, 0xe7, 0x25, + 0xdd, 0xb7, 0xeb, 0x30, 0x7b, 0x69, 0xf9, 0xc4, 0x41, 0xfd, 0x5e, 0x4f, + 0x61, 0x5a, 0xda, 0x1e, 0x1e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xce, 0xd3, 0x90, 0x50, 0x85, 0xbc, 0x3a, 0x00, 0x0b, 0x1b, 0xac, + 0x43, 0xbc, 0x7a, 0x9a, 0x3e, 0x9c, 0x42, 0x77, 0x9c, 0x3e, 0x41, 0xba, + 0x95, 0x0f, 0x22, 0x21, 0x98, 0xc9, 0xfa, 0x92, 0x7d, 0x12, 0x10, 0x41, + 0x3e, 0x88, 0x37, 0xd2, 0x23, 0xaa, 0xd4, 0xf8, 0x70, 0xf8, 0x76, 0x4a, + 0xdc, 0x93, 0x97, 0x62, 0x00, 0x20, 0xc6, 0x99, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x33, 0x0e, 0x0b, 0xbf, 0xf8, 0x28, 0x6b, 0x04, 0x60, 0x12, 0x51, + 0x0b, 0xa2, 0xca, 0x80, 0xf6, 0x06, 0x33, 0x55, 0xcf, 0x8c, 0xe9, + 0x7c, 0x6f, 0x13, 0xad, 0xa6, 0xef, 0xae, 0x7c, 0xef, 0x27, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_UnlimitedStreaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x9d, 0x8d, 0x4d, 0x0e, 0x00, 0x00, 0x00, 0x39, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x9d, 0x8d, 0x4d, 0x0e, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 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, 0x05, 0x00, 0x00, 0x00, 0xd3, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x41, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdd, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x4b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xd0, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xae, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x55, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x33, + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xeb, 0x49, 0xa4, 0x69, 0x96, 0xb2, 0x03, + 0x71, 0x7a, 0x8b, 0xe5, 0xf2, 0x61, 0xb0, 0xe8, 0x2d, 0x40, 0x0f, 0x3f, + 0x4e, 0xfc, 0x5f, 0xe8, 0x4b, 0x70, 0x5b, 0x21, 0x35, 0x03, 0xc4, 0x12, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x41, 0x38, 0x45, 0x44, 0x38, 0x37, 0x38, 0x39, + 0x32, 0x31, 0x38, 0x39, 0x37, 0x36, 0x32, 0x36, 0x33, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x41, 0x38, 0x45, 0x44, 0x38, 0x37, 0x38, 0x39, 0x32, 0x31, + 0x38, 0x39, 0x37, 0x36, 0x32, 0x36, 0x33, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xa0, 0x9a, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0xa1, 0xc0, + 0x05, 0x4d, 0xc5, 0x3b, 0x39, 0x65, 0x78, 0x9a, 0x82, 0x1c, 0x95, 0x70, + 0xef, 0x76, 0x1a, 0x50, 0x01, 0x42, 0x0e, 0xc3, 0x37, 0xc9, 0x70, 0x86, + 0xed, 0x14, 0xeb, 0xc6, 0x01, 0x26, 0x5e, 0x97, 0x7d, 0x7d, 0xed, 0xa6, + 0xb2, 0x3f, 0xae, 0x74, 0x42, 0x67, 0xa5, 0xa4, 0xe6, 0xcd, 0x9a, 0x44, + 0xb1, 0xfd, 0xfb, 0x12, 0x93, 0xf0, 0xb7, 0x5e, 0x3e, 0x1f, 0xfd, 0x2f, + 0xcb, 0xb1, 0xd6, 0xea, 0x4a, 0xc3, 0xea, 0x63, 0x68, 0xe6, 0xe0, 0xbe, + 0xd0, 0xb5, 0x4e, 0x58, 0x8c, 0xc5, 0x12, 0x92, 0xb4, 0x49, 0x10, 0x3b, + 0x0e, 0xe4, 0x15, 0x75, 0xfa, 0x17, 0x0e, 0x27, 0x38, 0x27, 0x34, 0x5e, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xdc, 0x38, 0x0c, 0x66, 0x86, 0xdd, 0x0d, 0xda, 0xb2, 0xd9, 0x71, + 0xd5, 0x57, 0x98, 0xb6, 0x8b, 0x1a, 0x20, 0x06, 0xed, 0xcc, 0x99, 0x80, + 0xa5, 0x9b, 0x0f, 0xbe, 0x62, 0x95, 0x9c, 0xa9, 0x29, 0xe0, 0xdc, 0x29, + 0x82, 0x2f, 0x4e, 0x1a, 0x3b, 0x16, 0xd9, 0x14, 0x0a, 0x39, 0x4a, 0xf0, + 0x6d, 0x9f, 0x05, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x5f, + 0x8c, 0x99, 0xb9, 0xbd, 0x86, 0x19, 0x96, 0x2d, 0xa6, 0x9f, 0xc7, 0x46, + 0x75, 0x2f, 0xa6, 0xdb, 0x89, 0xe2, 0x1b, 0x11, 0x30, 0xe6, 0x59, 0x89, + 0x15, 0x87, 0x3f, 0x8f, 0x05, 0xf4, 0x57, 0x12, 0x10, 0x46, 0x5f, 0xf7, + 0xc2, 0x5f, 0xe9, 0x39, 0x96, 0x44, 0x9e, 0x57, 0x72, 0xd2, 0xed, 0x72, + 0x3b, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xf0, 0x3d, 0x75, 0xd0, 0x23, 0x4c, 0x23, 0xac, 0x9f, 0x88, + 0xd5, 0xec, 0x4e, 0x95, 0x0c, 0x8a, 0x1a, 0x20, 0xa3, 0xae, 0xf5, 0xd8, + 0xc7, 0x33, 0x29, 0x62, 0x8a, 0x93, 0x64, 0xe6, 0x3e, 0x7d, 0x92, 0x26, + 0x68, 0x6c, 0xab, 0x48, 0xcc, 0xdf, 0x4b, 0xae, 0x05, 0xcd, 0x2b, 0x44, + 0x3e, 0x16, 0x71, 0x13, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x45, 0x6a, 0x5b, 0xa4, 0xdb, 0xb9, 0x22, 0x96, 0xf2, 0x0f, 0xf1, 0xcf, + 0xf3, 0x22, 0x93, 0x01, 0x2b, 0xba, 0x43, 0xc1, 0xbe, 0xab, 0x40, 0xc9, + 0x16, 0xd4, 0x55, 0xb4, 0x22, 0x45, 0x71, 0x4a, 0x12, 0x10, 0xa6, 0x6a, + 0x85, 0x24, 0xa8, 0xc6, 0x62, 0xb8, 0xb0, 0x64, 0xaf, 0xcc, 0x94, 0xc1, + 0x2a, 0x78, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0xb3, 0x8f, 0xa5, 0x5a, 0x0d, 0x58, 0x9e, 0x64, 0x07, + 0x95, 0x13, 0xc8, 0xd4, 0xa1, 0x88, 0x0f, 0x1a, 0x20, 0xdc, 0xf1, 0x89, + 0x16, 0xe9, 0xf8, 0xcd, 0x97, 0x53, 0x52, 0x4a, 0x84, 0x9a, 0xc8, 0x32, + 0x03, 0xba, 0xfb, 0x96, 0xb3, 0x59, 0x0d, 0xaf, 0x66, 0x39, 0x98, 0x05, + 0x27, 0x79, 0x73, 0xf3, 0xb6, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x27, 0x71, 0x48, 0xbc, 0x80, 0xeb, 0x94, 0xe8, 0xba, 0xa7, 0x7c, + 0x4d, 0x0b, 0x8e, 0x24, 0x4a, 0xc9, 0xa7, 0x5a, 0x71, 0x5d, 0x76, 0xf4, + 0xc4, 0x97, 0xe7, 0x18, 0x99, 0x4f, 0xb4, 0x15, 0x57, 0x12, 0x10, 0xd8, + 0xb5, 0x60, 0x37, 0xad, 0xcd, 0x02, 0x61, 0xb1, 0x33, 0x6f, 0xb3, 0x95, + 0xf5, 0x63, 0xc8, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x85, 0x7b, 0x3d, 0x69, 0x6e, 0x09, 0x83, 0x73, + 0x0c, 0xea, 0xa2, 0x59, 0xdc, 0xdc, 0x74, 0x3e, 0x1a, 0x20, 0x56, 0xc9, + 0xb0, 0xa2, 0xe1, 0xef, 0x1c, 0xdf, 0x1b, 0x5e, 0xb4, 0x24, 0xc0, 0x2e, + 0xc2, 0x68, 0x93, 0x85, 0x04, 0x4f, 0xe5, 0xca, 0xd7, 0x3a, 0x99, 0x6c, + 0x23, 0x50, 0x24, 0xc5, 0xf3, 0x33, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0xa4, 0x8e, 0x11, 0x30, 0xe8, 0x0e, 0x69, 0x0c, 0x8a, 0x77, + 0xef, 0x5f, 0x99, 0x35, 0xe6, 0xa7, 0xcb, 0xc2, 0x61, 0x18, 0x4d, 0xef, + 0x52, 0x97, 0x91, 0xb3, 0x54, 0x00, 0xf0, 0x2a, 0x8c, 0xe6, 0x12, 0x10, + 0xb9, 0x02, 0xe8, 0xd0, 0xc6, 0x3c, 0x4f, 0x2d, 0x73, 0xa3, 0x93, 0xe5, + 0x51, 0x54, 0x69, 0x76, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xf1, 0x3e, 0x72, 0xc6, 0x13, 0x2a, 0x19, + 0xe3, 0xc3, 0xff, 0x91, 0xf3, 0x22, 0x56, 0x13, 0x07, 0x1a, 0x20, 0x4e, + 0xcf, 0xcc, 0x08, 0x9b, 0xd6, 0xe6, 0x0c, 0x1a, 0x5f, 0x0d, 0x3f, 0xad, + 0x8f, 0xca, 0x44, 0x06, 0xb9, 0xc3, 0x27, 0xf8, 0x65, 0x85, 0xce, 0x4a, + 0x95, 0x47, 0xab, 0x08, 0xca, 0x55, 0xa3, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x93, 0x60, 0xdb, 0x0c, 0xb1, 0x29, 0xf3, 0xf3, 0x5c, + 0x16, 0x6e, 0x9e, 0x8d, 0x96, 0xc1, 0xdb, 0xfa, 0x9c, 0xac, 0x07, 0x7b, + 0x55, 0xe5, 0x0a, 0xc7, 0x9d, 0x0e, 0xec, 0x65, 0x28, 0x00, 0x26, 0x12, + 0x10, 0x6f, 0xcb, 0x6d, 0xbd, 0x34, 0xc9, 0xba, 0x1e, 0x51, 0x6d, 0x9b, + 0x81, 0x9b, 0xc5, 0xba, 0xc1, 0x62, 0x00, 0x20, 0xa0, 0x9a, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x3a, 0xeb, 0x49, 0xa4, 0x69, 0x96, 0xb2, 0x03, 0x71, 0x7a, 0x8b, + 0xe5, 0xf2, 0x61, 0xb0, 0xe8, 0x2d, 0x40, 0x0f, 0x3f, 0x4e, 0xfc, + 0x5f, 0xe8, 0x4b, 0x70, 0x5b, 0x21, 0x35, 0x03, 0xc4, 0x12, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_UnlimitedStreaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x75, 0x58, 0x8a, 0x10, 0x00, 0x00, 0x00, 0x3b, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x75, 0x58, 0x8a, 0x10, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 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, 0x05, 0x00, 0x00, 0x00, 0xdf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x2b, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb0, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe9, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0d, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x57, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x35, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6e, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x92, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xdc, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xba, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x05, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3f, + 0x00, 0x00, 0x00, 0x20, 0xec, 0x48, 0xfb, 0xcd, 0x93, 0x54, 0xd7, 0x72, + 0xb1, 0x81, 0x34, 0xee, 0x3e, 0x9e, 0x8f, 0x11, 0xb9, 0x6e, 0xd9, 0x9a, + 0x5c, 0xdb, 0xe7, 0xdc, 0xd2, 0x98, 0xb8, 0x2c, 0x2c, 0x44, 0x86, 0x39, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x34, 0x46, 0x31, 0x32, 0x42, 0x39, 0x34, + 0x42, 0x44, 0x36, 0x43, 0x44, 0x41, 0x38, 0x33, 0x33, 0x37, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x34, 0x46, 0x31, 0x32, 0x42, 0x39, 0x34, 0x42, 0x44, + 0x36, 0x43, 0x44, 0x41, 0x38, 0x33, 0x33, 0x37, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x80, 0xc8, 0xac, 0x49, 0x2e, 0x92, + 0x30, 0x8b, 0x48, 0x36, 0x38, 0x00, 0x40, 0x00, 0x48, 0xae, 0x9a, 0x86, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x3d, 0xad, + 0x2e, 0x61, 0x18, 0x84, 0xd0, 0x2b, 0xc9, 0x0f, 0x50, 0xef, 0x39, 0xb3, + 0x3a, 0xa8, 0x1a, 0x50, 0x6d, 0x07, 0x2b, 0x8e, 0xa8, 0x56, 0x22, 0x7e, + 0xf1, 0xc4, 0x88, 0x69, 0xf3, 0x94, 0xcd, 0xcd, 0x39, 0x06, 0xef, 0xc3, + 0x1c, 0xfe, 0x65, 0x6a, 0x93, 0x13, 0x62, 0xb7, 0x33, 0x33, 0x7e, 0x74, + 0x33, 0xb2, 0x82, 0xd5, 0xf6, 0x4d, 0x21, 0x19, 0x69, 0x99, 0x23, 0xce, + 0xf3, 0xfb, 0xa9, 0xa0, 0xa1, 0xc8, 0xde, 0x60, 0xef, 0x1a, 0xb2, 0x52, + 0xfe, 0x2e, 0x30, 0xc9, 0xc6, 0xf6, 0xb4, 0x24, 0x28, 0x54, 0x9f, 0xa6, + 0xe1, 0x8c, 0xca, 0x0a, 0x10, 0x56, 0x65, 0xe2, 0xb5, 0xf8, 0xb7, 0x15, + 0x20, 0x01, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x10, 0xde, 0x34, 0xc9, 0x3a, 0x13, 0x3e, 0x10, 0xbb, 0x95, 0x0a, 0x72, + 0xd4, 0x33, 0xcb, 0x96, 0x43, 0x1a, 0x20, 0xe6, 0x63, 0xc2, 0x1f, 0x8a, + 0x08, 0x63, 0x9c, 0xba, 0xc7, 0xba, 0xf1, 0x12, 0xe3, 0xec, 0x1f, 0x06, + 0x82, 0x3f, 0x16, 0x4d, 0x4b, 0xce, 0xa3, 0x83, 0x81, 0x89, 0xe0, 0x38, + 0xe9, 0x6f, 0x0d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xb6, + 0x8c, 0x1f, 0x70, 0x70, 0x74, 0xcb, 0x0a, 0x6a, 0x68, 0xf1, 0x1d, 0x15, + 0x32, 0xb1, 0xea, 0xdb, 0xfe, 0x87, 0x0e, 0x4f, 0xa3, 0xb2, 0xe0, 0x42, + 0xd8, 0x3a, 0xd4, 0x88, 0x86, 0x08, 0x59, 0x12, 0x10, 0xb8, 0x09, 0x46, + 0xc0, 0x3c, 0x7c, 0x4e, 0xac, 0x1c, 0x3e, 0x8a, 0x4f, 0x11, 0xac, 0x1a, + 0x8f, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xc0, 0x6c, 0x1f, 0x6d, 0x93, 0x17, 0x01, 0x88, 0xb6, 0x0b, + 0x49, 0x06, 0x57, 0x39, 0x74, 0xfd, 0x1a, 0x20, 0x3a, 0xe6, 0x98, 0xd2, + 0x74, 0x61, 0x6a, 0x73, 0x84, 0x8b, 0x0d, 0x09, 0x41, 0x37, 0xfa, 0x92, + 0x78, 0xc9, 0x84, 0x26, 0xb2, 0x44, 0xf8, 0x92, 0x91, 0xe6, 0xb0, 0xdb, + 0x25, 0xdf, 0xb8, 0xa4, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xd4, 0x56, 0x76, 0x3f, 0xfe, 0x20, 0x7e, 0x03, 0xae, 0xe9, 0xdd, 0x82, + 0x9e, 0x47, 0x9a, 0xed, 0xa8, 0x11, 0xdd, 0x6f, 0xee, 0xae, 0xae, 0x6b, + 0x75, 0x70, 0x37, 0xba, 0x84, 0x3e, 0x18, 0xc0, 0x12, 0x10, 0xb5, 0x7b, + 0x91, 0xaf, 0x31, 0xfc, 0x0e, 0x66, 0xed, 0x28, 0x06, 0x8d, 0x9a, 0xe8, + 0xb4, 0x53, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x12, 0x10, 0x1a, 0xe6, 0x9a, 0x49, 0xa0, 0xd2, 0x53, 0x47, 0x43, + 0x83, 0xc3, 0x02, 0x08, 0xba, 0x4c, 0x77, 0x1a, 0x20, 0xe8, 0x67, 0x03, + 0x8f, 0x44, 0xbb, 0x9e, 0xf3, 0x1c, 0x67, 0xff, 0x7b, 0x40, 0x73, 0xb2, + 0x33, 0xa3, 0xfb, 0x48, 0x7e, 0x71, 0x48, 0x66, 0x7c, 0xe5, 0x6c, 0xed, + 0x3d, 0x9a, 0x80, 0xf4, 0x49, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0xd5, 0x95, 0x20, 0x6e, 0xd9, 0x6a, 0x09, 0xaa, 0x36, 0xb7, 0x06, + 0xd9, 0x03, 0xf4, 0xe4, 0xb1, 0x97, 0xa5, 0xfe, 0xaf, 0x42, 0xbf, 0xc6, + 0xbe, 0x9b, 0x42, 0x05, 0x19, 0x36, 0xf8, 0x23, 0x0b, 0x12, 0x10, 0xd1, + 0xdb, 0x84, 0x79, 0x99, 0x6f, 0xb4, 0x05, 0xad, 0x03, 0xb8, 0xf7, 0xa7, + 0xc2, 0xa1, 0x05, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0xbe, 0x4b, 0xfa, 0xcb, 0xe3, 0x08, 0xb2, 0x92, + 0x61, 0xc6, 0x68, 0x4f, 0x2d, 0x91, 0x09, 0x8e, 0x1a, 0x20, 0x68, 0x7f, + 0x5f, 0x5f, 0x85, 0x47, 0xc4, 0xe1, 0x25, 0xff, 0x9a, 0x3c, 0x97, 0x6e, + 0x33, 0xdf, 0x00, 0x7f, 0x8b, 0x19, 0x7c, 0xc4, 0xc6, 0x4b, 0x62, 0xcc, + 0xcb, 0x4b, 0x19, 0xd3, 0xb0, 0xbb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, + 0x0a, 0x20, 0x3a, 0xb2, 0xa0, 0x8e, 0x31, 0x98, 0x44, 0xfa, 0x3f, 0x4b, + 0x2a, 0x8c, 0x3f, 0x9f, 0x9b, 0x37, 0x96, 0x6d, 0x87, 0xd1, 0x3b, 0x75, + 0x3f, 0x2f, 0x7e, 0xa6, 0x0c, 0xd7, 0xec, 0xad, 0x7e, 0x46, 0x12, 0x10, + 0xca, 0xd5, 0x82, 0xb3, 0x91, 0x9f, 0x83, 0x18, 0xa3, 0xee, 0x23, 0x3a, + 0x34, 0x59, 0x8a, 0xcc, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x05, 0x4b, 0x7f, 0x07, 0x01, 0xe0, 0xe6, + 0xaa, 0x23, 0x18, 0xf5, 0x55, 0xb7, 0xc8, 0xde, 0x83, 0x1a, 0x20, 0x87, + 0x99, 0x4b, 0xf0, 0xa2, 0xd9, 0x42, 0x8e, 0x37, 0x78, 0x11, 0xad, 0x58, + 0xfd, 0x08, 0x6a, 0x10, 0x25, 0x1c, 0x91, 0x59, 0x9f, 0x07, 0x31, 0xdf, + 0x5e, 0x92, 0xa8, 0x74, 0x49, 0x73, 0xba, 0x20, 0x02, 0x28, 0x01, 0x42, + 0x34, 0x0a, 0x20, 0x25, 0x0e, 0x63, 0x7e, 0x38, 0x8f, 0x49, 0x4c, 0x32, + 0x35, 0xce, 0xce, 0xb8, 0xd5, 0xd0, 0x44, 0xdc, 0x7c, 0x98, 0xaa, 0x73, + 0x00, 0xa3, 0x93, 0x48, 0x0a, 0x5e, 0x35, 0x6c, 0x6e, 0xfc, 0x6b, 0x12, + 0x10, 0x37, 0xe1, 0xd5, 0xdd, 0x2f, 0x3a, 0xd6, 0x25, 0x6f, 0x7b, 0x3f, + 0x1f, 0x98, 0x0f, 0x68, 0x3e, 0x62, 0x00, 0x20, 0xae, 0x9a, 0x86, 0xa2, + 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xec, 0x48, 0xfb, 0xcd, 0x93, 0x54, 0xd7, 0x72, 0xb1, 0x81, 0x34, + 0xee, 0x3e, 0x9e, 0x8f, 0x11, 0xb9, 0x6e, 0xd9, 0x9a, 0x5c, 0xdb, + 0xe7, 0xdc, 0xd2, 0x98, 0xb8, 0x2c, 0x2c, 0x44, 0x86, 0x39, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LicenseDuration_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x23, 0x35, 0xf3, 0x96, 0x00, 0x00, 0x00, 0x3d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x23, 0x35, 0xf3, 0x96, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xd1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3f, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1d, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x56, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x7a, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa2, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xdb, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xff, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x49, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x27, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x60, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xce, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xac, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xe5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xf7, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x09, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x53, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x31, + 0x00, 0x00, 0x00, 0x20, 0x18, 0x0d, 0xc2, 0x89, 0x7d, 0xbe, 0xa2, 0xf7, + 0x6a, 0xb2, 0xa0, 0x08, 0x4f, 0xfd, 0x64, 0x07, 0xe8, 0x5e, 0x5c, 0xbf, + 0xb9, 0x5a, 0x75, 0x93, 0x6c, 0x46, 0x9b, 0x55, 0x07, 0x00, 0x4b, 0x7c, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x30, 0x43, 0x34, 0x33, 0x32, 0x37, 0x32, 0x45, + 0x37, 0x35, 0x43, 0x30, 0x37, 0x38, 0x36, 0x38, 0x33, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x43, 0x34, 0x33, 0x32, 0x37, 0x32, 0x45, 0x37, 0x35, + 0x43, 0x30, 0x37, 0x38, 0x36, 0x38, 0x33, 0x39, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xbc, 0x9a, 0x86, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x1a, 0x66, 0x12, 0x10, 0xde, 0x02, 0x0a, 0x30, + 0xb7, 0x9b, 0x6d, 0x84, 0xae, 0xf7, 0xfc, 0xda, 0xce, 0x77, 0x07, 0xd4, + 0x1a, 0x50, 0x43, 0xaa, 0xd4, 0x85, 0x4a, 0xb4, 0xbe, 0x98, 0x0d, 0x49, + 0x65, 0xe2, 0x72, 0x00, 0xb8, 0xa9, 0x08, 0x38, 0x95, 0x3d, 0xf0, 0x26, + 0xc2, 0xc1, 0xa9, 0x68, 0xd6, 0xb1, 0xc2, 0x71, 0x56, 0xc6, 0x77, 0x8c, + 0xc7, 0x31, 0x61, 0x60, 0xda, 0x09, 0x82, 0x93, 0x42, 0xdf, 0x5a, 0x4f, + 0x1d, 0x28, 0xce, 0x78, 0x6f, 0x0c, 0xad, 0xa0, 0x17, 0xd9, 0xbb, 0xcc, + 0xcd, 0x88, 0xd1, 0x2c, 0x74, 0x87, 0xc4, 0x20, 0x6e, 0xdf, 0x59, 0x47, + 0xb0, 0xd1, 0x0e, 0xf3, 0xe7, 0x05, 0xa5, 0x06, 0xf5, 0x92, 0x20, 0x01, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x34, + 0xf0, 0x13, 0x6b, 0x38, 0x1f, 0x09, 0x75, 0x91, 0xda, 0xa7, 0x2a, 0x8d, + 0xb5, 0xb9, 0x82, 0x1a, 0x20, 0x6a, 0x62, 0xff, 0x95, 0x70, 0xd5, 0x25, + 0xa5, 0x5c, 0x9b, 0x34, 0xb8, 0x67, 0x0d, 0x46, 0x90, 0xf2, 0x3f, 0x36, + 0xb7, 0x8c, 0x37, 0xbb, 0x0f, 0x39, 0x01, 0xf3, 0xda, 0x3c, 0xaa, 0x9e, + 0x68, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xc4, 0x40, 0xb0, + 0x6e, 0x45, 0x63, 0x6e, 0xc9, 0xe5, 0xb7, 0xe8, 0x94, 0x27, 0x25, 0x8a, + 0xbf, 0xfd, 0xdd, 0x67, 0x8e, 0x25, 0xf0, 0x22, 0x4d, 0xd0, 0x16, 0xb5, + 0x1a, 0x01, 0x2d, 0x87, 0x95, 0x12, 0x10, 0xf3, 0x05, 0x0d, 0xcb, 0xd4, + 0xa2, 0xb3, 0x57, 0x76, 0x64, 0x12, 0x39, 0xb1, 0x09, 0x22, 0x64, 0x62, + 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x57, 0x7d, 0xf6, 0xbb, 0xb2, 0xa3, 0xdf, 0x40, 0x86, 0x36, 0xe9, 0xc5, + 0x8f, 0x56, 0xa9, 0xf7, 0x1a, 0x20, 0xf9, 0x1d, 0xc6, 0x15, 0xaf, 0xa8, + 0xf7, 0xcd, 0xbb, 0x33, 0x5e, 0x35, 0x83, 0x36, 0xe1, 0xfc, 0x5e, 0xe6, + 0x10, 0x8f, 0x97, 0x9b, 0xbc, 0xe3, 0x2e, 0x30, 0x64, 0x5d, 0x0c, 0x0d, + 0x63, 0x54, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x6b, 0x62, + 0xf0, 0xed, 0x8e, 0x61, 0x7e, 0x5b, 0x20, 0xed, 0x90, 0x15, 0x45, 0x4e, + 0xac, 0xfc, 0x9d, 0x2e, 0x10, 0x59, 0x36, 0xf6, 0x44, 0x40, 0xb2, 0xdd, + 0x90, 0x2f, 0xf2, 0xfd, 0x51, 0x8a, 0x12, 0x10, 0xc2, 0x90, 0x44, 0xf8, + 0xb9, 0xb5, 0x91, 0x19, 0x49, 0x45, 0xda, 0xa6, 0x69, 0xce, 0xaf, 0x6b, + 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, + 0x10, 0x2e, 0xb2, 0x78, 0x89, 0xd3, 0xd9, 0xf1, 0xb9, 0x78, 0x2b, 0x1f, + 0x04, 0xdd, 0x4d, 0x64, 0x80, 0x1a, 0x20, 0x07, 0x03, 0x99, 0xfe, 0xb1, + 0x40, 0x6c, 0xf4, 0xd6, 0x58, 0x52, 0x6b, 0x5a, 0x40, 0x83, 0xa8, 0x91, + 0x95, 0x5b, 0x1e, 0xe2, 0xdd, 0xf5, 0xdf, 0x30, 0xe4, 0xf3, 0x60, 0xb6, + 0xf7, 0xc4, 0x7a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0xbe, + 0x8e, 0xdf, 0x9e, 0xf3, 0x2c, 0x08, 0x8f, 0x0d, 0x2a, 0xca, 0x5b, 0xd0, + 0x6c, 0xfe, 0x84, 0x03, 0x53, 0x7f, 0x13, 0xfd, 0xe6, 0x09, 0x7e, 0x7c, + 0x2a, 0x8a, 0x3e, 0x80, 0x3e, 0x6e, 0xa2, 0x12, 0x10, 0x2c, 0xd6, 0xb5, + 0xb7, 0xbe, 0xaa, 0xd5, 0x43, 0x33, 0xe4, 0x2e, 0xbb, 0xa7, 0x90, 0x5e, + 0xd0, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x12, 0x10, 0xd0, 0x6f, 0x80, 0xf8, 0xf9, 0x8e, 0x19, 0x15, 0x9f, 0xe6, + 0x3e, 0x0c, 0x50, 0x5a, 0xd1, 0x51, 0x1a, 0x20, 0xb8, 0xae, 0xfb, 0x60, + 0x64, 0x70, 0x4c, 0xe2, 0x22, 0x6a, 0x64, 0x4c, 0xad, 0x9a, 0xde, 0x1e, + 0x0c, 0x06, 0x88, 0x64, 0x2a, 0x5b, 0xc2, 0x55, 0x62, 0xb7, 0x04, 0x6a, + 0xc9, 0xc5, 0x5a, 0x4d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0xd8, 0x63, 0x89, 0x6f, 0xce, 0x3b, 0x38, 0xb7, 0xe2, 0x4a, 0x38, 0x54, + 0x31, 0x9c, 0x7f, 0x8e, 0x56, 0x47, 0x85, 0xec, 0xf0, 0x6a, 0x7f, 0x2b, + 0x9c, 0x2d, 0x90, 0x8b, 0x00, 0xa2, 0x89, 0xb7, 0x12, 0x10, 0xac, 0xa0, + 0x9e, 0x33, 0x1a, 0xfb, 0x6c, 0xc5, 0x84, 0x77, 0x51, 0xea, 0xac, 0x23, + 0xcd, 0x22, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, + 0x3d, 0x12, 0x10, 0xd4, 0x95, 0xea, 0x4a, 0x28, 0x80, 0x88, 0xce, 0xa4, + 0x74, 0x8b, 0xb4, 0x31, 0x10, 0x41, 0x58, 0x1a, 0x20, 0xba, 0x15, 0x0c, + 0xa1, 0x14, 0xb6, 0x58, 0xcc, 0x5b, 0xb2, 0x7a, 0x82, 0x28, 0xcd, 0xe7, + 0x5b, 0x77, 0x5b, 0xab, 0xae, 0xfb, 0x11, 0xd4, 0x68, 0xcc, 0x67, 0xdc, + 0x35, 0x57, 0x10, 0x49, 0xc2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x52, 0x14, 0xb7, 0x57, 0x9e, 0xb4, 0x9a, 0x90, 0x62, 0x85, 0xba, + 0xa7, 0x06, 0x12, 0x50, 0xe6, 0xef, 0x8f, 0x10, 0x64, 0xff, 0x85, 0x03, + 0x32, 0x9a, 0x8b, 0xed, 0x08, 0x77, 0xa1, 0xbe, 0xf0, 0x12, 0x10, 0x47, + 0x1c, 0xb1, 0xbf, 0xcc, 0x3b, 0xdc, 0xca, 0x50, 0xf9, 0x00, 0xe9, 0xeb, + 0x32, 0x08, 0x00, 0x62, 0x00, 0x20, 0xbc, 0x9a, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x18, 0x0d, 0xc2, 0x89, 0x7d, 0xbe, 0xa2, 0xf7, 0x6a, 0xb2, 0xa0, + 0x08, 0x4f, 0xfd, 0x64, 0x07, 0xe8, 0x5e, 0x5c, 0xbf, 0xb9, 0x5a, + 0x75, 0x93, 0x6c, 0x46, 0x9b, 0x55, 0x07, 0x00, 0x4b, 0x7c, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV16, Both_CdmUseCase_LicenseDuration_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, + 0x00, 0x10, 0x98, 0xdb, 0x82, 0xe7, 0x00, 0x00, 0x00, 0x3f, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x50, 0x00, 0x04, 0x00, 0x10, + 0x98, 0xdb, 0x82, 0xe7, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xdd, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x4b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x29, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xd0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xe7, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x01, 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x0b, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x55, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x33, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x6c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x02, 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xda, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb8, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x02, 0xf1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x15, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x03, 0x5f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x3d, + 0x00, 0x00, 0x00, 0x20, 0xef, 0x2a, 0xcb, 0x19, 0x15, 0xe5, 0x33, 0x75, + 0xf0, 0xad, 0x55, 0x4e, 0xc3, 0x0b, 0xe4, 0xc5, 0xdc, 0xce, 0x93, 0xaa, + 0x1f, 0xc0, 0x84, 0x67, 0xb5, 0x89, 0x84, 0x61, 0x82, 0x0c, 0x9d, 0xaf, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x30, 0x39, 0x35, 0x46, 0x36, 0x34, 0x39, 0x39, + 0x37, 0x42, 0x38, 0x43, 0x36, 0x42, 0x44, 0x39, 0x33, 0x42, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x39, 0x35, 0x46, 0x36, 0x34, 0x39, 0x39, 0x37, 0x42, + 0x38, 0x43, 0x36, 0x42, 0x44, 0x39, 0x33, 0x42, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x9f, 0x49, 0xc0, 0xf7, 0x77, 0x4e, + 0xb6, 0x10, 0x9f, 0x73, 0x38, 0x00, 0x40, 0x00, 0x48, 0xe2, 0x9a, 0x86, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x1a, 0x66, 0x12, 0x10, 0x0d, 0x56, 0xf8, 0x9d, + 0xce, 0xfb, 0x63, 0x9f, 0xb0, 0x31, 0x77, 0x41, 0x1a, 0x44, 0x02, 0x93, + 0x1a, 0x50, 0x18, 0xb2, 0x65, 0xa8, 0xb5, 0x9e, 0x87, 0x5d, 0x37, 0x1a, + 0x33, 0x27, 0xa1, 0xac, 0x4d, 0xc9, 0xd0, 0x14, 0x09, 0x36, 0xd7, 0x31, + 0x0e, 0x95, 0xba, 0x8b, 0x44, 0x8b, 0xd1, 0xa4, 0xaa, 0x05, 0x75, 0x3c, + 0x01, 0x1a, 0xf1, 0xac, 0xbf, 0xf8, 0xdd, 0x50, 0x98, 0x20, 0xfd, 0xa5, + 0x9c, 0x5a, 0x78, 0x04, 0x20, 0x19, 0x0b, 0xff, 0x73, 0x3b, 0x41, 0x9f, + 0x15, 0xb7, 0x3c, 0x78, 0xdf, 0x0c, 0x45, 0x00, 0x55, 0x0e, 0xa7, 0x65, + 0x2a, 0xaa, 0xeb, 0xbb, 0x9a, 0xb1, 0x66, 0x5c, 0xc4, 0x03, 0x20, 0x01, + 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x93, + 0xbd, 0xb7, 0xba, 0x11, 0x5a, 0x00, 0xf6, 0x8f, 0x1e, 0xbb, 0x83, 0x6d, + 0x91, 0x2f, 0x63, 0x1a, 0x20, 0x20, 0x09, 0x17, 0xf1, 0xb4, 0x1c, 0x7a, + 0x10, 0x9a, 0x72, 0x9d, 0x33, 0x32, 0x68, 0x75, 0x71, 0x15, 0x03, 0x7b, + 0xf7, 0x72, 0x38, 0xe9, 0x39, 0xed, 0x4f, 0x43, 0xb1, 0x5b, 0xd8, 0x68, + 0x04, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x2e, 0x27, 0xea, + 0xd0, 0xf7, 0xcc, 0x22, 0x3f, 0xf9, 0x0f, 0xb4, 0xd7, 0x89, 0x58, 0x41, + 0x0c, 0x6d, 0xc1, 0xcc, 0xd2, 0x74, 0xb5, 0xb4, 0x46, 0x56, 0x2a, 0x8b, + 0xb9, 0x31, 0xbe, 0x73, 0xf1, 0x12, 0x10, 0x52, 0xa8, 0x40, 0x24, 0xbd, + 0xdb, 0x12, 0xa3, 0x7c, 0x0e, 0xe7, 0x6d, 0xd8, 0xa3, 0x83, 0x6c, 0x62, + 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x85, 0x41, 0x84, 0x79, 0x25, 0xbc, 0x7d, 0xe7, 0x20, 0x1f, 0x3c, 0x95, + 0xbf, 0xa4, 0xfc, 0x43, 0x1a, 0x20, 0x30, 0x26, 0xd2, 0xb4, 0xe8, 0x06, + 0x27, 0x0c, 0xbf, 0x46, 0x30, 0x77, 0xfd, 0x30, 0xac, 0x50, 0x81, 0x1a, + 0x16, 0x3f, 0x86, 0x60, 0x17, 0xed, 0x00, 0xc3, 0x4c, 0xd8, 0x1f, 0x9b, + 0xa1, 0xdf, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x9f, 0x51, + 0xb9, 0x72, 0x90, 0x71, 0x4c, 0x16, 0x62, 0x8b, 0xf2, 0x8e, 0x22, 0xce, + 0xbf, 0xd8, 0x13, 0x6d, 0x11, 0x85, 0xbf, 0x3c, 0x10, 0xf5, 0x16, 0xfb, + 0x8b, 0xd9, 0x4f, 0x27, 0xf6, 0xc2, 0x12, 0x10, 0x6d, 0x5e, 0xbc, 0x50, + 0x6d, 0x13, 0xea, 0xe5, 0xa2, 0xfd, 0x52, 0x50, 0x3b, 0x9e, 0xe6, 0x52, + 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, + 0x10, 0x18, 0xac, 0x83, 0x66, 0xf1, 0x01, 0x27, 0xd2, 0x56, 0x44, 0xe2, + 0x95, 0x87, 0x29, 0x7e, 0x47, 0x1a, 0x20, 0x9a, 0x4e, 0x02, 0xb3, 0x09, + 0x45, 0xd9, 0x55, 0x6b, 0x45, 0x4a, 0x8d, 0xac, 0x95, 0x41, 0x76, 0xdd, + 0x62, 0x80, 0xb1, 0x50, 0xe6, 0x63, 0x42, 0x19, 0x1c, 0xa9, 0x0f, 0x19, + 0x32, 0xcc, 0x81, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, 0x66, + 0x48, 0xfa, 0x38, 0x2c, 0xb5, 0xa9, 0x80, 0x4c, 0x46, 0x86, 0x40, 0x3a, + 0x68, 0x0a, 0x03, 0xcc, 0x54, 0xda, 0x35, 0x8d, 0xc0, 0x78, 0x5f, 0xe9, + 0xd4, 0xfd, 0x59, 0xd8, 0x32, 0xd8, 0x39, 0x12, 0x10, 0xb5, 0xae, 0xdb, + 0x51, 0x8b, 0x92, 0xea, 0xd1, 0x79, 0xa2, 0x01, 0x84, 0x7e, 0x01, 0xa3, + 0x72, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x12, 0x10, 0x3b, 0x13, 0x76, 0x8a, 0x19, 0x03, 0x38, 0x0c, 0x4c, 0x80, + 0xcb, 0x64, 0xc7, 0x0c, 0x23, 0x50, 0x1a, 0x20, 0xf7, 0x70, 0xad, 0x3e, + 0x4e, 0x1f, 0x1c, 0x24, 0xbb, 0xe3, 0x3e, 0xd1, 0x1f, 0x3f, 0x5a, 0x0b, + 0x1c, 0x20, 0xbc, 0xd7, 0x2f, 0x36, 0x31, 0x0e, 0x73, 0xa6, 0x1d, 0xdb, + 0xe9, 0x25, 0x38, 0x38, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, 0x20, + 0x2b, 0x9b, 0x7a, 0xce, 0xb0, 0x02, 0xa5, 0x84, 0xe7, 0xc9, 0xb4, 0x64, + 0x0c, 0x98, 0xbd, 0x3b, 0x90, 0x40, 0x1e, 0x69, 0x52, 0x83, 0x1a, 0x82, + 0x38, 0xe8, 0x7f, 0xdb, 0xd4, 0x9b, 0x62, 0x0e, 0x12, 0x10, 0xb4, 0x63, + 0xf0, 0x69, 0x4d, 0x8a, 0x9d, 0xc5, 0x32, 0x70, 0x78, 0x72, 0xe0, 0x56, + 0x7b, 0x10, 0x62, 0x00, 0x1a, 0x82, 0x01, 0x0a, 0x10, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, + 0x3d, 0x12, 0x10, 0x52, 0x75, 0x51, 0xba, 0x51, 0x01, 0x5f, 0xbc, 0xc8, + 0x8f, 0xb9, 0x62, 0xff, 0x98, 0x2e, 0x3c, 0x1a, 0x20, 0x08, 0x12, 0xd4, + 0x6d, 0xe7, 0x7a, 0x2a, 0x10, 0x89, 0x8d, 0xba, 0xaa, 0x03, 0x72, 0x4a, + 0x06, 0x48, 0xb4, 0xd3, 0xab, 0xe7, 0xe3, 0xb4, 0xc5, 0xd3, 0xe6, 0xe5, + 0x16, 0xeb, 0xc6, 0x98, 0xbf, 0x20, 0x02, 0x28, 0x01, 0x42, 0x34, 0x0a, + 0x20, 0x18, 0xea, 0xca, 0xd4, 0xc6, 0xa3, 0x05, 0xca, 0x94, 0xa1, 0x1c, + 0xf4, 0x2c, 0x2d, 0xae, 0x79, 0xfc, 0xc5, 0xa3, 0x98, 0x6b, 0xa4, 0xdd, + 0xdc, 0x88, 0xe0, 0x31, 0xa1, 0x6d, 0x02, 0xf9, 0x49, 0x12, 0x10, 0xdf, + 0x37, 0xc3, 0x90, 0x1b, 0xfc, 0x97, 0x25, 0xc3, 0xeb, 0x62, 0xf9, 0x11, + 0xbc, 0x0e, 0xc0, 0x62, 0x00, 0x20, 0xe2, 0x9a, 0x86, 0xa2, 0x06, 0x38, + 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0xef, 0x2a, 0xcb, 0x19, 0x15, 0xe5, 0x33, 0x75, 0xf0, 0xad, 0x55, + 0x4e, 0xc3, 0x0b, 0xe4, 0xc5, 0xdc, 0xce, 0x93, 0xaa, 0x1f, 0xc0, + 0x84, 0x67, 0xb5, 0x89, 0x84, 0x61, 0x82, 0x0c, 0x9d, 0xaf, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +// Renewal Tests. +// A few renewal examples from filter *PIG*:*CdmUseCase*. +// Note: running these cases generates many renewals. It should be +// ok to only test one or two. +////////////////////////////////////////////////////////////////////// + +TEST_F(ODKGoldenRenewalV16, Both_CdmUseCase_LicenseWithRenewal_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, + 0x00, 0x10, 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, 0x29, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x04, 0x00, 0x10, + 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x35, 0x37, 0x46, 0x34, 0x37, 0x39, 0x45, 0x36, + 0x44, 0x37, 0x44, 0x45, 0x31, 0x41, 0x42, 0x46, 0x32, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x35, 0x37, 0x46, 0x34, 0x37, 0x39, 0x45, 0x36, 0x44, 0x37, + 0x44, 0x45, 0x31, 0x41, 0x42, 0x46, 0x32, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x01, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0x90, 0x99, + 0x86, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, + 0x08, 0x20, 0xa7, 0x99, 0x86, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV16, Both_CdmUseCase_LicenseWithRenewal_Case1_0_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, + 0x00, 0x10, 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, 0x29, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x04, 0x00, 0x10, + 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x35, 0x37, 0x46, 0x34, 0x37, 0x39, 0x45, 0x36, + 0x44, 0x37, 0x44, 0x45, 0x31, 0x41, 0x42, 0x46, 0x32, 0x35, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x35, 0x37, 0x46, 0x34, 0x37, 0x39, 0x45, 0x36, 0x44, 0x37, + 0x44, 0x45, 0x31, 0x41, 0x42, 0x46, 0x32, 0x35, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x04, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0x90, 0x99, + 0x86, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0x5f, 0xd9, 0xbb, 0xa6, 0x00, 0x00, 0x00, + 0x08, 0x20, 0xec, 0x99, 0x86, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV16, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, + 0x00, 0x10, 0xb5, 0x6b, 0x94, 0x55, 0x00, 0x00, 0x00, 0x33, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x04, 0x00, 0x10, + 0xb5, 0x6b, 0x94, 0x55, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x44, 0x41, 0x30, 0x35, 0x34, 0x37, 0x43, 0x33, + 0x35, 0x33, 0x39, 0x43, 0x36, 0x45, 0x39, 0x41, 0x32, 0x46, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x44, 0x41, 0x30, 0x35, 0x34, 0x37, 0x43, 0x33, 0x35, 0x33, + 0x39, 0x43, 0x36, 0x45, 0x39, 0x41, 0x32, 0x46, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x01, 0x32, 0x0a, 0x25, 0xda, 0x91, 0x67, 0x0e, 0x88, + 0x2e, 0x8b, 0xca, 0x5b, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xfd, 0x9c, 0x86, + 0xa2, 0x06, 0x12, 0x0d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x38, 0x80, + 0xe7, 0x84, 0x0f, 0x48, 0x00, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x74, 0x6c, 0x00, 0x00, 0x00, 0x00, 0xb5, 0x6b, 0x94, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x20, 0x8e, 0x9d, 0x86, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} +} // namespace + +} // namespace wvodk_test diff --git a/oemcrypto/odk/test/odk_golden_v17.cpp b/oemcrypto/odk/test/odk_golden_v17.cpp new file mode 100644 index 00000000..2a734087 --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v17.cpp @@ -0,0 +1,3847 @@ +// Copyright 2022 Google LLC. All rights reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "odk.h" + +#include +#include + +#include + +#include "gtest/gtest.h" + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.h" +#include "odk_structs.h" +#include "odk_structs_priv.h" + +namespace wvodk_test { + +namespace { + +using oemcrypto_core_message::ODK_LicenseRequest; +using oemcrypto_core_message::ODK_ProvisioningRequest; +using oemcrypto_core_message::ODK_RenewalRequest; + +using oemcrypto_core_message::deserialize::CoreLicenseRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreProvisioningRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreRenewalRequestFromMessage; +using oemcrypto_core_message::features::CoreMessageFeatures; +using oemcrypto_core_message::serialize::CreateCoreLicenseResponseFromProto; +using oemcrypto_core_message::serialize:: + CreateCoreProvisioningResponseFromProto; +using oemcrypto_core_message::serialize::CreateCoreRenewalResponse; + +class ODKGoldenProvisionV17 : public ::testing::Test { + protected: + void RunTest() { + ODK_ProvisioningRequest core_provisioning_request; + EXPECT_TRUE(CoreProvisioningRequestFromMessage(core_request_, + &core_provisioning_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreProvisioningResponseFromProto( + features, provisioning_response_, core_provisioning_request, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + std::string core_request_; + std::string core_response_; + std::string provisioning_response_; +}; + +class ODKGoldenLicenseV17 : public ::testing::Test { + protected: + void RunTest() { + ODK_LicenseRequest core_license_request; + EXPECT_TRUE( + CoreLicenseRequestFromMessage(core_request_, &core_license_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreLicenseResponseFromProto( + features, serialized_license_, core_license_request, + core_request_sha256_, nonce_required_, uses_padding_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + bool nonce_required_; + // TODO(fredgc): padding is removed in protocol 2.2. + bool uses_padding_ = true; + std::string core_request_; + std::string core_response_; + std::string serialized_license_; + std::string core_request_sha256_; +}; + +class ODKGoldenRenewalV17 : public ::testing::Test { + protected: + void RunTest() { + ODK_RenewalRequest core_renewal_request; + EXPECT_TRUE( + CoreRenewalRequestFromMessage(core_request_, &core_renewal_request)); + std::string generated_core_message; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + EXPECT_TRUE(CreateCoreRenewalResponse(features, core_renewal_request, + renewal_duration_seconds_, + &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + uint64_t renewal_duration_seconds_; + std::string core_request_; + std::string core_response_; + std::string renewal_; +}; + +// README (for ODK maintainers): Set the environment variable DUMP_LICENSE="yes" +// Then set the environment variable GTEST_FILTER to the test you want to run. +// Run the script for the platform we want. E.g. run_fake_l1_tests, +// run_prov30_tests or run_prov40_tests. Look for the autogenerated code in +// $CDM_DIR/out/testbed/debug/*_data.cpp. If you are updating the ODK library, +// and you have to change the code above, then you're fine. If you have to +// change the code below then there is probably a backwards compatibility +// problem. + +////////////////////////////////////////////////////////////////////// +// Provisioning tests. +// One provisioning example from each of fake-l1 (with keybox), +// and prov30. For v17, Prov 4.0 does not use a core message. +// GTEST_FILTER='*CorePIGTest.OfflineNoNonce*" +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenProvisionV17, CorePIGTest_OfflineNoNonce_prov20) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x00, 0x02, 0x00, + 0x11, 0x52, 0x08, 0x36, 0xa1, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, + 0x00, 0x20, 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, + 0x65, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, + 0x6f, 0x78, 0x30, 0x30, 0x30, 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, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x00, 0x02, 0x00, 0x11, + 0x52, 0x08, 0x36, 0xa1, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, + 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, 0x6f, 0x78, 0x30, 0x30, + 0x30, 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, 0x03, + 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0xf3, 0x43, 0x08, 0xd7, 0xad, 0x72, 0x69, 0x16, 0x23, + 0xbe, 0xa3, 0xfe, 0x15, 0xf4, 0xe4, 0x04, 0xc1, 0x91, 0x3d, 0x2a, 0x30, + 0x74, 0xcb, 0x85, 0x5e, 0x72, 0x00, 0xf0, 0xce, 0xe6, 0x05, 0x02, 0x39, + 0x57, 0x6d, 0x76, 0xa2, 0x92, 0xdf, 0x4f, 0x49, 0x55, 0xfb, 0x6d, 0x5b, + 0xed, 0xdd, 0x5a, 0xd6, 0xb7, 0x3b, 0xe3, 0xe4, 0x58, 0x41, 0x6e, 0x35, + 0xec, 0x49, 0xd6, 0xd0, 0xf2, 0xa9, 0xbf, 0xc7, 0xad, 0xeb, 0x22, 0xc4, + 0x0e, 0xdf, 0xfb, 0xe6, 0xf3, 0x36, 0xca, 0xf4, 0x3a, 0x3e, 0x05, 0xcc, + 0x5a, 0xba, 0xca, 0xa4, 0xf2, 0x7e, 0xc0, 0x90, 0x81, 0x11, 0x2a, 0x74, + 0x7e, 0x7d, 0xad, 0x31, 0x28, 0xa3, 0xa5, 0xb7, 0xed, 0xad, 0x0b, 0x3c, + 0xb1, 0xba, 0x01, 0x18, 0x76, 0x50, 0xca, 0xdf, 0xcb, 0x2b, 0x7a, 0x9e, + 0xb3, 0x52, 0x83, 0x38, 0x33, 0x2d, 0x4b, 0xa5, 0x0b, 0x15, 0xd8, 0x6d, + 0x54, 0x87, 0x18, 0x70, 0x51, 0x1d, 0xc2, 0x21, 0xae, 0xfe, 0x08, 0x17, + 0x17, 0x8e, 0x7b, 0xd0, 0x28, 0x5a, 0xdc, 0x73, 0x8e, 0x75, 0x38, 0x24, + 0x56, 0x80, 0x6c, 0x2f, 0x43, 0xf7, 0x21, 0xff, 0xa4, 0xaa, 0x96, 0x27, + 0x9e, 0x24, 0x7d, 0xc6, 0xe8, 0x06, 0x82, 0xfc, 0x24, 0xd3, 0x94, 0x5e, + 0x4d, 0xe6, 0x4e, 0x4a, 0xc0, 0x18, 0x16, 0xd2, 0x76, 0x7c, 0x1e, 0x80, + 0xdf, 0xc7, 0x98, 0xac, 0x14, 0x9c, 0x04, 0x8a, 0x29, 0xb0, 0xa0, 0x2c, + 0xf8, 0xb4, 0x9e, 0x13, 0xb7, 0x16, 0x8c, 0xf3, 0x50, 0x50, 0x4b, 0x80, + 0x6e, 0x5f, 0xb8, 0xe0, 0x08, 0x87, 0x36, 0x48, 0x8e, 0xf0, 0x23, 0x8c, + 0x9c, 0x85, 0x37, 0x73, 0x26, 0xd8, 0xc9, 0xb8, 0x7b, 0xf0, 0xc1, 0x71, + 0x7c, 0x04, 0xd4, 0xbe, 0x24, 0xaf, 0x46, 0x80, 0x42, 0x37, 0x7b, 0x6f, + 0x31, 0x89, 0xb1, 0x47, 0x80, 0x52, 0xdb, 0xfe, 0x75, 0x0a, 0xc6, 0x76, + 0x9e, 0x38, 0x8c, 0xc5, 0x8a, 0xa0, 0xc4, 0x19, 0xd5, 0x19, 0x86, 0x68, + 0xc2, 0xda, 0x57, 0xf9, 0xb4, 0x18, 0x1f, 0xf8, 0x0a, 0x20, 0x7a, 0x1e, + 0x6e, 0x0f, 0xac, 0x62, 0xff, 0xd3, 0xf4, 0xbe, 0x65, 0x57, 0xca, 0xb6, + 0x67, 0x5a, 0xa2, 0x48, 0x56, 0x8f, 0xcd, 0xeb, 0xde, 0x3b, 0x23, 0xd5, + 0x8c, 0xb7, 0x98, 0x9e, 0xe6, 0x3f, 0x47, 0x56, 0x6f, 0xc5, 0x62, 0x25, + 0xba, 0xfd, 0xcc, 0xa0, 0x8d, 0x20, 0x3c, 0xe4, 0xef, 0x72, 0xc0, 0x31, + 0xa1, 0x05, 0x78, 0x47, 0xba, 0x41, 0x39, 0x5c, 0x6f, 0x58, 0x2c, 0x3c, + 0xb5, 0xac, 0x39, 0x16, 0xc5, 0xae, 0xd9, 0x97, 0x09, 0x69, 0x02, 0x49, + 0x86, 0x5c, 0x1a, 0xc5, 0x91, 0x71, 0x7e, 0x6f, 0x75, 0xdd, 0x8d, 0x60, + 0xbc, 0x6d, 0xb3, 0x9f, 0x82, 0x9e, 0x0b, 0x20, 0xe7, 0x97, 0x99, 0x33, + 0x14, 0xb9, 0xcb, 0x90, 0x4c, 0x55, 0x09, 0x1e, 0x04, 0xcf, 0x0c, 0xf0, + 0x8d, 0x9f, 0xea, 0x51, 0xcb, 0x85, 0x36, 0x3e, 0x0f, 0x5f, 0x7b, 0x24, + 0x26, 0x21, 0x8d, 0xd7, 0xcb, 0x22, 0xfb, 0xd7, 0xdc, 0x4f, 0x36, 0x18, + 0x4d, 0xae, 0x1e, 0xaa, 0x41, 0x66, 0x7a, 0x2d, 0xd0, 0x78, 0xba, 0x2d, + 0x9a, 0xc6, 0x9b, 0x39, 0x14, 0xe4, 0x3f, 0x74, 0x4a, 0xbb, 0x30, 0xb4, + 0x5f, 0x88, 0x71, 0xde, 0x0e, 0x29, 0xe9, 0xbb, 0x94, 0x61, 0x91, 0x40, + 0xd5, 0x5b, 0x62, 0x9c, 0x8f, 0x4f, 0xcc, 0xa6, 0xe9, 0x57, 0x10, 0x99, + 0x17, 0x17, 0x9f, 0x5b, 0xd5, 0x11, 0x53, 0x74, 0x05, 0xed, 0x99, 0xd6, + 0x49, 0xbb, 0x16, 0xd1, 0xf0, 0x21, 0xa0, 0xc4, 0xd9, 0x8c, 0xa9, 0x6d, + 0xb6, 0x4a, 0x3f, 0x64, 0xae, 0x33, 0x38, 0xd8, 0xb5, 0x0c, 0x51, 0x7e, + 0x97, 0xba, 0xe5, 0x76, 0x67, 0x2b, 0x7c, 0xb1, 0xc8, 0x5a, 0xe3, 0x71, + 0xaa, 0x42, 0xc6, 0x03, 0xa8, 0x14, 0xe4, 0x82, 0xa8, 0x7a, 0xdb, 0x8a, + 0x36, 0x16, 0xa9, 0xe3, 0xc9, 0xf5, 0xb3, 0x21, 0x79, 0x2c, 0xaf, 0x14, + 0xac, 0x03, 0xfa, 0xc7, 0x98, 0xcf, 0x1c, 0x8e, 0x1e, 0x34, 0xd3, 0x1d, + 0x11, 0x6d, 0x42, 0x5f, 0x69, 0xb0, 0x59, 0x69, 0xe2, 0x25, 0xcd, 0x5c, + 0x1f, 0xdc, 0x79, 0xfa, 0x08, 0xf7, 0x24, 0xa0, 0xf8, 0xed, 0x93, 0x9d, + 0x65, 0x4a, 0xd8, 0x8d, 0x07, 0x9c, 0xf4, 0x14, 0x1c, 0xce, 0x74, 0x60, + 0x13, 0x1a, 0xf6, 0x8f, 0x11, 0x15, 0x23, 0x4f, 0x26, 0xd4, 0x7c, 0xfd, + 0x83, 0x2b, 0xd6, 0x33, 0xea, 0x5d, 0x12, 0x6a, 0x7e, 0x2f, 0x68, 0x53, + 0x08, 0x28, 0x65, 0xbb, 0x37, 0xba, 0xff, 0xb9, 0xc8, 0x85, 0xaf, 0x8a, + 0x2f, 0x1c, 0xaa, 0x64, 0xdd, 0xed, 0x3f, 0xf2, 0xd3, 0x55, 0xdd, 0x3b, + 0x79, 0x51, 0xee, 0xde, 0x34, 0x48, 0xe9, 0xb9, 0x0a, 0xf6, 0xe0, 0x7e, + 0xa4, 0x54, 0xbe, 0x63, 0xe0, 0x54, 0x43, 0x3f, 0x9a, 0xc0, 0x27, 0xab, + 0x0a, 0x3f, 0x7a, 0x16, 0x44, 0xd2, 0x0f, 0xf1, 0xab, 0x5e, 0x31, 0x56, + 0xc8, 0x88, 0x26, 0x65, 0x33, 0x6a, 0x21, 0x64, 0xb5, 0xfd, 0x10, 0xf4, + 0x15, 0x98, 0xbe, 0xd3, 0x05, 0x02, 0x65, 0x59, 0x21, 0x2b, 0xb6, 0x9a, + 0x09, 0x3c, 0xd8, 0x83, 0x1d, 0x03, 0xab, 0x4e, 0xb2, 0xf1, 0xf7, 0xc1, + 0xde, 0x07, 0x69, 0xf3, 0xfe, 0xc8, 0x71, 0x57, 0xcf, 0x65, 0xa2, 0x26, + 0x44, 0xc2, 0x01, 0x0d, 0x60, 0x3a, 0x7b, 0x1b, 0xfc, 0x7c, 0xfe, 0xcc, + 0x6f, 0xe0, 0xbf, 0xa3, 0x88, 0xec, 0x6b, 0xc3, 0x0f, 0x0b, 0x43, 0xb2, + 0x58, 0x25, 0x56, 0xc3, 0xd7, 0x37, 0xbd, 0xa8, 0x25, 0x5d, 0xff, 0x0d, + 0xb6, 0x58, 0xf8, 0x3c, 0x3c, 0xd4, 0x32, 0xd0, 0x1e, 0xe0, 0x5f, 0xf6, + 0x93, 0x0a, 0xb2, 0x87, 0xee, 0x88, 0x98, 0x77, 0x09, 0x71, 0x96, 0x6d, + 0xba, 0x88, 0xf2, 0x93, 0x95, 0x5b, 0x01, 0xd2, 0xc0, 0xfe, 0xcf, 0xbd, + 0x4d, 0x04, 0xe4, 0x1a, 0xcb, 0xa9, 0x9c, 0x3c, 0xdb, 0x0f, 0x39, 0xd7, + 0x0b, 0xa5, 0x95, 0x7f, 0x0e, 0x4d, 0x63, 0x63, 0xb8, 0x96, 0x9e, 0x5a, + 0x3d, 0xad, 0x78, 0x86, 0x42, 0xa2, 0xe5, 0x15, 0x26, 0x97, 0xdb, 0x9d, + 0x52, 0x47, 0x77, 0x62, 0xa3, 0x7b, 0xe0, 0x28, 0x2f, 0xe9, 0x3f, 0x01, + 0x20, 0xc1, 0x01, 0x87, 0xdc, 0x37, 0x47, 0x98, 0x00, 0x70, 0x55, 0xea, + 0x49, 0x38, 0x9e, 0x1b, 0x08, 0x82, 0x3c, 0xcb, 0xff, 0x6f, 0xe7, 0xda, + 0xcd, 0x1d, 0x81, 0x7f, 0xba, 0x2b, 0xe9, 0x0b, 0x3a, 0xa8, 0xbd, 0xf5, + 0xd3, 0x3c, 0x19, 0x7b, 0xe7, 0xc7, 0x34, 0x17, 0xd2, 0xfe, 0x4a, 0x93, + 0x19, 0x32, 0x20, 0x9e, 0x39, 0xc7, 0x9a, 0x84, 0xc9, 0xd4, 0xb4, 0x44, + 0x66, 0x02, 0xf3, 0xf1, 0xad, 0x15, 0xaa, 0xfd, 0xa6, 0x5e, 0xe5, 0xfb, + 0x05, 0xa0, 0x8e, 0xc6, 0x96, 0xa4, 0x45, 0xf1, 0xed, 0xd3, 0x4b, 0xfd, + 0xa7, 0xf1, 0xd2, 0x54, 0x92, 0x78, 0x4b, 0x4f, 0xd7, 0xb4, 0xd0, 0xf2, + 0x9e, 0x39, 0x15, 0x48, 0x41, 0x22, 0xe9, 0x80, 0xf2, 0x87, 0x91, 0x2d, + 0x41, 0x8b, 0xee, 0x07, 0x52, 0x23, 0xaf, 0x47, 0x15, 0x3e, 0x8b, 0x22, + 0x9a, 0xe0, 0xe3, 0x11, 0xdf, 0xa3, 0x77, 0xdf, 0xdc, 0x42, 0xcd, 0x9f, + 0x06, 0x46, 0x3a, 0x1b, 0x00, 0xc2, 0x9b, 0x2e, 0x13, 0x58, 0x95, 0x14, + 0xc1, 0x8d, 0x1c, 0xcc, 0x49, 0xd1, 0xe8, 0x06, 0xc6, 0x31, 0x52, 0x31, + 0x85, 0x3d, 0xab, 0xe6, 0x97, 0xca, 0xf8, 0x66, 0xc2, 0xff, 0x2b, 0xc6, + 0x4c, 0xf9, 0x72, 0x6e, 0x01, 0xda, 0x23, 0x87, 0xe1, 0x4c, 0x71, 0x73, + 0x7d, 0xe8, 0xf3, 0x6b, 0x60, 0x7c, 0x23, 0x08, 0x6b, 0xf2, 0x9c, 0x52, + 0xd1, 0xa9, 0x27, 0x17, 0x11, 0x33, 0x7c, 0x4d, 0xca, 0x3b, 0xb9, 0xf3, + 0x26, 0x68, 0x0f, 0xf2, 0xc3, 0x4e, 0xde, 0xfe, 0x77, 0xe9, 0xed, 0x30, + 0x4f, 0x85, 0x79, 0xa0, 0x74, 0xab, 0xc3, 0xc1, 0x6b, 0x97, 0xc6, 0xce, + 0xee, 0x29, 0x68, 0xf7, 0x9d, 0x5e, 0x2d, 0x7a, 0x8d, 0x3e, 0x4f, 0xed, + 0x20, 0xe3, 0xab, 0xdf, 0xe5, 0x79, 0x04, 0x3b, 0x82, 0x36, 0x20, 0x6e, + 0x61, 0x64, 0x45, 0xd5, 0x11, 0xca, 0x4a, 0x26, 0xf1, 0x24, 0x7b, 0x65, + 0xf6, 0x61, 0xa5, 0xb5, 0x65, 0x6a, 0x04, 0xfb, 0xc5, 0x96, 0x04, 0xe9, + 0xdd, 0xf7, 0xe4, 0x10, 0xcd, 0xfa, 0x21, 0x1e, 0x84, 0x78, 0xcb, 0xf4, + 0xa6, 0xc4, 0x86, 0xd9, 0x3f, 0x79, 0xab, 0x90, 0xb3, 0x03, 0xb2, 0xa2, + 0xb9, 0xd8, 0xbd, 0x1b, 0x21, 0x64, 0x7d, 0x40, 0x13, 0x8c, 0x16, 0x19, + 0x4d, 0x39, 0x91, 0x45, 0x50, 0x99, 0x47, 0xae, 0x7d, 0xe4, 0xac, 0xd0, + 0x2e, 0x0a, 0x4d, 0xf8, 0x3e, 0x78, 0xfd, 0x69, 0x6c, 0x34, 0x07, 0x3a, + 0xc1, 0x5b, 0xd3, 0xd1, 0x10, 0xcc, 0xc0, 0xa9, 0x2c, 0x19, 0x2b, 0x6a, + 0x9c, 0x0d, 0x7d, 0xce, 0x32, 0x50, 0xce, 0xc4, 0xd2, 0x59, 0x5a, 0x06, + 0xbc, 0xba, 0x40, 0x74, 0xcf, 0x03, 0x94, 0x02, 0x3e, 0xee, 0x43, 0x93, + 0x62, 0xf8, 0xc9, 0xa1, 0x04, 0xd7, 0x61, 0xea, 0x16, 0xa4, 0xfb, 0xef, + 0xc2, 0x2e, 0x32, 0x2e, 0xd2, 0x32, 0xfc, 0x85, 0x8e, 0x8e, 0x6e, 0x12, + 0x10, 0xc1, 0xd7, 0xc5, 0xd4, 0x81, 0xc6, 0x17, 0x53, 0x4f, 0x6d, 0x99, + 0x7e, 0x42, 0x8b, 0x2c, 0xb2, 0x1a, 0xa8, 0x0b, 0x0a, 0xeb, 0x03, 0x08, + 0x02, 0x12, 0x10, 0x7c, 0xb4, 0x9f, 0x98, 0x7a, 0x63, 0x5e, 0x1e, 0x0a, + 0x52, 0x18, 0x46, 0x94, 0x58, 0x2d, 0x6e, 0x18, 0xe7, 0xc7, 0x92, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xe2, 0x58, 0x32, 0xa8, 0x8f, 0x42, 0xf5, 0x8b, 0x68, 0x66, 0x1d, + 0x2b, 0x6c, 0xf5, 0x60, 0xc5, 0x27, 0xb4, 0x2f, 0x2d, 0xa1, 0x9f, 0xce, + 0xe1, 0x9c, 0xb1, 0xb6, 0xa9, 0x09, 0x40, 0x03, 0xd8, 0x41, 0x3b, 0xbc, + 0x9d, 0xa8, 0x6d, 0x47, 0xc7, 0xad, 0x0f, 0x47, 0x7f, 0xa5, 0xab, 0x81, + 0x82, 0x5b, 0x09, 0x2a, 0x35, 0x26, 0x72, 0x6f, 0xf0, 0x82, 0xd8, 0x0c, + 0x2d, 0xf8, 0x55, 0xf5, 0x26, 0x07, 0x58, 0x97, 0xf2, 0x9f, 0x23, 0x63, + 0x9a, 0x7b, 0xef, 0xcd, 0x75, 0x04, 0xac, 0x8b, 0x20, 0x24, 0x75, 0xdd, + 0xb2, 0xb1, 0xc6, 0x81, 0xc8, 0xe3, 0xd2, 0xdd, 0xed, 0x8e, 0x70, 0x75, + 0xb7, 0x60, 0xb4, 0x16, 0x59, 0xc7, 0x98, 0x41, 0x9d, 0xff, 0x86, 0x5f, + 0x85, 0x64, 0x1d, 0xe4, 0x60, 0x85, 0xe1, 0xbb, 0xe0, 0x66, 0x1e, 0xd4, + 0xc1, 0x09, 0x4d, 0x5b, 0xa8, 0xf9, 0x90, 0xfd, 0xb4, 0x5d, 0x7c, 0x90, + 0x77, 0xfb, 0xd1, 0xd3, 0x12, 0x69, 0xe9, 0xd7, 0x8d, 0xac, 0xc6, 0x99, + 0x51, 0x95, 0xf3, 0x37, 0xe6, 0xf9, 0xff, 0xab, 0x23, 0xd3, 0x40, 0x43, + 0x80, 0x1a, 0x7d, 0x19, 0x7b, 0x97, 0xb5, 0xfa, 0x8f, 0x64, 0x85, 0xa4, + 0xe3, 0xae, 0x37, 0x18, 0x58, 0x38, 0xd1, 0xc6, 0x85, 0x4b, 0x16, 0x03, + 0xae, 0x3f, 0xfd, 0x8e, 0xb3, 0xf4, 0x2a, 0x5f, 0xce, 0x11, 0x9b, 0xa1, + 0x5e, 0x3d, 0x6a, 0xb6, 0x30, 0x99, 0xb3, 0xb8, 0xf3, 0x6e, 0xed, 0x6e, + 0xee, 0xb9, 0x4b, 0x1a, 0x36, 0x67, 0x91, 0x70, 0x02, 0xec, 0x0c, 0xa5, + 0x55, 0xa1, 0x64, 0x29, 0x42, 0x7f, 0x39, 0x9a, 0x15, 0xa1, 0x20, 0x40, + 0x3f, 0x69, 0x4e, 0x97, 0xe3, 0xc3, 0x5c, 0x94, 0x3b, 0x59, 0x58, 0xb1, + 0x0d, 0x6b, 0xfd, 0x26, 0x84, 0x71, 0x60, 0xcf, 0x3a, 0xa3, 0x2c, 0x04, + 0x76, 0xbe, 0xe3, 0x0e, 0xeb, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x52, 0xaa, 0x01, 0x08, 0x01, 0x10, 0x00, + 0x1a, 0x81, 0x01, 0x04, 0xc2, 0x7a, 0x4c, 0xca, 0x5d, 0xda, 0xf5, 0xd2, + 0xd6, 0x6c, 0x67, 0x6e, 0x8f, 0x75, 0x26, 0x41, 0x36, 0xb3, 0xb3, 0xa6, + 0x1f, 0x2e, 0x98, 0xb7, 0x76, 0x7a, 0x63, 0x3d, 0x27, 0xf7, 0xef, 0x3c, + 0x46, 0x36, 0x44, 0x80, 0x93, 0x76, 0x1f, 0x2b, 0xda, 0xc5, 0x78, 0x76, + 0x24, 0x82, 0xba, 0x9d, 0xac, 0xb8, 0x6d, 0xe3, 0x38, 0x2e, 0x5c, 0x2a, + 0x25, 0x39, 0xff, 0x7b, 0x51, 0x5a, 0x9b, 0x53, 0xb4, 0xfb, 0x1b, 0x1d, + 0x8c, 0xe7, 0x16, 0xc9, 0x39, 0x40, 0xe3, 0xbe, 0x30, 0x85, 0x26, 0xdb, + 0x49, 0x78, 0x62, 0x50, 0x0e, 0x4d, 0xf4, 0x88, 0xc4, 0xcb, 0xb1, 0x75, + 0x50, 0xbe, 0x38, 0xa1, 0x57, 0x3b, 0x8c, 0xd0, 0xe9, 0xb2, 0x18, 0x8d, + 0x87, 0xdd, 0x31, 0x44, 0x89, 0xa7, 0x9d, 0x51, 0x74, 0x9c, 0xdc, 0xfe, + 0x39, 0x22, 0x37, 0xc7, 0xef, 0xd4, 0x41, 0x42, 0xac, 0xce, 0x3e, 0xa1, + 0x22, 0x20, 0xf8, 0x60, 0x88, 0xd5, 0xc2, 0x33, 0x6d, 0xb4, 0x92, 0x11, + 0x73, 0xbc, 0x51, 0xf9, 0x33, 0xd9, 0x65, 0x49, 0xba, 0xd8, 0x4a, 0x2e, + 0x96, 0x85, 0x1e, 0x3a, 0xdf, 0xdb, 0x6a, 0xce, 0x17, 0x41, 0x12, 0x80, + 0x02, 0x22, 0x5c, 0x2d, 0x62, 0xca, 0xea, 0x54, 0x08, 0xaf, 0x58, 0xc4, + 0x5e, 0xeb, 0xd9, 0x1a, 0xee, 0xf9, 0x30, 0x31, 0xff, 0x95, 0x18, 0x74, + 0xae, 0xe7, 0x67, 0x3f, 0x33, 0x19, 0xff, 0xf4, 0x0e, 0x69, 0x0c, 0xfc, + 0xd8, 0x81, 0x79, 0xa6, 0x02, 0x06, 0xc4, 0x14, 0x57, 0xf6, 0x8a, 0xd4, + 0xc9, 0x77, 0x50, 0x83, 0x05, 0x9b, 0xf7, 0xa6, 0x58, 0x7c, 0x68, 0x53, + 0x83, 0x7b, 0x47, 0x49, 0xbc, 0xbd, 0x4c, 0xb3, 0xff, 0x67, 0x4f, 0x48, + 0x10, 0xd7, 0x9a, 0x6b, 0x55, 0xe1, 0x17, 0x3d, 0x05, 0xdb, 0x62, 0x8e, + 0x5c, 0x11, 0xa7, 0xce, 0x71, 0xab, 0x78, 0xfe, 0x8e, 0x60, 0x9b, 0x53, + 0x6b, 0x02, 0xb9, 0xf8, 0x9b, 0x58, 0x47, 0x29, 0x8e, 0x0d, 0x8e, 0x57, + 0x27, 0xa5, 0x7f, 0xeb, 0x36, 0xc6, 0x61, 0x58, 0xd2, 0x20, 0x0e, 0x38, + 0xd5, 0x98, 0xdb, 0x5d, 0x71, 0xf5, 0x76, 0x80, 0x32, 0x44, 0xd6, 0x4c, + 0x02, 0x1f, 0xa6, 0xbb, 0xef, 0xc9, 0xe2, 0x1b, 0xfc, 0x35, 0x7b, 0xe4, + 0xc4, 0xfd, 0xf3, 0x26, 0x7b, 0xd3, 0xe2, 0xdf, 0x3d, 0x27, 0x8a, 0x7b, + 0x97, 0x0b, 0x5e, 0x72, 0x05, 0x2a, 0x27, 0x45, 0x7a, 0x2c, 0x59, 0x82, + 0x75, 0xd5, 0x65, 0x9d, 0x37, 0x3e, 0x34, 0xc3, 0x2d, 0x84, 0xfb, 0xe7, + 0xa7, 0xae, 0x4b, 0x1b, 0x54, 0x2d, 0xec, 0xfe, 0x82, 0x68, 0x94, 0xf7, + 0x58, 0x47, 0xfc, 0x89, 0xb3, 0xf3, 0x75, 0x8d, 0x46, 0xd6, 0x05, 0x3a, + 0xb9, 0xe6, 0xae, 0x72, 0x1a, 0xf9, 0x0e, 0x69, 0xd0, 0x56, 0x29, 0x14, + 0xa2, 0x0f, 0x20, 0xaa, 0x20, 0x99, 0xc1, 0x02, 0x7b, 0xa5, 0xb1, 0xcb, + 0x2e, 0xa7, 0x46, 0x63, 0x3f, 0x9f, 0x95, 0x63, 0xee, 0x69, 0x92, 0x7a, + 0xe2, 0xa3, 0x0d, 0xae, 0xc7, 0x09, 0xee, 0xab, 0xb4, 0x69, 0x7d, 0x1e, + 0x54, 0x1b, 0xfc, 0x09, 0xc0, 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, + 0x01, 0x12, 0x10, 0x65, 0x80, 0x2c, 0x9b, 0x62, 0x5e, 0x5a, 0x31, 0x9c, + 0x33, 0xdc, 0x1c, 0xb7, 0xc3, 0xc6, 0xd4, 0x18, 0xe3, 0xa5, 0xbd, 0xd0, + 0x05, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xb8, 0x05, 0x02, 0x04, 0x3c, 0x2a, 0x8a, 0x0f, 0xd8, 0xd2, 0x5c, + 0x61, 0x3e, 0x1e, 0x3e, 0x3b, 0x5e, 0x34, 0x9f, 0x33, 0x2f, 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, 0x23, + 0x40, 0x4f, 0x2b, 0xf1, 0xfc, 0xa1, 0x6f, 0xd0, 0xa4, 0xb9, 0x82, 0x63, + 0x4d, 0xb6, 0x24, 0x07, 0xf8, 0xf1, 0x4a, 0xca, 0xe3, 0xb0, 0x5a, 0x03, + 0x8b, 0xd3, 0xe4, 0xbb, 0xba, 0xe4, 0x39, 0x1b, 0xbf, 0xa7, 0xa4, 0x7f, + 0xb9, 0xd0, 0x1d, 0xe8, 0x57, 0xea, 0x88, 0xe5, 0xe3, 0x6e, 0xe3, 0x6e, + 0x24, 0x58, 0x59, 0xfc, 0x0f, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe8, + 0x3d, 0x12, 0x80, 0x03, 0x7e, 0x06, 0x58, 0x1a, 0x01, 0x91, 0x84, 0xab, + 0x57, 0x2a, 0xfd, 0xca, 0xdd, 0xd0, 0x3f, 0x16, 0x1c, 0xe6, 0x82, 0x00, + 0xf8, 0xe6, 0xf8, 0xad, 0x16, 0x19, 0x47, 0x36, 0x0b, 0xc8, 0xd4, 0x9c, + 0x0d, 0x68, 0x00, 0x9b, 0x1c, 0x46, 0x44, 0xf9, 0xb3, 0xf3, 0xfb, 0x6d, + 0xdf, 0xd9, 0x2e, 0xf9, 0x2d, 0xe6, 0x2d, 0x41, 0xd4, 0x59, 0xd2, 0x9d, + 0x81, 0xbf, 0xae, 0xf3, 0x97, 0x0a, 0x3a, 0x39, 0xd2, 0x5b, 0x26, 0x62, + 0xec, 0xb0, 0x3b, 0x2d, 0xa7, 0xb6, 0x83, 0x02, 0xfa, 0xa6, 0xdd, 0x98, + 0xd9, 0x5a, 0x14, 0x3c, 0xc8, 0xc1, 0xcb, 0x6a, 0xdd, 0xa7, 0x6d, 0x2e, + 0xe9, 0xc3, 0x72, 0x3f, 0xaf, 0x95, 0xa2, 0x9c, 0xdc, 0x3e, 0x96, 0x8b, + 0x68, 0x21, 0xa9, 0x1c, 0x05, 0x1c, 0xa2, 0x80, 0xa8, 0x66, 0x69, 0x71, + 0x0a, 0x1a, 0xd7, 0xa4, 0x4b, 0xf9, 0x21, 0x80, 0x27, 0x46, 0x0d, 0xf6, + 0x94, 0xe2, 0xe9, 0x27, 0x03, 0x96, 0xdf, 0x22, 0x19, 0x63, 0xf2, 0x1e, + 0xe6, 0xaa, 0x22, 0x0a, 0x5e, 0xe4, 0xa4, 0xd0, 0xfe, 0xb3, 0xd5, 0x3e, + 0xb5, 0x73, 0x2f, 0x8f, 0x91, 0xe9, 0xa9, 0x6b, 0x3b, 0x8b, 0xe2, 0x84, + 0xc5, 0x13, 0x39, 0xea, 0x28, 0x4d, 0x4d, 0x0e, 0xdd, 0x55, 0xb6, 0xad, + 0x56, 0xf7, 0x41, 0x64, 0x20, 0xe0, 0x5e, 0x05, 0x9f, 0x97, 0x34, 0xa9, + 0x6b, 0xe2, 0x5a, 0xa4, 0x45, 0x60, 0xdb, 0xa8, 0xc3, 0x87, 0x55, 0xa4, + 0x2a, 0x82, 0xbd, 0x7f, 0x88, 0xed, 0xd1, 0x9d, 0xf3, 0x46, 0xa6, 0x67, + 0xb3, 0x3b, 0x81, 0x14, 0xc7, 0x6a, 0x88, 0x38, 0xc4, 0x23, 0xd8, 0x24, + 0xa5, 0x0b, 0x23, 0x25, 0x1a, 0x08, 0x81, 0x36, 0xd6, 0xe8, 0xf4, 0x75, + 0x29, 0x9d, 0x2a, 0xfd, 0x46, 0xce, 0xa5, 0x1b, 0x5c, 0xbd, 0xf7, 0x89, + 0xa5, 0x72, 0x12, 0x5c, 0xd2, 0x4f, 0xbb, 0x81, 0x3b, 0x38, 0x7a, 0x10, + 0xcd, 0x2a, 0x30, 0xe3, 0x44, 0x76, 0x34, 0xab, 0x34, 0x08, 0xf9, 0x6b, + 0x9c, 0xf3, 0xd9, 0x88, 0x96, 0xd4, 0x05, 0xf3, 0xf5, 0x40, 0xd9, 0xc5, + 0x79, 0x62, 0x76, 0x0f, 0xcd, 0x17, 0x7c, 0xdd, 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, 0x22, 0x04, 0xa1, 0x36, 0x08, 0x52, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + RunTest(); +} + +TEST_F(ODKGoldenProvisionV17, CorePIGTest_OfflineNoNonce_prov30) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x00, 0x02, 0x00, + 0x11, 0x97, 0x5f, 0xe4, 0xee, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, + 0x00, 0x20, 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, + 0x65, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, + 0x6f, 0x78, 0x30, 0x30, 0x30, 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, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x00, 0x02, 0x00, 0x11, + 0x97, 0x5f, 0xe4, 0xee, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, + 0x57, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x54, 0x65, 0x73, 0x74, + 0x4f, 0x6e, 0x6c, 0x79, 0x4b, 0x65, 0x79, 0x62, 0x6f, 0x78, 0x30, 0x30, + 0x30, 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, 0x03, + 0x00, 0x00, 0x04, 0xd0, 0x00, 0x00, 0x04, 0xd5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x09, 0xec, 0x00, 0x00, 0x01, 0x00, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t provisioning_response_raw[] = { + 0x0a, 0xd0, 0x09, 0xe6, 0x71, 0x29, 0x43, 0xec, 0xc7, 0x9d, 0xad, 0x9a, + 0x40, 0xf1, 0x14, 0x6d, 0x99, 0xe9, 0xae, 0x6f, 0xbf, 0x12, 0xaa, 0x6d, + 0x7b, 0x6d, 0x3e, 0xf4, 0x14, 0x3f, 0xd1, 0xbe, 0x0f, 0x33, 0x14, 0x3f, + 0x5b, 0x4c, 0x2c, 0xb7, 0xb8, 0xc8, 0xd0, 0x09, 0x7b, 0xe9, 0x07, 0xd3, + 0xb7, 0x59, 0x40, 0x2b, 0xd0, 0x88, 0x93, 0x02, 0x5b, 0xa9, 0x9b, 0xdc, + 0xa2, 0x7a, 0xd0, 0x89, 0xa7, 0x21, 0x30, 0x05, 0xa9, 0xac, 0xe4, 0xa1, + 0x39, 0xf3, 0xe1, 0xf9, 0x37, 0x17, 0xbc, 0xfa, 0xd0, 0x12, 0x7d, 0xa8, + 0x1d, 0x26, 0x14, 0xd5, 0xc4, 0x4d, 0x99, 0x07, 0x92, 0xac, 0x3f, 0x53, + 0x82, 0x96, 0xec, 0x47, 0x94, 0x54, 0x33, 0x3e, 0x9c, 0xab, 0x5b, 0xa0, + 0xff, 0x3c, 0x7d, 0x64, 0xa5, 0x0f, 0x52, 0x35, 0xb8, 0x66, 0x5a, 0x63, + 0xdc, 0xd7, 0xe2, 0x3e, 0x48, 0xf6, 0x30, 0x6a, 0x60, 0x7d, 0xa8, 0x4e, + 0x38, 0x45, 0x0f, 0x6a, 0xd5, 0xbb, 0xc8, 0x23, 0x5e, 0x3c, 0xfd, 0xdf, + 0x76, 0x40, 0x6a, 0x1d, 0x6f, 0xae, 0x45, 0x9d, 0x7f, 0x1b, 0x4b, 0xb2, + 0xd3, 0x89, 0x63, 0xeb, 0xb4, 0x44, 0x22, 0x2c, 0x1a, 0x3f, 0x19, 0x07, + 0x95, 0x2c, 0xf8, 0xa0, 0xc2, 0xa0, 0xd4, 0x02, 0xf0, 0x26, 0x89, 0x21, + 0x27, 0x24, 0x4d, 0x50, 0x24, 0x3c, 0x28, 0xfe, 0x96, 0x00, 0x3e, 0xfc, + 0x40, 0xf2, 0x15, 0x83, 0x37, 0x35, 0x2e, 0xfa, 0x2d, 0xff, 0x7b, 0x53, + 0xff, 0xad, 0x06, 0xf3, 0x18, 0xc0, 0xdd, 0xc3, 0xeb, 0x0c, 0x0d, 0x74, + 0x60, 0x37, 0xaa, 0xd0, 0x2a, 0x1d, 0xeb, 0x97, 0xe2, 0x82, 0xd2, 0x7c, + 0x96, 0xa2, 0x6e, 0x53, 0x89, 0xb4, 0x74, 0xbe, 0x7d, 0xc7, 0x9c, 0x81, + 0x16, 0xe0, 0x44, 0xd1, 0xe4, 0xfe, 0xba, 0x58, 0xc7, 0x26, 0xd3, 0x0f, + 0x25, 0x2f, 0x8c, 0xc1, 0x59, 0x9f, 0xd6, 0xe8, 0xe3, 0xa4, 0x7d, 0x0a, + 0x73, 0xa5, 0xc5, 0xb5, 0x32, 0x21, 0xde, 0x47, 0xba, 0xec, 0x5b, 0x6f, + 0x82, 0x22, 0x7b, 0x74, 0xf1, 0x86, 0x22, 0x20, 0xed, 0xf6, 0xec, 0xc2, + 0x30, 0xd5, 0x77, 0xdf, 0x55, 0xd6, 0x8a, 0xee, 0x34, 0x0d, 0xbc, 0xc7, + 0xb0, 0x11, 0x03, 0xf8, 0xd9, 0x57, 0x0a, 0x96, 0x2c, 0xe0, 0x13, 0xc4, + 0x59, 0x47, 0x80, 0x89, 0x47, 0x38, 0x5d, 0x22, 0x51, 0x13, 0xa6, 0x08, + 0x36, 0x0d, 0x2b, 0x02, 0xa3, 0xab, 0xca, 0xe2, 0x80, 0xfc, 0x3a, 0x05, + 0xa6, 0x7e, 0xb5, 0x56, 0xd9, 0x42, 0x9d, 0x0f, 0xfd, 0xfc, 0x98, 0xf8, + 0xfa, 0x9c, 0x28, 0xc3, 0xfa, 0x3f, 0x2f, 0x08, 0x68, 0x6a, 0xb9, 0xdb, + 0x7a, 0x8b, 0x6b, 0x78, 0x5a, 0x69, 0xaf, 0x93, 0x2b, 0xbd, 0xdd, 0x0b, + 0x07, 0x1e, 0xf3, 0x4e, 0x28, 0xa0, 0x32, 0xcb, 0xcf, 0xaa, 0xd1, 0xa8, + 0x12, 0xfb, 0xc6, 0x10, 0xdc, 0x1c, 0x37, 0x0a, 0x7e, 0xcc, 0x98, 0x0f, + 0x84, 0xe7, 0x07, 0xe1, 0x36, 0x5d, 0x83, 0x12, 0x76, 0xf4, 0x3f, 0xa4, + 0xb9, 0x39, 0x60, 0xf8, 0x79, 0x10, 0x9f, 0x2f, 0x91, 0xb0, 0xfc, 0xac, + 0x25, 0xa0, 0x70, 0x80, 0x3b, 0x03, 0xca, 0x4c, 0x4f, 0xb8, 0xa2, 0x1a, + 0xe5, 0xe6, 0xd8, 0x81, 0x12, 0x34, 0xc0, 0x18, 0x8b, 0xfa, 0x5f, 0xa5, + 0x0a, 0xe4, 0x4f, 0x09, 0x67, 0xf2, 0x8f, 0x5c, 0x81, 0xe9, 0xd2, 0x42, + 0x89, 0xc0, 0x5d, 0xba, 0x17, 0xa5, 0x58, 0xa5, 0x8f, 0xa4, 0x5c, 0x99, + 0x08, 0x5c, 0xee, 0x1c, 0xe0, 0xb6, 0xbc, 0xb5, 0x63, 0x15, 0xf3, 0x03, + 0x06, 0x1a, 0x05, 0x16, 0x93, 0x63, 0x57, 0xf0, 0xde, 0x14, 0x82, 0xf0, + 0xa8, 0xf5, 0xcc, 0x79, 0x3b, 0x42, 0x31, 0x08, 0x34, 0xc8, 0x36, 0x51, + 0x72, 0x45, 0xcb, 0x5b, 0xd1, 0xd9, 0x63, 0xd0, 0xe4, 0x9d, 0x27, 0xdd, + 0x98, 0x40, 0x01, 0xff, 0x62, 0xc2, 0xec, 0x7b, 0x2a, 0x2e, 0x12, 0x4f, + 0xb5, 0x61, 0x70, 0xee, 0x7c, 0xcd, 0xd9, 0xf6, 0xc1, 0x53, 0x83, 0x9a, + 0x45, 0x3c, 0xda, 0xfe, 0x98, 0x2c, 0x30, 0x85, 0x9e, 0xb3, 0xc7, 0x74, + 0x36, 0x98, 0x82, 0x78, 0xc2, 0x11, 0x3e, 0xd7, 0x10, 0xab, 0x31, 0x2e, + 0x6b, 0xc4, 0x33, 0x4d, 0x7f, 0x70, 0x38, 0xb2, 0x4b, 0x20, 0xbc, 0x65, + 0xcf, 0x6a, 0xa1, 0x12, 0xb0, 0x50, 0xf7, 0x98, 0x3e, 0xc9, 0x7b, 0x97, + 0xf6, 0x5c, 0x5c, 0xbe, 0x9e, 0xe5, 0x8b, 0xb0, 0xc7, 0x27, 0x78, 0xc3, + 0x87, 0x8b, 0xe5, 0x33, 0xee, 0x8e, 0x00, 0x04, 0xf6, 0xda, 0x90, 0x21, + 0x7d, 0xa0, 0x85, 0x9d, 0x55, 0xdc, 0x10, 0x11, 0x28, 0x91, 0x2c, 0x7b, + 0xf8, 0x09, 0x51, 0xed, 0x13, 0x51, 0xb1, 0x1d, 0x88, 0x94, 0x85, 0x6c, + 0x55, 0xaf, 0x2b, 0x64, 0xec, 0xe0, 0x6a, 0xa0, 0x4f, 0xe9, 0x97, 0x74, + 0x68, 0x84, 0xaf, 0x59, 0xf7, 0xf3, 0x60, 0xd6, 0x63, 0xde, 0x9f, 0xce, + 0xc9, 0x55, 0xb4, 0xe6, 0x60, 0xc6, 0x85, 0xe7, 0x8f, 0x67, 0xc5, 0xd0, + 0xf5, 0xf9, 0xb1, 0x90, 0x8b, 0x63, 0x44, 0xaf, 0x03, 0x05, 0x5e, 0xa9, + 0x70, 0x20, 0xae, 0x5e, 0xa9, 0xc6, 0x5f, 0x41, 0x5a, 0x86, 0x75, 0x28, + 0x1b, 0x00, 0x46, 0x58, 0x67, 0xe5, 0xb0, 0x3b, 0xc1, 0xf5, 0x44, 0xf8, + 0x19, 0x40, 0x8e, 0xe9, 0x9b, 0x58, 0xa3, 0xd0, 0xac, 0x4b, 0x8b, 0xb9, + 0x9f, 0xec, 0x23, 0x92, 0xcb, 0xa2, 0xfd, 0x88, 0x34, 0x46, 0x48, 0xcc, + 0x05, 0xb3, 0xb6, 0x83, 0x2a, 0xbe, 0xbe, 0x7c, 0xd6, 0x4e, 0x5d, 0x67, + 0x53, 0x8b, 0xc9, 0xa4, 0xd0, 0xde, 0xd8, 0xea, 0xdd, 0x7c, 0x8f, 0x94, + 0xe6, 0x16, 0xa1, 0x4b, 0xe7, 0xb7, 0xe4, 0x71, 0x76, 0x4c, 0x40, 0x8a, + 0xd3, 0xb9, 0x70, 0x18, 0x9e, 0x57, 0xa6, 0x5e, 0x19, 0xbe, 0xdd, 0x5d, + 0x51, 0x29, 0x02, 0x83, 0xfd, 0x59, 0x1d, 0xc9, 0x31, 0x6d, 0x86, 0x5c, + 0x24, 0xb7, 0x03, 0xf1, 0x33, 0xa4, 0x55, 0xec, 0x3b, 0x24, 0x3a, 0xe6, + 0x3e, 0x13, 0x87, 0xde, 0x36, 0x3e, 0x51, 0x82, 0x77, 0x01, 0x0a, 0x30, + 0x1a, 0x66, 0x43, 0x5e, 0x39, 0x11, 0xf4, 0x1d, 0xd3, 0x5e, 0x47, 0x3c, + 0xd7, 0x47, 0x9e, 0x9c, 0xb7, 0xee, 0x84, 0xe9, 0xcc, 0x0b, 0x40, 0x2d, + 0xa0, 0x72, 0x5b, 0x77, 0xd2, 0xca, 0x0f, 0xd8, 0x8b, 0x24, 0xae, 0x4e, + 0x01, 0xcd, 0xed, 0xdc, 0x1d, 0x68, 0xa1, 0xd2, 0xbf, 0x92, 0xa1, 0x3a, + 0x8f, 0xc9, 0x42, 0xfa, 0xc2, 0x66, 0x20, 0xbd, 0xc0, 0x4d, 0x58, 0x2b, + 0x52, 0x2e, 0x0d, 0xc4, 0xec, 0xec, 0xdf, 0x3c, 0xc6, 0x05, 0x6c, 0x5b, + 0xc6, 0x09, 0x95, 0xa5, 0x77, 0x4b, 0x5d, 0x63, 0xdb, 0xec, 0x06, 0xf1, + 0x39, 0x2e, 0x2c, 0x5b, 0x5d, 0xe1, 0x96, 0x02, 0x06, 0x20, 0x17, 0xf5, + 0x84, 0x01, 0x95, 0xea, 0xf0, 0x9f, 0x0e, 0x71, 0x10, 0x7c, 0x8a, 0x29, + 0x15, 0xed, 0xee, 0x66, 0x80, 0x84, 0x4c, 0xdc, 0xa4, 0xd2, 0x1a, 0x3c, + 0x05, 0x85, 0x5c, 0xb2, 0x43, 0x14, 0x2b, 0x11, 0xd4, 0x12, 0xf3, 0xbd, + 0xf4, 0x37, 0x90, 0x37, 0x7f, 0x4e, 0x8a, 0x84, 0x2c, 0x73, 0xd2, 0x60, + 0x63, 0xb6, 0xd4, 0x1b, 0xc2, 0xaf, 0x28, 0x48, 0x94, 0x4f, 0x2d, 0xd7, + 0x59, 0x89, 0xc6, 0x34, 0xe8, 0x27, 0xb2, 0xa5, 0x57, 0x89, 0x4e, 0x53, + 0xf1, 0xe5, 0x62, 0xb0, 0x37, 0xc7, 0x91, 0x75, 0x2f, 0xa5, 0x5e, 0x7b, + 0xce, 0xdb, 0xdc, 0xd0, 0x29, 0x63, 0x8f, 0x86, 0x6f, 0x1a, 0xf0, 0x67, + 0x39, 0x3c, 0x2b, 0x2c, 0xdf, 0x73, 0xd7, 0xaa, 0x07, 0x9b, 0x17, 0x48, + 0x11, 0xf2, 0x77, 0xbd, 0x01, 0x32, 0x94, 0x38, 0x2d, 0x08, 0x1b, 0x44, + 0xcb, 0xa3, 0x9c, 0x60, 0x11, 0xd6, 0x71, 0x1f, 0x3c, 0x38, 0x6d, 0x46, + 0xd0, 0xe6, 0x23, 0x75, 0x4e, 0xe4, 0x28, 0xa7, 0x9e, 0x6c, 0xe9, 0xc7, + 0x1d, 0x47, 0x65, 0x13, 0xd5, 0xd4, 0x71, 0xf1, 0xc8, 0x20, 0xf9, 0x4f, + 0xbf, 0x1c, 0x83, 0xf0, 0x50, 0xd5, 0xe9, 0x31, 0x99, 0xa4, 0x0a, 0x00, + 0xe9, 0xf0, 0xd1, 0x7c, 0xa6, 0x42, 0x68, 0x60, 0x37, 0xd7, 0xad, 0x34, + 0xf9, 0x97, 0xfd, 0xf1, 0x83, 0x35, 0xc4, 0x6b, 0x96, 0x6a, 0xce, 0xac, + 0x17, 0x29, 0x67, 0x8f, 0x4c, 0x89, 0xaa, 0x9c, 0x8c, 0x53, 0x06, 0x52, + 0xac, 0x3c, 0x4d, 0x05, 0x11, 0x73, 0x15, 0x09, 0xb9, 0x3d, 0x19, 0xbb, + 0x8e, 0xae, 0xae, 0x79, 0xab, 0x4d, 0x6e, 0xd2, 0xfb, 0x85, 0x01, 0x1d, + 0x0e, 0x1e, 0x17, 0xb4, 0x8e, 0x1b, 0x04, 0x76, 0x6d, 0x22, 0x5d, 0x51, + 0xdb, 0xa7, 0xc5, 0x74, 0x05, 0xe3, 0xc6, 0xa9, 0xab, 0xa8, 0x6a, 0x21, + 0xc4, 0x43, 0x23, 0xbc, 0xf7, 0xca, 0xf2, 0x12, 0x88, 0x76, 0xbb, 0x18, + 0xba, 0x5b, 0xaa, 0x84, 0x9b, 0x54, 0xcb, 0x15, 0x9f, 0x75, 0xa6, 0x07, + 0xc1, 0x2f, 0x4a, 0xdc, 0x0f, 0x94, 0xfb, 0x23, 0xbd, 0x4f, 0x60, 0x2d, + 0x13, 0xea, 0x78, 0x39, 0x0d, 0x77, 0xd0, 0xb5, 0x48, 0xa2, 0x3b, 0x27, + 0x4d, 0xb3, 0x50, 0xb6, 0xaf, 0xdf, 0xa9, 0x4a, 0xfb, 0x0c, 0x86, 0x7b, + 0x3a, 0x79, 0xd7, 0xb4, 0xa0, 0xa7, 0x3d, 0xf9, 0xd3, 0x20, 0xdd, 0x12, + 0x10, 0xc5, 0x6a, 0x79, 0xb2, 0xad, 0x9f, 0x05, 0x8d, 0x16, 0x18, 0xea, + 0xd0, 0x8c, 0x2a, 0x3f, 0xdc, 0x1a, 0xfb, 0x09, 0x0a, 0xbe, 0x02, 0x08, + 0x02, 0x12, 0x10, 0x35, 0x7f, 0x7a, 0xfa, 0x7d, 0x33, 0x42, 0x33, 0x1c, + 0x8c, 0xd1, 0x07, 0xdd, 0xc7, 0x5a, 0x96, 0x18, 0xfb, 0xc8, 0x92, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xe0, 0x6f, 0x39, 0x4c, 0xe6, 0x8a, 0x6d, 0x01, 0x07, 0x30, 0xa5, + 0x99, 0xc6, 0x54, 0x56, 0x3d, 0x7e, 0xff, 0xf5, 0xb7, 0x36, 0xbc, 0x59, + 0x87, 0x89, 0xbc, 0x8a, 0x88, 0x57, 0xfc, 0xaa, 0x6c, 0x48, 0xbc, 0xb4, + 0x63, 0xf1, 0xe4, 0xd7, 0x65, 0x0c, 0xda, 0x79, 0xe0, 0xd0, 0x24, 0xed, + 0x14, 0x58, 0x93, 0xc2, 0x9a, 0xd4, 0xde, 0x77, 0x81, 0x7d, 0x89, 0x42, + 0x32, 0xca, 0x9c, 0x29, 0x2a, 0xec, 0x9b, 0x0a, 0xc7, 0xe3, 0x47, 0xba, + 0x09, 0x92, 0xbb, 0xd0, 0xca, 0x99, 0xb8, 0x7d, 0xac, 0xf0, 0x79, 0x6d, + 0xf0, 0x31, 0x64, 0x76, 0x92, 0x6c, 0x1e, 0xd4, 0x9b, 0xff, 0x33, 0x49, + 0x5b, 0xd4, 0x2a, 0x77, 0xea, 0x84, 0x5b, 0x15, 0xe6, 0xff, 0x4b, 0x3b, + 0x56, 0xae, 0x55, 0x93, 0xbf, 0x0e, 0x4f, 0x66, 0x2d, 0x7a, 0xcb, 0x6a, + 0x70, 0x1d, 0x30, 0x94, 0x74, 0x8c, 0x55, 0xe4, 0x76, 0xdc, 0xa9, 0x8c, + 0x08, 0x30, 0x91, 0x26, 0xbd, 0xe2, 0x4e, 0x2a, 0xfa, 0xbf, 0x1a, 0x38, + 0x64, 0xf9, 0xcd, 0x36, 0x32, 0x59, 0xe8, 0x69, 0x2d, 0xbf, 0xba, 0xc0, + 0xed, 0x4a, 0xb8, 0x1f, 0x4e, 0x77, 0x4a, 0x25, 0xea, 0x53, 0xcc, 0x04, + 0xb1, 0xd9, 0x63, 0x62, 0xb1, 0x53, 0x72, 0x8a, 0x1f, 0x70, 0x87, 0x63, + 0x03, 0x72, 0x59, 0x4d, 0x49, 0xd5, 0x99, 0x46, 0xb7, 0xbc, 0x1b, 0xe7, + 0x1f, 0x58, 0x19, 0x83, 0x8e, 0x7b, 0x39, 0x27, 0x29, 0xe7, 0x6f, 0x40, + 0x89, 0xd1, 0xa3, 0x26, 0xc6, 0xf6, 0xb6, 0x5e, 0xe2, 0x5a, 0xc7, 0x2f, + 0x6d, 0xa4, 0xc9, 0x31, 0xd5, 0xcf, 0xe2, 0x3d, 0x0f, 0x05, 0x60, 0xd1, + 0x77, 0xed, 0xd1, 0x4c, 0xeb, 0x08, 0x7c, 0x64, 0xfb, 0x95, 0x78, 0x88, + 0xe6, 0x86, 0x00, 0x83, 0x22, 0xff, 0xdf, 0xc4, 0x1b, 0xaa, 0xe6, 0xe0, + 0x7e, 0xdc, 0x97, 0x62, 0xef, 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, + 0x3d, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, 0x76, 0x69, 0x6e, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x48, 0x01, 0x12, 0x80, 0x02, 0x6a, 0xb0, 0x72, 0xec, + 0xba, 0xb9, 0xbd, 0x9e, 0x85, 0x38, 0x76, 0xad, 0xc1, 0x58, 0xd4, 0x71, + 0xd6, 0x99, 0xc8, 0x7b, 0x75, 0x69, 0x09, 0xb3, 0x1e, 0x8b, 0x3d, 0xb0, + 0x06, 0x16, 0xcb, 0x84, 0x79, 0xc7, 0x7f, 0xc4, 0x68, 0x38, 0xbc, 0xa7, + 0xd4, 0xee, 0x7b, 0x04, 0xf7, 0x94, 0x72, 0xae, 0xe2, 0x5c, 0x0d, 0x37, + 0x2d, 0x78, 0xfd, 0xa7, 0xd7, 0xac, 0xa2, 0x08, 0x50, 0x90, 0xc0, 0x50, + 0x06, 0x9d, 0x2a, 0xba, 0xb1, 0xc1, 0x71, 0x49, 0xcd, 0x2e, 0x3c, 0x68, + 0x53, 0x0b, 0x23, 0xdf, 0x85, 0xc0, 0x4e, 0x4f, 0x8f, 0x42, 0x6b, 0x18, + 0x55, 0xbc, 0x88, 0x23, 0xff, 0xe0, 0x51, 0xac, 0xa8, 0xc7, 0xf2, 0xa7, + 0x28, 0xaf, 0x89, 0x2c, 0x02, 0x9e, 0xf1, 0xec, 0xf4, 0x04, 0x05, 0x7b, + 0x43, 0x3e, 0x28, 0x01, 0x17, 0xa1, 0x11, 0x9c, 0x98, 0xd5, 0x93, 0xf7, + 0x9a, 0xd3, 0x68, 0xcf, 0x75, 0x05, 0x52, 0x57, 0xea, 0x3f, 0xc0, 0x9b, + 0x63, 0x04, 0x9b, 0x8a, 0x66, 0x04, 0xe8, 0x7e, 0xb7, 0xda, 0x1b, 0xae, + 0x5c, 0x12, 0x5a, 0x1e, 0xa1, 0x00, 0x3d, 0xc0, 0x69, 0x26, 0x55, 0x39, + 0x0f, 0x50, 0x9c, 0x11, 0x76, 0xcc, 0x31, 0x4e, 0x51, 0x91, 0xae, 0xfc, + 0x94, 0x05, 0x5e, 0xa6, 0xe5, 0x85, 0xcc, 0x36, 0x22, 0x2e, 0xda, 0x7c, + 0x16, 0x40, 0xdf, 0xdd, 0x24, 0xec, 0x9d, 0x10, 0x9f, 0x3d, 0x65, 0xdc, + 0x00, 0x94, 0xf9, 0x0e, 0x36, 0x93, 0xb8, 0xa3, 0x8c, 0x30, 0xf5, 0xfb, + 0x94, 0x8e, 0xce, 0x34, 0xb6, 0xc8, 0xef, 0xe3, 0x10, 0x64, 0xc4, 0x29, + 0x51, 0xf9, 0x4f, 0x46, 0x46, 0x5b, 0x2f, 0x83, 0x42, 0xe4, 0x24, 0x63, + 0xff, 0xac, 0xec, 0x8e, 0x13, 0xad, 0x99, 0x24, 0xad, 0x58, 0xab, 0x61, + 0xfb, 0xd0, 0xda, 0xca, 0x48, 0xd4, 0xb1, 0xbf, 0x30, 0x04, 0xb0, 0x27, + 0x1a, 0xb4, 0x05, 0x0a, 0xae, 0x02, 0x08, 0x01, 0x12, 0x10, 0x6b, 0x99, + 0x4c, 0x4a, 0x94, 0x73, 0x2e, 0x0c, 0x81, 0xca, 0xcc, 0x34, 0x71, 0xcf, + 0x8a, 0x63, 0x18, 0xe1, 0xa7, 0xbd, 0xd0, 0x05, 0x22, 0x8e, 0x02, 0x30, + 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbc, 0xfa, 0x43, 0x1b, + 0xaa, 0xbb, 0xd9, 0xb7, 0x5b, 0xb8, 0xec, 0xf6, 0xf0, 0xb6, 0xb1, 0xa6, + 0xc3, 0xd1, 0x45, 0xb8, 0x6e, 0x40, 0x85, 0xa0, 0xcf, 0x24, 0x68, 0x91, + 0xc2, 0x45, 0x8d, 0x4e, 0xf2, 0x42, 0x9e, 0xaa, 0x72, 0xed, 0x86, 0xdc, + 0xfb, 0x85, 0x29, 0x3f, 0x90, 0xb0, 0xc5, 0x12, 0x4e, 0x42, 0x0b, 0xce, + 0xfa, 0x0f, 0x83, 0x1a, 0x4c, 0xe9, 0xc9, 0xc1, 0x0b, 0x12, 0xeb, 0xc7, + 0xc5, 0x1a, 0xd5, 0xa1, 0x8d, 0x26, 0x6d, 0x78, 0x87, 0x2d, 0xc2, 0x63, + 0x84, 0x6c, 0x5e, 0x78, 0xd8, 0x0a, 0x78, 0x68, 0xc2, 0x82, 0x40, 0x0a, + 0xf7, 0x02, 0x63, 0x97, 0xec, 0x1c, 0x08, 0x91, 0x2b, 0xc2, 0xa7, 0xe9, + 0x17, 0xb8, 0x7b, 0x84, 0xed, 0xdc, 0x5c, 0x6c, 0x11, 0x38, 0xb4, 0x18, + 0xff, 0x11, 0x32, 0xd4, 0x34, 0x48, 0xc0, 0xa0, 0x47, 0x2d, 0x81, 0xe2, + 0xb6, 0x41, 0xe9, 0xd4, 0x5a, 0xf1, 0x75, 0x3d, 0x94, 0xf7, 0xb7, 0xf6, + 0x3b, 0x35, 0x78, 0x9c, 0x72, 0x7b, 0x12, 0xe0, 0x73, 0xd9, 0x92, 0x3d, + 0x23, 0xe6, 0xa2, 0x50, 0x95, 0xcc, 0xbc, 0x8b, 0xef, 0xa3, 0x09, 0x85, + 0x85, 0xb8, 0x74, 0xa8, 0x10, 0xab, 0x0a, 0x18, 0x35, 0x7d, 0x27, 0x5c, + 0x6a, 0x52, 0x0e, 0x5b, 0xb9, 0xa9, 0x2c, 0xee, 0xdf, 0x6e, 0xa3, 0x49, + 0xbf, 0x32, 0x3a, 0x6a, 0xe2, 0x72, 0xe4, 0xdd, 0x6f, 0xfb, 0x89, 0xf3, + 0xdf, 0xa6, 0x4a, 0x52, 0x8a, 0x9d, 0xd5, 0x49, 0x04, 0x33, 0xd2, 0xa2, + 0xca, 0x74, 0x3b, 0x2c, 0x34, 0xf1, 0x12, 0x2f, 0x85, 0xc3, 0x3c, 0x4f, + 0x73, 0x1f, 0x2c, 0x8a, 0xd2, 0x6f, 0xa4, 0xb7, 0x91, 0xf9, 0x5f, 0x79, + 0x04, 0x9c, 0x69, 0xe6, 0x62, 0xab, 0x15, 0x91, 0x23, 0x0e, 0x62, 0xbc, + 0x80, 0x1f, 0x97, 0x5f, 0x33, 0xe7, 0x33, 0x9e, 0x91, 0xf6, 0xdc, 0xfb, + 0x02, 0x03, 0x01, 0x00, 0x01, 0x28, 0xe9, 0x3d, 0x12, 0x80, 0x03, 0x0e, + 0x78, 0x2b, 0x14, 0x53, 0x5c, 0x82, 0x9a, 0x00, 0x8d, 0x49, 0x18, 0x5e, + 0x21, 0xb6, 0xfb, 0xeb, 0xa7, 0xee, 0x10, 0x26, 0x75, 0x6f, 0xcd, 0x45, + 0xe8, 0x64, 0x72, 0x56, 0x9e, 0x39, 0x3d, 0x7e, 0x6a, 0x70, 0x5d, 0xf1, + 0x4a, 0xc0, 0x23, 0x66, 0x07, 0x04, 0x4c, 0x8d, 0x18, 0xf7, 0xa7, 0xc5, + 0xc3, 0x18, 0x3f, 0x72, 0xf4, 0xfd, 0xad, 0xb5, 0xc6, 0x8b, 0x77, 0x2e, + 0x20, 0xfb, 0xe4, 0x7b, 0xef, 0x79, 0xef, 0xcd, 0x7f, 0x21, 0x9c, 0x32, + 0xcf, 0xf4, 0xc8, 0xee, 0xfa, 0x81, 0x38, 0x7e, 0x36, 0xec, 0xdd, 0x29, + 0x94, 0xc3, 0xb7, 0x25, 0x6e, 0x77, 0x90, 0x81, 0xbe, 0x6c, 0x16, 0x75, + 0x83, 0x33, 0x41, 0x78, 0x74, 0xb3, 0x54, 0xa4, 0xe6, 0x1c, 0x95, 0xa2, + 0x1c, 0x2b, 0x93, 0x6c, 0xb7, 0xd3, 0x37, 0x31, 0x57, 0xa8, 0x95, 0xce, + 0x0e, 0x16, 0xc0, 0xbb, 0x4e, 0x23, 0xca, 0x23, 0x2a, 0x66, 0x4c, 0xe5, + 0xac, 0xc3, 0x0a, 0xe3, 0x31, 0x32, 0x53, 0xad, 0x2c, 0x70, 0x1d, 0x5a, + 0x20, 0x27, 0xf2, 0x6f, 0x0c, 0x53, 0x7b, 0x71, 0x77, 0x94, 0x5c, 0x28, + 0xc3, 0xf3, 0x3e, 0x48, 0x5f, 0x1a, 0xa2, 0x18, 0xf3, 0x53, 0xb4, 0xa5, + 0x3c, 0xb1, 0x9c, 0x67, 0x39, 0x68, 0x8d, 0xfa, 0x96, 0x8f, 0x6f, 0xdd, + 0x29, 0x35, 0xbc, 0x2c, 0x0d, 0xe5, 0xd7, 0xff, 0x25, 0x2d, 0xcd, 0x3f, + 0xdc, 0xb9, 0xa0, 0xaf, 0x5a, 0x41, 0x3c, 0xce, 0xa9, 0xab, 0x75, 0xee, + 0xf2, 0xbe, 0xee, 0xa8, 0x3b, 0x29, 0xaf, 0x07, 0xbf, 0x84, 0xbd, 0xdd, + 0xe3, 0x83, 0x42, 0xd5, 0x40, 0x8d, 0x39, 0xcf, 0x4d, 0xa9, 0xa3, 0x0c, + 0xd8, 0xbc, 0xfc, 0x32, 0xa5, 0x03, 0x63, 0x22, 0x82, 0xde, 0x3d, 0x1d, + 0xd9, 0x54, 0xd8, 0xcc, 0x57, 0x10, 0x8b, 0xbe, 0xc3, 0xae, 0x52, 0xbc, + 0xaf, 0x17, 0x62, 0xe7, 0x9f, 0x42, 0x75, 0xb8, 0x92, 0x7f, 0x61, 0xd8, + 0x08, 0x57, 0x40, 0x10, 0x2c, 0x85, 0x96, 0x97, 0x48, 0x14, 0xde, 0xb0, + 0x5f, 0xf9, 0xc6, 0xde, 0xfc, 0x25, 0x9c, 0x4d, 0x6e, 0x52, 0x54, 0xf0, + 0xa2, 0xa5, 0xfc, 0x32, 0x45, 0x75, 0x94, 0xbe, 0xe9, 0x57, 0x2a, 0xb8, + 0x6e, 0xab, 0x0f, 0xf5, 0x0c, 0x9a, 0xf9, 0x29, 0x06, 0x65, 0x54, 0xd8, + 0x93, 0x98, 0x3a, 0x5c, 0x71, 0x52, 0x0d, 0xf3, 0x4b, 0xc4, 0xc5, 0xbd, + 0x34, 0xb3, 0x58, 0xcf, 0x83, 0x94, 0xf0, 0x60, 0xb7, 0x91, 0x56, 0xff, + 0x21, 0x7d, 0x03, 0xeb, 0xc9, 0x09, 0x0c, 0x45, 0x6d, 0xa0, 0xaa, 0xd3, + 0x58, 0xc6, 0xea, 0x9d, 0x2c, 0xfc, 0xd3, 0x0a, 0x43, 0x62, 0x66, 0x4d, + 0xdc, 0x25, 0xe2, 0x7f, 0x7e, 0x39, 0x33, 0x82, 0x97, 0x30, 0xfe, 0xdd, + 0x4d, 0x64, 0x56, 0xff, 0xf1, 0x76, 0xc2, 0x78, 0x0b, 0xce, 0xb3, 0x22, + 0x04, 0xee, 0xe4, 0x5f, 0x97, 0x2a, 0x80, 0x02, 0xa4, 0xd4, 0xca, 0x05, + 0x61, 0xfc, 0x6d, 0xbb, 0x73, 0x76, 0xb0, 0x4e, 0xec, 0x7c, 0x7e, 0xdb, + 0xcc, 0x93, 0xa8, 0x8b, 0x0a, 0xb9, 0x80, 0x1b, 0xdb, 0x96, 0xa4, 0x02, + 0xac, 0xe9, 0x46, 0x7e, 0x88, 0x71, 0xb7, 0xe2, 0x37, 0x8b, 0x26, 0x64, + 0x27, 0xba, 0xb0, 0x29, 0x07, 0xdb, 0x80, 0x74, 0x3f, 0x36, 0xac, 0x95, + 0x13, 0xd7, 0xe1, 0x28, 0xe3, 0x07, 0x87, 0x90, 0xa7, 0xef, 0xe4, 0x24, + 0x54, 0x60, 0x01, 0x56, 0xdb, 0xab, 0xad, 0x43, 0x8b, 0xe5, 0x25, 0xa9, + 0x1f, 0xd7, 0x9d, 0x43, 0xe7, 0xf3, 0x27, 0x3c, 0xdf, 0xa3, 0xe8, 0xbc, + 0xb6, 0xe3, 0xa8, 0x9e, 0xaf, 0x17, 0xb1, 0x96, 0x45, 0x5d, 0x8a, 0x8b, + 0x48, 0xed, 0xa5, 0x4d, 0xfa, 0x51, 0xfa, 0x2f, 0x32, 0x60, 0x34, 0x1b, + 0xd8, 0xcf, 0xa5, 0xf9, 0x8f, 0x9e, 0xec, 0x0d, 0xd7, 0x00, 0xd8, 0x23, + 0xa4, 0x4f, 0x01, 0xa3, 0x3f, 0x17, 0x4e, 0x6e, 0x0f, 0x05, 0xd7, 0xc5, + 0xf2, 0xaa, 0x5a, 0x5c, 0x7a, 0x92, 0x04, 0xb1, 0xfb, 0x30, 0x45, 0x0a, + 0xed, 0x41, 0x37, 0x73, 0x92, 0x81, 0x62, 0x3f, 0x64, 0x29, 0x46, 0x56, + 0xc8, 0x9c, 0x86, 0xea, 0xf2, 0xd2, 0x17, 0x63, 0xac, 0xd8, 0x05, 0x78, + 0xa0, 0xfb, 0xbc, 0x2b, 0x8d, 0xde, 0xad, 0x8b, 0xcc, 0xc1, 0x52, 0x06, + 0x91, 0xb3, 0xae, 0x0c, 0x43, 0x6f, 0x86, 0xea, 0x03, 0xbd, 0x87, 0x0d, + 0x1f, 0xa9, 0xbf, 0x87, 0xce, 0xb4, 0x5b, 0x5e, 0x73, 0x55, 0x0e, 0x32, + 0xd9, 0x0d, 0x74, 0xf1, 0xcb, 0x67, 0x57, 0xe4, 0x8f, 0x29, 0x01, 0xb5, + 0x52, 0xe2, 0xc2, 0x4b, 0x4d, 0xc3, 0x5d, 0x62, 0x44, 0x17, 0x10, 0x2a, + 0x56, 0x64, 0x90, 0xf2, 0xd4, 0x98, 0x73, 0xaf, 0x1f, 0x4e, 0x77, 0xa8, + 0xa0, 0x61, 0xa5, 0x15, 0x63, 0x1e, 0x3a, 0x64, 0x1d, 0xcc, 0xa3, 0x4c, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +// License tests. +// All license requests from fake_l1, +// GTEST_FILTER="*PIG*:*CdmUseCase*Case1*" +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenLicenseV17, CorePIGTest_OfflineNoNonce) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x85, 0xaf, 0xcc, 0x86, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x95, 0x00, 0x02, 0x00, 0x11, + 0x85, 0xaf, 0xcc, 0x86, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x50, + 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, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x20, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x45, 0x33, 0x46, 0x30, 0x44, 0x36, 0x41, 0x45, + 0x33, 0x36, 0x43, 0x41, 0x38, 0x37, 0x38, 0x36, 0x30, 0x33, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x33, 0x46, 0x30, 0x44, 0x36, 0x41, 0x45, 0x33, 0x36, + 0x43, 0x41, 0x38, 0x37, 0x38, 0x36, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xf2, 0xcb, + 0x92, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0x5b, 0x7d, 0x63, 0x39, 0x95, 0x57, 0x37, 0x17, 0x5d, 0x8f, 0x47, 0x82, + 0x4d, 0x5a, 0xd7, 0xfd, 0x1a, 0x50, 0xda, 0x2c, 0x6d, 0xf5, 0xe8, 0x3b, + 0x27, 0x68, 0x51, 0xc1, 0xb3, 0x7e, 0x3f, 0xa3, 0x4e, 0xb3, 0xbf, 0x3a, + 0xd4, 0x66, 0xbf, 0xe1, 0x4e, 0x32, 0x1b, 0xf5, 0xf1, 0xaf, 0xab, 0xde, + 0x90, 0x4b, 0xfe, 0x35, 0x54, 0x35, 0x07, 0x17, 0xf1, 0x91, 0x83, 0x8e, + 0x40, 0xbc, 0xbf, 0xeb, 0x57, 0xd2, 0xd7, 0x75, 0x83, 0xf7, 0xce, 0x69, + 0xd8, 0x61, 0xe5, 0x19, 0x8a, 0x14, 0x5e, 0xb8, 0x1b, 0xc1, 0xbd, 0x27, + 0xf6, 0x71, 0xc0, 0x37, 0x13, 0x62, 0x9c, 0xa3, 0x66, 0xe0, 0x8b, 0xa8, + 0x98, 0x3c, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x10, 0x9a, 0x30, 0xb3, 0xb3, 0x48, 0xbb, 0x91, 0x31, 0x17, 0x06, + 0x3a, 0x4b, 0xd8, 0x5f, 0x67, 0x9a, 0x1a, 0x20, 0x1e, 0xe1, 0xb0, 0xa3, + 0xe4, 0x52, 0xf1, 0x00, 0xbd, 0x2b, 0x4c, 0xbd, 0xa9, 0x90, 0xd5, 0xf8, + 0x48, 0xdd, 0x42, 0x23, 0x19, 0x29, 0x08, 0xa8, 0x22, 0x2d, 0xad, 0x7a, + 0xed, 0x7b, 0x87, 0x16, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x85, 0xaf, 0xcc, 0x86, + 0x80, 0x00, 0x00, 0x00, 0x62, 0x00, 0x20, 0xf2, 0xcb, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = false; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, CorePIGTest_OfflineWithPST) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xbe, 0x81, 0x80, 0x1d, 0x00, 0x00, 0x00, 0x0a, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x95, 0x00, 0x02, 0x00, 0x11, + 0xbe, 0x81, 0x80, 0x1d, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x42, 0x30, 0x43, 0x46, 0x30, 0x31, 0x38, 0x34, + 0x34, 0x38, 0x39, 0x46, 0x34, 0x42, 0x33, 0x32, 0x30, 0x36, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x30, 0x43, 0x46, 0x30, 0x31, 0x38, 0x34, 0x34, 0x38, + 0x39, 0x46, 0x34, 0x42, 0x33, 0x32, 0x30, 0x36, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x4a, 0x71, 0xc4, 0xb2, 0xac, 0x76, + 0x5c, 0x21, 0xec, 0x3d, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xf2, 0xcb, + 0x92, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0xaa, 0x99, 0x95, 0xa7, 0x4a, 0x28, 0x0f, 0x65, 0x1d, 0xfa, 0x03, 0x1d, + 0x6a, 0x4c, 0xb4, 0xcb, 0x1a, 0x50, 0x5b, 0xc5, 0x86, 0xe5, 0xfe, 0x26, + 0x71, 0x85, 0x08, 0x11, 0xf8, 0xcd, 0xeb, 0xaa, 0x9e, 0x99, 0x1c, 0xc2, + 0xbe, 0x20, 0x6b, 0x81, 0xf0, 0x5e, 0x36, 0xb6, 0x0b, 0x87, 0x6c, 0x69, + 0x27, 0x4e, 0x0b, 0x00, 0x56, 0x98, 0x48, 0x26, 0x32, 0x6c, 0xdc, 0x26, + 0x4a, 0x8a, 0xae, 0x81, 0x4f, 0x57, 0x6f, 0xf2, 0x88, 0xa6, 0xe4, 0xc7, + 0x20, 0x1b, 0x20, 0x5f, 0x00, 0x8c, 0xdb, 0xe2, 0xe7, 0x9a, 0x34, 0x4b, + 0xfa, 0xc6, 0x0d, 0xa2, 0xf9, 0x54, 0xb3, 0x08, 0x9d, 0x95, 0x78, 0xae, + 0xd2, 0x72, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x10, 0x83, 0x2f, 0x47, 0xdb, 0xea, 0xb7, 0xf0, 0xbe, 0xfb, 0x55, + 0x48, 0xd5, 0xa2, 0x68, 0x7d, 0x04, 0x1a, 0x20, 0xea, 0xec, 0x5f, 0x39, + 0xcc, 0x91, 0xe0, 0x34, 0x75, 0xa4, 0x4e, 0xe9, 0xef, 0xfa, 0x73, 0xb6, + 0x1e, 0xa9, 0x7b, 0xe3, 0x02, 0xc2, 0x1c, 0x89, 0x31, 0x1b, 0x5b, 0xf7, + 0xbe, 0x26, 0xe6, 0xc1, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x81, 0x80, 0x1d, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0xf2, 0xcb, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, CorePIGTest_OfflineHWSecureRequired) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x78, 0x9a, 0x2d, 0xcd, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x02, 0x00, 0x11, + 0x78, 0x9a, 0x2d, 0xcd, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x42, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x54, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x66, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x8e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x44, 0x44, 0x39, 0x32, 0x30, 0x45, 0x43, 0x45, + 0x42, 0x37, 0x45, 0x33, 0x36, 0x36, 0x42, 0x45, 0x30, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x44, 0x44, 0x39, 0x32, 0x30, 0x45, 0x43, 0x45, 0x42, 0x37, + 0x45, 0x33, 0x36, 0x36, 0x42, 0x45, 0x30, 0x39, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xc3, 0x52, 0xcf, 0xa8, 0x45, 0x4b, + 0xd8, 0x6e, 0x39, 0xc5, 0x38, 0x90, 0x1c, 0x40, 0x00, 0x48, 0xf2, 0xcb, + 0x92, 0xa2, 0x06, 0x12, 0x0f, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, + 0x53, 0xa7, 0x22, 0x66, 0xaa, 0x89, 0x20, 0x19, 0xbd, 0x71, 0x5b, 0xae, + 0xbd, 0x0f, 0x63, 0x8b, 0x1a, 0x50, 0x23, 0xce, 0xb5, 0x0a, 0x10, 0x2f, + 0x61, 0x0e, 0x70, 0xa5, 0x5d, 0x0a, 0x26, 0xb3, 0xae, 0x59, 0x5a, 0x82, + 0xb8, 0xbf, 0x7c, 0x89, 0x3d, 0x13, 0xee, 0xb4, 0x00, 0x5f, 0x4e, 0x5b, + 0x67, 0xc4, 0x6b, 0x19, 0x79, 0x26, 0xbd, 0xbd, 0xcf, 0x19, 0xee, 0x77, + 0xa0, 0xab, 0x7c, 0xe3, 0x4c, 0xc1, 0x1a, 0x7b, 0xa0, 0x41, 0x89, 0x83, + 0x36, 0x61, 0xf0, 0x62, 0x28, 0x91, 0xb8, 0x68, 0x26, 0xe5, 0x80, 0xd1, + 0x13, 0x80, 0x8e, 0xe6, 0xfe, 0x09, 0x6f, 0x85, 0xdc, 0x48, 0x18, 0xfa, + 0x29, 0xd4, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x10, 0xfc, 0xf0, 0x03, 0xef, 0x56, 0xf1, 0x0b, 0x2f, 0x02, 0xcd, + 0xd6, 0xe2, 0x51, 0x24, 0xfb, 0x1b, 0x1a, 0x20, 0x29, 0xde, 0x86, 0x18, + 0x2a, 0x69, 0xc6, 0x7d, 0xcc, 0xde, 0xe9, 0x01, 0xf2, 0x7d, 0xec, 0xba, + 0x01, 0xf0, 0x34, 0x90, 0xf9, 0x86, 0x36, 0x60, 0xef, 0x56, 0xce, 0xfd, + 0x84, 0x1c, 0x97, 0xcc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x78, 0x9a, 0x2d, 0xcd, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x12, 0x10, 0x91, 0xa3, 0xd5, 0x6c, 0xf8, 0x2a, 0x49, 0xd4, + 0x36, 0x66, 0x34, 0x4d, 0x0b, 0xb9, 0xc4, 0x2b, 0x1a, 0x20, 0x41, 0xc9, + 0x72, 0xe3, 0x04, 0x4b, 0x5a, 0xac, 0x7f, 0x82, 0x4c, 0x63, 0xca, 0xb6, + 0xc9, 0xa0, 0x71, 0x89, 0x23, 0xd5, 0xdc, 0x9c, 0x00, 0x73, 0x45, 0xb6, + 0x6e, 0xe8, 0xd8, 0xfa, 0x33, 0x48, 0x20, 0x02, 0x28, 0x05, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x78, 0x9a, + 0x2d, 0xcd, 0x8c, 0x00, 0x40, 0x10, 0x62, 0x00, 0x20, 0xf2, 0xcb, 0x92, + 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_Streaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xdc, 0x6b, 0x48, 0x20, 0x00, 0x00, 0x00, 0x10, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xdc, 0x6b, 0x48, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x39, 0x44, 0x46, 0x32, 0x35, 0x37, 0x46, 0x31, + 0x30, 0x45, 0x33, 0x44, 0x46, 0x35, 0x34, 0x31, 0x30, 0x43, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x39, 0x44, 0x46, 0x32, 0x35, 0x37, 0x46, 0x31, 0x30, 0x45, + 0x33, 0x44, 0x46, 0x35, 0x34, 0x31, 0x30, 0x43, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x28, 0x40, 0x00, 0x48, 0xf2, 0xcb, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x1a, 0x6f, + 0x35, 0xa2, 0xf4, 0x59, 0x0b, 0xec, 0x20, 0x47, 0x0d, 0x0b, 0x21, 0xda, + 0x89, 0x6b, 0x1a, 0x50, 0x06, 0x30, 0xb6, 0x4a, 0xf3, 0xc7, 0x96, 0x19, + 0x38, 0xab, 0x14, 0x6c, 0xba, 0xe4, 0xed, 0x27, 0x70, 0x4d, 0xef, 0x0f, + 0x8c, 0xf8, 0xcc, 0x2a, 0xd2, 0x38, 0x67, 0x81, 0xb6, 0xd2, 0x74, 0x76, + 0x6f, 0x86, 0x29, 0xfc, 0x91, 0x37, 0x04, 0x75, 0xfc, 0xd9, 0xaa, 0xd4, + 0xe6, 0x99, 0x6c, 0x62, 0xc4, 0xcb, 0x50, 0x7a, 0xb9, 0x4d, 0x1f, 0x8d, + 0x75, 0x1f, 0x85, 0x46, 0xcc, 0x94, 0xb0, 0x37, 0x3a, 0x71, 0x17, 0x52, + 0xa7, 0x77, 0x21, 0xda, 0xb5, 0xf0, 0x03, 0xad, 0x07, 0xab, 0xd8, 0xea, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x12, 0xf7, 0x07, 0x1c, 0x91, 0x6c, 0x7f, 0xb0, 0x37, 0xc4, 0xf5, 0x6b, + 0x76, 0xdd, 0xf0, 0x16, 0x1a, 0x20, 0x9e, 0x6b, 0xac, 0xc8, 0xa6, 0x7e, + 0x84, 0x01, 0x05, 0x90, 0x59, 0xc2, 0x6b, 0xa0, 0x26, 0xd7, 0x24, 0x4f, + 0xf3, 0xee, 0x47, 0x01, 0x88, 0x73, 0x0f, 0x7c, 0x7c, 0x6e, 0x24, 0x95, + 0x7c, 0xd2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x6b, 0x48, 0x20, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x61, 0xa6, 0x60, 0xf4, 0x6e, 0xfe, 0xbf, 0xaf, 0x91, 0xba, + 0x2f, 0xc0, 0x99, 0x84, 0x31, 0x8b, 0x1a, 0x20, 0xa6, 0x0d, 0xf5, 0x64, + 0x17, 0xe3, 0x22, 0x28, 0x3b, 0xdd, 0x33, 0xb2, 0x38, 0x80, 0xcc, 0x10, + 0x00, 0xb9, 0x3e, 0xf5, 0x05, 0x2e, 0xb4, 0xcb, 0x20, 0xa5, 0x22, 0xd6, + 0xc9, 0xa9, 0xbc, 0x46, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x6b, 0x48, 0x20, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xc2, 0x95, 0x87, 0xdc, 0x18, 0xd4, 0xc2, 0xf4, + 0x8f, 0xac, 0xb0, 0x03, 0xb8, 0xe9, 0xfa, 0xe7, 0x1a, 0x20, 0x9c, 0x45, + 0xee, 0x4a, 0xf0, 0xf8, 0x86, 0x69, 0x79, 0x42, 0x5e, 0xef, 0x22, 0x76, + 0xe6, 0x77, 0x4d, 0x76, 0x1f, 0x51, 0x17, 0xc8, 0xed, 0x88, 0x9c, 0x4f, + 0xee, 0xee, 0x5e, 0x4b, 0xbe, 0xc2, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x6b, + 0x48, 0x20, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0xc0, 0xb5, 0x5e, 0x8f, 0xae, 0x65, + 0x2e, 0x96, 0xbb, 0x23, 0x6d, 0x51, 0x18, 0xc2, 0x66, 0xaf, 0x1a, 0x20, + 0x3f, 0x36, 0xd5, 0xce, 0xc6, 0xb4, 0xff, 0x7c, 0xe6, 0xb1, 0xa6, 0x22, + 0xb7, 0x45, 0xed, 0x00, 0xd3, 0x6a, 0xe8, 0x50, 0x14, 0xe5, 0x90, 0xaa, + 0xec, 0xe2, 0xa0, 0x1b, 0x1b, 0xa1, 0x99, 0x54, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0xdc, 0x6b, 0x48, 0x20, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x0a, 0x8d, 0x91, 0xe5, + 0x9d, 0xf2, 0x81, 0x63, 0x6d, 0xc4, 0xaf, 0x98, 0xa3, 0xbe, 0xcf, 0xb6, + 0x1a, 0x20, 0x83, 0x47, 0x68, 0x45, 0x87, 0x87, 0x47, 0x66, 0x81, 0x1f, + 0x6f, 0xe6, 0x3e, 0xbe, 0x51, 0xf3, 0x60, 0xb5, 0x7e, 0xfa, 0x27, 0xd4, + 0x42, 0x59, 0x1a, 0x8c, 0xc4, 0xcf, 0xd4, 0x2e, 0x0a, 0x91, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0xdc, 0x6b, 0x48, 0x20, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xf2, 0xcb, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_Streaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x48, 0x7b, 0xdb, 0x50, 0x00, 0x00, 0x00, 0x12, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x48, 0x7b, 0xdb, 0x50, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x32, 0x43, 0x32, 0x36, 0x39, 0x46, 0x34, 0x33, + 0x34, 0x31, 0x37, 0x38, 0x30, 0x36, 0x38, 0x33, 0x30, 0x45, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x32, 0x43, 0x32, 0x36, 0x39, 0x46, 0x34, 0x33, 0x34, 0x31, + 0x37, 0x38, 0x30, 0x36, 0x38, 0x33, 0x30, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xad, 0xc4, 0xee, 0xcd, 0x8a, 0x4e, + 0x7b, 0x1d, 0x48, 0x5a, 0x38, 0x28, 0x40, 0x00, 0x48, 0x98, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xfc, 0x99, + 0xbf, 0xe9, 0x0c, 0xa1, 0xa2, 0xb6, 0xf8, 0xbd, 0x6e, 0x22, 0x2f, 0xba, + 0x72, 0xf5, 0x1a, 0x50, 0xfc, 0xfe, 0xc7, 0x7e, 0x79, 0xa3, 0x13, 0x94, + 0x8d, 0x88, 0xc3, 0x58, 0x12, 0x99, 0x37, 0xba, 0xa7, 0x53, 0x6d, 0xad, + 0x18, 0xd8, 0x5e, 0x24, 0x25, 0x76, 0x49, 0x1f, 0x3c, 0x2d, 0x0e, 0x35, + 0x6d, 0xfa, 0x63, 0x26, 0xee, 0xc5, 0x45, 0xd2, 0x6a, 0x28, 0x9a, 0x4b, + 0x4d, 0x97, 0xcd, 0xc8, 0xb3, 0x77, 0x13, 0x40, 0xec, 0x3d, 0x2b, 0x4e, + 0xc5, 0xcc, 0x1b, 0x10, 0x49, 0xfc, 0xe1, 0x90, 0x50, 0xf2, 0x09, 0x44, + 0x79, 0x48, 0xbf, 0xff, 0x06, 0x34, 0x93, 0x4b, 0x7c, 0xe1, 0xf0, 0xc8, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x24, 0xd9, 0x64, 0xe7, 0x1f, 0xc5, 0x7a, 0x33, 0xce, 0xde, 0xa7, 0x87, + 0xc8, 0x43, 0x28, 0x3e, 0x1a, 0x20, 0x21, 0xac, 0xb5, 0x19, 0xb7, 0x6d, + 0x57, 0x3b, 0x4d, 0x26, 0x25, 0x77, 0xa4, 0x80, 0x4d, 0xf2, 0x97, 0x51, + 0xe0, 0x8f, 0xc4, 0x49, 0x37, 0xa0, 0x66, 0x80, 0xa0, 0x57, 0x21, 0x87, + 0x52, 0xdc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x48, 0x7b, 0xdb, 0x50, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xed, 0x84, 0x17, 0xb3, 0xb9, 0xc4, 0x4f, 0x4d, 0x28, 0xaa, + 0x73, 0x18, 0xf8, 0x64, 0xef, 0xdd, 0x1a, 0x20, 0x89, 0xe4, 0xc4, 0x2d, + 0xd3, 0x33, 0xdb, 0xcd, 0xf0, 0xcb, 0x21, 0xf2, 0x14, 0x69, 0xdf, 0x56, + 0x0e, 0xd8, 0x1c, 0x26, 0x8b, 0x11, 0x07, 0xbf, 0x8a, 0xb3, 0xb4, 0xcc, + 0x4a, 0xfe, 0xc5, 0xe8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x48, 0x7b, 0xdb, 0x50, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xf9, 0x98, 0x18, 0x90, 0x27, 0xb5, 0x70, 0x10, + 0x91, 0xe6, 0x31, 0x42, 0xd6, 0xbe, 0xb9, 0x1c, 0x1a, 0x20, 0x02, 0xf2, + 0xdb, 0xdd, 0x0d, 0x42, 0x5f, 0x28, 0x1b, 0x6c, 0x70, 0x50, 0x10, 0x3b, + 0xb2, 0x9a, 0x79, 0x06, 0xd6, 0x84, 0x4b, 0xa9, 0x99, 0x6e, 0xf2, 0x48, + 0x97, 0x59, 0x69, 0x4b, 0x42, 0x06, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x48, 0x7b, + 0xdb, 0x50, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x37, 0x62, 0x66, 0xa2, 0x1f, 0x65, + 0x25, 0xe2, 0xd7, 0x44, 0x6f, 0x6f, 0x90, 0xd8, 0x5f, 0xac, 0x1a, 0x20, + 0xed, 0xef, 0x90, 0x25, 0x55, 0x94, 0x5e, 0x39, 0x53, 0x3e, 0x32, 0xf2, + 0xd0, 0xc9, 0xc8, 0xa9, 0xaa, 0xf0, 0x51, 0x58, 0xaf, 0xd0, 0x8b, 0x44, + 0x96, 0xbf, 0x17, 0xf9, 0x2c, 0x91, 0x6a, 0x2e, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x7b, 0xdb, 0x50, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x7e, 0x5c, 0xa6, 0xbc, + 0x35, 0x17, 0x3e, 0xa4, 0x12, 0xca, 0x28, 0xf7, 0x32, 0x05, 0xb5, 0x3e, + 0x1a, 0x20, 0x38, 0x61, 0xf6, 0x0a, 0x8b, 0xa0, 0x4a, 0x9b, 0x9d, 0x04, + 0x15, 0xdd, 0xb7, 0xdf, 0x8e, 0xb1, 0x3a, 0x44, 0x3b, 0x52, 0xaf, 0x27, + 0xd8, 0x47, 0x5f, 0x4d, 0xbe, 0xd9, 0x5f, 0x8e, 0xd0, 0xcd, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x48, 0x7b, 0xdb, 0x50, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0x98, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_StreamingQuickStart_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x0d, 0xd9, 0x8d, 0x30, 0x00, 0x00, 0x00, 0x14, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x0d, 0xd9, 0x8d, 0x30, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x30, 0x35, 0x36, 0x43, 0x44, 0x38, 0x38, 0x34, + 0x32, 0x39, 0x44, 0x43, 0x46, 0x45, 0x33, 0x43, 0x31, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x35, 0x36, 0x43, 0x44, 0x38, 0x38, 0x34, 0x32, 0x39, + 0x44, 0x43, 0x46, 0x45, 0x33, 0x43, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x14, 0x40, 0x28, 0x48, 0xbe, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x5d, 0x34, + 0x93, 0xab, 0x64, 0x12, 0x52, 0x4c, 0xa7, 0xc9, 0x2f, 0x63, 0x7b, 0x13, + 0x13, 0x0d, 0x1a, 0x50, 0x9c, 0x0d, 0x53, 0xa6, 0xb2, 0xb6, 0x12, 0x33, + 0xfd, 0x10, 0xac, 0x6b, 0x9a, 0x18, 0xc8, 0x32, 0x9e, 0xfa, 0x4d, 0xf2, + 0x61, 0xcf, 0x7e, 0x6e, 0xb6, 0x6b, 0x15, 0x35, 0xdc, 0x76, 0x6a, 0x4f, + 0x12, 0x91, 0x73, 0xc9, 0x71, 0x00, 0x7e, 0x3e, 0xd1, 0x72, 0xa3, 0xb6, + 0x7d, 0x88, 0xba, 0x34, 0x3b, 0xb1, 0xcd, 0xb0, 0xd3, 0x2d, 0x9b, 0x02, + 0xe6, 0xb9, 0xe6, 0x9c, 0x1e, 0x49, 0xcf, 0x6e, 0x6c, 0x81, 0x5d, 0x2b, + 0xe7, 0x10, 0x06, 0x57, 0x72, 0x73, 0x25, 0x1f, 0x75, 0xd5, 0x8f, 0x76, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x42, 0xeb, 0x1f, 0xda, 0x27, 0x25, 0xfe, 0x17, 0x4c, 0xb4, 0x2e, 0x40, + 0xc1, 0x89, 0x8c, 0xc1, 0x1a, 0x20, 0xc7, 0xcb, 0x77, 0x46, 0x8e, 0x07, + 0xfd, 0x09, 0x33, 0x80, 0xbe, 0xe7, 0x1f, 0x2a, 0x28, 0x45, 0x57, 0xd6, + 0xde, 0x53, 0xa4, 0xb6, 0x5b, 0x34, 0x8c, 0x32, 0x0d, 0x59, 0x39, 0x5e, + 0xca, 0x9a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xd9, 0x8d, 0x30, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x81, 0x33, 0xb1, 0xf5, 0x2b, 0x76, 0x88, 0x33, 0x21, 0x38, + 0x38, 0x7f, 0xa9, 0xe5, 0xa7, 0x26, 0x1a, 0x20, 0xe1, 0xf3, 0x77, 0xcd, + 0xb9, 0x96, 0x59, 0xf3, 0xce, 0x12, 0x1c, 0xec, 0xb2, 0xac, 0x53, 0xfa, + 0xe5, 0x1a, 0x17, 0xe0, 0x34, 0x9b, 0x8c, 0x17, 0xa8, 0xad, 0x6f, 0xe3, + 0xe1, 0x59, 0x55, 0x30, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xd9, 0x8d, 0x30, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xce, 0xe5, 0xc8, 0x2e, 0x55, 0x3a, 0xe5, 0x00, + 0xf4, 0x5a, 0x04, 0xbe, 0xb3, 0x71, 0xa2, 0x8e, 0x1a, 0x20, 0x4f, 0xa7, + 0x07, 0x80, 0x3a, 0xcd, 0x99, 0x6e, 0x63, 0x68, 0x7e, 0xba, 0x15, 0x6d, + 0xb5, 0xca, 0xcc, 0x4a, 0x71, 0xc2, 0xde, 0x21, 0x34, 0x56, 0x93, 0x5f, + 0x5d, 0xed, 0xac, 0x17, 0xe1, 0x5b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xd9, + 0x8d, 0x30, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x5e, 0xa3, 0x21, 0x87, 0x20, 0x18, + 0x9a, 0x51, 0xef, 0x72, 0x4a, 0x96, 0x54, 0x43, 0x5f, 0xe8, 0x1a, 0x20, + 0x58, 0xf0, 0x02, 0x41, 0xad, 0x41, 0x35, 0xcb, 0xf3, 0x68, 0x9b, 0x39, + 0x26, 0xe4, 0x8a, 0xd5, 0x16, 0xb0, 0x2d, 0x6a, 0xc2, 0xbf, 0xcc, 0x57, + 0x18, 0xcc, 0x2c, 0x78, 0xb9, 0x24, 0xc7, 0xa7, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0xd9, 0x8d, 0x30, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x69, 0xe5, 0x3c, 0xc8, + 0xcd, 0x1d, 0x38, 0xec, 0xea, 0x7d, 0x2b, 0x5b, 0x68, 0xa0, 0x73, 0xf2, + 0x1a, 0x20, 0x4a, 0xed, 0x21, 0xea, 0xdc, 0x18, 0xe1, 0x8c, 0xca, 0xa4, + 0xbd, 0xef, 0xa9, 0xe0, 0xd5, 0x01, 0xd8, 0xa7, 0x60, 0x48, 0x46, 0x25, + 0x96, 0xca, 0xf7, 0xcf, 0x51, 0x3f, 0xca, 0x54, 0xbe, 0xac, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x0d, 0xd9, 0x8d, 0x30, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xbe, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_StreamingQuickStart_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xa8, 0xfd, 0x09, 0xa2, 0x00, 0x00, 0x00, 0x16, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xa8, 0xfd, 0x09, 0xa2, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x42, 0x45, 0x45, 0x42, 0x38, 0x39, 0x41, 0x37, + 0x30, 0x46, 0x45, 0x30, 0x45, 0x45, 0x36, 0x45, 0x31, 0x32, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x45, 0x45, 0x42, 0x38, 0x39, 0x41, 0x37, 0x30, 0x46, + 0x45, 0x30, 0x45, 0x45, 0x36, 0x45, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x9e, 0xd3, 0x15, 0xd7, 0x3a, 0x81, + 0x9e, 0x80, 0x3e, 0x89, 0x38, 0x14, 0x40, 0x28, 0x48, 0xd2, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0xe1, 0xb8, + 0xe4, 0x8c, 0x3f, 0xac, 0xb2, 0xce, 0x18, 0x70, 0x02, 0x63, 0xa5, 0x32, + 0xce, 0xf9, 0x1a, 0x50, 0x39, 0xa1, 0x03, 0x1c, 0x51, 0x44, 0xca, 0x46, + 0x38, 0x7c, 0x9c, 0x8f, 0xaa, 0x11, 0xd1, 0x46, 0x33, 0xc9, 0xf6, 0xb5, + 0x96, 0x84, 0x33, 0x3a, 0x0e, 0xd4, 0xf0, 0x05, 0x3b, 0x37, 0x20, 0x1c, + 0x02, 0x4a, 0x84, 0xd1, 0x1f, 0x0d, 0x62, 0x80, 0x4a, 0x72, 0xdb, 0xd0, + 0x89, 0x81, 0x23, 0xb2, 0x03, 0xe9, 0x7f, 0xb1, 0x37, 0xa5, 0xc4, 0xfa, + 0x73, 0x25, 0x9c, 0x72, 0xa5, 0xd0, 0x2f, 0x76, 0x8a, 0x9f, 0x4d, 0xa9, + 0x31, 0xac, 0xcf, 0xb8, 0xdc, 0xcc, 0x49, 0xd9, 0xfc, 0x9c, 0x47, 0x06, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xac, 0x8a, 0xdc, 0xd8, 0x01, 0x81, 0xc8, 0x8d, 0xb6, 0x5d, 0xcf, 0x44, + 0x99, 0x7e, 0xd6, 0x89, 0x1a, 0x20, 0x22, 0x4f, 0x2a, 0xf2, 0xbe, 0x3b, + 0x06, 0x03, 0xc1, 0x14, 0x31, 0x00, 0xd4, 0xff, 0x98, 0xe5, 0xe2, 0x9a, + 0x57, 0x7a, 0x3d, 0x1b, 0xbd, 0x19, 0x0b, 0x22, 0x1e, 0x10, 0x1c, 0xb5, + 0xf8, 0x71, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xfd, 0x09, 0xa2, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x42, 0xa1, 0xe7, 0x7e, 0x5f, 0xd1, 0x60, 0xac, 0xb7, 0xad, + 0xc6, 0xcb, 0x08, 0x7c, 0x55, 0x71, 0x1a, 0x20, 0xe2, 0x81, 0x20, 0x2b, + 0x70, 0x15, 0x65, 0xcc, 0x4a, 0x3b, 0x39, 0xee, 0xda, 0x36, 0xd2, 0x8b, + 0x2f, 0x49, 0xbb, 0xf3, 0xb2, 0xe1, 0x20, 0xa4, 0x02, 0x99, 0x0a, 0x0e, + 0xbb, 0x04, 0x5e, 0xc9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xfd, 0x09, 0xa2, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x6d, 0x33, 0x1d, 0xbc, 0x75, 0x53, 0xe4, 0x00, + 0xae, 0x6e, 0x2e, 0x8c, 0x28, 0x0c, 0x4c, 0xda, 0x1a, 0x20, 0x45, 0x77, + 0x36, 0xc4, 0x9f, 0x19, 0x66, 0x01, 0xfd, 0x95, 0x1e, 0x7f, 0xe5, 0xed, + 0xc1, 0x45, 0x5a, 0xdd, 0x90, 0x28, 0x45, 0x78, 0xae, 0x19, 0x7d, 0x4e, + 0x98, 0x0b, 0xad, 0x0b, 0x82, 0x4b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xfd, + 0x09, 0xa2, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0xff, 0x90, 0xda, 0xff, 0xbb, 0xba, + 0x68, 0x07, 0x9a, 0x25, 0xfe, 0x7d, 0x79, 0x76, 0xc4, 0x49, 0x1a, 0x20, + 0xb2, 0xb0, 0x82, 0x6d, 0x5d, 0x7c, 0xc6, 0x6a, 0xc5, 0xe8, 0x99, 0x7a, + 0xc4, 0xaf, 0xdb, 0x5d, 0xd4, 0xc3, 0x13, 0xf0, 0xe4, 0x8d, 0xd3, 0xda, + 0xa4, 0xdb, 0xfe, 0x9b, 0x9b, 0x79, 0xf7, 0x94, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0xa8, 0xfd, 0x09, 0xa2, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x9d, 0x5d, 0x8d, 0x07, + 0x79, 0xfd, 0x4b, 0x14, 0x17, 0xc2, 0x0a, 0xfb, 0x05, 0xaf, 0xc3, 0x8b, + 0x1a, 0x20, 0xb0, 0xc9, 0x3c, 0xdf, 0xe8, 0x97, 0x17, 0x11, 0xc3, 0xff, + 0x61, 0xc2, 0x8b, 0x97, 0xed, 0x0d, 0x05, 0xa4, 0x8b, 0xf1, 0x49, 0x6b, + 0x57, 0x9d, 0x83, 0xf7, 0x8e, 0x71, 0x48, 0x17, 0x95, 0xad, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0xa8, 0xfd, 0x09, 0xa2, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xd2, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenHardTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x30, 0x6a, 0xdd, 0xc0, 0x00, 0x00, 0x00, 0x18, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x30, 0x6a, 0xdd, 0xc0, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x43, 0x31, 0x43, 0x46, 0x34, 0x35, 0x30, 0x35, + 0x36, 0x37, 0x33, 0x34, 0x42, 0x38, 0x44, 0x35, 0x31, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x31, 0x43, 0x46, 0x34, 0x35, 0x30, 0x35, 0x36, 0x37, + 0x33, 0x34, 0x42, 0x38, 0x44, 0x35, 0x31, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xe6, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x7e, 0x34, + 0x2b, 0x5f, 0x07, 0x4b, 0x7c, 0x94, 0xb1, 0x1c, 0x59, 0x4c, 0x23, 0x97, + 0xe4, 0x76, 0x1a, 0x50, 0xc3, 0xdd, 0xfe, 0x4e, 0x36, 0x64, 0x4b, 0x34, + 0x23, 0xa5, 0x87, 0xd3, 0x4a, 0x11, 0xed, 0x36, 0x88, 0x6e, 0x81, 0x25, + 0xab, 0x58, 0xb8, 0x0c, 0x51, 0x00, 0x2a, 0xc2, 0x62, 0xb4, 0xc0, 0x97, + 0x71, 0x9d, 0x98, 0xad, 0x84, 0xaf, 0x83, 0x1c, 0xd6, 0x0b, 0xd0, 0xab, + 0xf7, 0x8b, 0x53, 0xcb, 0xba, 0x1f, 0xf1, 0x99, 0x93, 0x5c, 0xca, 0xcb, + 0x81, 0xf9, 0x23, 0x9c, 0x38, 0xa9, 0xfb, 0x46, 0x40, 0x18, 0x63, 0xc1, + 0xe2, 0xc0, 0x24, 0x18, 0x68, 0xc0, 0xae, 0x78, 0x0a, 0x4f, 0x6d, 0x33, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xf6, 0xad, 0xc7, 0xcf, 0xd2, 0xa1, 0x05, 0xb9, 0xa9, 0x5e, 0x56, 0x09, + 0x7f, 0x30, 0x28, 0x5d, 0x1a, 0x20, 0xbf, 0x5a, 0x87, 0x0b, 0x3d, 0x70, + 0x31, 0x8d, 0xa7, 0x4e, 0x2e, 0x5f, 0xfc, 0xcb, 0x18, 0x1d, 0x04, 0xe4, + 0xd7, 0x58, 0xb2, 0x5b, 0x52, 0xe4, 0x63, 0x4c, 0x43, 0x97, 0xd3, 0xc9, + 0xa8, 0x35, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x30, 0x6a, 0xdd, 0xc0, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x1d, 0xd1, 0x0d, 0xdc, 0xc9, 0x45, 0xac, 0x3e, 0x53, 0xff, + 0xf3, 0x5e, 0x65, 0x97, 0xe7, 0x0a, 0x1a, 0x20, 0x2c, 0xd6, 0x71, 0xd3, + 0xc6, 0x55, 0x00, 0x77, 0xa0, 0x58, 0x3c, 0xd3, 0xc6, 0x7b, 0xbf, 0x59, + 0xbc, 0xe2, 0x2f, 0xb8, 0x55, 0x48, 0x00, 0x10, 0x36, 0x3f, 0xb6, 0xc6, + 0x6c, 0x81, 0x3a, 0x59, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x30, 0x6a, 0xdd, 0xc0, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x99, 0x72, 0x9c, 0x6f, 0x0a, 0xfd, 0x77, 0xde, + 0xb5, 0xf4, 0x23, 0x2f, 0xdf, 0x78, 0xa9, 0xd2, 0x1a, 0x20, 0xfd, 0xf6, + 0x8c, 0x0e, 0x34, 0xda, 0x20, 0xd4, 0xb9, 0x65, 0x45, 0x4a, 0x44, 0x8b, + 0x2a, 0x61, 0xf9, 0x23, 0x83, 0x21, 0x92, 0x5e, 0x6d, 0x03, 0x10, 0x9c, + 0x8f, 0xed, 0x67, 0x54, 0x6f, 0x8e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x30, 0x6a, + 0xdd, 0xc0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x13, 0x6f, 0x48, 0x7e, 0xae, 0x0d, + 0xb1, 0x9e, 0xa8, 0x8d, 0xeb, 0x85, 0xbc, 0xda, 0x9a, 0x87, 0x1a, 0x20, + 0x65, 0x3e, 0xbe, 0xcb, 0xd2, 0xd3, 0xa1, 0x11, 0xbf, 0x2b, 0x50, 0x2e, + 0x8c, 0x40, 0xf8, 0xe6, 0x40, 0xec, 0x69, 0x93, 0xec, 0xd6, 0x2d, 0x20, + 0x28, 0x3d, 0x7c, 0x55, 0x55, 0x92, 0x69, 0x39, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x6a, 0xdd, 0xc0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xd2, 0x55, 0x69, 0x6c, + 0x86, 0x63, 0x6e, 0x18, 0xa8, 0xc1, 0x28, 0xce, 0xfe, 0x8c, 0xdb, 0xd1, + 0x1a, 0x20, 0x3b, 0xe8, 0x2f, 0x8e, 0xb8, 0x80, 0x97, 0xf1, 0x09, 0x9b, + 0xdb, 0x61, 0xc8, 0xb9, 0xc1, 0x7b, 0x13, 0x9c, 0xc6, 0x1a, 0xd7, 0x7d, + 0x0e, 0x06, 0x23, 0x0e, 0x2d, 0xc5, 0x51, 0xf7, 0xf4, 0x83, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x6a, 0xdd, 0xc0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xe6, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenHardTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xd5, 0x2f, 0x4a, 0x02, 0x00, 0x00, 0x00, 0x1a, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xd5, 0x2f, 0x4a, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x46, 0x39, 0x46, 0x46, 0x44, 0x32, 0x46, 0x33, + 0x39, 0x44, 0x46, 0x37, 0x42, 0x36, 0x35, 0x32, 0x31, 0x36, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x46, 0x39, 0x46, 0x46, 0x44, 0x32, 0x46, 0x33, 0x39, 0x44, + 0x46, 0x37, 0x42, 0x36, 0x35, 0x32, 0x31, 0x36, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x29, 0xbd, 0x4b, 0xc5, 0x78, 0x12, + 0xfd, 0xf2, 0xef, 0x93, 0x38, 0x64, 0x40, 0x32, 0x48, 0xfe, 0xcc, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x13, 0xb0, + 0xce, 0xd8, 0xea, 0x21, 0x01, 0x1a, 0xe4, 0x03, 0x20, 0xbd, 0x13, 0xc0, + 0xd4, 0xec, 0x1a, 0x50, 0x3b, 0xd0, 0x8b, 0x01, 0x34, 0xbc, 0xae, 0xe6, + 0x57, 0x34, 0xac, 0x15, 0x59, 0x39, 0xe8, 0xa8, 0x29, 0xc1, 0xca, 0x59, + 0x75, 0xc5, 0xd0, 0x61, 0x0f, 0x55, 0xa7, 0x96, 0x5b, 0x8b, 0xfa, 0xee, + 0x62, 0x3f, 0x59, 0xbc, 0xb9, 0x75, 0x18, 0x9d, 0xfc, 0x2e, 0x6a, 0xe7, + 0x65, 0x12, 0x74, 0x94, 0xf2, 0x36, 0x29, 0xbc, 0x6b, 0xff, 0xea, 0xa9, + 0x78, 0x86, 0xd8, 0x8f, 0x87, 0x74, 0x5e, 0x23, 0x5f, 0xcf, 0x88, 0xb3, + 0x43, 0x85, 0xcc, 0x12, 0xa1, 0xc2, 0x60, 0x9e, 0x53, 0xdb, 0xa1, 0x48, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x67, 0xca, 0x1c, 0xa8, 0x9d, 0xfb, 0x4d, 0x5c, 0x85, 0x89, 0x62, 0xae, + 0x69, 0xe3, 0x9f, 0x5d, 0x1a, 0x20, 0xb7, 0x3e, 0xd2, 0x1d, 0xc5, 0x1b, + 0xa5, 0xf1, 0x5d, 0xaa, 0x3d, 0x87, 0xe7, 0x9e, 0x21, 0xfd, 0xda, 0xdc, + 0xf0, 0x44, 0xde, 0x02, 0x88, 0xde, 0x60, 0x72, 0xb5, 0x03, 0x11, 0x73, + 0x5a, 0xc9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x2f, 0x4a, 0x02, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x4c, 0x19, 0xeb, 0x0b, 0xab, 0xfd, 0x12, 0x2e, 0x26, 0x25, + 0x43, 0x10, 0x3a, 0xb7, 0x15, 0xc3, 0x1a, 0x20, 0x9b, 0x9a, 0xdd, 0xe3, + 0xdc, 0x45, 0x2e, 0xd7, 0xea, 0x4c, 0xe3, 0x42, 0xb2, 0x5a, 0xe3, 0x33, + 0x83, 0x55, 0x61, 0x5c, 0x94, 0x95, 0xa4, 0x27, 0x47, 0x2d, 0xd6, 0x0b, + 0x83, 0x3e, 0xfe, 0xc7, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x2f, 0x4a, 0x02, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x2f, 0x90, 0x4c, 0xa1, 0xb9, 0x87, 0x71, 0x9f, + 0x7b, 0x13, 0x37, 0x06, 0xe8, 0x5d, 0xc7, 0x44, 0x1a, 0x20, 0x04, 0x7a, + 0xf4, 0xa4, 0xe2, 0x62, 0x69, 0x2e, 0x94, 0xf7, 0x9a, 0xb9, 0x10, 0x52, + 0xa5, 0x74, 0xfc, 0xf1, 0xc7, 0x34, 0x8d, 0xdd, 0x09, 0xa7, 0xc4, 0xf8, + 0xb5, 0x41, 0x52, 0x5e, 0x02, 0xda, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xd5, 0x2f, + 0x4a, 0x02, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0xf3, 0x79, 0xe2, 0x1b, 0xb1, 0xd9, + 0x16, 0x05, 0x5e, 0x42, 0xe3, 0x5c, 0x6a, 0xb4, 0x81, 0x02, 0x1a, 0x20, + 0xe7, 0xbb, 0xd0, 0xc9, 0xa0, 0xd0, 0xf2, 0xff, 0xca, 0x78, 0x41, 0x37, + 0x7a, 0xe1, 0xcf, 0x87, 0x8b, 0x3f, 0x27, 0x59, 0xe5, 0xbf, 0x1c, 0xcd, + 0xb6, 0x27, 0xf5, 0x16, 0x77, 0x3c, 0xd2, 0xd3, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0xd5, 0x2f, 0x4a, 0x02, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xc0, 0xca, 0x8f, 0xa9, + 0x4c, 0xd6, 0x78, 0xec, 0x2d, 0x72, 0x5e, 0xc5, 0x5f, 0x7b, 0x89, 0x62, + 0x1a, 0x20, 0xfe, 0x73, 0x9a, 0xd6, 0x07, 0x1e, 0x97, 0x14, 0xd7, 0x6b, + 0x8a, 0xea, 0x80, 0x97, 0x1e, 0x94, 0x6f, 0xa4, 0x27, 0xa3, 0xd8, 0xe4, + 0xe7, 0x08, 0xe1, 0x21, 0xfe, 0xef, 0xed, 0x7c, 0x56, 0x23, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0xd5, 0x2f, 0x4a, 0x02, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xfe, 0xcc, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenHardTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x8a, 0x59, 0xd8, 0xfa, 0x00, 0x00, 0x00, 0x1c, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x8a, 0x59, 0xd8, 0xfa, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x34, 0x43, 0x37, 0x36, 0x39, 0x45, 0x41, 0x32, + 0x42, 0x38, 0x46, 0x37, 0x45, 0x42, 0x35, 0x31, 0x31, 0x38, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x43, 0x37, 0x36, 0x39, 0x45, 0x41, 0x32, 0x42, 0x38, + 0x46, 0x37, 0x45, 0x42, 0x35, 0x31, 0x31, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0x96, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0xde, 0xee, + 0x35, 0xf5, 0xd6, 0xbc, 0x45, 0xc2, 0x2c, 0x48, 0x36, 0x68, 0xc6, 0x6c, + 0x7a, 0x8c, 0x1a, 0x50, 0x27, 0xed, 0xa9, 0xd3, 0xba, 0x48, 0x6b, 0xa4, + 0x1d, 0x7a, 0x79, 0x2c, 0xd6, 0x4c, 0x21, 0x0e, 0x51, 0x8d, 0xdb, 0x50, + 0x89, 0xa1, 0x8f, 0xe0, 0x17, 0x9a, 0x18, 0xa1, 0xbc, 0x57, 0xcc, 0xbe, + 0xcf, 0x6b, 0x4e, 0x4b, 0x7c, 0x47, 0xb6, 0x2e, 0x8c, 0x46, 0x71, 0xd5, + 0x17, 0x2d, 0x83, 0xbc, 0x77, 0xfd, 0xcb, 0x25, 0x35, 0x9c, 0x60, 0xb3, + 0x68, 0x30, 0xd6, 0xbc, 0xdf, 0x0b, 0xe7, 0xa1, 0x8c, 0x41, 0x5e, 0x30, + 0x1a, 0xe6, 0x1e, 0x34, 0xa0, 0x2a, 0xc3, 0x37, 0xce, 0xd6, 0xad, 0x75, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x76, 0xb8, 0x60, 0x00, 0x9a, 0xfd, 0x7b, 0xe2, 0xf3, 0x57, 0x32, 0x66, + 0x12, 0x7b, 0x9e, 0xe0, 0x1a, 0x20, 0x79, 0xd5, 0x4a, 0xf8, 0x89, 0x3b, + 0x49, 0xc3, 0xf5, 0xb3, 0xb6, 0x01, 0xcd, 0xe4, 0x51, 0x70, 0xe6, 0x58, + 0xa3, 0x8c, 0x0c, 0x25, 0x82, 0x40, 0xe1, 0xb7, 0x36, 0x17, 0x12, 0x91, + 0x5a, 0x17, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x59, 0xd8, 0xfa, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xe0, 0xd1, 0x0c, 0x75, 0x0f, 0x0a, 0x6e, 0x97, 0x43, 0x81, + 0x3e, 0x13, 0x4a, 0x5f, 0xb7, 0x5c, 0x1a, 0x20, 0x3a, 0xa4, 0x10, 0xd9, + 0x40, 0x45, 0x3f, 0xaa, 0x35, 0x97, 0xd1, 0xce, 0xec, 0xcf, 0x01, 0xd5, + 0xef, 0xc6, 0x01, 0x2b, 0x2f, 0xdf, 0xc1, 0x00, 0x4f, 0xed, 0x97, 0x9a, + 0x77, 0x3a, 0x8b, 0x12, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x59, 0xd8, 0xfa, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x36, 0x67, 0xef, 0x31, 0x64, 0xee, 0x80, 0xcb, + 0x77, 0x29, 0x8c, 0xd9, 0x26, 0x34, 0x0e, 0x43, 0x1a, 0x20, 0x91, 0x79, + 0xde, 0xa1, 0x11, 0x24, 0x28, 0x8b, 0x0f, 0x2b, 0x3f, 0xf6, 0x12, 0xa8, + 0x37, 0xf4, 0x63, 0xb4, 0x96, 0xce, 0xcf, 0x8c, 0xfc, 0x4b, 0xb0, 0x90, + 0xdc, 0x2c, 0x34, 0xbe, 0x55, 0xdb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x59, + 0xd8, 0xfa, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x7e, 0x7b, 0xed, 0xc1, 0x81, 0x4c, + 0xca, 0x07, 0x2e, 0x59, 0xa5, 0x8e, 0x8e, 0x1b, 0x60, 0x10, 0x1a, 0x20, + 0x24, 0x1d, 0x94, 0x69, 0x6d, 0x87, 0x0f, 0xae, 0x18, 0x2f, 0x79, 0x19, + 0xea, 0x46, 0x74, 0xc8, 0x65, 0x49, 0x39, 0xd3, 0x20, 0x47, 0x64, 0xbf, + 0x65, 0x4b, 0x37, 0xf0, 0xce, 0xb9, 0x14, 0x79, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x8a, 0x59, 0xd8, 0xfa, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xde, 0x9f, 0x96, 0x51, + 0x52, 0x02, 0x08, 0xab, 0x10, 0x8c, 0xcc, 0x44, 0xd7, 0x7b, 0x4c, 0x0b, + 0x1a, 0x20, 0x3f, 0xc2, 0x0f, 0xac, 0xb7, 0x89, 0xa1, 0x9f, 0x16, 0x9b, + 0xb5, 0x15, 0xa9, 0x19, 0x30, 0x6f, 0x67, 0x1c, 0xad, 0x9d, 0xda, 0x78, + 0x9e, 0xe0, 0x3e, 0x8b, 0xb8, 0xd0, 0x27, 0x3f, 0xf0, 0xdb, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x8a, 0x59, 0xd8, 0xfa, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0x96, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenHardTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x9d, 0x6a, 0x09, 0x4d, 0x00, 0x00, 0x00, 0x1e, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x9d, 0x6a, 0x09, 0x4d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x33, 0x34, 0x46, 0x30, 0x45, 0x31, 0x38, 0x30, + 0x35, 0x42, 0x41, 0x37, 0x46, 0x43, 0x35, 0x38, 0x31, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x33, 0x34, 0x46, 0x30, 0x45, 0x31, 0x38, 0x30, 0x35, 0x42, + 0x41, 0x37, 0x46, 0x43, 0x35, 0x38, 0x31, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xd8, 0x35, 0xc4, 0xf6, 0xfe, 0x5e, + 0x8b, 0x9e, 0xa9, 0x6a, 0x38, 0x64, 0x40, 0x32, 0x48, 0xae, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x12, 0x10, 0x32, 0x4b, + 0xaa, 0xff, 0xe4, 0x70, 0x86, 0xba, 0x11, 0x0f, 0xa5, 0x9f, 0x07, 0x17, + 0x85, 0xf6, 0x1a, 0x50, 0x2e, 0xc7, 0x37, 0x36, 0x3c, 0xfb, 0x94, 0x53, + 0xeb, 0x75, 0x85, 0x5e, 0x26, 0x3f, 0xf5, 0xac, 0x2c, 0x46, 0xb8, 0x17, + 0x02, 0x00, 0x13, 0x11, 0x07, 0x37, 0x97, 0xf1, 0x86, 0xf6, 0xdc, 0xc0, + 0x6e, 0x39, 0x18, 0xa0, 0xc6, 0xf4, 0x23, 0x67, 0x8d, 0xb6, 0xda, 0xda, + 0x8d, 0xc4, 0x5d, 0x04, 0x71, 0x40, 0xa3, 0x52, 0xe5, 0xfd, 0x9f, 0x2d, + 0xf7, 0xf3, 0x55, 0xc5, 0x03, 0x66, 0x1c, 0x53, 0x72, 0x1e, 0x13, 0x98, + 0x15, 0xc2, 0xf3, 0xe6, 0xab, 0x8e, 0xe0, 0xed, 0xc5, 0xc6, 0x9f, 0x57, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x2a, 0x0b, 0x6e, 0x97, 0xbb, 0xf6, 0x14, 0x2e, 0xa8, 0xb3, 0x03, 0xe2, + 0x18, 0x7c, 0xc6, 0xde, 0x1a, 0x20, 0xd5, 0x8f, 0xb4, 0x8d, 0x35, 0x9e, + 0xd0, 0x25, 0x55, 0x37, 0x5b, 0x73, 0xcb, 0x3e, 0x0c, 0xd8, 0x05, 0x4e, + 0xa9, 0x85, 0xe7, 0x43, 0x57, 0x43, 0x9d, 0x0e, 0x33, 0xa2, 0xae, 0xaf, + 0xd9, 0xb8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x6a, 0x09, 0x4d, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x7a, 0xe7, 0xfd, 0x45, 0x81, 0xb0, 0xbb, 0x06, 0x1e, 0xe2, + 0x30, 0x97, 0xa1, 0xda, 0xe8, 0x98, 0x1a, 0x20, 0x80, 0x95, 0x3d, 0x88, + 0xf8, 0x16, 0x67, 0xba, 0x61, 0xac, 0x6e, 0xc7, 0x66, 0x7d, 0xd9, 0x65, + 0x50, 0xe4, 0xc7, 0x20, 0x54, 0x16, 0xef, 0xde, 0xb5, 0x11, 0x0a, 0x65, + 0x28, 0xec, 0x97, 0xd8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x6a, 0x09, 0x4d, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xd0, 0x26, 0xcf, 0xc9, 0x73, 0xfd, 0xef, 0xee, + 0x85, 0x37, 0x52, 0x70, 0x05, 0xeb, 0xbb, 0x67, 0x1a, 0x20, 0x76, 0xba, + 0xcc, 0x4a, 0xb1, 0xbf, 0x39, 0x69, 0x96, 0xe8, 0x06, 0xd0, 0x29, 0x28, + 0xc4, 0x59, 0x0f, 0x21, 0x38, 0x18, 0x89, 0x01, 0xd8, 0xe5, 0xdd, 0xc1, + 0x0b, 0x63, 0x50, 0x75, 0x42, 0xca, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x6a, + 0x09, 0x4d, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x1a, 0xfd, 0x2e, 0x78, 0x87, 0x4b, + 0xdd, 0xf6, 0x9d, 0xc5, 0x76, 0x0b, 0xf9, 0xec, 0x2a, 0x48, 0x1a, 0x20, + 0x55, 0x9c, 0x76, 0x9a, 0x7d, 0x94, 0x29, 0xdf, 0x10, 0x20, 0x1e, 0xfa, + 0xfd, 0xfd, 0x97, 0xac, 0xed, 0xe7, 0x5f, 0x14, 0x5d, 0x9e, 0x25, 0x0b, + 0x6b, 0x1d, 0xe5, 0xc8, 0x83, 0x68, 0xa5, 0xbb, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x9d, 0x6a, 0x09, 0x4d, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x82, 0xdb, 0xe0, 0xa3, + 0xdc, 0x01, 0x8c, 0x4e, 0x5d, 0x61, 0x16, 0x7e, 0xed, 0x77, 0x08, 0xa3, + 0x1a, 0x20, 0xbb, 0xe3, 0x3f, 0x32, 0xee, 0x8a, 0x8c, 0x09, 0xe6, 0xf1, + 0x56, 0x27, 0x70, 0xc2, 0x0b, 0x3d, 0x50, 0xea, 0xd5, 0x9d, 0x6b, 0xb1, + 0x60, 0xf5, 0x02, 0x3e, 0x4b, 0xcd, 0xd7, 0x3d, 0x89, 0xef, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x9d, 0x6a, 0x09, 0x4d, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xae, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenSoftTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x62, 0x41, 0x90, 0x1a, 0x00, 0x00, 0x00, 0x20, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x62, 0x41, 0x90, 0x1a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x30, 0x41, 0x30, 0x31, 0x45, 0x36, 0x43, 0x30, + 0x45, 0x30, 0x39, 0x37, 0x39, 0x37, 0x30, 0x42, 0x31, 0x43, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x30, 0x41, 0x30, 0x31, 0x45, 0x36, 0x43, 0x30, 0x45, 0x30, + 0x39, 0x37, 0x39, 0x37, 0x30, 0x42, 0x31, 0x43, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xc6, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0xd4, 0x05, + 0xbb, 0xf4, 0x17, 0xfb, 0xd1, 0x6e, 0x0a, 0xc9, 0xa8, 0xdf, 0x9e, 0x33, + 0x0a, 0x07, 0x1a, 0x50, 0xa8, 0x44, 0x98, 0x69, 0xb3, 0x2e, 0xe2, 0xb4, + 0x8d, 0x95, 0x9e, 0x60, 0xc2, 0x3b, 0x31, 0xa5, 0xd1, 0x50, 0xd6, 0x91, + 0x7d, 0xc4, 0x3d, 0x95, 0x97, 0x30, 0x54, 0x1d, 0x8c, 0x37, 0x4e, 0x89, + 0xcb, 0xec, 0x29, 0x32, 0xa7, 0x57, 0x09, 0x36, 0x7f, 0xb6, 0x7f, 0xbf, + 0xa3, 0x75, 0x68, 0xf4, 0xc5, 0xfe, 0xb0, 0xa6, 0x60, 0xac, 0xc6, 0xea, + 0xeb, 0x37, 0xad, 0x01, 0x90, 0x7b, 0xc5, 0x47, 0xc9, 0xa7, 0x9a, 0x2c, + 0xcb, 0x45, 0x81, 0x4b, 0xa3, 0x92, 0x8e, 0xdb, 0x37, 0xbe, 0x56, 0x2c, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x8d, 0x12, 0x01, 0x58, 0x99, 0xe1, 0xc6, 0x6a, 0x91, 0x01, 0x55, 0xd7, + 0xaa, 0x31, 0xf5, 0xcf, 0x1a, 0x20, 0xe5, 0x6b, 0xde, 0x6e, 0x27, 0x04, + 0x51, 0x9d, 0x96, 0x93, 0x73, 0x9e, 0x76, 0x7a, 0x7f, 0x3e, 0xf8, 0x2f, + 0xa1, 0xaa, 0x63, 0x06, 0xca, 0xce, 0x55, 0x0b, 0xba, 0xc5, 0xfd, 0xa1, + 0x78, 0x67, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x62, 0x41, 0x90, 0x1a, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x9e, 0x3b, 0xc5, 0x78, 0x56, 0x0d, 0x87, 0xfa, 0x07, 0x5d, + 0xff, 0x5f, 0x8e, 0xb0, 0x39, 0x4b, 0x1a, 0x20, 0xf8, 0x96, 0xf3, 0x67, + 0x5b, 0x8c, 0xa2, 0xcb, 0x70, 0xc4, 0x31, 0xa7, 0x5d, 0xc7, 0x6f, 0x42, + 0x09, 0x24, 0x21, 0xb0, 0x87, 0x03, 0xea, 0x34, 0x15, 0x41, 0x74, 0x67, + 0x0f, 0xed, 0x86, 0xbd, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x62, 0x41, 0x90, 0x1a, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xf1, 0xa0, 0x61, 0xa4, 0xa3, 0x26, 0xd1, 0xfc, + 0x78, 0x8a, 0x15, 0xf7, 0x58, 0x59, 0x01, 0xeb, 0x1a, 0x20, 0x78, 0x04, + 0x42, 0x9d, 0xef, 0xfc, 0x81, 0xb1, 0x1b, 0x2f, 0xef, 0xfa, 0x62, 0xba, + 0x98, 0x62, 0xa2, 0xe0, 0xdc, 0x39, 0x1d, 0x63, 0x59, 0x74, 0x3d, 0x06, + 0xb6, 0x18, 0x56, 0x41, 0x34, 0xa6, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x62, 0x41, + 0x90, 0x1a, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x8f, 0x60, 0x25, 0x41, 0xcd, 0x3c, + 0x2b, 0x45, 0xb1, 0x6e, 0x44, 0xa8, 0xc3, 0xa1, 0xb0, 0x4f, 0x1a, 0x20, + 0xbd, 0xaa, 0x5c, 0xb0, 0x4f, 0xe0, 0x2e, 0x8e, 0x29, 0x19, 0x43, 0x19, + 0x29, 0xff, 0xac, 0x23, 0xcd, 0x11, 0xc0, 0xd8, 0x81, 0x0a, 0x97, 0x3d, + 0x4c, 0xba, 0xc1, 0xd1, 0x5a, 0x46, 0xa7, 0x4f, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x62, 0x41, 0x90, 0x1a, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x2b, 0xa4, 0xd4, 0x8a, + 0x36, 0x4f, 0xa9, 0xcb, 0x8b, 0xc2, 0x7b, 0x89, 0x11, 0x5f, 0xf9, 0xa3, + 0x1a, 0x20, 0xc2, 0xdd, 0xd0, 0x3d, 0xd9, 0x61, 0xfc, 0x19, 0x7a, 0x06, + 0x6a, 0xda, 0xcd, 0xa8, 0x98, 0x66, 0xea, 0x2f, 0x7a, 0x36, 0x99, 0xbd, + 0x52, 0xd8, 0x10, 0x75, 0xb1, 0xa1, 0x83, 0x55, 0xb5, 0xa5, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x62, 0x41, 0x90, 0x1a, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xc6, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenSoftTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x7a, 0x86, 0x63, 0x3a, 0x00, 0x00, 0x00, 0x22, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x7a, 0x86, 0x63, 0x3a, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x37, 0x30, 0x44, 0x32, 0x42, 0x41, 0x41, 0x31, + 0x45, 0x46, 0x33, 0x32, 0x31, 0x46, 0x37, 0x45, 0x31, 0x45, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x30, 0x44, 0x32, 0x42, 0x41, 0x41, 0x31, 0x45, 0x46, + 0x33, 0x32, 0x31, 0x46, 0x37, 0x45, 0x31, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xf1, 0x19, 0x08, 0xcf, 0x56, 0xc3, + 0x86, 0xf7, 0x45, 0x60, 0x38, 0x64, 0x40, 0x32, 0x48, 0xde, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x67, 0xe9, + 0x5c, 0xdf, 0xe1, 0xf7, 0xbf, 0xfb, 0x2d, 0x48, 0x7a, 0xac, 0xf3, 0xbe, + 0xec, 0x74, 0x1a, 0x50, 0x82, 0xa3, 0x4f, 0xef, 0x8c, 0xb8, 0x20, 0xd0, + 0x2e, 0xaf, 0x0a, 0xed, 0x01, 0x01, 0x14, 0xc7, 0x7c, 0xa0, 0x85, 0x8f, + 0x07, 0xbe, 0x25, 0x06, 0x98, 0x5c, 0x6f, 0x34, 0x30, 0x6e, 0xab, 0x87, + 0x89, 0xdc, 0x64, 0xac, 0x79, 0xb3, 0x33, 0x2b, 0x63, 0x1f, 0x17, 0xae, + 0x18, 0x5b, 0x0c, 0xdf, 0x56, 0x06, 0x33, 0x3f, 0xf9, 0x42, 0xc9, 0x1d, + 0x80, 0x22, 0xd8, 0x04, 0xad, 0xf3, 0xca, 0x39, 0xb0, 0xfa, 0x7f, 0xe2, + 0x44, 0x40, 0xef, 0xed, 0x3a, 0xe8, 0x51, 0x8a, 0x2e, 0x22, 0xa1, 0x67, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xd7, 0x30, 0x81, 0x6e, 0xbb, 0x74, 0x55, 0x61, 0xe0, 0x51, 0xd1, 0xbb, + 0x39, 0x85, 0x35, 0x4f, 0x1a, 0x20, 0x05, 0xc7, 0xc6, 0x1b, 0xf1, 0xde, + 0xa8, 0xe8, 0x85, 0xa7, 0x04, 0xb4, 0xd9, 0x6f, 0x35, 0x0a, 0x2b, 0xae, + 0xf0, 0xe1, 0x2b, 0x40, 0x9a, 0xd6, 0xcb, 0x87, 0x87, 0x9c, 0x8b, 0x81, + 0xba, 0xff, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x86, 0x63, 0x3a, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x47, 0x74, 0xd4, 0xf0, 0x2e, 0xd4, 0x15, 0x62, 0x54, 0xda, + 0x24, 0xc9, 0x55, 0x15, 0xee, 0xdf, 0x1a, 0x20, 0xaa, 0xdb, 0xba, 0x0d, + 0x66, 0x6d, 0xad, 0xea, 0xfc, 0xa1, 0x1f, 0x33, 0xd4, 0x83, 0xcd, 0x1f, + 0x8d, 0x10, 0xa3, 0xd1, 0x3c, 0x0a, 0xa8, 0x26, 0x3a, 0x57, 0x5e, 0xba, + 0x0f, 0x93, 0xca, 0xc7, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x86, 0x63, 0x3a, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xc9, 0x8c, 0xed, 0x9b, 0x1a, 0xd8, 0x9d, 0xac, + 0xe0, 0x7f, 0x66, 0x65, 0x7c, 0x7f, 0x22, 0xfd, 0x1a, 0x20, 0x7e, 0xaa, + 0x05, 0x56, 0x23, 0xd0, 0xf3, 0xd3, 0xea, 0x20, 0x03, 0x88, 0xca, 0xfa, + 0xef, 0xca, 0xd5, 0x83, 0x40, 0x19, 0x38, 0x8d, 0x2e, 0x75, 0xb9, 0x22, + 0x80, 0x12, 0x6e, 0x48, 0x0b, 0x2a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x86, + 0x63, 0x3a, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x57, 0xe7, 0x86, 0xdf, 0x5f, 0x76, + 0x33, 0x49, 0x21, 0xba, 0x30, 0xf7, 0xb4, 0x44, 0xef, 0xcf, 0x1a, 0x20, + 0x58, 0xa0, 0xf6, 0xa2, 0xfc, 0xd2, 0x1b, 0xb8, 0x3c, 0x46, 0xc0, 0x73, + 0xa1, 0xf9, 0x6a, 0xb4, 0x64, 0x17, 0x80, 0x95, 0x57, 0x35, 0x24, 0xfd, + 0x20, 0xd7, 0x40, 0x27, 0x7a, 0xbf, 0x26, 0x7a, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x7a, 0x86, 0x63, 0x3a, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x2e, 0x0f, 0x30, 0x33, + 0x07, 0xf9, 0x9b, 0x9c, 0x1b, 0x94, 0xd3, 0x66, 0xd2, 0x6f, 0xae, 0x62, + 0x1a, 0x20, 0x19, 0xd6, 0x65, 0x46, 0x6d, 0xab, 0xa1, 0x9a, 0xba, 0x11, + 0xb0, 0x8d, 0xcb, 0x47, 0x86, 0x04, 0x7f, 0x9d, 0x02, 0xda, 0x20, 0xe4, + 0xc2, 0xee, 0x6a, 0x3c, 0xd6, 0x27, 0x2c, 0x7e, 0x61, 0x04, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x7a, 0x86, 0x63, 0x3a, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xde, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenSoftTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x47, 0x80, 0xa5, 0xb1, 0x00, 0x00, 0x00, 0x24, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x47, 0x80, 0xa5, 0xb1, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x42, 0x42, 0x43, 0x33, 0x43, 0x34, 0x33, 0x32, + 0x44, 0x43, 0x36, 0x43, 0x46, 0x36, 0x39, 0x36, 0x32, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x42, 0x43, 0x33, 0x43, 0x34, 0x33, 0x32, 0x44, 0x43, + 0x36, 0x43, 0x46, 0x36, 0x39, 0x36, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x64, 0x40, 0x32, 0x48, 0xf6, 0xcd, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x47, 0x56, + 0x49, 0xa8, 0x71, 0x66, 0xe0, 0x78, 0xbe, 0xa9, 0x7f, 0xd1, 0xb6, 0xea, + 0x7c, 0xe8, 0x1a, 0x50, 0xdf, 0x1d, 0x12, 0xfa, 0x2b, 0x4b, 0x4a, 0x50, + 0xe7, 0x1c, 0xd5, 0x46, 0x57, 0x62, 0x79, 0x90, 0xa6, 0x71, 0x3e, 0x06, + 0xaa, 0x7e, 0x31, 0xcc, 0x06, 0x1e, 0x44, 0xee, 0xb4, 0xd5, 0x57, 0xc7, + 0xc9, 0x56, 0xe0, 0x7e, 0x16, 0x33, 0x6c, 0x85, 0xb3, 0xb7, 0x16, 0x99, + 0xbd, 0x31, 0x7e, 0xb0, 0xe2, 0x26, 0xc8, 0x71, 0x42, 0x1f, 0x5f, 0xd6, + 0xd5, 0x30, 0x6d, 0x60, 0x7b, 0x99, 0x8b, 0x67, 0x68, 0x9f, 0xd7, 0x5e, + 0xe0, 0x25, 0xc8, 0x86, 0x9f, 0x01, 0xec, 0x12, 0x54, 0xcf, 0xa8, 0xa2, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xd2, 0x6d, 0xc4, 0x9c, 0x32, 0xc6, 0x61, 0x36, 0xc4, 0x13, 0x58, 0xf7, + 0x02, 0xdd, 0x8b, 0x56, 0x1a, 0x20, 0xd6, 0x36, 0x3f, 0x64, 0x76, 0xb3, + 0x59, 0xa1, 0xfb, 0x56, 0xf7, 0xa2, 0x0f, 0x06, 0x6c, 0xef, 0x76, 0x25, + 0xed, 0x36, 0x32, 0xc1, 0x7b, 0x66, 0x7f, 0x66, 0x6a, 0xbb, 0xb2, 0xf2, + 0xd6, 0x0e, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x47, 0x80, 0xa5, 0xb1, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0xdc, 0xb8, 0x06, 0x9c, 0x04, 0x4e, 0x2f, 0xda, 0x25, 0x07, + 0x59, 0xcf, 0x31, 0x98, 0x09, 0x3f, 0x1a, 0x20, 0x52, 0xd0, 0xfd, 0x86, + 0x2d, 0x14, 0xe6, 0x99, 0xc3, 0x94, 0x29, 0x08, 0x11, 0x20, 0x05, 0x3f, + 0x60, 0x68, 0x96, 0xc0, 0x9a, 0xbb, 0x85, 0x01, 0xe5, 0xb4, 0xb7, 0x4a, + 0x2d, 0x9e, 0x7d, 0x9c, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x47, 0x80, 0xa5, 0xb1, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0xb6, 0xbd, 0x8f, 0x81, 0x0f, 0x33, 0x10, 0xda, + 0x90, 0x08, 0xe2, 0x6b, 0xa5, 0x50, 0x96, 0x24, 0x1a, 0x20, 0x42, 0xb6, + 0x3e, 0x22, 0x7f, 0x77, 0x95, 0x16, 0x87, 0x72, 0xba, 0x54, 0x2a, 0x42, + 0x50, 0xac, 0xfe, 0x9c, 0x78, 0x67, 0x50, 0x66, 0xe8, 0xa3, 0xf9, 0xe0, + 0x7a, 0x2a, 0x79, 0xd5, 0xc7, 0x1b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x47, 0x80, + 0xa5, 0xb1, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x7b, 0xc8, 0x64, 0x16, 0x55, 0x67, + 0xbb, 0x19, 0x09, 0x3e, 0x96, 0x81, 0xdf, 0xbb, 0x02, 0xd4, 0x1a, 0x20, + 0x07, 0x4c, 0x12, 0x78, 0x59, 0xd1, 0x58, 0x3a, 0x5c, 0x5a, 0x56, 0x3d, + 0xf3, 0x19, 0xc3, 0x83, 0x47, 0xd4, 0xe0, 0x94, 0x64, 0x43, 0x1c, 0xf1, + 0x63, 0xf1, 0x9b, 0x67, 0x9b, 0xfc, 0xa5, 0xc4, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x47, 0x80, 0xa5, 0xb1, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x47, 0x2e, 0x6c, 0xdd, + 0xfd, 0x16, 0xeb, 0x27, 0x36, 0xac, 0x34, 0x45, 0x77, 0x51, 0x27, 0x44, + 0x1a, 0x20, 0x85, 0xe9, 0xe3, 0x8c, 0x87, 0xa2, 0xff, 0xcf, 0x75, 0x40, + 0x9a, 0x2c, 0xa4, 0x36, 0x3e, 0x8f, 0xd2, 0x7a, 0xdd, 0xfe, 0x08, 0x65, + 0x7a, 0x4f, 0x3c, 0xe5, 0x10, 0x1e, 0x20, 0xab, 0xcf, 0x0f, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x47, 0x80, 0xa5, 0xb1, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xf6, 0xcd, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_SevenSoftTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xc6, 0x1a, 0x2b, 0x29, 0x00, 0x00, 0x00, 0x26, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xc6, 0x1a, 0x2b, 0x29, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x34, 0x39, 0x35, 0x37, 0x32, 0x32, 0x36, 0x43, + 0x31, 0x43, 0x39, 0x46, 0x41, 0x41, 0x42, 0x44, 0x32, 0x32, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x39, 0x35, 0x37, 0x32, 0x32, 0x36, 0x43, 0x31, 0x43, + 0x39, 0x46, 0x41, 0x41, 0x42, 0x44, 0x32, 0x32, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xaf, 0xc3, 0xd3, 0xcc, 0x8e, 0x97, + 0xc2, 0x65, 0x4f, 0x1c, 0x38, 0x64, 0x40, 0x32, 0x48, 0x8e, 0xce, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x66, 0xdd, + 0x68, 0x6f, 0x64, 0x88, 0x31, 0x70, 0xa3, 0xb4, 0x4c, 0x9d, 0xbf, 0x89, + 0x34, 0xab, 0x1a, 0x50, 0xc2, 0xa5, 0x42, 0x08, 0xe5, 0x58, 0x5c, 0x05, + 0x10, 0xed, 0x1f, 0x3b, 0x15, 0xd2, 0x94, 0xa0, 0x28, 0x41, 0x5b, 0x9d, + 0x1e, 0x4b, 0x4f, 0x84, 0x31, 0x02, 0x31, 0xe0, 0x14, 0x4d, 0xbd, 0x92, + 0xd6, 0x53, 0xc3, 0xd0, 0x7d, 0x8d, 0x13, 0xa0, 0x9f, 0xca, 0xad, 0xe8, + 0x60, 0x42, 0x40, 0x1e, 0xb9, 0xda, 0x7a, 0x57, 0xd0, 0xa8, 0xa8, 0xee, + 0x7c, 0xd9, 0xfb, 0xc3, 0x77, 0xb0, 0x7e, 0xf6, 0xda, 0x27, 0x86, 0x06, + 0xd8, 0xf2, 0x4b, 0x06, 0xd3, 0x0b, 0x32, 0x3b, 0x65, 0xb6, 0x28, 0x3a, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x68, 0x08, 0x6d, 0xab, 0x92, 0xf5, 0x83, 0x63, 0x5a, 0x0c, 0x03, 0x38, + 0xa8, 0x3e, 0x64, 0x33, 0x1a, 0x20, 0x5b, 0x51, 0xbd, 0x2c, 0xaa, 0x9c, + 0xe7, 0xfa, 0xa0, 0xa8, 0x53, 0x1f, 0x4d, 0x67, 0x71, 0xce, 0x8f, 0x27, + 0x39, 0x1f, 0xb8, 0xae, 0x72, 0x4d, 0xf3, 0x89, 0x2d, 0x08, 0x07, 0x47, + 0xe7, 0x57, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x1a, 0x2b, 0x29, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x72, 0x57, 0x3c, 0x55, 0x1c, 0xac, 0x25, 0x80, 0x86, 0x1d, + 0xe6, 0x36, 0xa9, 0x53, 0x2c, 0x1c, 0x1a, 0x20, 0x89, 0x58, 0xca, 0xc2, + 0xac, 0x15, 0xd9, 0x64, 0xb5, 0x94, 0xcd, 0x5e, 0xa9, 0xd5, 0xea, 0x45, + 0x5b, 0x52, 0x59, 0xfa, 0xb9, 0x54, 0xdf, 0xa8, 0x20, 0xa6, 0xd5, 0x89, + 0xf4, 0xa4, 0x81, 0xd7, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x1a, 0x2b, 0x29, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x04, 0x2f, 0x39, 0xc4, 0x34, 0x5b, 0xd2, 0x8a, + 0xa8, 0xcc, 0x90, 0x7d, 0x81, 0xe4, 0x4f, 0x5d, 0x1a, 0x20, 0x0d, 0xa1, + 0x0b, 0x52, 0x2b, 0x64, 0xbf, 0xea, 0x12, 0x36, 0xf5, 0x8e, 0xd8, 0x10, + 0xb3, 0x2b, 0x7e, 0x70, 0xef, 0x1e, 0x5b, 0x0a, 0xa0, 0x46, 0x57, 0xcb, + 0xc0, 0xb5, 0xed, 0xd2, 0x22, 0x97, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x1a, + 0x2b, 0x29, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x0e, 0x65, 0xce, 0x52, 0x34, 0x25, + 0xc4, 0x9a, 0x71, 0x9e, 0x26, 0x69, 0xdd, 0xf6, 0x67, 0x76, 0x1a, 0x20, + 0xcf, 0xc4, 0x6c, 0xd6, 0xfe, 0x62, 0x0d, 0xd8, 0x2b, 0x80, 0x18, 0x7b, + 0x3c, 0x55, 0x47, 0xcd, 0xe9, 0xc1, 0x18, 0x37, 0x0c, 0x30, 0x94, 0xad, + 0xff, 0x22, 0xae, 0x0b, 0x2f, 0xa2, 0xb6, 0x68, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0xc6, 0x1a, 0x2b, 0x29, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x6b, 0x13, 0x45, 0xfb, + 0x4a, 0xcd, 0xe2, 0xb1, 0xa7, 0x18, 0x7c, 0xac, 0x33, 0xaf, 0xcb, 0xcc, + 0x1a, 0x20, 0x8c, 0x6f, 0xec, 0xf3, 0x24, 0x73, 0x90, 0xe9, 0xb5, 0x6e, + 0x34, 0xd6, 0x54, 0x8b, 0x53, 0xec, 0x8a, 0x7a, 0x14, 0xef, 0x78, 0xb0, + 0xae, 0x0c, 0x58, 0x56, 0x04, 0x36, 0x83, 0x41, 0x26, 0x2d, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0x1a, 0x2b, 0x29, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0x8e, 0xce, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LicenseWithRenewal_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x4c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x9c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x60, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, + 0x38, 0x46, 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, 0x38, 0x46, + 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xa6, 0xce, + 0x92, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x4e, 0x2d, 0x78, 0x20, 0x9a, 0x57, 0x5f, 0x86, + 0x5e, 0x40, 0xc1, 0xcb, 0x48, 0x54, 0x2a, 0x3d, 0x1a, 0x50, 0x64, 0x5e, + 0xd5, 0xdd, 0xff, 0x13, 0xf8, 0x75, 0x24, 0x09, 0x87, 0x7a, 0x88, 0x02, + 0xaa, 0xff, 0x2e, 0x17, 0x7c, 0x7e, 0x33, 0x5c, 0x08, 0xd0, 0x3f, 0x52, + 0x23, 0x63, 0x7e, 0xce, 0xed, 0x68, 0x9e, 0xc3, 0x56, 0xe5, 0x2e, 0x9f, + 0xd0, 0x3e, 0x74, 0x9d, 0x5f, 0x0c, 0x09, 0x32, 0x6f, 0x07, 0xcc, 0xab, + 0x78, 0x13, 0xc2, 0xa1, 0x77, 0x01, 0xf0, 0xc6, 0xbc, 0xa2, 0x0b, 0xd1, + 0x71, 0x0a, 0xa5, 0x1f, 0x0b, 0xb9, 0x32, 0x19, 0xb6, 0x92, 0xac, 0x54, + 0x97, 0xea, 0x97, 0x16, 0x05, 0xaa, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xf3, 0x19, 0xc1, 0xd4, 0x9a, 0xc0, + 0x79, 0xa3, 0x29, 0xbd, 0x93, 0xc7, 0x89, 0x59, 0x0b, 0xc8, 0x1a, 0x20, + 0x5d, 0x38, 0x9a, 0x9c, 0x61, 0x8b, 0x8b, 0xb6, 0x9d, 0xe3, 0xb8, 0x84, + 0xe9, 0x0f, 0xf0, 0x40, 0x91, 0x64, 0xd6, 0x73, 0x66, 0xdd, 0xa4, 0x43, + 0x80, 0xa1, 0x93, 0x8c, 0x87, 0x66, 0x9a, 0xaf, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, + 0xee, 0xa5, 0xfe, 0xd6, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x4d, 0xf3, 0xd0, 0xe0, + 0xed, 0x20, 0x30, 0x65, 0x76, 0xb4, 0x1c, 0xd7, 0x27, 0x72, 0x20, 0x72, + 0x1a, 0x20, 0x53, 0x35, 0xaa, 0x84, 0x1f, 0x84, 0x5b, 0xaf, 0xd5, 0xf6, + 0xf1, 0xf7, 0x28, 0x75, 0x36, 0xb9, 0xdd, 0x03, 0xa3, 0xce, 0x35, 0x69, + 0xc7, 0x93, 0xa5, 0x24, 0xbe, 0xb1, 0xfe, 0xb4, 0x06, 0x6a, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x71, 0xfc, + 0x8d, 0xac, 0x69, 0x8e, 0x61, 0x84, 0x71, 0x59, 0x1a, 0x74, 0x7c, 0x4d, + 0x1a, 0x5f, 0x1a, 0x20, 0xe4, 0x24, 0xc2, 0xde, 0x31, 0xd4, 0x82, 0x3b, + 0x01, 0xda, 0x20, 0x30, 0x74, 0x65, 0x6b, 0xe4, 0xa4, 0x43, 0xaf, 0x13, + 0x2e, 0xc9, 0x0c, 0xc0, 0x1a, 0xd1, 0xbc, 0xd7, 0xc0, 0x52, 0xd7, 0x65, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0xec, 0x82, 0x20, 0x86, 0xae, 0x20, 0xfb, 0xb8, 0xad, 0x57, 0x7d, 0x52, + 0x8f, 0xa3, 0x73, 0xc0, 0x1a, 0x20, 0xac, 0x59, 0x9d, 0xed, 0x08, 0xdc, + 0x2e, 0x84, 0x5b, 0xf2, 0x5f, 0x6e, 0x6f, 0xe7, 0xea, 0xb4, 0x12, 0x0f, + 0x6d, 0x0b, 0x71, 0x94, 0x56, 0x1b, 0xf1, 0x9f, 0x23, 0xa0, 0xfb, 0x5f, + 0xfe, 0x00, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0xe7, 0x62, 0x11, 0x21, 0xab, 0x8e, 0x38, 0x1e, 0x02, 0x91, + 0xac, 0xc5, 0xcc, 0x6d, 0x86, 0xb6, 0x1a, 0x20, 0xf3, 0x35, 0x5c, 0x5f, + 0x1b, 0xd7, 0xf8, 0x7e, 0xfc, 0xc5, 0xd9, 0xa8, 0x32, 0xae, 0x89, 0xa5, + 0x53, 0xa2, 0x8f, 0x22, 0x0c, 0x09, 0x70, 0xfd, 0x6c, 0xb5, 0xba, 0xa5, + 0x38, 0xe7, 0xd7, 0x83, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0xa6, 0xce, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LicenseWithRenewal_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x2c, 0xad, 0x0b, 0x34, 0x00, 0x00, 0x00, 0x2a, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x2c, 0xad, 0x0b, 0x34, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x2e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x37, 0x46, 0x31, 0x34, 0x42, 0x42, 0x45, 0x31, + 0x31, 0x41, 0x32, 0x37, 0x32, 0x45, 0x37, 0x32, 0x32, 0x36, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x46, 0x31, 0x34, 0x42, 0x42, 0x45, 0x31, 0x31, 0x41, + 0x32, 0x37, 0x32, 0x45, 0x37, 0x32, 0x32, 0x36, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x27, 0x6e, 0x0f, 0xca, 0xd3, 0x79, + 0x6f, 0x67, 0x08, 0x3a, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0x99, 0xcf, + 0x92, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0xfd, 0xd3, 0x61, 0x81, 0x6d, 0x36, 0x4b, 0x61, + 0x66, 0xee, 0x81, 0xcd, 0x9a, 0x9d, 0xd3, 0x39, 0x1a, 0x50, 0x36, 0x2d, + 0xde, 0xef, 0xae, 0x06, 0xda, 0x0d, 0xb3, 0xaf, 0x88, 0xe4, 0xe1, 0xe7, + 0xdb, 0x11, 0x7f, 0xd7, 0x52, 0x3d, 0x9f, 0x50, 0xf4, 0xb1, 0x94, 0xe3, + 0x17, 0x6d, 0x12, 0x7a, 0x4b, 0x15, 0xce, 0x7b, 0x50, 0x68, 0x0b, 0xea, + 0x10, 0x21, 0x31, 0x98, 0x35, 0xf3, 0x32, 0x38, 0x9f, 0x73, 0xbd, 0x31, + 0x70, 0x68, 0x9d, 0x6a, 0xfd, 0xdd, 0xda, 0x9d, 0x97, 0x37, 0x52, 0x79, + 0x41, 0xa0, 0xb0, 0x1b, 0x44, 0xf1, 0xa3, 0x7f, 0xa6, 0xdd, 0x0b, 0x8b, + 0x39, 0x26, 0xd9, 0x6a, 0x3d, 0x11, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xac, 0x3b, 0x52, 0x9a, 0xfd, 0x52, + 0x00, 0x68, 0xbf, 0x14, 0x8a, 0x45, 0x06, 0x83, 0x7a, 0xe7, 0x1a, 0x20, + 0xcb, 0x50, 0xad, 0xb7, 0xe8, 0x38, 0xc6, 0xed, 0xcb, 0x21, 0x02, 0x04, + 0xb4, 0x9a, 0xf5, 0xf7, 0x45, 0x16, 0xd2, 0x1c, 0x6e, 0xd9, 0xad, 0xf6, + 0xe1, 0x6d, 0x20, 0xba, 0xbf, 0x1b, 0xc0, 0x72, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, + 0x2c, 0xad, 0x0b, 0x34, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x2b, 0xab, 0x35, 0xde, + 0xb5, 0xf3, 0xdd, 0xa2, 0xc8, 0x4b, 0x2a, 0x08, 0x98, 0xd9, 0x14, 0x8b, + 0x1a, 0x20, 0xd2, 0x59, 0x00, 0xce, 0x7d, 0x42, 0x23, 0xab, 0xba, 0xc9, + 0xe3, 0x5c, 0x25, 0xc7, 0x08, 0x1e, 0xb2, 0xb1, 0x12, 0x90, 0x7d, 0x90, + 0x80, 0xa3, 0x6e, 0xfc, 0x0b, 0x6d, 0x2a, 0x0c, 0x50, 0x8d, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x19, 0x2c, 0xad, 0x0b, 0x34, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x8b, 0x2b, + 0x09, 0xf3, 0x68, 0xcd, 0xb2, 0xce, 0xcd, 0x93, 0x5a, 0x1c, 0x02, 0xc0, + 0xc1, 0x64, 0x1a, 0x20, 0x64, 0x82, 0xa3, 0x8c, 0x4b, 0x42, 0xd5, 0xee, + 0x25, 0x4f, 0x30, 0xd7, 0x08, 0x1b, 0xeb, 0x60, 0xa9, 0xac, 0x79, 0xb9, + 0xd8, 0x09, 0x54, 0xf4, 0x1c, 0x0b, 0xa2, 0xcc, 0xd1, 0xc9, 0x28, 0x18, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x19, 0x2c, 0xad, 0x0b, 0x34, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0xa4, 0xf8, 0xcc, 0x3a, 0xd6, 0x3e, 0x3b, 0x7c, 0x8e, 0x3a, 0x25, 0xc7, + 0x28, 0x64, 0xd8, 0x02, 0x1a, 0x20, 0x05, 0x69, 0xb5, 0x8a, 0x16, 0x2c, + 0xd2, 0x7d, 0xa5, 0xb0, 0x76, 0x66, 0x5c, 0xa1, 0x87, 0x8b, 0x6e, 0x8f, + 0xe1, 0x7c, 0x2c, 0x5f, 0xe4, 0x04, 0x38, 0xe1, 0x81, 0xf1, 0x26, 0x58, + 0x50, 0x3f, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0x2c, 0xad, 0x0b, 0x34, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0xf4, 0xa9, 0x88, 0xb1, 0x86, 0xa5, 0x7c, 0x00, 0xea, 0x52, + 0xe7, 0x33, 0x2a, 0x4a, 0x9c, 0x06, 0x1a, 0x20, 0xa3, 0xdf, 0x0d, 0xe6, + 0x69, 0x4c, 0x4f, 0xa6, 0x8f, 0x2a, 0xee, 0x8c, 0x72, 0x8a, 0xc2, 0x29, + 0xe3, 0x33, 0x83, 0x57, 0x6c, 0xb7, 0xea, 0x38, 0xc0, 0x88, 0x9b, 0x4a, + 0x4c, 0x79, 0x10, 0xfc, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0x2c, 0xad, 0x0b, 0x34, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0x99, 0xcf, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, 0x2c, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 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, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x4c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x9c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x60, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x36, 0x42, 0x31, 0x46, 0x45, 0x44, 0x30, 0x35, + 0x39, 0x32, 0x44, 0x37, 0x36, 0x30, 0x41, 0x32, 0x32, 0x38, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x36, 0x42, 0x31, 0x46, 0x45, 0x44, 0x30, 0x35, 0x39, 0x32, + 0x44, 0x37, 0x36, 0x30, 0x41, 0x32, 0x32, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0x8c, 0xd0, + 0x92, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x6b, 0xc6, 0x7d, 0x1c, 0x7f, 0xc1, 0x76, 0x0b, + 0xb3, 0xe6, 0x59, 0x1d, 0x25, 0x5f, 0xc2, 0xdc, 0x1a, 0x50, 0xa5, 0xeb, + 0xc5, 0xc3, 0x5c, 0xb8, 0x45, 0x85, 0x5e, 0x38, 0x07, 0x03, 0x7a, 0xd9, + 0x45, 0xf4, 0x5a, 0x06, 0xe7, 0xdf, 0xfb, 0xb0, 0x0e, 0x31, 0x82, 0x74, + 0xc1, 0x6e, 0x43, 0x1a, 0x22, 0x1c, 0xea, 0x35, 0x95, 0x31, 0x7f, 0xd7, + 0x96, 0x07, 0x61, 0x47, 0x2d, 0xb7, 0x4a, 0x13, 0xcb, 0xcd, 0x40, 0x57, + 0xcc, 0xf3, 0x8c, 0x4b, 0xa1, 0x74, 0x2b, 0x14, 0xa6, 0xea, 0xc2, 0xf8, + 0xae, 0x5a, 0x53, 0x89, 0x8a, 0xf3, 0x86, 0xa7, 0x33, 0xd6, 0xb6, 0xa2, + 0xa5, 0x68, 0x60, 0x79, 0x14, 0x3e, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x80, 0x0c, 0xdf, 0x19, 0xea, 0x58, + 0xa2, 0x50, 0xe8, 0xce, 0xc6, 0x06, 0x80, 0x2a, 0x5c, 0x84, 0x1a, 0x20, + 0x40, 0xe4, 0x12, 0x47, 0x9c, 0x34, 0x3b, 0xb2, 0xe4, 0x69, 0x3e, 0x49, + 0x4b, 0xe7, 0x8b, 0xc3, 0xdc, 0xa2, 0x00, 0xdf, 0x30, 0x79, 0x29, 0x28, + 0x0e, 0xa2, 0xd0, 0x25, 0x6b, 0x0e, 0x9e, 0xec, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, + 0xe6, 0x94, 0x9b, 0x2c, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0xa2, 0x74, 0x2c, 0x5f, + 0xba, 0x1a, 0xe9, 0xf6, 0x61, 0x8c, 0xb0, 0x9e, 0xd9, 0x17, 0x39, 0x94, + 0x1a, 0x20, 0xdd, 0x94, 0x8d, 0xb6, 0x64, 0x20, 0xf2, 0xe9, 0xaa, 0xac, + 0xbb, 0x31, 0xd3, 0xa7, 0x3a, 0x85, 0xe0, 0xfe, 0xa7, 0x67, 0xc5, 0xf2, + 0x03, 0x3a, 0x1a, 0xbf, 0x8b, 0xd0, 0xb2, 0xf0, 0x78, 0x14, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xdd, 0x32, + 0xac, 0x99, 0x4a, 0xe7, 0x1d, 0x82, 0x49, 0x08, 0x85, 0x00, 0xa9, 0xf8, + 0xcd, 0xcf, 0x1a, 0x20, 0x55, 0x8e, 0xf0, 0x73, 0x60, 0x84, 0xa7, 0x1e, + 0x4c, 0xf5, 0xa9, 0xda, 0xb9, 0x5f, 0x46, 0xc8, 0xfc, 0xb1, 0x50, 0x0a, + 0xd0, 0x59, 0x0f, 0xd9, 0xeb, 0x50, 0xc8, 0xf8, 0x6d, 0x92, 0x9d, 0xcf, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0x6c, 0x8b, 0x1a, 0x62, 0x04, 0x58, 0x13, 0x34, 0x84, 0x90, 0xfb, 0xf4, + 0xf2, 0xb0, 0xb1, 0x18, 0x1a, 0x20, 0x90, 0x50, 0xe1, 0x2e, 0xec, 0xbd, + 0x70, 0x55, 0x60, 0x6e, 0x40, 0x4c, 0x71, 0x03, 0x11, 0x2f, 0x03, 0xb4, + 0x26, 0x49, 0xd8, 0x07, 0x49, 0x47, 0x28, 0x90, 0xc4, 0x64, 0xeb, 0x95, + 0xdc, 0xeb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0x4f, 0x69, 0x0e, 0x19, 0xab, 0x00, 0x7b, 0xb5, 0x5b, 0x38, + 0x30, 0xe2, 0x83, 0x30, 0x88, 0xc6, 0x1a, 0x20, 0x67, 0xfb, 0x45, 0xae, + 0x7b, 0x55, 0x6d, 0xd0, 0xe8, 0xf6, 0xe7, 0xa3, 0x7f, 0x4e, 0xde, 0x6a, + 0x68, 0x65, 0x17, 0x82, 0x64, 0xc4, 0x22, 0x24, 0xbd, 0x9e, 0xf6, 0xa0, + 0x83, 0x6e, 0x36, 0xe9, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0x8c, 0xd0, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x24, 0xf9, 0xc1, 0xd1, 0x00, 0x00, 0x00, 0x2e, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x24, 0xf9, 0xc1, 0xd1, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 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, 0xb4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x2e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x33, 0x46, 0x37, 0x36, 0x33, 0x34, 0x36, 0x42, + 0x44, 0x44, 0x34, 0x33, 0x32, 0x39, 0x30, 0x36, 0x32, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x33, 0x46, 0x37, 0x36, 0x33, 0x34, 0x36, 0x42, 0x44, 0x44, + 0x34, 0x33, 0x32, 0x39, 0x30, 0x36, 0x32, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xc1, 0xf0, 0xf1, 0x8a, 0x9b, 0x9b, + 0x09, 0x4f, 0x67, 0xfe, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0xff, 0xd0, + 0x92, 0xa2, 0x06, 0x12, 0x13, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x38, 0x0a, 0x48, 0x0f, 0x70, 0x00, 0x78, 0x00, + 0x1a, 0x66, 0x12, 0x10, 0x25, 0x3d, 0xc5, 0xb7, 0xe6, 0xde, 0xdd, 0xfa, + 0x0f, 0x40, 0xba, 0x09, 0x57, 0xce, 0x08, 0xae, 0x1a, 0x50, 0x54, 0xd6, + 0xc6, 0x4c, 0xb6, 0xe5, 0x0a, 0xd0, 0x13, 0xb0, 0x58, 0x4c, 0x85, 0xd2, + 0x36, 0x14, 0x02, 0xb4, 0xba, 0x93, 0x40, 0x59, 0x5b, 0x43, 0x1a, 0x98, + 0xe8, 0x54, 0x54, 0x26, 0x75, 0x39, 0x9b, 0x4c, 0xfc, 0x10, 0x80, 0xab, + 0xf8, 0xde, 0x34, 0x81, 0xe8, 0x31, 0x85, 0xeb, 0x02, 0xe1, 0x14, 0xe6, + 0xab, 0x93, 0x72, 0xbb, 0x19, 0x5c, 0xfb, 0xa7, 0x1e, 0xc0, 0x14, 0xa4, + 0xb3, 0x91, 0x68, 0x10, 0xbd, 0x27, 0x94, 0x6b, 0x78, 0x91, 0x8a, 0xda, + 0x5d, 0xf3, 0x15, 0x46, 0xe8, 0x1a, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xf2, 0x8f, 0x7b, 0x68, 0x7b, 0x61, + 0xfe, 0xcd, 0xa1, 0x87, 0xbd, 0x89, 0xe7, 0x98, 0xff, 0x6b, 0x1a, 0x20, + 0x3c, 0x7a, 0xab, 0xfd, 0xc1, 0x61, 0xe3, 0xd4, 0x68, 0xa4, 0x45, 0x13, + 0x05, 0x68, 0xe8, 0x68, 0x6c, 0x85, 0xd7, 0x3a, 0xc0, 0xdd, 0x37, 0xe6, + 0x79, 0x26, 0x96, 0xa3, 0x10, 0x85, 0x2d, 0x2a, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, + 0x24, 0xf9, 0xc1, 0xd1, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0xea, 0xf1, 0x68, 0x99, + 0x78, 0x02, 0xea, 0xd8, 0x00, 0x33, 0xcc, 0x9f, 0x3b, 0x3f, 0xba, 0x8a, + 0x1a, 0x20, 0xbd, 0x2b, 0xe1, 0xbf, 0x1e, 0xd6, 0x50, 0xe1, 0x89, 0xec, + 0xbb, 0x5c, 0xef, 0xd9, 0xdc, 0x8e, 0x3e, 0x2e, 0x2f, 0xf7, 0xb2, 0xc9, + 0xe2, 0x6d, 0xb7, 0x77, 0x6d, 0x47, 0x5e, 0x5e, 0x85, 0x62, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x18, 0xc8, + 0x46, 0x96, 0x5a, 0x25, 0xef, 0x28, 0xa7, 0xd6, 0xbe, 0xc7, 0xfc, 0x8a, + 0x2e, 0xe9, 0x1a, 0x20, 0x6b, 0xf1, 0x7d, 0xf9, 0x11, 0xd9, 0xca, 0xc1, + 0x45, 0xe1, 0x35, 0x20, 0x3f, 0x4a, 0xb2, 0xa5, 0x20, 0x5e, 0xdc, 0x09, + 0x51, 0x2b, 0x5b, 0xd1, 0x24, 0xf8, 0x68, 0x7c, 0xde, 0x4f, 0x4d, 0x13, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0x72, 0x9c, 0xe7, 0x79, 0xa7, 0xc3, 0x81, 0x8a, 0xa1, 0x19, 0x05, 0x9f, + 0x15, 0x3a, 0x3f, 0x95, 0x1a, 0x20, 0xc6, 0x60, 0x36, 0x87, 0xe0, 0x3c, + 0x60, 0xfa, 0x83, 0x6a, 0x5e, 0xc0, 0xcf, 0xec, 0x00, 0xd5, 0xf6, 0xf7, + 0x9d, 0xac, 0xb5, 0x97, 0x47, 0xf1, 0xf5, 0xfc, 0x54, 0x0d, 0xa5, 0xde, + 0x33, 0xe5, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0x66, 0x30, 0x54, 0x2a, 0x1f, 0x9c, 0x85, 0xdc, 0xe4, 0xfb, + 0x32, 0x03, 0xf3, 0x83, 0x95, 0x8f, 0x1a, 0x20, 0x54, 0xe0, 0x1f, 0x33, + 0xe1, 0x22, 0xaf, 0xfe, 0xef, 0xde, 0xf0, 0x32, 0xcc, 0xa6, 0x12, 0x48, + 0x21, 0x0e, 0x46, 0x07, 0x63, 0x56, 0xcd, 0xa3, 0x63, 0x78, 0x5f, 0xdc, + 0xe3, 0x2d, 0xe0, 0x11, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0xff, 0xd0, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LimitedDurationLicense_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xcf, 0x57, 0x52, 0x00, 0x00, 0x00, 0x30, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xcf, 0x57, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x4c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x5e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x9c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x60, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x84, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x37, 0x43, 0x38, 0x38, 0x46, 0x35, 0x41, 0x44, + 0x35, 0x42, 0x35, 0x43, 0x34, 0x44, 0x36, 0x39, 0x32, 0x43, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x43, 0x38, 0x38, 0x46, 0x35, 0x41, 0x44, 0x35, 0x42, + 0x35, 0x43, 0x34, 0x44, 0x36, 0x39, 0x32, 0x43, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xf2, 0xd1, 0x92, + 0xa2, 0x06, 0x12, 0x14, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, 0x0f, + 0x28, 0x3c, 0x38, 0x0f, 0x48, 0x05, 0x58, 0x01, 0x70, 0x00, 0x78, 0x01, + 0x1a, 0x66, 0x12, 0x10, 0x51, 0x07, 0x58, 0xf5, 0xf6, 0xb7, 0xa2, 0x85, + 0xaf, 0xee, 0xf3, 0xc4, 0x3f, 0xf0, 0xa8, 0xad, 0x1a, 0x50, 0xac, 0x41, + 0x97, 0xf0, 0x7a, 0x6d, 0x36, 0x0f, 0xf3, 0xa9, 0xc0, 0x0d, 0x1a, 0xa2, + 0xd3, 0x42, 0xd8, 0x88, 0x86, 0xe7, 0x86, 0xc0, 0x34, 0xa9, 0x0e, 0x03, + 0x4d, 0x92, 0x9f, 0x98, 0xf9, 0xb4, 0xee, 0x51, 0x3e, 0xbc, 0xc2, 0x88, + 0xf2, 0x67, 0x53, 0x61, 0xac, 0xe6, 0x68, 0x13, 0x5a, 0x48, 0xa0, 0x03, + 0xa9, 0xa4, 0xbd, 0xcc, 0x67, 0x41, 0x3d, 0xf6, 0x27, 0x6a, 0x85, 0x52, + 0x71, 0x79, 0xfc, 0xb0, 0x9e, 0x76, 0x45, 0x7e, 0x5a, 0x9c, 0x32, 0x63, + 0xd1, 0x76, 0x06, 0x6e, 0x1d, 0x38, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xd2, 0xdc, 0x9f, 0x98, 0x96, 0xea, + 0x12, 0xee, 0x56, 0x3e, 0x52, 0x4b, 0xcd, 0x34, 0x61, 0x3a, 0x1a, 0x20, + 0xc0, 0x9a, 0x54, 0x60, 0x77, 0xb7, 0xec, 0x97, 0x88, 0x95, 0xca, 0x99, + 0x74, 0x89, 0xc0, 0xc4, 0x41, 0x0f, 0x84, 0x77, 0xa3, 0x10, 0x85, 0x81, + 0x37, 0xbc, 0x8c, 0x93, 0x76, 0x74, 0x62, 0x6b, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, + 0xee, 0xcf, 0x57, 0x52, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x29, 0x69, 0x9e, 0x99, + 0xc6, 0xd7, 0x9f, 0x6b, 0x68, 0x2f, 0x18, 0x20, 0x34, 0x57, 0x3f, 0xd4, + 0x1a, 0x20, 0xc6, 0x4f, 0xba, 0x10, 0x83, 0xe7, 0xaa, 0x6d, 0xcd, 0xca, + 0x42, 0x4c, 0x76, 0xe8, 0xc2, 0xb1, 0xee, 0x10, 0x88, 0x95, 0x54, 0x01, + 0x84, 0xe1, 0xca, 0xcb, 0x61, 0x6b, 0x7c, 0x10, 0x89, 0xc1, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x14, 0xee, 0xcf, 0x57, 0x52, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0xa1, 0x31, + 0x9d, 0xb0, 0x28, 0x50, 0x81, 0xcf, 0x39, 0x5c, 0xf9, 0xef, 0xbb, 0x7a, + 0x80, 0x43, 0x1a, 0x20, 0xda, 0x26, 0xa7, 0xbc, 0x31, 0x2e, 0x93, 0x24, + 0x9a, 0x40, 0x6c, 0x03, 0x44, 0xdd, 0x07, 0x22, 0x9d, 0x8e, 0x2e, 0x2a, + 0xca, 0xcd, 0xc2, 0xdd, 0x4b, 0x44, 0x88, 0x73, 0x88, 0x28, 0xef, 0x2c, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x14, 0xee, 0xcf, 0x57, 0x52, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0x9a, 0x20, 0xd8, 0x07, 0xe4, 0xcb, 0x75, 0x93, 0x22, 0xe8, 0xe9, 0x80, + 0x78, 0x30, 0xbb, 0x9f, 0x1a, 0x20, 0x56, 0xcc, 0x79, 0x52, 0xf1, 0xf2, + 0x77, 0xab, 0x6c, 0x20, 0xb3, 0x7a, 0xca, 0x39, 0x03, 0x92, 0xe0, 0x18, + 0x6f, 0x9e, 0x42, 0xdf, 0x72, 0x75, 0x54, 0x15, 0xd3, 0x3f, 0x81, 0x35, + 0xb9, 0x25, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, 0xee, 0xcf, 0x57, 0x52, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0xae, 0x99, 0x37, 0xde, 0xee, 0x48, 0x60, 0x01, 0x70, 0xdf, + 0xd4, 0xd3, 0xc4, 0x07, 0xd6, 0x49, 0x1a, 0x20, 0x71, 0xa1, 0xc6, 0x91, + 0x32, 0xa2, 0x21, 0x52, 0x91, 0xdc, 0xfd, 0x06, 0x7e, 0x2a, 0x83, 0xf8, + 0x6e, 0x14, 0xbe, 0xf1, 0xf9, 0xc4, 0x20, 0xee, 0x86, 0x38, 0x5d, 0x7f, + 0x6d, 0x6c, 0x6f, 0x7a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, 0xee, 0xcf, 0x57, 0x52, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0xf2, 0xd1, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x91, 0xcb, 0x74, 0x71, 0x00, 0x00, 0x00, 0x32, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x91, 0xcb, 0x74, 0x71, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x2e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x34, 0x42, 0x45, 0x31, 0x36, 0x36, 0x31, 0x36, + 0x30, 0x38, 0x43, 0x30, 0x39, 0x31, 0x46, 0x33, 0x32, 0x45, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x42, 0x45, 0x31, 0x36, 0x36, 0x31, 0x36, 0x30, 0x38, + 0x43, 0x30, 0x39, 0x31, 0x46, 0x33, 0x32, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x95, 0x14, 0x20, 0x6a, 0xff, 0x32, + 0x03, 0xbc, 0x6c, 0xe6, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0x93, 0xd2, 0x92, + 0xa2, 0x06, 0x12, 0x14, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x0f, + 0x28, 0x3c, 0x38, 0x0f, 0x48, 0x05, 0x58, 0x01, 0x70, 0x00, 0x78, 0x01, + 0x1a, 0x66, 0x12, 0x10, 0x7a, 0xb6, 0x67, 0x56, 0x7f, 0x74, 0x16, 0x7c, + 0xce, 0x39, 0x23, 0x56, 0xc0, 0x6c, 0xb3, 0xd6, 0x1a, 0x50, 0x01, 0xb2, + 0x17, 0x38, 0xa4, 0xfb, 0x20, 0xbc, 0xde, 0x96, 0x6b, 0xae, 0x37, 0x8a, + 0x15, 0xcc, 0x21, 0xb3, 0xd3, 0xb8, 0x99, 0xdd, 0x5d, 0x34, 0x14, 0xd2, + 0xe4, 0x4b, 0xcc, 0xf4, 0xed, 0x91, 0x48, 0x78, 0x73, 0x9a, 0x76, 0xba, + 0xa6, 0xb6, 0xae, 0xe7, 0xa1, 0x7d, 0x51, 0x16, 0xb5, 0xc6, 0xb5, 0x33, + 0xdd, 0x80, 0x77, 0x6f, 0x0b, 0x4e, 0xed, 0xab, 0xaf, 0xa6, 0xd5, 0x68, + 0x7b, 0x59, 0x14, 0x64, 0xe3, 0x11, 0x71, 0x05, 0x67, 0x24, 0x02, 0xc7, + 0xf1, 0xb7, 0xf8, 0x56, 0x35, 0xbe, 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xce, 0x52, 0x02, 0xd9, 0x13, 0x7f, + 0xa4, 0x05, 0x11, 0xb1, 0x9e, 0x18, 0x0d, 0x8f, 0x5e, 0x7e, 0x1a, 0x20, + 0x27, 0x22, 0xb8, 0xee, 0x70, 0x3a, 0xab, 0x80, 0x89, 0xfc, 0x34, 0xa4, + 0x8f, 0x75, 0x53, 0x6e, 0x60, 0xb9, 0x9e, 0x8d, 0xdd, 0x76, 0x89, 0xd6, + 0xdc, 0x3b, 0xe7, 0x62, 0x99, 0x61, 0x48, 0xfa, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, + 0x91, 0xcb, 0x74, 0x71, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, 0x5d, 0x78, 0xfa, 0x39, + 0x09, 0xf1, 0xcb, 0x6a, 0x69, 0x8a, 0xed, 0x8e, 0xaf, 0xa6, 0x5d, 0xcc, + 0x1a, 0x20, 0xf1, 0xa7, 0x66, 0xe8, 0xc3, 0x63, 0xbb, 0x63, 0x85, 0x08, + 0xaa, 0x71, 0xbe, 0x1a, 0x24, 0x80, 0xf9, 0x24, 0x93, 0x88, 0x2c, 0x33, + 0xce, 0x0c, 0x50, 0xe1, 0xc6, 0xdc, 0x7f, 0xed, 0x45, 0x59, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x14, 0x91, 0xcb, 0x74, 0x71, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x12, 0x10, 0x98, 0xfb, + 0x14, 0x6c, 0xc0, 0x5e, 0x4b, 0x75, 0xd0, 0x1f, 0x77, 0xbe, 0xf9, 0x90, + 0x92, 0xd6, 0x1a, 0x20, 0xd8, 0x39, 0x84, 0xa0, 0x2e, 0x6e, 0xf4, 0x92, + 0xcb, 0xa1, 0x36, 0x53, 0xdf, 0x73, 0x7b, 0xbe, 0x5b, 0xf5, 0xf8, 0x77, + 0xe6, 0x0b, 0x25, 0x4c, 0x5d, 0xf5, 0x48, 0x15, 0x90, 0xc7, 0xfb, 0xf8, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x14, 0x91, 0xcb, 0x74, 0x71, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, + 0x49, 0x04, 0x91, 0x23, 0xfb, 0x96, 0xbd, 0xbe, 0xe0, 0x7d, 0xf6, 0x9b, + 0x0c, 0xa3, 0x80, 0x99, 0x1a, 0x20, 0x03, 0x41, 0xef, 0x8d, 0xbc, 0xe8, + 0x64, 0xa7, 0xb4, 0x98, 0x84, 0xb5, 0x3b, 0xdb, 0x04, 0x04, 0x10, 0x27, + 0x96, 0x0a, 0x6b, 0x04, 0x7f, 0x60, 0xef, 0xfa, 0x2c, 0x5f, 0x50, 0x6c, + 0xbc, 0xbb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, 0x91, 0xcb, 0x74, 0x71, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x12, 0x10, 0xd1, 0xfc, 0xd1, 0x29, 0x11, 0x1a, 0x90, 0x8b, 0xcc, 0xe9, + 0xce, 0x1a, 0x2e, 0x47, 0x7e, 0x0c, 0x1a, 0x20, 0xe7, 0x66, 0x27, 0xae, + 0x94, 0x90, 0x5c, 0x99, 0x05, 0x04, 0x7d, 0xb5, 0xca, 0x81, 0x62, 0x6f, + 0x11, 0x01, 0x8d, 0xca, 0x50, 0x4c, 0xbb, 0x99, 0xf5, 0xd6, 0x94, 0x36, + 0x81, 0x0e, 0xfe, 0xbb, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x14, 0x91, 0xcb, 0x74, 0x71, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0x93, 0xd2, 0x92, 0xa2, 0x06, + 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_Heartbeat_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, 0x00, 0x34, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 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, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x32, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x44, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x56, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x94, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xb8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x42, 0x34, 0x35, 0x31, 0x46, 0x33, 0x37, 0x37, + 0x37, 0x35, 0x37, 0x31, 0x38, 0x32, 0x42, 0x37, 0x33, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x34, 0x35, 0x31, 0x46, 0x33, 0x37, 0x37, 0x37, 0x35, + 0x37, 0x31, 0x38, 0x32, 0x42, 0x37, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xb4, 0xd2, 0x92, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x38, 0x1e, + 0x48, 0x0a, 0x50, 0x0a, 0x1a, 0x66, 0x12, 0x10, 0xbd, 0x7f, 0xe0, 0x8a, + 0xad, 0x90, 0x35, 0x02, 0xc2, 0x23, 0x20, 0x63, 0xf5, 0x48, 0x10, 0xf8, + 0x1a, 0x50, 0xd5, 0x31, 0xf7, 0x5c, 0x0f, 0x1c, 0xf7, 0xbc, 0xf5, 0xe2, + 0xe2, 0x58, 0xaf, 0xd3, 0xca, 0x3b, 0x28, 0x93, 0x9f, 0x23, 0xc6, 0x8a, + 0x5c, 0xeb, 0x61, 0x0d, 0xb9, 0x7d, 0xf4, 0xe6, 0xf0, 0x0c, 0x21, 0x35, + 0x7e, 0x3c, 0x2a, 0x21, 0x92, 0xb2, 0xa2, 0x71, 0xc9, 0x86, 0x3c, 0x7c, + 0x58, 0x96, 0x9c, 0xa8, 0x1e, 0x56, 0x03, 0x24, 0xb3, 0x1a, 0x5e, 0xc0, + 0x2d, 0x97, 0x5a, 0x9c, 0xa4, 0x0e, 0xc7, 0xf5, 0xb2, 0x6d, 0x0b, 0x47, + 0x2e, 0x10, 0x5f, 0xd0, 0x02, 0xed, 0x7e, 0x4a, 0x17, 0x61, 0x20, 0x01, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xa6, 0xf5, + 0x96, 0x0d, 0x4f, 0xce, 0xfe, 0x51, 0xe2, 0x26, 0x73, 0xb9, 0xa0, 0x30, + 0xb9, 0x27, 0x1a, 0x20, 0x81, 0x05, 0xda, 0xee, 0x9a, 0xd7, 0x02, 0xd6, + 0x5d, 0xc5, 0xcb, 0x6e, 0x41, 0xd8, 0x8c, 0x41, 0x1b, 0x04, 0x69, 0x0f, + 0xca, 0x69, 0x06, 0x46, 0xe2, 0x79, 0xc4, 0x38, 0x12, 0xd0, 0x3b, 0x77, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, 0x32, 0xa2, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0xa3, 0xc9, 0xae, 0xf8, 0xb2, 0x01, 0x33, 0xfb, 0x53, 0x70, 0xc9, 0x97, + 0x35, 0x07, 0x45, 0xf0, 0x1a, 0x20, 0xbe, 0xf1, 0xdb, 0x30, 0x01, 0x64, + 0x02, 0xe4, 0xe4, 0xb5, 0x03, 0xb5, 0xb3, 0x20, 0xb4, 0xdc, 0x3b, 0xaa, + 0x9c, 0x6c, 0x5d, 0x4a, 0x65, 0x6d, 0xd1, 0x58, 0x87, 0xfb, 0xe1, 0x0e, + 0x98, 0x96, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, 0x32, 0xa2, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x12, 0x10, 0x4e, 0x0b, 0x87, 0x07, 0x85, 0x84, 0xc4, 0xcd, 0x71, 0xd5, + 0xad, 0x63, 0x72, 0x47, 0x33, 0xfc, 0x1a, 0x20, 0x15, 0xbd, 0xcf, 0xd5, + 0xd7, 0xda, 0x5b, 0x25, 0x84, 0xb8, 0x1e, 0x31, 0x49, 0xf2, 0x63, 0x79, + 0x9b, 0x95, 0xb5, 0x19, 0x88, 0x43, 0x86, 0x03, 0x0e, 0x2f, 0x55, 0x6b, + 0xe1, 0xe0, 0x29, 0x5a, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, 0x32, 0xa2, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x27, 0x4d, 0xaa, 0xb0, 0x19, 0x5d, 0x8d, 0x97, + 0x08, 0x8d, 0x00, 0x23, 0x32, 0x8e, 0x10, 0x97, 0x1a, 0x20, 0x3a, 0x38, + 0x9d, 0x66, 0x1c, 0x62, 0x58, 0x75, 0xdd, 0x08, 0x6e, 0x77, 0x87, 0x34, + 0x74, 0x78, 0xc8, 0x0d, 0x43, 0xf0, 0x21, 0x8c, 0xc4, 0x0d, 0x8c, 0xef, + 0xb0, 0x9e, 0x25, 0x08, 0xdc, 0x4c, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, + 0x32, 0xa2, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, + 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x89, 0x5f, 0xd2, 0xe7, 0x12, 0xef, + 0x92, 0xe1, 0x34, 0x4a, 0xa6, 0xda, 0xff, 0xc4, 0xeb, 0xf3, 0x1a, 0x20, + 0x9f, 0xae, 0x4a, 0xbb, 0xee, 0x52, 0x30, 0x6a, 0x61, 0x94, 0x05, 0xa8, + 0x82, 0xaf, 0xc2, 0xe4, 0x38, 0xe5, 0x82, 0xbf, 0xf6, 0xfc, 0x06, 0x6f, + 0x4c, 0x5a, 0x45, 0xcc, 0x81, 0xee, 0xab, 0x92, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, + 0x7a, 0xde, 0x32, 0xa2, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0xb4, + 0xd2, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_Heartbeat_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x7b, 0x1b, 0xdd, 0xcb, 0x00, 0x00, 0x00, 0x36, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x7b, 0x1b, 0xdd, 0xcb, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 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, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xee, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x50, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x26, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x64, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x76, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x88, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x46, 0x44, 0x31, 0x41, 0x43, 0x46, 0x33, 0x46, + 0x39, 0x32, 0x34, 0x38, 0x46, 0x39, 0x32, 0x36, 0x33, 0x32, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x46, 0x44, 0x31, 0x41, 0x43, 0x46, 0x33, 0x46, 0x39, 0x32, + 0x34, 0x38, 0x46, 0x39, 0x32, 0x36, 0x33, 0x32, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0x0d, 0x38, 0x79, 0xc3, 0xc5, 0xd7, + 0x37, 0x92, 0xa3, 0x35, 0x38, 0x00, 0x40, 0x00, 0x48, 0x8e, 0xd3, 0x92, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x38, 0x1e, + 0x48, 0x0a, 0x50, 0x0a, 0x1a, 0x66, 0x12, 0x10, 0xb3, 0x65, 0xfc, 0xf8, + 0xd5, 0x82, 0xe7, 0x12, 0x78, 0x14, 0x0a, 0xfb, 0x1c, 0x95, 0xdf, 0x30, + 0x1a, 0x50, 0xba, 0x5d, 0xa2, 0xd6, 0xc3, 0xfd, 0x04, 0x23, 0x1e, 0x07, + 0xda, 0x92, 0x81, 0xa8, 0xc9, 0x1d, 0x72, 0x2e, 0x40, 0x33, 0xee, 0x30, + 0xac, 0x8b, 0x3f, 0x2b, 0x83, 0x46, 0x2a, 0xf0, 0x7e, 0x5e, 0x35, 0x35, + 0xb4, 0x29, 0xd0, 0x5e, 0xae, 0xc1, 0x0b, 0x98, 0xae, 0xc3, 0xe0, 0x03, + 0x18, 0xd1, 0xce, 0x35, 0x43, 0x12, 0xee, 0xd3, 0x49, 0x7e, 0x00, 0x08, + 0x5b, 0x5f, 0x8b, 0x0d, 0x1d, 0xef, 0x57, 0x1c, 0xa5, 0x96, 0x9d, 0x26, + 0xb0, 0xb8, 0x98, 0xdb, 0x24, 0x53, 0xe4, 0x7d, 0xf3, 0xe6, 0x20, 0x01, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x4f, 0xf4, + 0x3b, 0x8f, 0xa3, 0x78, 0x33, 0x81, 0x5d, 0x82, 0x7f, 0xe8, 0xe2, 0xcb, + 0x59, 0x0a, 0x1a, 0x20, 0x6c, 0x39, 0x8b, 0xef, 0x75, 0xea, 0x74, 0x19, + 0x8a, 0x34, 0x6c, 0xef, 0x43, 0xa4, 0x9d, 0x6f, 0x24, 0x4b, 0x4d, 0x8d, + 0xf9, 0x97, 0xfa, 0xb0, 0x2c, 0x5f, 0xc7, 0x61, 0x2a, 0xb2, 0x50, 0x42, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x28, 0x7b, 0x1b, 0xdd, 0xcb, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x81, 0x88, 0x6a, 0x03, 0x18, 0x4a, 0xa7, 0x3a, 0x08, 0xd8, 0x6f, 0x14, + 0xc5, 0xc0, 0x37, 0x9b, 0x1a, 0x20, 0x8a, 0xf0, 0x93, 0xa8, 0x89, 0xe9, + 0x69, 0x4a, 0x1a, 0x62, 0x72, 0x16, 0x2f, 0xe8, 0x98, 0x84, 0x95, 0x95, + 0x6a, 0xd2, 0x21, 0x08, 0x0f, 0xb1, 0xb6, 0x69, 0x20, 0x6b, 0xee, 0x0d, + 0xc5, 0x8d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7b, 0x1b, 0xdd, 0xcb, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x12, 0x10, 0xd6, 0x28, 0x78, 0x5a, 0xc6, 0xff, 0x4c, 0xa1, 0xf7, 0xf6, + 0xfc, 0x0e, 0xc5, 0xdd, 0xc1, 0xc0, 0x1a, 0x20, 0xba, 0x10, 0x64, 0x59, + 0xba, 0xf9, 0x4c, 0x7e, 0xe4, 0x14, 0x2e, 0x5c, 0xb1, 0xab, 0xdf, 0xe4, + 0x4f, 0x88, 0xde, 0x42, 0xb6, 0xc8, 0xd2, 0x1e, 0xbd, 0x75, 0x37, 0x9a, + 0x33, 0x5f, 0x80, 0xaa, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7b, 0x1b, 0xdd, 0xcb, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x47, 0x32, 0x86, 0xf8, 0xaf, 0x43, 0xd7, 0xfa, + 0xfd, 0xac, 0x36, 0xd5, 0x64, 0x36, 0x1d, 0xcf, 0x1a, 0x20, 0x2d, 0xf4, + 0x07, 0x5a, 0x61, 0x5e, 0x83, 0xfc, 0x6d, 0x4d, 0x5b, 0xe4, 0x98, 0x1a, + 0xff, 0x83, 0xac, 0x13, 0xab, 0x49, 0x4d, 0x68, 0xbb, 0x5d, 0xe8, 0xe9, + 0xa9, 0x0f, 0xce, 0x75, 0xa4, 0xba, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x7b, 0x1b, + 0xdd, 0xcb, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, + 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x6e, 0x6a, 0x0c, 0x1c, 0x4d, 0x57, + 0x50, 0x17, 0x5d, 0xc4, 0xb3, 0x93, 0x74, 0x5c, 0x39, 0xe6, 0x1a, 0x20, + 0xf2, 0x99, 0xc1, 0x94, 0x54, 0xe7, 0x98, 0x24, 0x9e, 0x92, 0xeb, 0xb8, + 0x08, 0xd6, 0x71, 0x60, 0x2d, 0x6e, 0x96, 0x56, 0x6c, 0x37, 0x2f, 0x7e, + 0xd0, 0x26, 0xc6, 0x74, 0x2e, 0x8a, 0xf3, 0x68, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, + 0x7b, 0x1b, 0xdd, 0xcb, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0x8e, + 0xd3, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_UnlimitedStreaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x00, 0xc2, 0xfa, 0xf0, 0x00, 0x00, 0x00, 0x38, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x00, 0xc2, 0xfa, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x6a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 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, + 0x05, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x46, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x31, 0x32, 0x30, 0x45, 0x43, 0x37, 0x39, 0x35, + 0x43, 0x46, 0x42, 0x44, 0x32, 0x45, 0x31, 0x44, 0x33, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x31, 0x32, 0x30, 0x45, 0x43, 0x37, 0x39, 0x35, 0x43, 0x46, + 0x42, 0x44, 0x32, 0x45, 0x31, 0x44, 0x33, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0xe8, 0xd3, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0x0b, 0x38, + 0x0e, 0x91, 0xd2, 0xb4, 0xad, 0x6b, 0x21, 0xb3, 0x92, 0xf8, 0x17, 0x43, + 0x99, 0x8d, 0x1a, 0x50, 0x16, 0x44, 0xce, 0x7a, 0x37, 0x0f, 0xb3, 0xd0, + 0xc3, 0x53, 0xaf, 0x9d, 0xba, 0x77, 0x53, 0x40, 0xd7, 0x17, 0xf0, 0x41, + 0xa9, 0x51, 0x1c, 0x84, 0x78, 0x6a, 0x97, 0x2f, 0xa3, 0x2b, 0x17, 0x86, + 0x9c, 0x2e, 0xca, 0x81, 0xbe, 0x73, 0x9e, 0xf6, 0x5d, 0xbc, 0xe1, 0x56, + 0x43, 0x56, 0xa9, 0x3c, 0x50, 0x36, 0x55, 0x04, 0x62, 0x33, 0x8d, 0xc2, + 0x2b, 0xfd, 0x2a, 0x8c, 0xd7, 0xbf, 0xaf, 0x6e, 0x94, 0x55, 0x66, 0x01, + 0x4a, 0xb8, 0xe9, 0xdf, 0xad, 0x96, 0xf5, 0x4e, 0x93, 0xf2, 0x87, 0x07, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0xf7, 0xf9, 0x1e, 0xa1, 0x45, 0x0f, 0x4f, 0xe9, 0xb3, 0xa3, 0xae, 0xe2, + 0x79, 0xc9, 0x97, 0xd2, 0x1a, 0x20, 0x25, 0x09, 0xf9, 0xc6, 0x8b, 0xe6, + 0xb6, 0xcf, 0xf6, 0x13, 0x15, 0x0a, 0x11, 0xdb, 0x8e, 0x68, 0x89, 0x42, + 0x25, 0xea, 0xf6, 0xc2, 0xc2, 0x51, 0x89, 0xc8, 0x41, 0x79, 0xb1, 0xdf, + 0xd0, 0xe4, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xfa, 0xf0, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x97, 0xa1, 0x40, 0x54, 0x64, 0x38, 0x2c, 0x01, 0x5f, 0x05, + 0x7b, 0xf6, 0xf0, 0xa2, 0x9b, 0x02, 0x1a, 0x20, 0xff, 0xea, 0x46, 0x74, + 0xec, 0xe8, 0x9d, 0xb7, 0x7f, 0x02, 0xa1, 0xf1, 0x39, 0x4d, 0x8c, 0x99, + 0x13, 0x54, 0x66, 0x62, 0xd1, 0xfb, 0x7f, 0x7a, 0x59, 0x64, 0x95, 0xf4, + 0xab, 0x26, 0x67, 0xce, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xfa, 0xf0, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x14, 0x49, 0xc9, 0x42, 0x5b, 0x28, 0x9b, 0x28, + 0x3a, 0x8a, 0x4c, 0xb5, 0x5f, 0xdb, 0xc6, 0x1d, 0x1a, 0x20, 0xe0, 0x73, + 0x2f, 0x07, 0xce, 0x3a, 0x88, 0xaa, 0x49, 0x34, 0xcc, 0xac, 0xd0, 0x44, + 0x06, 0xab, 0x44, 0xae, 0x93, 0x18, 0x05, 0x8f, 0x38, 0xd9, 0xb5, 0xe6, + 0xc6, 0x83, 0x45, 0x55, 0xfa, 0x7b, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, + 0xfa, 0xf0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x73, 0x45, 0x32, 0x30, 0xea, 0x13, + 0x80, 0x5f, 0x6f, 0x5a, 0x08, 0xa4, 0x39, 0xbe, 0x8c, 0x3d, 0x1a, 0x20, + 0x6a, 0xb1, 0x81, 0xf7, 0x90, 0x07, 0xe5, 0x22, 0x96, 0x13, 0x01, 0x44, + 0xbb, 0xcd, 0xc9, 0xf1, 0xe5, 0x9d, 0x46, 0x83, 0xca, 0x72, 0xfe, 0x17, + 0x76, 0xc1, 0x81, 0x5c, 0x8b, 0x2e, 0x18, 0x04, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc2, 0xfa, 0xf0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x19, 0x00, 0x00, 0x44, + 0x37, 0x42, 0x27, 0xab, 0x92, 0xb9, 0x27, 0xaa, 0x3e, 0x0a, 0x38, 0x2c, + 0x1a, 0x20, 0xa4, 0x36, 0xb0, 0x4f, 0xec, 0xeb, 0x63, 0x02, 0x14, 0xe2, + 0xa6, 0xb1, 0xeb, 0xf7, 0xd7, 0x52, 0xf8, 0xfa, 0x79, 0x14, 0x5e, 0xe4, + 0xd0, 0x12, 0xc1, 0x20, 0x76, 0x0f, 0x3d, 0x57, 0xb9, 0x21, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc2, 0xfa, 0xf0, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, + 0x20, 0xe8, 0xd3, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_UnlimitedStreaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x46, 0x0a, 0xd8, 0x38, 0x00, 0x00, 0x00, 0x3a, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x46, 0x0a, 0xd8, 0x38, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 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, + 0x05, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x66, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x45, 0x43, 0x36, 0x45, 0x34, 0x41, 0x37, 0x32, + 0x43, 0x42, 0x42, 0x31, 0x36, 0x34, 0x33, 0x37, 0x33, 0x36, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x43, 0x36, 0x45, 0x34, 0x41, 0x37, 0x32, 0x43, 0x42, + 0x42, 0x31, 0x36, 0x34, 0x33, 0x37, 0x33, 0x36, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xc5, 0x4d, 0x91, 0xe8, 0x46, 0x4e, + 0xfd, 0x2e, 0x7e, 0x71, 0x38, 0x00, 0x40, 0x00, 0x48, 0xf6, 0xd3, 0x92, + 0xa2, 0x06, 0x12, 0x0e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x66, 0x12, 0x10, 0xef, 0x6c, + 0x04, 0x79, 0xe1, 0xd4, 0xc5, 0x6c, 0x49, 0x4f, 0x78, 0xaf, 0x67, 0xa4, + 0x1d, 0xd8, 0x1a, 0x50, 0xee, 0x13, 0x1a, 0x17, 0x9d, 0xf9, 0x7e, 0x7f, + 0xa4, 0x3d, 0x18, 0xfd, 0xcb, 0x67, 0x4c, 0x4b, 0x58, 0x8c, 0xd8, 0x1d, + 0xe9, 0xcf, 0x6c, 0x26, 0xb1, 0xf7, 0x4c, 0xd5, 0x0a, 0x8d, 0x84, 0x77, + 0x71, 0x88, 0x87, 0x26, 0x94, 0x1c, 0xf6, 0x50, 0xe4, 0xec, 0xc3, 0x5d, + 0x92, 0xd5, 0xef, 0xc3, 0x5d, 0x11, 0x57, 0x13, 0x01, 0x09, 0x06, 0xa8, + 0x55, 0x46, 0xae, 0x04, 0x8a, 0x46, 0x38, 0xc0, 0xe9, 0x14, 0x6b, 0xa1, + 0xff, 0x66, 0x5a, 0xc7, 0xa4, 0xd6, 0xba, 0x32, 0xf2, 0x41, 0x9c, 0xd9, + 0x20, 0x01, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, + 0x45, 0x95, 0x30, 0x46, 0x5b, 0xcb, 0x93, 0x70, 0x52, 0xac, 0x5e, 0x7a, + 0x05, 0xed, 0xa4, 0xcb, 0x1a, 0x20, 0x21, 0x8b, 0xfd, 0xb1, 0x20, 0x48, + 0xb8, 0x19, 0x96, 0x54, 0x8f, 0x08, 0xe9, 0xc1, 0x6b, 0x7b, 0xf2, 0x58, + 0x29, 0xa3, 0x5c, 0x13, 0x02, 0x13, 0xc9, 0xb1, 0x07, 0x35, 0x05, 0xdf, + 0x57, 0xfa, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0a, 0xd8, 0x38, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x12, 0x10, 0x6b, 0x79, 0xe3, 0xa2, 0xf0, 0x10, 0xcb, 0x45, 0x17, 0x39, + 0xa8, 0xdd, 0x3b, 0x48, 0xeb, 0xbf, 0x1a, 0x20, 0xa9, 0x82, 0x1e, 0xed, + 0xab, 0x6d, 0x30, 0x32, 0x3d, 0x69, 0x81, 0x74, 0x02, 0xf3, 0xca, 0x73, + 0x4e, 0xb8, 0x95, 0x3c, 0x3c, 0x94, 0x2e, 0xeb, 0xe5, 0xba, 0xa8, 0x8f, + 0x59, 0x52, 0xbb, 0x61, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0a, 0xd8, 0x38, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x12, 0x10, 0x59, 0x5d, 0xf1, 0x64, 0x66, 0x12, 0x54, 0x84, + 0xfb, 0xa6, 0xda, 0x74, 0xe5, 0xb1, 0xc8, 0xd7, 0x1a, 0x20, 0xd8, 0x44, + 0x63, 0x88, 0x84, 0x16, 0xe6, 0x42, 0xbf, 0x61, 0x84, 0xf5, 0x31, 0xd9, + 0x96, 0xc8, 0x28, 0x5f, 0xa5, 0x7a, 0xd9, 0xf6, 0x61, 0xa0, 0x69, 0xc3, + 0x8d, 0xaf, 0xc4, 0x0a, 0x30, 0x6d, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0a, + 0xd8, 0x38, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x12, 0x10, 0x26, 0xdd, 0x54, 0x90, 0x33, 0xcb, + 0x01, 0x45, 0x3d, 0xb1, 0xee, 0x8f, 0x34, 0x67, 0x2a, 0x22, 0x1a, 0x20, + 0x88, 0xc5, 0x00, 0x50, 0xa5, 0x57, 0x21, 0x96, 0x21, 0xca, 0x5f, 0x78, + 0xa2, 0x2e, 0x47, 0xfe, 0xf1, 0xba, 0xaf, 0x60, 0x3f, 0xa7, 0xd9, 0x3a, + 0x9a, 0xa3, 0xb1, 0xb8, 0x88, 0xfe, 0x7e, 0x9b, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x00, + 0x46, 0x0a, 0xd8, 0x38, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, + 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, + 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0xb0, 0x8b, 0x6a, 0x50, + 0x7a, 0x71, 0x81, 0x6a, 0x62, 0xdf, 0xf8, 0xfc, 0x1d, 0x2a, 0xad, 0xfe, + 0x1a, 0x20, 0x3d, 0x69, 0x81, 0x74, 0xc0, 0xde, 0xc3, 0xc9, 0xa9, 0xe6, + 0xef, 0x0e, 0xe8, 0xab, 0x51, 0x8c, 0x58, 0x08, 0x8a, 0x17, 0xb7, 0xb4, + 0xf0, 0x8e, 0xbd, 0xad, 0xe6, 0xf1, 0x5a, 0x2c, 0xb6, 0x9a, 0x20, 0x02, + 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x46, 0x0a, 0xd8, 0x38, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, + 0x20, 0xf6, 0xd3, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LicenseDuration_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x3c, 0x48, 0xdb, 0x3c, 0x00, 0x00, 0x00, 0x3c, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x3c, 0x48, 0xdb, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xe2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x32, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x44, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x56, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x94, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xb8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x32, 0x34, 0x31, 0x30, 0x39, 0x39, 0x32, 0x35, + 0x34, 0x36, 0x45, 0x30, 0x33, 0x38, 0x44, 0x31, 0x33, 0x38, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x32, 0x34, 0x31, 0x30, 0x39, 0x39, 0x32, 0x35, 0x34, 0x36, + 0x45, 0x30, 0x33, 0x38, 0x44, 0x31, 0x33, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0x84, 0xd4, 0x92, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x1a, 0x66, 0x12, 0x10, 0x31, 0xcd, 0x05, 0xfb, + 0x9e, 0xd9, 0x3b, 0x3a, 0xb9, 0xf3, 0xa4, 0x7b, 0xec, 0x46, 0xd4, 0xa9, + 0x1a, 0x50, 0x57, 0xfa, 0x64, 0xcd, 0xf9, 0x5a, 0x7f, 0x6e, 0xbe, 0x1d, + 0x87, 0x1e, 0xf8, 0xa4, 0xb4, 0x0d, 0x94, 0x48, 0xd0, 0xd7, 0xea, 0x94, + 0x06, 0x20, 0x4a, 0x3a, 0x95, 0xc0, 0xa9, 0x8b, 0x61, 0x69, 0x5f, 0x96, + 0xb1, 0x64, 0x19, 0xb0, 0x92, 0x3a, 0x8c, 0x43, 0x76, 0x97, 0x17, 0x29, + 0xe6, 0x2d, 0xb6, 0xd9, 0xd9, 0x60, 0x92, 0x88, 0x39, 0xec, 0x2a, 0xfd, + 0xdf, 0x4e, 0xa1, 0x5a, 0xfc, 0x5b, 0x1d, 0x54, 0x79, 0x53, 0xe0, 0x82, + 0xd4, 0x87, 0x9f, 0x10, 0xa8, 0x6e, 0x82, 0xf3, 0x69, 0x40, 0x20, 0x01, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0x88, 0x54, + 0xc8, 0x17, 0x7a, 0x7b, 0x97, 0x01, 0x37, 0x14, 0x9b, 0x07, 0x52, 0x76, + 0x52, 0xcb, 0x1a, 0x20, 0xc5, 0x11, 0x0c, 0xe1, 0xb2, 0x44, 0xe8, 0x4d, + 0x66, 0x94, 0x7a, 0x50, 0x52, 0x46, 0x1d, 0x80, 0x04, 0x5b, 0x43, 0x8b, + 0xb6, 0x7f, 0x31, 0x5b, 0x77, 0xab, 0xfd, 0x69, 0x2b, 0x8e, 0x95, 0xa2, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x28, 0x3c, 0x48, 0xdb, 0x3c, 0x80, 0x00, 0x00, 0x08, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0x2e, 0x36, 0xd2, 0x04, 0xcb, 0xe8, 0xba, 0x12, 0x47, 0xc4, 0x39, 0xe0, + 0x1c, 0x81, 0x6b, 0x92, 0x1a, 0x20, 0x10, 0x43, 0xbd, 0x39, 0xd5, 0x78, + 0x3e, 0xb6, 0x7f, 0xed, 0xa1, 0x35, 0xc2, 0x71, 0x45, 0x17, 0x42, 0xc0, + 0xe3, 0xd4, 0x15, 0xc6, 0x38, 0x1c, 0xf7, 0x87, 0x6a, 0xd8, 0x5c, 0x4d, + 0x25, 0x66, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x3c, 0x48, 0xdb, 0x3c, 0x80, 0x00, + 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x12, 0x10, 0x1d, 0x76, 0xc6, 0xf8, 0x85, 0xf5, 0x12, 0xea, 0x2a, 0xf2, + 0x34, 0x1c, 0x29, 0xb8, 0x4a, 0x35, 0x1a, 0x20, 0x8a, 0x1f, 0x7f, 0x82, + 0x7a, 0x65, 0x9a, 0xa2, 0x8f, 0x9d, 0x45, 0xc8, 0x13, 0x47, 0x37, 0x40, + 0x92, 0xcd, 0xd5, 0x4d, 0xb1, 0x32, 0x40, 0x37, 0x54, 0xac, 0x7a, 0x80, + 0x8a, 0x5a, 0x24, 0x71, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x3c, 0x48, 0xdb, 0x3c, + 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x80, 0x6e, 0x8d, 0xa8, 0x65, 0x78, 0x35, 0xba, + 0xd3, 0xe0, 0xe2, 0x31, 0x4a, 0x02, 0xc3, 0x0c, 0x1a, 0x20, 0x20, 0x5a, + 0x11, 0x14, 0x3f, 0x5e, 0xa2, 0x4d, 0x8d, 0x33, 0xac, 0xb4, 0xde, 0xc0, + 0x56, 0xec, 0x2e, 0x1c, 0x82, 0xe5, 0xf3, 0xa9, 0xf8, 0x39, 0xcc, 0x0c, + 0x55, 0x29, 0xd1, 0x62, 0xbf, 0x81, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x3c, 0x48, + 0xdb, 0x3c, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, + 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x9a, 0xf7, 0x38, 0xb6, 0x4e, 0xe4, + 0x1e, 0x02, 0xd7, 0x3f, 0xd7, 0x0f, 0x30, 0x9d, 0xd9, 0xab, 0x1a, 0x20, + 0xbf, 0xd2, 0x85, 0x0b, 0x38, 0xa3, 0xaa, 0x8d, 0x5b, 0xb5, 0x22, 0xb3, + 0xd2, 0xb6, 0xa6, 0x69, 0xc2, 0x7b, 0x78, 0x18, 0xa8, 0x4e, 0x01, 0x3c, + 0x54, 0xb5, 0xb7, 0x95, 0x1a, 0x6d, 0x90, 0x15, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, + 0x3c, 0x48, 0xdb, 0x3c, 0x80, 0x00, 0x00, 0x08, 0x62, 0x00, 0x20, 0x84, + 0xd4, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} + +TEST_F(ODKGoldenLicenseV17, Both_CdmUseCase_LicenseDuration_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, + 0x00, 0x11, 0x01, 0x6d, 0x4d, 0xe9, 0x00, 0x00, 0x00, 0x3e, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x35, 0x00, 0x02, 0x00, 0x11, + 0x01, 0x6d, 0x4d, 0xe9, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x74, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xee, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x50, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xa0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x26, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x64, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x76, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x88, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x43, 0x45, 0x44, 0x36, 0x41, 0x32, 0x35, 0x45, + 0x42, 0x42, 0x34, 0x37, 0x45, 0x42, 0x34, 0x45, 0x33, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x43, 0x45, 0x44, 0x36, 0x41, 0x32, 0x35, 0x45, 0x42, 0x42, + 0x34, 0x37, 0x45, 0x42, 0x34, 0x45, 0x33, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x00, 0x32, 0x0a, 0xa0, 0xb4, 0xb6, 0xf2, 0x6f, 0xf4, + 0x2b, 0x4a, 0x44, 0xa2, 0x38, 0x00, 0x40, 0x00, 0x48, 0xaa, 0xd4, 0x92, + 0xa2, 0x06, 0x12, 0x0c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x1a, 0x66, 0x12, 0x10, 0x1d, 0x4b, 0xf4, 0x13, + 0xa0, 0xa5, 0x7a, 0xcf, 0x9c, 0x76, 0xd8, 0xbb, 0xc0, 0x8e, 0x05, 0x56, + 0x1a, 0x50, 0x8e, 0x9c, 0x6e, 0x24, 0xee, 0xec, 0x26, 0xa6, 0xa4, 0xdd, + 0xe5, 0x21, 0x5c, 0x34, 0xd1, 0x61, 0x3b, 0x32, 0x56, 0x2d, 0xb3, 0x75, + 0xa4, 0x7f, 0x9e, 0xa6, 0xaa, 0xf0, 0xba, 0xaa, 0x4a, 0xf3, 0x18, 0x42, + 0xaa, 0x2a, 0x64, 0xfd, 0x59, 0xdd, 0x28, 0xd7, 0xd1, 0xe6, 0xe1, 0xbe, + 0x4d, 0x03, 0xf4, 0x20, 0x98, 0x0f, 0x89, 0xba, 0x14, 0x44, 0xb3, 0x1a, + 0xd7, 0xa8, 0x2f, 0x83, 0x1d, 0xb9, 0x44, 0xd3, 0xdf, 0x8b, 0x57, 0x03, + 0xd1, 0x4d, 0x7c, 0x16, 0xf1, 0x64, 0xc7, 0x83, 0xac, 0x61, 0x20, 0x01, + 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x10, 0xe9, 0x14, + 0x26, 0x43, 0x41, 0xfd, 0x86, 0x00, 0x58, 0x04, 0x6f, 0xec, 0xdc, 0x0e, + 0x11, 0x69, 0x1a, 0x20, 0x9c, 0x67, 0xb1, 0x9b, 0x2b, 0x18, 0x47, 0x48, + 0xc3, 0x67, 0x72, 0xdd, 0x77, 0x01, 0xa6, 0x7c, 0x70, 0x83, 0xe2, 0xac, + 0x0c, 0xf6, 0xcb, 0xae, 0x05, 0xf5, 0xa4, 0x42, 0x37, 0x1e, 0x56, 0x54, + 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, + 0x00, 0x00, 0x00, 0x28, 0x01, 0x6d, 0x4d, 0xe9, 0x80, 0x00, 0x40, 0x00, + 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, 0x10, + 0xe1, 0xca, 0xfc, 0xa1, 0x93, 0x0b, 0xea, 0x64, 0x0f, 0xe9, 0x6b, 0x9e, + 0xeb, 0xc1, 0x66, 0x3d, 0x1a, 0x20, 0xe2, 0xc5, 0x3c, 0x15, 0x7c, 0x75, + 0x9a, 0x4f, 0x87, 0x5d, 0x45, 0xa5, 0x76, 0x57, 0x7d, 0xb7, 0x90, 0x5f, + 0x28, 0x29, 0x6d, 0x60, 0x01, 0xc8, 0x01, 0x96, 0x59, 0xa4, 0xd6, 0x2b, + 0xf1, 0xf8, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x01, 0x6d, 0x4d, 0xe9, 0x80, 0x00, + 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x12, 0x10, 0xa7, 0x14, 0xf2, 0x34, 0xcf, 0x02, 0x2e, 0xc3, 0xbf, 0x71, + 0xdf, 0x38, 0x0a, 0x32, 0xab, 0x99, 0x1a, 0x20, 0xbe, 0x55, 0x02, 0xff, + 0x3e, 0x8e, 0x0a, 0xd6, 0x9e, 0x40, 0x0c, 0xb3, 0x58, 0xee, 0x87, 0x08, + 0x96, 0x7e, 0xff, 0xc8, 0xa6, 0xd4, 0x29, 0x94, 0x88, 0x7b, 0x4c, 0x19, + 0x9e, 0x43, 0xd2, 0xaa, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x01, 0x6d, 0x4d, 0xe9, + 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x12, 0x10, 0x52, 0xed, 0x82, 0x9e, 0xeb, 0x39, 0xa0, 0x78, + 0xae, 0x9c, 0x98, 0x35, 0xf9, 0xfa, 0x5f, 0x37, 0x1a, 0x20, 0xe9, 0x8c, + 0x84, 0xe2, 0x4d, 0x08, 0x87, 0x45, 0xeb, 0x24, 0xc0, 0x56, 0x68, 0x46, + 0x2e, 0xfb, 0x60, 0xe0, 0x30, 0x02, 0xad, 0x10, 0x55, 0x40, 0x7b, 0x33, + 0xf1, 0x17, 0xeb, 0x6a, 0x12, 0xd0, 0x20, 0x02, 0x28, 0x01, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, 0x01, 0x6d, + 0x4d, 0xe9, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x1a, 0x60, 0x0a, 0x10, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, + 0x3d, 0x3d, 0x3d, 0x3d, 0x12, 0x10, 0x64, 0xb4, 0xa4, 0xa5, 0x59, 0x06, + 0xfa, 0x4e, 0xfd, 0x09, 0xa8, 0xc9, 0x4b, 0x9c, 0x5e, 0x30, 0x1a, 0x20, + 0xd1, 0x1b, 0x6f, 0x9a, 0x42, 0x5d, 0x51, 0x7a, 0xe3, 0x2f, 0x86, 0x04, + 0x1d, 0xff, 0xb0, 0xf1, 0x66, 0x74, 0x80, 0xa8, 0x18, 0x3f, 0x9a, 0x60, + 0x89, 0x49, 0x98, 0x47, 0xcd, 0xd7, 0x8f, 0xda, 0x20, 0x02, 0x28, 0x01, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x37, 0x00, 0x00, 0x00, 0x28, + 0x01, 0x6d, 0x4d, 0xe9, 0x80, 0x00, 0x40, 0x00, 0x62, 0x00, 0x20, 0xaa, + 0xd4, 0x92, 0xa2, 0x06, 0x38, 0x00, + }; + serialized_license_ = + std::string(reinterpret_cast(serialized_license_raw), + sizeof(serialized_license_raw)); + const uint8_t core_request_sha256_raw[] = { + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + }; + core_request_sha256_ = + std::string(reinterpret_cast(core_request_sha256_raw), + sizeof(core_request_sha256_raw)); + nonce_required_ = true; + RunTest(); +} +////////////////////////////////////////////////////////////////////// +// Renewal Tests. +// A few renewal examples from filter *PIG*:*CdmUseCase*. +// Note: running these cases generates many renewals. It should be +// ok to only test one or two. +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_LicenseWithRenewal_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, + 0x38, 0x46, 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, 0x38, 0x46, + 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x01, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xa6, 0xce, + 0x92, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, + 0x08, 0x20, 0xbd, 0xce, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_LicenseWithRenewal_Case1_0_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, + 0x38, 0x46, 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x45, 0x36, 0x45, 0x42, 0x30, 0x43, 0x37, 0x44, 0x38, 0x46, + 0x44, 0x46, 0x34, 0x36, 0x36, 0x41, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x04, 0x38, 0xb4, 0x01, 0x40, 0x00, 0x48, 0xa6, 0xce, + 0x92, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0xee, 0xa5, 0xfe, 0xd6, 0x00, 0x00, 0x00, + 0x08, 0x20, 0x82, 0xcf, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} +TEST_F(ODKGoldenRenewalV17, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, 0x2c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x55, 0x0a, 0x20, 0x36, 0x42, 0x31, 0x46, 0x45, 0x44, 0x30, 0x35, + 0x39, 0x32, 0x44, 0x37, 0x36, 0x30, 0x41, 0x32, 0x32, 0x38, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x36, 0x42, 0x31, 0x46, 0x45, 0x44, 0x30, 0x35, 0x39, 0x32, + 0x44, 0x37, 0x36, 0x30, 0x41, 0x32, 0x32, 0x38, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x01, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0x8c, 0xd0, + 0x92, 0xa2, 0x06, 0x12, 0x08, 0x08, 0x01, 0x18, 0x01, 0x38, 0x0a, 0x48, + 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x74, + 0x6c, 0x00, 0x00, 0x00, 0x19, 0xe6, 0x94, 0x9b, 0x2c, 0x00, 0x00, 0x00, + 0x08, 0x20, 0xa3, 0xd0, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV17, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0x24, 0xf9, 0xc1, 0xd1, 0x00, 0x00, 0x00, 0x2e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0x24, 0xf9, 0xc1, 0xd1, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x61, 0x0a, 0x20, 0x33, 0x46, 0x37, 0x36, 0x33, 0x34, 0x36, 0x42, + 0x44, 0x44, 0x34, 0x33, 0x32, 0x39, 0x30, 0x36, 0x32, 0x41, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x33, 0x46, 0x37, 0x36, 0x33, 0x34, 0x36, 0x42, 0x44, 0x44, + 0x34, 0x33, 0x32, 0x39, 0x30, 0x36, 0x32, 0x41, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x01, 0x32, 0x0a, 0xc1, 0xf0, 0xf1, 0x8a, 0x9b, 0x9b, + 0x09, 0x4f, 0x67, 0xfe, 0x38, 0x00, 0x40, 0xb4, 0x01, 0x48, 0xff, 0xd0, + 0x92, 0xa2, 0x06, 0x12, 0x0a, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x38, + 0x0a, 0x48, 0x0f, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x74, 0x6c, 0x00, 0x00, 0x00, 0x19, 0x24, 0xf9, 0xc1, 0xd1, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x96, 0xd1, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_LimitedDurationLicense_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0xee, 0xcf, 0x57, 0x52, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0xee, 0xcf, 0x57, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x37, 0x43, 0x38, 0x38, 0x46, 0x35, 0x41, 0x44, + 0x35, 0x42, 0x35, 0x43, 0x34, 0x44, 0x36, 0x39, 0x32, 0x43, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x37, 0x43, 0x38, 0x38, 0x46, 0x35, 0x41, 0x44, 0x35, 0x42, + 0x35, 0x43, 0x34, 0x44, 0x36, 0x39, 0x32, 0x43, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x01, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0xf2, 0xd1, 0x92, + 0xa2, 0x06, 0x12, 0x0b, 0x08, 0x01, 0x18, 0x00, 0x38, 0x80, 0xe7, 0x84, + 0x0f, 0x48, 0x00, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x74, 0x6c, 0x00, 0x00, 0x00, 0x00, 0xee, 0xcf, 0x57, 0x52, 0x00, + 0x00, 0x00, 0x08, 0x20, 0x83, 0xd2, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0x91, 0xcb, 0x74, 0x71, 0x00, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0x91, 0xcb, 0x74, 0x71, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe1, 0x33, 0x80, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x60, 0x0a, 0x20, 0x34, 0x42, 0x45, 0x31, 0x36, 0x36, 0x31, 0x36, + 0x30, 0x38, 0x43, 0x30, 0x39, 0x31, 0x46, 0x33, 0x32, 0x45, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x34, 0x42, 0x45, 0x31, 0x36, 0x36, 0x31, 0x36, 0x30, 0x38, + 0x43, 0x30, 0x39, 0x31, 0x46, 0x33, 0x32, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x02, 0x28, 0x01, 0x32, 0x0a, 0x95, 0x14, 0x20, 0x6a, 0xff, 0x32, + 0x03, 0xbc, 0x6c, 0xe6, 0x38, 0x0f, 0x40, 0x3c, 0x48, 0x93, 0xd2, 0x92, + 0xa2, 0x06, 0x12, 0x0d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x38, 0x80, + 0xe7, 0x84, 0x0f, 0x48, 0x00, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x74, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x91, 0xcb, 0x74, + 0x71, 0x00, 0x00, 0x00, 0x00, 0x20, 0xa4, 0xd2, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV17, Both_CdmUseCase_Heartbeat_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x11, 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, 0x00, 0x34, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, + }; + core_request_ = std::string(reinterpret_cast(core_request_raw), + sizeof(core_request_raw)); + const uint8_t core_response_raw[] = { + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x11, + 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + }; + core_response_ = std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t renewal_raw[] = { + 0x0a, 0x54, 0x0a, 0x20, 0x42, 0x34, 0x35, 0x31, 0x46, 0x33, 0x37, 0x37, + 0x37, 0x35, 0x37, 0x31, 0x38, 0x32, 0x42, 0x37, 0x33, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x20, 0x42, 0x34, 0x35, 0x31, 0x46, 0x33, 0x37, 0x37, 0x37, 0x35, + 0x37, 0x31, 0x38, 0x32, 0x42, 0x37, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x00, + 0x20, 0x01, 0x28, 0x03, 0x38, 0x00, 0x40, 0x00, 0x48, 0xb4, 0xd2, 0x92, + 0xa2, 0x06, 0x12, 0x0a, 0x08, 0x01, 0x18, 0x01, 0x38, 0x1e, 0x48, 0x0a, + 0x50, 0x0a, 0x1a, 0x16, 0x20, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x74, 0x6c, 0x00, 0x00, 0x00, 0x28, 0x7a, 0xde, 0x32, 0xa2, 0x00, 0x00, + 0x00, 0x08, 0x20, 0xea, 0xd2, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 40; + RunTest(); +} +////////////////////////////////////////////////////////////////////// +} // namespace +} // namespace wvodk_test diff --git a/oemcrypto/odk/test/odk_test.cpp b/oemcrypto/odk/test/odk_test.cpp index a244d25b..5fafb070 100644 --- a/oemcrypto/odk/test/odk_test.cpp +++ b/oemcrypto/odk/test/odk_test.cpp @@ -872,6 +872,7 @@ std::vector TestCases() { {17, 16, 5, 16, 5}, {17, 17, 0, 17, 0}, {17, 17, 1, 17, 1}, + {17, 17, 2, 17, 2}, }; return test_cases; } diff --git a/oemcrypto/odk/test/odk_test.gypi b/oemcrypto/odk/test/odk_test.gypi index 0cb8a00e..4eb3b186 100644 --- a/oemcrypto/odk/test/odk_test.gypi +++ b/oemcrypto/odk/test/odk_test.gypi @@ -4,6 +4,8 @@ { 'sources': [ + 'odk_golden_v16.cpp', + 'odk_golden_v17.cpp', 'odk_test.cpp', 'odk_test_helper.cpp', 'odk_test_helper.h', diff --git a/oemcrypto/test/GEN_api_lock_file.c b/oemcrypto/test/GEN_api_lock_file.c new file mode 100644 index 00000000..37e577e6 --- /dev/null +++ b/oemcrypto/test/GEN_api_lock_file.c @@ -0,0 +1,306 @@ +// Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine License +// Agreement. +// +// This code is semi-auto-generated, do not edit unless you know what you are +// doing. The script oemcrypto/lock-api-for-release will append to this file. +// +// If this file does not build, then you have modified an OEMCrypto API +// function. Instead, you should rename the old function and give the modified +// function a new oecc number. + +#include "OEMCryptoCENC.h" + +// This initial generation of this file was for v16.4, so older functions will +// not have an accurate version number. + +OEMCryptoResult _oecc84(const uint8_t* sandbox_id, size_t sandbox_id_length); +OEMCryptoResult _oecc01(void); +OEMCryptoResult _oecc02(void); +OEMCryptoResult _oecc09(OEMCrypto_SESSION* session); +OEMCryptoResult _oecc10(OEMCrypto_SESSION session); +OEMCryptoResult _oecc95(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* mac_key_context, + size_t mac_key_context_length, + const OEMCrypto_SharedMemory* enc_key_context, + size_t enc_key_context_length); +OEMCryptoResult _oecc21(OEMCrypto_SESSION session, + const uint8_t* derivation_key, + size_t derivation_key_length, + const OEMCrypto_SharedMemory* mac_key_context, + size_t mac_key_context_length, + const OEMCrypto_SharedMemory* enc_key_context, + size_t enc_key_context_length); +OEMCryptoResult _oecc14(OEMCrypto_SESSION session, uint32_t* nonce); +OEMCryptoResult _oecc96(OEMCrypto_SESSION session, uint8_t* message, + size_t message_length, size_t* core_message_size, + uint8_t* signature, size_t* signature_length); +OEMCryptoResult _oecc97(OEMCrypto_SESSION session, uint8_t* message, + size_t message_length, size_t* core_message_size, + uint8_t* signature, size_t* signature_length); +OEMCryptoResult _oecc98(OEMCrypto_SESSION session, uint8_t* message, + size_t message_length, size_t* core_message_size, + uint8_t* signature, size_t* signature_length); +OEMCryptoResult _oecc55(const uint8_t* buffer, size_t buffer_length); +OEMCryptoResult _oecc83( + OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, + const uint8_t* signature, size_t signature_length, + OEMCrypto_Substring enc_mac_keys_iv, OEMCrypto_Substring enc_mac_keys, + size_t key_array_length, const OEMCrypto_KeyObject* key_array, + OEMCrypto_Substring pst, OEMCrypto_Substring srm_restriction_data, + OEMCrypto_LicenseType license_type); +OEMCryptoResult _oecc99(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, size_t core_message_length, + const uint8_t* signature, size_t signature_length); +OEMCryptoResult _oecc92( + OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, + size_t key_array_length, + const OEMCrypto_EntitledContentKeyObject_V16* key_array); +OEMCryptoResult _oecc91(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, const uint8_t* signature, + size_t signature_length, size_t num_keys, + const OEMCrypto_KeyRefreshObject* key_array); +OEMCryptoResult _oecc101(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, size_t core_message_length, + const uint8_t* signature, size_t signature_length); +OEMCryptoResult _oecc41(OEMCrypto_SESSION session, + const uint8_t* content_key_id, + size_t content_key_id_length, + uint8_t* key_control_block, + size_t* key_control_block_length); +OEMCryptoResult _oecc81(OEMCrypto_SESSION session, + const uint8_t* content_key_id, + size_t content_key_id_length, + OEMCryptoCipherMode cipher_mode); +OEMCryptoResult _oecc105( + OEMCrypto_SESSION session, + const OEMCrypto_SampleDescription* samples, // an array of samples. + size_t samples_length, // the number of samples. + const OEMCrypto_CENCEncryptPatternDesc* pattern); +OEMCryptoResult _oecc93(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* data_addr, + size_t data_addr_length, + const OEMCrypto_DestBufferDesc* out_buffer_descriptor, + uint8_t subsample_flags); +OEMCryptoResult _oecc24(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* in_buffer, + size_t in_buffer_length, const uint8_t* iv, + OEMCrypto_Algorithm algorithm, + OEMCrypto_SharedMemory* out_buffer); +OEMCryptoResult _oecc25(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* in_buffer, + size_t in_buffer_length, const uint8_t* iv, + OEMCrypto_Algorithm algorithm, + OEMCrypto_SharedMemory* out_buffer); +OEMCryptoResult _oecc26(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* buffer, + size_t buffer_length, OEMCrypto_Algorithm algorithm, + OEMCrypto_SharedMemory* signature, + size_t* signature_length); +OEMCryptoResult _oecc27(OEMCrypto_SESSION session, + const OEMCrypto_SharedMemory* buffer, + size_t buffer_length, OEMCrypto_Algorithm algorithm, + const OEMCrypto_SharedMemory* signature, + size_t signature_length); +OEMCryptoResult _oecc08(const uint8_t* keybox_or_cert, + size_t keybox_or_cert_length, + uint8_t* wrapped_keybox_or_cert, + size_t* wrapped_keybox_or_cert_length, + const uint8_t* transport_key, + size_t transport_key_length); +OEMCryptoResult _oecc03(const uint8_t* keybox_or_cert, + size_t keybox_or_cert_length); +OEMCrypto_ProvisioningMethod _oecc49(void); +OEMCryptoResult _oecc05(void); +OEMCryptoResult _oecc07(uint8_t* device_id, size_t* device_id_length); +OEMCryptoResult _oecc04(uint8_t* key_data, size_t* key_data_length); +OEMCryptoResult _oecc78(const uint8_t* buffer, size_t buffer_length); +OEMCryptoResult _oecc103(OEMCrypto_SESSION session); +OEMCryptoResult _oecc104(uint8_t* public_cert, size_t* public_cert_length); +OEMCryptoResult _oecc06(uint8_t* random_data, size_t random_data_length); +uint32_t _oecc22(void); +uint32_t _oecc108(void); +uint8_t _oecc46(void); +OEMCryptoResult _oecc44(OEMCrypto_HDCP_Capability* current, + OEMCrypto_HDCP_Capability* maximum); +bool _oecc29(void); +size_t _oecc94(void); +bool _oecc39(void); +OEMCryptoResult _oecc38(size_t* count); +OEMCryptoResult _oecc37(size_t* max); +uint32_t _oecc52(void); +bool _oecc53(void); +OEMCryptoResult _oecc54(uint16_t* version); +uint32_t _oecc71(void); +uint32_t _oecc85(void); +OEMCryptoResult _oecc102(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, size_t core_message_length, + const uint8_t* signature, size_t signature_length, + uint8_t* wrapped_private_key, + size_t* wrapped_private_key_length); +OEMCryptoResult _oecc107(OEMCrypto_SESSION session, + OEMCrypto_PrivateKeyType key_type, + const uint8_t* wrapped_private_key, + size_t wrapped_private_key_length); +OEMCryptoResult _oecc45(void); +OEMCryptoResult _oecc36(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, uint8_t* signature, + size_t* signature_length, + RSA_Padding_Scheme padding_scheme); +OEMCryptoResult _oecc61(uint8_t* header_buffer, size_t* header_buffer_length); +OEMCryptoResult _oecc62(const uint8_t* buffer, size_t buffer_length); +OEMCryptoResult _oecc63(OEMCrypto_SESSION session, + uint32_t* usage_entry_number); +OEMCryptoResult _oecc64(OEMCrypto_SESSION session, uint32_t usage_entry_number, + const uint8_t* buffer, size_t buffer_length); +OEMCryptoResult _oecc65(OEMCrypto_SESSION session, + OEMCrypto_SharedMemory* header_buffer, + size_t* header_buffer_length, + OEMCrypto_SharedMemory* entry_buffer, + size_t* entry_buffer_length); +OEMCryptoResult _oecc66(OEMCrypto_SESSION session, const uint8_t* pst, + size_t pst_length); +OEMCryptoResult _oecc32(OEMCrypto_SESSION session, const uint8_t* pst, + size_t pst_length, uint8_t* buffer, + size_t* buffer_length); +OEMCryptoResult _oecc68(OEMCrypto_SESSION session, uint32_t new_index); +OEMCryptoResult _oecc67(uint32_t new_entry_count, uint8_t* header_buffer, + size_t* header_buffer_length); +OEMCryptoResult _oecc57(void); +uint32_t _oecc86(void); +OEMCryptoResult _oecc88(OEMCrypto_SESSION session, uint32_t frame_number, + const uint8_t* hash, size_t hash_length); +OEMCryptoResult _oecc89(OEMCrypto_SESSION session, + uint32_t* failed_frame_number); +OEMCryptoResult _oecc109(OEMCrypto_SESSION session, size_t buffer_size, + OEMCrypto_DestBufferDesc* output_descriptor, + int* secure_fd); +OEMCryptoResult _oecc110(OEMCrypto_SESSION session, + OEMCrypto_DestBufferDesc* output_descriptor, + int secure_fd); +OEMCryptoResult _oecc115(uint32_t* ree_major, uint32_t* ree_minor, + uint32_t* tee_major, uint32_t* tee_minor); +OEMCryptoResult _oecc113(OEMCrypto_SESSION session, uint8_t* buffer, + size_t* buffer_length, uint32_t use_test_key); +OEMCryptoResult _oecc114(OEMCrypto_SESSION session, const uint8_t* buffer, + size_t buffer_length, uint32_t use_test_key); +OEMCryptoResult _oecc13(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, uint8_t* signature, + size_t* signature_length); +OEMCryptoResult _oecc51(OEMCrypto_SESSION session, + const uint32_t* unaligned_nonce, + const uint8_t* encrypted_message_key, + size_t encrypted_message_key_length, + const uint8_t* enc_rsa_key, size_t enc_rsa_key_length, + const uint8_t* enc_rsa_key_iv, uint8_t* wrapped_rsa_key, + size_t* wrapped_rsa_key_length); +OEMCryptoResult _oecc18(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, const uint8_t* signature, + size_t signature_length, + const uint32_t* unaligned_nonce, + const uint8_t* enc_rsa_key, size_t enc_rsa_key_length, + const uint8_t* enc_rsa_key_iv, uint8_t* wrapped_rsa_key, + size_t* wrapped_rsa_key_length); +OEMCryptoResult _oecc30(void); +OEMCryptoResult _oecc33(OEMCrypto_SESSION session, const uint8_t* pst, + size_t pst_length, const uint8_t* message, + size_t message_length, const uint8_t* signature, + size_t signature_length); +OEMCryptoResult _oecc43(const uint8_t* pst, size_t pst_length); +OEMCryptoResult _oecc69(OEMCrypto_SESSION session, const uint8_t* pst, + size_t pst_length); +OEMCryptoResult _oecc34(void); +OEMCryptoResult _oecc70(uint64_t time_since_license_received, + uint64_t time_since_first_decrypt, + uint64_t time_since_last_decrypt, + OEMCrypto_Usage_Entry_Status status, + uint8_t* server_mac_key, uint8_t* client_mac_key, + const uint8_t* pst, size_t pst_length); +OEMCryptoResult _oecc12(OEMCrypto_SESSION session, + const uint8_t* mac_key_context, + uint32_t mac_key_context_length, + const uint8_t* enc_key_context, + uint32_t enc_key_context_length); +OEMCryptoResult _oecc48(OEMCrypto_SESSION session, const uint8_t* data_addr, + size_t data_addr_length, bool is_encrypted, + const uint8_t* iv, + size_t block_offset, // used for CTR "cenc" mode only. + OEMCrypto_DestBufferDesc* out_buffer, + const OEMCrypto_CENCEncryptPatternDesc_V15* pattern, + uint8_t subsample_flags); +OEMCryptoResult _oecc50(OEMCrypto_SESSION session, uint8_t* public_cert, + size_t* public_cert_length); +OEMCryptoResult _oecc19(OEMCrypto_SESSION session, + const uint8_t* wrapped_rsa_key, + size_t wrapped_rsa_key_length); + +// OEMCrypto_Idle defined in v17.1 +OEMCryptoResult _oecc123(OEMCrypto_IdleState state, uint32_t os_specific_code); + +// OEMCrypto_Wake defined in v17.1 +OEMCryptoResult _oecc124(void); + +// OEMCrypto_CreateEntitledKeySession defined in v17.1 +OEMCryptoResult _oecc111(OEMCrypto_SESSION oec_session, + OEMCrypto_SESSION* key_session); + +// OEMCrypto_RemoveEntitledKeySession defined in v17.1 +OEMCryptoResult _oecc112(OEMCrypto_SESSION key_session); + +// OEMCrypto_LoadEntitledContentKeys defined in v17.1 +OEMCryptoResult _oecc121(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, size_t key_array_length, + const OEMCrypto_EntitledContentKeyObject* key_array); + +// OEMCrypto_BuildInformation defined in v17.1 +OEMCryptoResult _oecc125(char* buffer, size_t* buffer_length); + +// OEMCrypto_SecurityLevel defined in v17.1 +OEMCrypto_Security_Level _oecc126(void); + +// OEMCrypto_GetDTCP2Capability defined in v17.1 +OEMCryptoResult _oecc128(OEMCrypto_DTCP2_Capability* capability); + +// OEMCrypto_ProductionReady defined in v17.1 +OEMCryptoResult _oecc122(void); + +// OEMCrypto_GetWatermarkingSupport defined in v17.1 +OEMCrypto_WatermarkingSupport _oecc129(void); + +// OEMCrypto_ReuseUsageEntry defined in v17.1 +OEMCryptoResult _oecc127(OEMCrypto_SESSION session, + uint32_t usage_entry_number); + +// OEMCrypto_GetBootCertificateChain defined in v17.1 +OEMCryptoResult _oecc116(uint8_t* bcc, size_t* bcc_length, + uint8_t* additional_signature, + size_t* additional_signature_length); + +// OEMCrypto_GenerateCertificateKeyPair defined in v17.1 +OEMCryptoResult _oecc117(OEMCrypto_SESSION session, uint8_t* public_key, + size_t* public_key_length, + uint8_t* public_key_signature, + size_t* public_key_signature_length, + uint8_t* wrapped_private_key, + size_t* wrapped_private_key_length, + OEMCrypto_PrivateKeyType* key_type); + +// OEMCrypto_InstallOemPrivateKey defined in v17.1 +OEMCryptoResult _oecc118(OEMCrypto_SESSION session, + OEMCrypto_PrivateKeyType key_type, + const uint8_t* wrapped_private_key, + size_t wrapped_private_key_length); + +// OEMCrypto_ReassociateEntitledKeySession defined in v17.1 +OEMCryptoResult _oecc119(OEMCrypto_SESSION key_session, + OEMCrypto_SESSION oec_session); + +// OEMCrypto_LoadCasECMKeys defined in v17.1 +OEMCryptoResult _oecc120(OEMCrypto_SESSION session, const uint8_t* message, + size_t message_length, + const OEMCrypto_EntitledContentKeyObject* even_key, + const OEMCrypto_EntitledContentKeyObject* odd_key); + +// OEMCrypto_GetOEMKeyToken defined in v17.2 +OEMCryptoResult _oecc130(OEMCrypto_SESSION key_session, uint8_t* key_token, + size_t* key_token_length); diff --git a/oemcrypto/test/fuzz_tests/README.md b/oemcrypto/test/fuzz_tests/README.md index 3f664446..f4e86710 100644 --- a/oemcrypto/test/fuzz_tests/README.md +++ b/oemcrypto/test/fuzz_tests/README.md @@ -127,8 +127,7 @@ OEMCrypto implementations on linux. information locally. * Build and test fuzz scripts locally using following commands. The build - script builds fuzz binaries for both oemcrypto reference implementation - as well as opk implementation. + script builds fuzz binaries for opk implementation. ```shell $ cd PATH_TO_CDM_DIR diff --git a/oemcrypto/test/fuzz_tests/build_oemcrypto_fuzztests b/oemcrypto/test/fuzz_tests/build_oemcrypto_fuzztests index 2b8c9023..e1648604 100755 --- a/oemcrypto/test/fuzz_tests/build_oemcrypto_fuzztests +++ b/oemcrypto/test/fuzz_tests/build_oemcrypto_fuzztests @@ -6,18 +6,21 @@ set -ex +# CDM_DIR is used by several script, especially when there is some confusion +if [ -z "$CDM_DIR" ]; then + export CDM_DIR="$(readlink -e $(dirname $0)/../../..)" +fi +cd $CDM_DIR + export CXX=clang++ export CC=clang export GYP_DEFINES="$GYP_DEFINES clang=1" -export PATH_TO_CDM_DIR=. -export PYTHONPATH="$PYTHONPATH:$PATH_TO_CDM_DIR/third_party" +echo "CDM_DIR = $CDM_DIR" +export PYTHONPATH="$PYTHONPATH:$CDM_DIR/third_party" -python3 $PATH_TO_CDM_DIR/third_party/gyp/__init__.py --format=ninja \ - --depth=$(pwd) oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gyp -ninja -C out/Default # oemcrypto_opk_fuzztests.gypi has flags to instrument all the gyp targets # with fuzzer flags. -python3 $PATH_TO_CDM_DIR/third_party/gyp/__init__.py --format=ninja \ +python3 $CDM_DIR/third_party/gyp/__init__.py --format=ninja \ --depth=$(pwd) \ --include=oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi \ oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/1970fbbb5d20902996167f3309fbd38a6850b147 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/1970fbbb5d20902996167f3309fbd38a6850b147 deleted file mode 100644 index 3c2447f9..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/1970fbbb5d20902996167f3309fbd38a6850b147 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/23ef7d98cdd44b07f7a582b24e44984a835aeb59 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/23ef7d98cdd44b07f7a582b24e44984a835aeb59 new file mode 100644 index 00000000..71f0701a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/23ef7d98cdd44b07f7a582b24e44984a835aeb59 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/5812ad7753622d9177a1b3dd71c6c4a008ff54eb b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/5812ad7753622d9177a1b3dd71c6c4a008ff54eb deleted file mode 100644 index 46c70c78..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/5812ad7753622d9177a1b3dd71c6c4a008ff54eb and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/b02efc63fc06ecac3df93523d2318ec8a67e8d21 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/b02efc63fc06ecac3df93523d2318ec8a67e8d21 new file mode 100644 index 00000000..0cea3fe5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/b02efc63fc06ecac3df93523d2318ec8a67e8d21 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 new file mode 100644 index 00000000..dab87bf9 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0285ab6852dc82c1adee1ef77a6573df480161d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0285ab6852dc82c1adee1ef77a6573df480161d7 new file mode 100644 index 00000000..68f0ec7e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0285ab6852dc82c1adee1ef77a6573df480161d7 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03705943a03b55af8796a85ef076751c1a35dab3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03705943a03b55af8796a85ef076751c1a35dab3 new file mode 100644 index 00000000..c6d2bb41 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03705943a03b55af8796a85ef076751c1a35dab3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea new file mode 100644 index 00000000..8a128777 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/080308d9a78045272feb864835800f3c963e4110 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/080308d9a78045272feb864835800f3c963e4110 new file mode 100644 index 00000000..1829d600 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/080308d9a78045272feb864835800f3c963e4110 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/09064c11a50f1e5a7e3e561495aa4148c425ee41 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/09064c11a50f1e5a7e3e561495aa4148c425ee41 new file mode 100644 index 00000000..59420467 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/09064c11a50f1e5a7e3e561495aa4148c425ee41 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/096509f3e835e6235b48d6fb33ce73093f2996dc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/096509f3e835e6235b48d6fb33ce73093f2996dc new file mode 100644 index 00000000..92e9167b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/096509f3e835e6235b48d6fb33ce73093f2996dc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 new file mode 100644 index 00000000..3b169bf4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10da8c370429a6a450d5ad0ee563653d18dbfeb8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10da8c370429a6a450d5ad0ee563653d18dbfeb8 deleted file mode 100644 index 129e7c5a..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10da8c370429a6a450d5ad0ee563653d18dbfeb8 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10e69df82df7df7a5d3cffe390d5073a37527c78 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10e69df82df7df7a5d3cffe390d5073a37527c78 new file mode 100644 index 00000000..7d8812f6 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10e69df82df7df7a5d3cffe390d5073a37527c78 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1121c84038be5099dc3ce3d2d69d5e8d0b094c98 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1121c84038be5099dc3ce3d2d69d5e8d0b094c98 new file mode 100644 index 00000000..6240f90b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1121c84038be5099dc3ce3d2d69d5e8d0b094c98 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d new file mode 100644 index 00000000..294f86c9 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 new file mode 100644 index 00000000..8150c2fe Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11c19b2cc104b1cf85422685340d5e917498ee16 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11c19b2cc104b1cf85422685340d5e917498ee16 new file mode 100644 index 00000000..d41a2500 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11c19b2cc104b1cf85422685340d5e917498ee16 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/120f2cfe38baa03b5d58dcbc3b0be49d21f3c869 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/120f2cfe38baa03b5d58dcbc3b0be49d21f3c869 new file mode 100644 index 00000000..4a63de93 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/120f2cfe38baa03b5d58dcbc3b0be49d21f3c869 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 new file mode 100644 index 00000000..138d4de3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/151941252771d6c9173ee1397d457db28bc20059 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/151941252771d6c9173ee1397d457db28bc20059 new file mode 100644 index 00000000..9bf34d9a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/151941252771d6c9173ee1397d457db28bc20059 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1522db2eb65a0eafe367151d77b3a4dbfe65bee4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1522db2eb65a0eafe367151d77b3a4dbfe65bee4 new file mode 100644 index 00000000..8e30396c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1522db2eb65a0eafe367151d77b3a4dbfe65bee4 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca new file mode 100644 index 00000000..1fec89e3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/180835f71f4a9bfde27b61579c2a3a6d8d8e78ef b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/180835f71f4a9bfde27b61579c2a3a6d8d8e78ef new file mode 100644 index 00000000..c0cca326 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/180835f71f4a9bfde27b61579c2a3a6d8d8e78ef differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ae600c50a9a0bca685d7b83004fa3135901ded2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ae600c50a9a0bca685d7b83004fa3135901ded2 deleted file mode 100644 index 803d2150..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ae600c50a9a0bca685d7b83004fa3135901ded2 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 new file mode 100644 index 00000000..7d0336c1 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ba27988b89d8936e9237fb758059df1bc3ac36a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ba27988b89d8936e9237fb758059df1bc3ac36a new file mode 100644 index 00000000..7f3f4f93 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ba27988b89d8936e9237fb758059df1bc3ac36a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 new file mode 100644 index 00000000..401050ba Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1be21d7100f97ffba5b208ee5715d2f7531f383b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1be21d7100f97ffba5b208ee5715d2f7531f383b new file mode 100644 index 00000000..17f40daf Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1be21d7100f97ffba5b208ee5715d2f7531f383b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e new file mode 100644 index 00000000..44e1534d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 new file mode 100644 index 00000000..5afd7766 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21d16dc13d2b8103c7943a5bd960ebc77dfefde4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21d16dc13d2b8103c7943a5bd960ebc77dfefde4 deleted file mode 100644 index f3c738d5..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21d16dc13d2b8103c7943a5bd960ebc77dfefde4 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21f47f867c422f05c68997e44f395bf6d6d0c4b3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21f47f867c422f05c68997e44f395bf6d6d0c4b3 new file mode 100644 index 00000000..f8fcf3e5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21f47f867c422f05c68997e44f395bf6d6d0c4b3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/249806515cd342087c40b0d529e68ea01e1b128e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/249806515cd342087c40b0d529e68ea01e1b128e new file mode 100644 index 00000000..bbd0d2c7 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/249806515cd342087c40b0d529e68ea01e1b128e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/27c685d38645723287ce2a36cf338aa3126ca787 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/27c685d38645723287ce2a36cf338aa3126ca787 new file mode 100644 index 00000000..1d469640 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/27c685d38645723287ce2a36cf338aa3126ca787 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 new file mode 100644 index 00000000..87889171 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab new file mode 100644 index 00000000..88d5f374 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 new file mode 100644 index 00000000..a0f1c959 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a new file mode 100644 index 00000000..832f1d54 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/30bc1ad7affa6c1e83b008e02d3d78e765b27a6c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/30bc1ad7affa6c1e83b008e02d3d78e765b27a6c new file mode 100644 index 00000000..f960b3dc Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/30bc1ad7affa6c1e83b008e02d3d78e765b27a6c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 new file mode 100644 index 00000000..c03096db Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31cf7b90c83d6d4f1373d967fc7e230b13707cad b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31cf7b90c83d6d4f1373d967fc7e230b13707cad new file mode 100644 index 00000000..e1906992 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31cf7b90c83d6d4f1373d967fc7e230b13707cad differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/325cc084469713e200c0af60c74292f395da6064 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/325cc084469713e200c0af60c74292f395da6064 new file mode 100644 index 00000000..1a28b346 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/325cc084469713e200c0af60c74292f395da6064 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b new file mode 100644 index 00000000..cf6fd6c8 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 new file mode 100644 index 00000000..03fbf779 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca new file mode 100644 index 00000000..eb47250c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38d4821122ddf0e84dba312f444bfbef5b81cc9d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38d4821122ddf0e84dba312f444bfbef5b81cc9d deleted file mode 100644 index deaea68f..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38d4821122ddf0e84dba312f444bfbef5b81cc9d and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 new file mode 100644 index 00000000..5f345003 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cdf5d3cd5937b78d2560970a0ccce14fb0d0230 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cdf5d3cd5937b78d2560970a0ccce14fb0d0230 deleted file mode 100644 index 1daaa246..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cdf5d3cd5937b78d2560970a0ccce14fb0d0230 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cf22dc963d6705061004cb0fad32bdebc86ffc9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cf22dc963d6705061004cb0fad32bdebc86ffc9 deleted file mode 100644 index 30e88100..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cf22dc963d6705061004cb0fad32bdebc86ffc9 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3d891464eace6f7d3c716830e6051f7e90b90610 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3d891464eace6f7d3c716830e6051f7e90b90610 deleted file mode 100644 index 66ff92c3..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3d891464eace6f7d3c716830e6051f7e90b90610 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3db0d75cfdb383714d6bb3c1d7ededaed2123be1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3db0d75cfdb383714d6bb3c1d7ededaed2123be1 new file mode 100644 index 00000000..f1b831e4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3db0d75cfdb383714d6bb3c1d7ededaed2123be1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d new file mode 100644 index 00000000..41a05087 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/42105d003732a222e40d25c877bd182983d1d07e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/42105d003732a222e40d25c877bd182983d1d07e new file mode 100644 index 00000000..d846bb15 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/42105d003732a222e40d25c877bd182983d1d07e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe new file mode 100644 index 00000000..c82175e0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/456ce34099fe25289e165eaa1f93a94b8c0beee9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/456ce34099fe25289e165eaa1f93a94b8c0beee9 new file mode 100644 index 00000000..feff4faf Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/456ce34099fe25289e165eaa1f93a94b8c0beee9 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db new file mode 100644 index 00000000..c2860021 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e new file mode 100644 index 00000000..62c38203 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a new file mode 100644 index 00000000..09ef7f54 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4bda3ac6a2ed0e63735181845273e44ee096a02d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4bda3ac6a2ed0e63735181845273e44ee096a02d new file mode 100644 index 00000000..8a882cd3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4bda3ac6a2ed0e63735181845273e44ee096a02d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4be9a6a1a463c1babc2fc82de8b855c622227200 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4be9a6a1a463c1babc2fc82de8b855c622227200 new file mode 100644 index 00000000..8a57ebaf Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4be9a6a1a463c1babc2fc82de8b855c622227200 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4c4b4ac81d0444b917c445c46f568e1ade6eebc8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4c4b4ac81d0444b917c445c46f568e1ade6eebc8 new file mode 100644 index 00000000..c7c32e06 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4c4b4ac81d0444b917c445c46f568e1ade6eebc8 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f new file mode 100644 index 00000000..2be6fc5d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 new file mode 100644 index 00000000..41f3e792 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 new file mode 100644 index 00000000..5c2b1d54 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d new file mode 100644 index 00000000..b34e5b90 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb new file mode 100644 index 00000000..883d0779 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ac68c41431dc78942624816ddaf1c9284b90a1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ac68c41431dc78942624816ddaf1c9284b90a1 new file mode 100644 index 00000000..9a9b2b61 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ac68c41431dc78942624816ddaf1c9284b90a1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 new file mode 100644 index 00000000..4012771a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 new file mode 100644 index 00000000..f6db7363 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/649a785d4fa52fc0db4d90d51b084353ad1e6f6d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/649a785d4fa52fc0db4d90d51b084353ad1e6f6d new file mode 100644 index 00000000..69a3bb89 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/649a785d4fa52fc0db4d90d51b084353ad1e6f6d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 new file mode 100644 index 00000000..19c2474b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c new file mode 100644 index 00000000..f0af3576 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f new file mode 100644 index 00000000..294915bf Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f new file mode 100644 index 00000000..17a1a5fd Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 new file mode 100644 index 00000000..6f90ccea Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f63549f4969ebcf0d8504159519f9b20cb259aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f63549f4969ebcf0d8504159519f9b20cb259aa new file mode 100644 index 00000000..ed18658e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f63549f4969ebcf0d8504159519f9b20cb259aa differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f65463040c50e026e252e7544dff41babbc4604 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f65463040c50e026e252e7544dff41babbc4604 deleted file mode 100644 index a7629af7..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f65463040c50e026e252e7544dff41babbc4604 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/70daf8991859146fff0f147d190594f07b2952b3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/70daf8991859146fff0f147d190594f07b2952b3 new file mode 100644 index 00000000..23dda90b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/70daf8991859146fff0f147d190594f07b2952b3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/733b4e9024aa0f32227da45a08b12d0715ed0834 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/733b4e9024aa0f32227da45a08b12d0715ed0834 new file mode 100644 index 00000000..e605c211 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/733b4e9024aa0f32227da45a08b12d0715ed0834 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/737cd5853708e2d2732e4c54dc944bc54d522406 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/737cd5853708e2d2732e4c54dc944bc54d522406 deleted file mode 100644 index 93bed59a..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/737cd5853708e2d2732e4c54dc944bc54d522406 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 new file mode 100644 index 00000000..1ca4d68e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa new file mode 100644 index 00000000..1d950a89 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 new file mode 100644 index 00000000..50f265e8 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 new file mode 100644 index 00000000..df36b8b9 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d new file mode 100644 index 00000000..6c4b98b0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 new file mode 100644 index 00000000..e23426d9 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a new file mode 100644 index 00000000..b8d9ae10 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87bc4b02fd7544d306e8db2629ee73fda0e4d581 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87bc4b02fd7544d306e8db2629ee73fda0e4d581 new file mode 100644 index 00000000..9f35bef4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87bc4b02fd7544d306e8db2629ee73fda0e4d581 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87e457fd00f48571ecc482ca7ff96e3375869ac3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87e457fd00f48571ecc482ca7ff96e3375869ac3 new file mode 100644 index 00000000..97054f4d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87e457fd00f48571ecc482ca7ff96e3375869ac3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b7a5c18731be9ba1c9d836667ec007a4169de23 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b7a5c18731be9ba1c9d836667ec007a4169de23 new file mode 100644 index 00000000..57c6a928 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b7a5c18731be9ba1c9d836667ec007a4169de23 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8d47cedfb8c23677b10651e05645ab8b1835b6c1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8d47cedfb8c23677b10651e05645ab8b1835b6c1 new file mode 100644 index 00000000..3b1189fb Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8d47cedfb8c23677b10651e05645ab8b1835b6c1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 new file mode 100644 index 00000000..bc99f9e1 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d new file mode 100644 index 00000000..bdb8151d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 new file mode 100644 index 00000000..cd9b42c4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 new file mode 100644 index 00000000..02d61fb6 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96831b586053575d609e63674190dc3219b9a003 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96831b586053575d609e63674190dc3219b9a003 new file mode 100644 index 00000000..29cb89e5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96831b586053575d609e63674190dc3219b9a003 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96f9058e89bd44446e8f3e9f2eb62585668591f1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96f9058e89bd44446e8f3e9f2eb62585668591f1 new file mode 100644 index 00000000..b1979672 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96f9058e89bd44446e8f3e9f2eb62585668591f1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/970f2e92cbcc069ee31d32f5cda6c691b7ed7fc7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/970f2e92cbcc069ee31d32f5cda6c691b7ed7fc7 new file mode 100644 index 00000000..a0a20cd0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/970f2e92cbcc069ee31d32f5cda6c691b7ed7fc7 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97a3724c855e142691e1084ef45f02f614a032f4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97a3724c855e142691e1084ef45f02f614a032f4 new file mode 100644 index 00000000..4f1e3689 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97a3724c855e142691e1084ef45f02f614a032f4 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/988fc98ea6e4416b30e99ab39cd70813dd9ff828 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/988fc98ea6e4416b30e99ab39cd70813dd9ff828 new file mode 100644 index 00000000..54c72266 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/988fc98ea6e4416b30e99ab39cd70813dd9ff828 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9985d0be5ab329aaff9e18758af5cf7c2373b7f0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9985d0be5ab329aaff9e18758af5cf7c2373b7f0 new file mode 100644 index 00000000..8a42002b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9985d0be5ab329aaff9e18758af5cf7c2373b7f0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9a0b17f115defca3c9b789ea768168d18497bead b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9a0b17f115defca3c9b789ea768168d18497bead new file mode 100644 index 00000000..cc4c2059 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9a0b17f115defca3c9b789ea768168d18497bead differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9b75f20679a2ba1ef2163893322a81fe6c54a0cd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9b75f20679a2ba1ef2163893322a81fe6c54a0cd new file mode 100644 index 00000000..91390080 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9b75f20679a2ba1ef2163893322a81fe6c54a0cd differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad new file mode 100644 index 00000000..37f60800 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f7fefbfe661e56b0c07e931851389b041692567 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f7fefbfe661e56b0c07e931851389b041692567 new file mode 100644 index 00000000..99631e24 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f7fefbfe661e56b0c07e931851389b041692567 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9fa54bed19e057df5194cf2232117e86d3b6dc0b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9fa54bed19e057df5194cf2232117e86d3b6dc0b new file mode 100644 index 00000000..36197851 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9fa54bed19e057df5194cf2232117e86d3b6dc0b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0d791df464e8a918a4995759714b191f9a2930e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0d791df464e8a918a4995759714b191f9a2930e new file mode 100644 index 00000000..d6f29cf0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0d791df464e8a918a4995759714b191f9a2930e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a24f216f0ae2ae501bdd21cc9766ad46d51dce9f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a24f216f0ae2ae501bdd21cc9766ad46d51dce9f new file mode 100644 index 00000000..149b87e5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a24f216f0ae2ae501bdd21cc9766ad46d51dce9f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe new file mode 100644 index 00000000..bb0ecfe3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a667500363948869dfc72acbd781e14d0dcfd56c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a667500363948869dfc72acbd781e14d0dcfd56c new file mode 100644 index 00000000..1430671a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a667500363948869dfc72acbd781e14d0dcfd56c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a8a356518396fa5b41de3c2e9359b1a906c8ce12 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a8a356518396fa5b41de3c2e9359b1a906c8ce12 new file mode 100644 index 00000000..b43d6f33 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a8a356518396fa5b41de3c2e9359b1a906c8ce12 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a9d9462a602e9e54ebe86ad523a4cf509202239b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a9d9462a602e9e54ebe86ad523a4cf509202239b new file mode 100644 index 00000000..37870b7b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a9d9462a602e9e54ebe86ad523a4cf509202239b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/aacbeaf7eadf2c9354f8b5cef48604212008eb33 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/aacbeaf7eadf2c9354f8b5cef48604212008eb33 new file mode 100644 index 00000000..25525586 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/aacbeaf7eadf2c9354f8b5cef48604212008eb33 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 new file mode 100644 index 00000000..695b4d06 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adfd0ced22d4b14d9472dd39ef6ada4137180844 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adfd0ced22d4b14d9472dd39ef6ada4137180844 new file mode 100644 index 00000000..386fce1e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adfd0ced22d4b14d9472dd39ef6ada4137180844 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ae4904456f7c98fa460127cad5722629eaf375b7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ae4904456f7c98fa460127cad5722629eaf375b7 new file mode 100644 index 00000000..d569563f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ae4904456f7c98fa460127cad5722629eaf375b7 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 new file mode 100644 index 00000000..694a4256 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 new file mode 100644 index 00000000..5bff4213 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3ae974d2558a81d2ce7f10caacced4f1f47c533 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3ae974d2558a81d2ce7f10caacced4f1f47c533 new file mode 100644 index 00000000..c5dd32de Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3ae974d2558a81d2ce7f10caacced4f1f47c533 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c new file mode 100644 index 00000000..7bc1890c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 new file mode 100644 index 00000000..7bac769c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b53b0c974f3296788ed15885cdd393c19eaa833a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b53b0c974f3296788ed15885cdd393c19eaa833a new file mode 100644 index 00000000..f312dfc3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b53b0c974f3296788ed15885cdd393c19eaa833a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b572c5d6854c1a5048682c66e8856e9d36e7432d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b572c5d6854c1a5048682c66e8856e9d36e7432d new file mode 100644 index 00000000..60392716 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b572c5d6854c1a5048682c66e8856e9d36e7432d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b7360deec7bff31dae35d0dbdd8de5d275f1191a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b7360deec7bff31dae35d0dbdd8de5d275f1191a new file mode 100644 index 00000000..aa0e7f32 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b7360deec7bff31dae35d0dbdd8de5d275f1191a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 new file mode 100644 index 00000000..003ee32e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bc08741066ebc87d7d46ef6a5984971ae6186fa2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bc08741066ebc87d7d46ef6a5984971ae6186fa2 new file mode 100644 index 00000000..96440ae8 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bc08741066ebc87d7d46ef6a5984971ae6186fa2 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef new file mode 100644 index 00000000..8658752c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 new file mode 100644 index 00000000..9c364121 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 new file mode 100644 index 00000000..efbcc4d5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ca9956ae8e38e999ec3c5113d8b05888aad6ce25 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ca9956ae8e38e999ec3c5113d8b05888aad6ce25 new file mode 100644 index 00000000..6ddfeac3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ca9956ae8e38e999ec3c5113d8b05888aad6ce25 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cad65bde385d438eac3f1b3b54d9735c3ea1c475 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cad65bde385d438eac3f1b3b54d9735c3ea1c475 new file mode 100644 index 00000000..5e31df51 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cad65bde385d438eac3f1b3b54d9735c3ea1c475 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cb295c43921dc4bad7ea292e4b5dae704a18bc1f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cb295c43921dc4bad7ea292e4b5dae704a18bc1f new file mode 100644 index 00000000..f706ae5d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cb295c43921dc4bad7ea292e4b5dae704a18bc1f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c new file mode 100644 index 00000000..0d7a2932 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d32eb599a72c10c702179987c3bf9162c44e1a96 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d32eb599a72c10c702179987c3bf9162c44e1a96 new file mode 100644 index 00000000..6527a67a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d32eb599a72c10c702179987c3bf9162c44e1a96 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d3668cbdb23f199b8ecbf5f46a7fc2f03c6cb126 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d3668cbdb23f199b8ecbf5f46a7fc2f03c6cb126 new file mode 100644 index 00000000..6acee662 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d3668cbdb23f199b8ecbf5f46a7fc2f03c6cb126 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4be74f6acbd8a4ee481ce49a35659f7f3549e06 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4be74f6acbd8a4ee481ce49a35659f7f3549e06 new file mode 100644 index 00000000..dd9e5370 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4be74f6acbd8a4ee481ce49a35659f7f3549e06 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d53171a36056241ea76c8ae089770d740241ab4b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d53171a36056241ea76c8ae089770d740241ab4b new file mode 100644 index 00000000..b396c396 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d53171a36056241ea76c8ae089770d740241ab4b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d6210463c5504048832ec428987ae12196879dbf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d6210463c5504048832ec428987ae12196879dbf new file mode 100644 index 00000000..07b87a09 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d6210463c5504048832ec428987ae12196879dbf differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7041c3322321256350b0295456d933798b89c3b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7041c3322321256350b0295456d933798b89c3b new file mode 100644 index 00000000..6fdeda88 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7041c3322321256350b0295456d933798b89c3b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d775f9b5597e76cbf380ad74fea86c307c224309 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d775f9b5597e76cbf380ad74fea86c307c224309 deleted file mode 100644 index e6b86fa1..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d775f9b5597e76cbf380ad74fea86c307c224309 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa new file mode 100644 index 00000000..7bd771d6 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 new file mode 100644 index 00000000..8f86ed90 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/da19453351c3c97a6638c6459d5e6d52530ef2b0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/da19453351c3c97a6638c6459d5e6d52530ef2b0 new file mode 100644 index 00000000..06c9e0d6 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/da19453351c3c97a6638c6459d5e6d52530ef2b0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dacb7f933d8091949eb58a1d4742d63852b4940d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dacb7f933d8091949eb58a1d4742d63852b4940d new file mode 100644 index 00000000..81e2526e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dacb7f933d8091949eb58a1d4742d63852b4940d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db05326428a371755ad51eacbdce730d9fdfeb4e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db05326428a371755ad51eacbdce730d9fdfeb4e new file mode 100644 index 00000000..1d311d20 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db05326428a371755ad51eacbdce730d9fdfeb4e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd new file mode 100644 index 00000000..831373f4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d new file mode 100644 index 00000000..2e284a54 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0282b8026051307d6821f4214fd732a82d2ca14 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0282b8026051307d6821f4214fd732a82d2ca14 new file mode 100644 index 00000000..f34b0dc6 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0282b8026051307d6821f4214fd732a82d2ca14 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0a42c3dd45b6b2b1af036784202c319ca10f146 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0a42c3dd45b6b2b1af036784202c319ca10f146 new file mode 100644 index 00000000..37610f3b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0a42c3dd45b6b2b1af036784202c319ca10f146 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 new file mode 100644 index 00000000..4b796145 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e974276349af1ab8387631f597bfba994bd5da9c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e974276349af1ab8387631f597bfba994bd5da9c new file mode 100644 index 00000000..82a41d45 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e974276349af1ab8387631f597bfba994bd5da9c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9c4232d40cbc76f71220641ea9f8740bfedd306 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9c4232d40cbc76f71220641ea9f8740bfedd306 deleted file mode 100644 index d586f100..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9c4232d40cbc76f71220641ea9f8740bfedd306 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eaf3adf2980f1f1f021aafe465ec04d2bbf5d1ce b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eaf3adf2980f1f1f021aafe465ec04d2bbf5d1ce deleted file mode 100644 index a7dc6140..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eaf3adf2980f1f1f021aafe465ec04d2bbf5d1ce and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eb533db3c1a3fb6e75363004769aab5a45dedddb b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eb533db3c1a3fb6e75363004769aab5a45dedddb new file mode 100644 index 00000000..f0f3365c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eb533db3c1a3fb6e75363004769aab5a45dedddb differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 new file mode 100644 index 00000000..4ae7c11b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b new file mode 100644 index 00000000..8ce14364 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f64d8aac4b4c11f8226965fa11a2cfb4295f7987 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f64d8aac4b4c11f8226965fa11a2cfb4295f7987 new file mode 100644 index 00000000..d4b9e737 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f64d8aac4b4c11f8226965fa11a2cfb4295f7987 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f6c28150e2e1a1390516a09d453d33cb9a1337b4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f6c28150e2e1a1390516a09d453d33cb9a1337b4 deleted file mode 100644 index b9800961..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f6c28150e2e1a1390516a09d453d33cb9a1337b4 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f85ac377234f5f7b4b15ace9365eefae27881876 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f85ac377234f5f7b4b15ace9365eefae27881876 new file mode 100644 index 00000000..41d1e60e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f85ac377234f5f7b4b15ace9365eefae27881876 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f8eec32608e9d330b3973576735646427a6731f8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f8eec32608e9d330b3973576735646427a6731f8 new file mode 100644 index 00000000..32c83fdb Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f8eec32608e9d330b3973576735646427a6731f8 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fb655444ed95def5326f642c7ac3a6a7e7cae5de b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fb655444ed95def5326f642c7ac3a6a7e7cae5de new file mode 100644 index 00000000..8bff7854 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fb655444ed95def5326f642c7ac3a6a7e7cae5de differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fba13dc4063739e6d3b1651a742cfb80e5053fdf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fba13dc4063739e6d3b1651a742cfb80e5053fdf new file mode 100644 index 00000000..955f2767 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fba13dc4063739e6d3b1651a742cfb80e5053fdf differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fd63517f1edf14196b80b795c08995f3a4cdbd35 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fd63517f1edf14196b80b795c08995f3a4cdbd35 new file mode 100644 index 00000000..27e29c75 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fd63517f1edf14196b80b795c08995f3a4cdbd35 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e new file mode 100644 index 00000000..e90b6627 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c new file mode 100644 index 00000000..94594c4a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f deleted file mode 100644 index 411b41ca..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a deleted file mode 100644 index dd245f4a..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b deleted file mode 100644 index ff53f68f..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc new file mode 100644 index 00000000..7d7969da Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/b0b757465797a5e49307b325481c338ddb591afa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/b0b757465797a5e49307b325481c338ddb591afa new file mode 100644 index 00000000..19506468 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/b0b757465797a5e49307b325481c338ddb591afa differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 new file mode 100644 index 00000000..e12eb9db Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/374d2a1ab0be81451653b26a0ff99c2f20351700 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/898b59f382a227ba7f3977fabeecce928a1c8f33 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/374d2a1ab0be81451653b26a0ff99c2f20351700 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/898b59f382a227ba7f3977fabeecce928a1c8f33 index 561fce23..876de8a4 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/374d2a1ab0be81451653b26a0ff99c2f20351700 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/898b59f382a227ba7f3977fabeecce928a1c8f33 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7a883f7628e57eb5fe48d660fed48ac5da2f5d21 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/94dde36e88bca50f24c228c5e5e9811c711a1b49 similarity index 85% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7a883f7628e57eb5fe48d660fed48ac5da2f5d21 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/94dde36e88bca50f24c228c5e5e9811c711a1b49 index 2f041f70..3a9a4b84 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7a883f7628e57eb5fe48d660fed48ac5da2f5d21 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/94dde36e88bca50f24c228c5e5e9811c711a1b49 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 new file mode 100644 index 00000000..083b686e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/3f4491c53865cf9d8975423626980c1a5d547dae b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/3f4491c53865cf9d8975423626980c1a5d547dae new file mode 100644 index 00000000..94d5aa73 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/3f4491c53865cf9d8975423626980c1a5d547dae differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/401f966cf4d9f594cd993c9e429833ae2b298f2b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/401f966cf4d9f594cd993c9e429833ae2b298f2b new file mode 100644 index 00000000..d2484b28 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/401f966cf4d9f594cd993c9e429833ae2b298f2b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/44c74993d4832e49d818af03c8469ceb6482802f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/44c74993d4832e49d818af03c8469ceb6482802f new file mode 100644 index 00000000..1cb22732 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/44c74993d4832e49d818af03c8469ceb6482802f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/6a7338ef51621a3936d362be039348682d3f42bc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/6a7338ef51621a3936d362be039348682d3f42bc new file mode 100644 index 00000000..477306ba Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/6a7338ef51621a3936d362be039348682d3f42bc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7196add7d06e51a0b6a583581f81dac29df69f7b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7196add7d06e51a0b6a583581f81dac29df69f7b new file mode 100644 index 00000000..231f7f81 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7196add7d06e51a0b6a583581f81dac29df69f7b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a591b11c7ff1f45e8edb1a055a3255edb247576d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 similarity index 63% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a591b11c7ff1f45e8edb1a055a3255edb247576d rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 index f5dc76e4..ee4a672f 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a591b11c7ff1f45e8edb1a055a3255edb247576d and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/78c3819333632152791a0a58eacbd67ca19abc4e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/78c3819333632152791a0a58eacbd67ca19abc4e new file mode 100644 index 00000000..a92d1632 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/78c3819333632152791a0a58eacbd67ca19abc4e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/814054a30f7cdc10e4d83e48e6a5b00becf46cf1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/814054a30f7cdc10e4d83e48e6a5b00becf46cf1 new file mode 100644 index 00000000..112ab0f1 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/814054a30f7cdc10e4d83e48e6a5b00becf46cf1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/8c4ea32a7996921e51ec7717035f2826eb9d0853 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/8c4ea32a7996921e51ec7717035f2826eb9d0853 new file mode 100644 index 00000000..4d62d872 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/8c4ea32a7996921e51ec7717035f2826eb9d0853 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9628ef383581ef1f7591d4316fd75276959c2cab b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9628ef383581ef1f7591d4316fd75276959c2cab new file mode 100644 index 00000000..131cd7aa Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9628ef383581ef1f7591d4316fd75276959c2cab differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9b80edcb955ebf5d52f0e9c754a51aafd03a032d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9b80edcb955ebf5d52f0e9c754a51aafd03a032d new file mode 100644 index 00000000..2701f83f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9b80edcb955ebf5d52f0e9c754a51aafd03a032d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a5c27f614414c51fafa12bbc298f061d111ac5dd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a5c27f614414c51fafa12bbc298f061d111ac5dd new file mode 100644 index 00000000..4ceea01e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a5c27f614414c51fafa12bbc298f061d111ac5dd differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a6873ce79ac837648b62cf89f6c568706ac00c99 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a6873ce79ac837648b62cf89f6c568706ac00c99 new file mode 100644 index 00000000..c3c516ab Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a6873ce79ac837648b62cf89f6c568706ac00c99 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/b93ff0791e1995e5014d1b717afda122e6ade75f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/b93ff0791e1995e5014d1b717afda122e6ade75f new file mode 100644 index 00000000..4114ff6c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/b93ff0791e1995e5014d1b717afda122e6ade75f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c182ac7556d1cd1ed73da74882dee807381f3ee0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c179fc48504dbe00aa946d65d71e2a0165423b2f similarity index 63% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c182ac7556d1cd1ed73da74882dee807381f3ee0 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c179fc48504dbe00aa946d65d71e2a0165423b2f index 7a2af725..8bda288a 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c182ac7556d1cd1ed73da74882dee807381f3ee0 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c179fc48504dbe00aa946d65d71e2a0165423b2f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/cf7792686f978e3b5c6105d97a3a7c9837368f0d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/cf7792686f978e3b5c6105d97a3a7c9837368f0d new file mode 100644 index 00000000..fc9409f1 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/cf7792686f978e3b5c6105d97a3a7c9837368f0d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/e007898e3ade64f83149acb974f39b00ed05cde4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/e007898e3ade64f83149acb974f39b00ed05cde4 new file mode 100644 index 00000000..e637ca1b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/e007898e3ade64f83149acb974f39b00ed05cde4 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 new file mode 100644 index 00000000..2f4df33c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c new file mode 100644 index 00000000..7d11b568 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1bac9ff28790816e80d3f7f2c87f72c3d5485987 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1bac9ff28790816e80d3f7f2c87f72c3d5485987 new file mode 100644 index 00000000..af5021de Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1bac9ff28790816e80d3f7f2c87f72c3d5485987 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1c2e50d75ca628b62b3b05ffe17dcb0bd815074d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1c2e50d75ca628b62b3b05ffe17dcb0bd815074d new file mode 100644 index 00000000..613b52f6 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1c2e50d75ca628b62b3b05ffe17dcb0bd815074d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/26dd022e20552f6c36def4f19eed5954e9ecbf08 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/26dd022e20552f6c36def4f19eed5954e9ecbf08 new file mode 100644 index 00000000..e80b5766 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/26dd022e20552f6c36def4f19eed5954e9ecbf08 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2b900789bbacbb6581ce5eb82cb32c845b74ac01 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2b900789bbacbb6581ce5eb82cb32c845b74ac01 new file mode 100644 index 00000000..039b9be7 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2b900789bbacbb6581ce5eb82cb32c845b74ac01 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc new file mode 100644 index 00000000..900a2019 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/3063b747267c41526835726740e2752b0efd277a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/3063b747267c41526835726740e2752b0efd277a new file mode 100644 index 00000000..41affc38 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/3063b747267c41526835726740e2752b0efd277a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/46e509ae9a53927b3c36f04c17cc4bffb9d63619 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/46e509ae9a53927b3c36f04c17cc4bffb9d63619 new file mode 100644 index 00000000..8ac3bac6 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/46e509ae9a53927b3c36f04c17cc4bffb9d63619 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe new file mode 100644 index 00000000..2864ac96 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e8535ce0b1c5294f35d4f957effef1532ac6560 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e8535ce0b1c5294f35d4f957effef1532ac6560 new file mode 100644 index 00000000..90e0108f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e8535ce0b1c5294f35d4f957effef1532ac6560 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a new file mode 100644 index 00000000..1c6aea4e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/5d798c32f5c1e458077509799531cca5ac956343 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/5d798c32f5c1e458077509799531cca5ac956343 new file mode 100644 index 00000000..43950c9e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/5d798c32f5c1e458077509799531cca5ac956343 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6008f01a62c84227dab6dd3187b4107465ebca14 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6008f01a62c84227dab6dd3187b4107465ebca14 new file mode 100644 index 00000000..2f0ec24c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6008f01a62c84227dab6dd3187b4107465ebca14 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60d8d9532b4dae783871f1befc1a71da4caa8405 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60d8d9532b4dae783871f1befc1a71da4caa8405 new file mode 100644 index 00000000..9167c83c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60d8d9532b4dae783871f1befc1a71da4caa8405 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60df090dd8440f5b29c173fc04e6ac4fd83fcfbf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60df090dd8440f5b29c173fc04e6ac4fd83fcfbf new file mode 100644 index 00000000..72c00efa Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60df090dd8440f5b29c173fc04e6ac4fd83fcfbf differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/67eb049639b91a7ad90147c323f4494d21ad92af b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/67eb049639b91a7ad90147c323f4494d21ad92af new file mode 100644 index 00000000..1c22e83b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/67eb049639b91a7ad90147c323f4494d21ad92af differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6aeafb823a606e97ab896a5fde5b2e771b1ddd86 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6aeafb823a606e97ab896a5fde5b2e771b1ddd86 new file mode 100644 index 00000000..b0ee50d3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6aeafb823a606e97ab896a5fde5b2e771b1ddd86 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 deleted file mode 100644 index baf0a05c..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/714731f02b06f331811f54cd92dede72377d6e7e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/714731f02b06f331811f54cd92dede72377d6e7e new file mode 100644 index 00000000..ac50b915 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/714731f02b06f331811f54cd92dede72377d6e7e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/72a401ddc314e9cdf3cd79080610a57cfedc47ad b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/72a401ddc314e9cdf3cd79080610a57cfedc47ad new file mode 100644 index 00000000..24b4ee1f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/72a401ddc314e9cdf3cd79080610a57cfedc47ad differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d deleted file mode 100644 index 4e600526..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8196b2365ca56224853dfeeddde216b4f467f0dd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8196b2365ca56224853dfeeddde216b4f467f0dd deleted file mode 100644 index 639ab6a0..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8196b2365ca56224853dfeeddde216b4f467f0dd and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 deleted file mode 100644 index 16a14bc7..00000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81dd1ccd2485b5f87a1bc69c337fbed7b46bb208 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81dd1ccd2485b5f87a1bc69c337fbed7b46bb208 new file mode 100644 index 00000000..2f0c8d4c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81dd1ccd2485b5f87a1bc69c337fbed7b46bb208 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8479d72571edf5016e1ea108d9fe5cde9aefb212 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8479d72571edf5016e1ea108d9fe5cde9aefb212 new file mode 100644 index 00000000..4b8218a7 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8479d72571edf5016e1ea108d9fe5cde9aefb212 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/92ebd373b454fa4569a884216e0382de5505a629 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/92ebd373b454fa4569a884216e0382de5505a629 new file mode 100644 index 00000000..651de5da Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/92ebd373b454fa4569a884216e0382de5505a629 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/93cd53951a9d66d88c5f67223becf152b59fcbdc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/93cd53951a9d66d88c5f67223becf152b59fcbdc new file mode 100644 index 00000000..93314a09 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/93cd53951a9d66d88c5f67223becf152b59fcbdc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/9808dd01e64b4afef70b73e36c4b535dd1cc66c5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/9808dd01e64b4afef70b73e36c4b535dd1cc66c5 new file mode 100644 index 00000000..950e043e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/9808dd01e64b4afef70b73e36c4b535dd1cc66c5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5c1794fbf1849e99591df8932fdd396605e9738 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5c1794fbf1849e99591df8932fdd396605e9738 new file mode 100644 index 00000000..cbaf7cc7 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5c1794fbf1849e99591df8932fdd396605e9738 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5df528e8b43462969b8b861342a1d61a0974275 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5df528e8b43462969b8b861342a1d61a0974275 new file mode 100644 index 00000000..a820254e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5df528e8b43462969b8b861342a1d61a0974275 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/ae43d3634880e8325da476ab4544faaff31d3165 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/ae43d3634880e8325da476ab4544faaff31d3165 new file mode 100644 index 00000000..d99206f0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/ae43d3634880e8325da476ab4544faaff31d3165 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/b64e63f278751a31b4bb63044b680811b0f6bcc9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/b64e63f278751a31b4bb63044b680811b0f6bcc9 new file mode 100644 index 00000000..55d7039d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/b64e63f278751a31b4bb63044b680811b0f6bcc9 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd1b8656218819db11065037bc8681fd2a113bf3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd1b8656218819db11065037bc8681fd2a113bf3 new file mode 100644 index 00000000..7b17d352 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd1b8656218819db11065037bc8681fd2a113bf3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd5fb0e7e72fb293d516857246e3b94941b76517 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd5fb0e7e72fb293d516857246e3b94941b76517 new file mode 100644 index 00000000..14f0e6cc Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd5fb0e7e72fb293d516857246e3b94941b76517 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/d6350f4e6eaff1726c48e6b283bbeae4f5b30468 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/d6350f4e6eaff1726c48e6b283bbeae4f5b30468 new file mode 100644 index 00000000..3f785b09 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/d6350f4e6eaff1726c48e6b283bbeae4f5b30468 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/dd618d63065009c9812b2834e623ae90cd363c1a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/dd618d63065009c9812b2834e623ae90cd363c1a new file mode 100644 index 00000000..0905ec19 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/dd618d63065009c9812b2834e623ae90cd363c1a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/debf636b4ae4c2b7ce3a14e866777e4a1bc10594 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/debf636b4ae4c2b7ce3a14e866777e4a1bc10594 new file mode 100644 index 00000000..bf169c2f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/debf636b4ae4c2b7ce3a14e866777e4a1bc10594 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 new file mode 100644 index 00000000..a414e819 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e4913cf245772fc597307400caa868f3da21a8f6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e4913cf245772fc597307400caa868f3da21a8f6 new file mode 100644 index 00000000..ffe0dc54 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e4913cf245772fc597307400caa868f3da21a8f6 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 new file mode 100644 index 00000000..8766c31d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/eb9d4867ea92f1abccb3495e9976bbd297df3f82 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/eb9d4867ea92f1abccb3495e9976bbd297df3f82 new file mode 100644 index 00000000..6b9777d4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/eb9d4867ea92f1abccb3495e9976bbd297df3f82 differ diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc index 26f48cdf..0c4d76d7 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc @@ -2,93 +2,88 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { -// Free dynamic memory allocated by fuzzer script. -void FreeOutputBuffers(OEMCrypto_SESSION session_id, - OEMCrypto_DestBufferDesc& output_descriptor, - int* secure_fd) { - switch (output_descriptor.type) { - case OEMCrypto_BufferType_Clear: { - delete[] output_descriptor.buffer.clear.clear_buffer; - break; - } - case OEMCrypto_BufferType_Secure: { - OEMCrypto_FreeSecureBuffer(session_id, &output_descriptor, *secure_fd); - break; - } - case OEMCrypto_BufferType_Direct: { - break; - } - } -} +namespace { -bool InitializeOutputBuffers(OEMCrypto_SESSION session_id, - OEMCrypto_DestBufferDesc& output_descriptor, - int* secure_fd, size_t input_buffer_size) { - switch (output_descriptor.type) { - case OEMCrypto_BufferType_Clear: { - output_descriptor.buffer.clear.clear_buffer = - new OEMCrypto_SharedMemory[input_buffer_size]; - return true; - } - case OEMCrypto_BufferType_Secure: { - OEMCryptoResult sts = OEMCrypto_AllocateSecureBuffer( - session_id, input_buffer_size, &output_descriptor, secure_fd); - return sts == OEMCrypto_SUCCESS; - } - case OEMCrypto_BufferType_Direct: { - return true; - } - } +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + return 0; } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - uint8_t subsample_flags; - // OEMCrypto_DestBufferDesc and a buffer from which data needs to be copied // are expected as inputs to copy buffer API. - // Input fuzzed data is interpreted as + // Input fuzzed data is interpreted as: // (OEMCrypto_DestBufferDesc | subsample_flags | input_buffer) - if (size <= sizeof(OEMCrypto_Copy_Buffer_Fuzz)) { + wvoec::OEMCrypto_Copy_Buffer_Fuzz fuzzed_structure; + if (size < sizeof(fuzzed_structure)) { return 0; } - OEMCrypto_Copy_Buffer_Fuzz fuzzed_structure; - // Fuzz dest_buffer_desc. - memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_BufferType_MaxValue, - &fuzzed_structure.dest_buffer_desc.type); + FuzzedDataProvider fuzzed_data(data, size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + wvoec::ConvertDataToValidEnum(OEMCrypto_BufferType_MaxValue, + fuzzed_structure.dest_buffer_desc.type); + fuzzed_structure.dest_buffer_desc.buffer_config %= + wvoec::MAX_FUZZ_OUTPUT_LENGTH + 1; + const std::vector input_buffer = + fuzzed_data.ConsumeRemainingBytes(); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Fuzz input buffer to be copied. - size_t input_buffer_size = size - sizeof(fuzzed_structure); + const uint32_t session_id = license_api_fuzz.session().session_id(); + + // Initialize output buffer. + OEMCrypto_DestBufferDesc dest_buffer_desc; int secure_fd = 0; - // Create output buffer pointers. If secure buffer is not supported, we - // explicitly convert to clear buffer and fuzz. - if (!InitializeOutputBuffers(session->session_id(), - fuzzed_structure.dest_buffer_desc, &secure_fd, - input_buffer_size)) { - LOGI( - "[OEMCrypto decrypt CENC fuzz] Secure buffers are not supported. Use " - "clear buffer instead."); - fuzzed_structure.dest_buffer_desc.type = OEMCrypto_BufferType_Clear; - InitializeOutputBuffers(session->session_id(), - fuzzed_structure.dest_buffer_desc, &secure_fd, - input_buffer_size); + dest_buffer_desc.type = fuzzed_structure.dest_buffer_desc.type; + switch (dest_buffer_desc.type) { + case OEMCrypto_BufferType_Clear: + dest_buffer_desc.buffer.clear.clear_buffer = + new OEMCrypto_SharedMemory[fuzzed_structure.dest_buffer_desc + .buffer_config]; + dest_buffer_desc.buffer.clear.clear_buffer_length = + fuzzed_structure.dest_buffer_desc.buffer_config; + break; + + case OEMCrypto_BufferType_Secure: + if (OEMCrypto_AllocateSecureBuffer( + session_id, fuzzed_structure.dest_buffer_desc.buffer_config, + &dest_buffer_desc, &secure_fd) != OEMCrypto_SUCCESS) { + return 0; + } + break; + + case OEMCrypto_BufferType_Direct: + dest_buffer_desc.buffer.direct.is_video = + fuzzed_structure.dest_buffer_desc.buffer_config & 1; + break; } - OEMCrypto_CopyBuffer(session->session_id(), data + sizeof(fuzzed_structure), - input_buffer_size, &fuzzed_structure.dest_buffer_desc, - subsample_flags); - FreeOutputBuffers(session->session_id(), fuzzed_structure.dest_buffer_desc, - &secure_fd); + + OEMCrypto_CopyBuffer(session_id, input_buffer.data(), input_buffer.size(), + &dest_buffer_desc, fuzzed_structure.subsample_flags); + + // Free output buffer. + switch (dest_buffer_desc.type) { + case OEMCrypto_BufferType_Clear: + delete[] dest_buffer_desc.buffer.clear.clear_buffer; + break; + + case OEMCrypto_BufferType_Secure: + OEMCrypto_FreeSecureBuffer(session_id, &dest_buffer_desc, secure_fd); + break; + + case OEMCrypto_BufferType_Direct: + break; + } + return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc new file mode 100644 index 00000000..07c0bd44 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); + + FuzzedDataProvider fuzzed_data(data, size); + + uint32_t key_session; + uint32_t* const key_session_ptr = + fuzzed_data.ConsumeBool() ? &key_session : nullptr; + + OEMCrypto_CreateEntitledKeySession(session_fuzz.session().session_id(), + key_session_ptr); + + if (key_session_ptr == nullptr || fuzzed_data.ConsumeBool()) { + key_session = fuzzed_data.ConsumeIntegral(); + } + + OEMCrypto_RemoveEntitledKeySession(key_session); + + session_fuzz.Terminate(); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc index 560a172d..47f39ef8 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc @@ -2,29 +2,24 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - // Open a session, create a usage entry. - Session* session = entry.license_messages().session(); - session->open(); - entry.InstallTestRSAKey(session); - session->GenerateNonce(); - session->CreateNewUsageEntry(); - vector encrypted_usage_header; - session->UpdateUsageEntry(&encrypted_usage_header); + entry.InstallTestRSAKey(); + entry.session().CreateNewUsageEntry(); + entry.session().GenerateNonce(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); // LoadLicense sets the pst for usage entry. entry.LoadLicense(); + OEMCrypto_DeactivateUsageEntry(entry.session().session_id(), data, size); + entry.Terminate(); - OEMCrypto_DeactivateUsageEntry(session->session_id(), data, size); - session->close(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc index eb1465ea..d67c2b45 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc @@ -2,186 +2,178 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_overflow.h" -namespace wvoec { -const size_t MAX_FUZZ_SAMPLE_SIZE = 5 * MB; -// Free dynamic memory allocated by fuzzer script. -void FreeOutputBuffers(OEMCrypto_SESSION session_id, - OEMCrypto_SampleDescription* sample_description, - size_t sample_index, int* secure_fd_array) { - for (size_t i = 0; i < sample_index; i++) { - OEMCrypto_DestBufferDesc fuzzed_output_descriptor = - sample_description[i].buffers.output_descriptor; - switch (fuzzed_output_descriptor.type) { - case OEMCrypto_BufferType_Clear: { - delete[] fuzzed_output_descriptor.buffer.clear.clear_buffer; - break; - } - case OEMCrypto_BufferType_Secure: { - OEMCrypto_FreeSecureBuffer(session_id, &fuzzed_output_descriptor, - secure_fd_array[i]); - break; - } - case OEMCrypto_BufferType_Direct: { - break; - } - } - } -} +namespace { -// Function to initialize output buffer pointers by allocating memory. -// Limiting output buffer size to 5 MB as 4 MB is maximum size specified -// by resource rating tier documentation. -bool InitializeOutputBuffers(OEMCrypto_SESSION session_id, - OEMCrypto_DestBufferDesc& output_descriptor, - size_t sample_index, - vector& secure_fd_array) { - switch (output_descriptor.type) { - case OEMCrypto_BufferType_Clear: { - output_descriptor.buffer.clear.clear_buffer = - new OEMCrypto_SharedMemory[std::min( - MAX_FUZZ_SAMPLE_SIZE, - output_descriptor.buffer.clear.clear_buffer_length)]; - return true; - } - case OEMCrypto_BufferType_Secure: { - int* secure_fd; - OEMCryptoResult sts = OEMCrypto_AllocateSecureBuffer( - session_id, - std::min(MAX_FUZZ_SAMPLE_SIZE, - output_descriptor.buffer.secure.secure_buffer_length), - &output_descriptor, secure_fd); - if (sts == OEMCrypto_SUCCESS) secure_fd_array[sample_index] = *secure_fd; - return sts == OEMCrypto_SUCCESS; - } - case OEMCrypto_BufferType_Direct: { - return true; - } - } +// Limit output buffer size to 5 MB as 4 MB is maximum size specified by +// resource rating tier documentation. +constexpr size_t MAX_FUZZ_SAMPLE_SIZE = 5 * wvoec::MB; + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicense(); + return 0; } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - size_t samples_length; - // Split data using separator. - auto inputs = SplitInput(data, size); - if (inputs.size() < 2) { + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); + if (inputs.size() < 3) { return 0; } - OEMCrypto_Decrypt_Cenc_Fuzz fuzzed_structure; - if (inputs[0].size() < sizeof(fuzzed_structure)) { + // Read cipher mode and pattern from fuzzed data. + wvoec::OEMCrypto_Decrypt_Cenc_Fuzz fuzzed_structure; + if (inputs[0].size < sizeof(fuzzed_structure)) { return 0; } - // Copy OEMCrypto_Decrypt_Cenc_Fuzz from input data. - memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); + FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); - size_t remaining_size_for_samples = - inputs[0].size() - sizeof(fuzzed_structure); - // Initialize FDP structures to read data using inbuilt functions. - FuzzedDataProvider fuzzed_sample_data(data + sizeof(fuzzed_structure), - remaining_size_for_samples); - FuzzedDataProvider fuzzed_subsample_data(inputs[1].data(), inputs[1].size()); + // Allocate sample descriptions. + std::vector sample_descriptions( + fuzzed_data.remaining_bytes() / + sizeof(wvoec::OEMCrypto_SampleDescription_Fuzz)); - // Read subsamples from fuzzed data. - vector subsamples; - while (fuzzed_subsample_data.remaining_bytes() >= - sizeof(OEMCrypto_SubSampleDescription)) { - OEMCrypto_SubSampleDescription subsample; - fuzzed_subsample_data.ConsumeData(&subsample, - sizeof(OEMCrypto_SubSampleDescription)); - subsamples.push_back(subsample); - } - if (subsamples.size() == 0) { - return 0; - } + // Allocate input buffers for each sample description. + std::vector> input_buffers( + sample_descriptions.size()); - // Infer samples_length from fuzzed data. - size_t sample_description_size = sizeof(OEMCrypto_SampleDescription); - samples_length = - fuzzed_sample_data.remaining_bytes() / sample_description_size; - if (samples_length == 0) { - return 0; - } + // Allocate secure_fd values for secure buffers. + std::vector secure_fd_array(sample_descriptions.size()); - // Initialize sample_descriptions array. - vector sample_descriptions(samples_length); - // Create array to maintain secure_fd buffer values for secure buffers. - vector secure_fd_array(samples_length); + // Allocate subsamples for each sample description. + std::vector> subsamples( + sample_descriptions.size()); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Copy samples from fuzzed data. - size_t input_subsample_index = 0; - size_t total_input_data_length = 0; - for (size_t i = 0; i < samples_length; i++) { - fuzzed_sample_data.ConsumeData(&sample_descriptions[i], - sample_description_size); - ConvertDataToValidEnum( + const uint32_t session_id = license_api_fuzz.session().session_id(); + + // Free first given number of output buffers. + const auto FreeOutputBuffers = [&sample_descriptions, session_id, + &secure_fd_array](size_t num_buffers) { + for (size_t i = 0; i < num_buffers; i++) { + OEMCrypto_DestBufferDesc& output_descriptor = + sample_descriptions[i].buffers.output_descriptor; + switch (output_descriptor.type) { + case OEMCrypto_BufferType_Clear: + delete[] output_descriptor.buffer.clear.clear_buffer; + break; + + case OEMCrypto_BufferType_Secure: + OEMCrypto_FreeSecureBuffer(session_id, &output_descriptor, + secure_fd_array[i]); + break; + + case OEMCrypto_BufferType_Direct: + break; + } + } + }; + + // Prepare each sample description. + FuzzedDataProvider& sample_description_data = fuzzed_data; + FuzzedDataProvider input_buffer_data(inputs[1].data, inputs[1].size); + FuzzedDataProvider subsample_data(inputs[2].data, inputs[2].size); + for (size_t i = 0; i < sample_descriptions.size(); i++) { + // Read and normalize sample description fuzzed properties. + wvoec::OEMCrypto_SampleDescription_Fuzz fuzzed_sample_description; + sample_description_data.ConsumeData(&fuzzed_sample_description, + sizeof(fuzzed_sample_description)); + fuzzed_sample_description.buffers.input_data_length %= + MAX_FUZZ_SAMPLE_SIZE + 1; + wvoec::ConvertDataToValidEnum( OEMCrypto_BufferType_MaxValue, - &sample_descriptions[i].buffers.output_descriptor.type); + fuzzed_sample_description.buffers.output_descriptor.type); + fuzzed_sample_description.buffers.output_descriptor.buffer_config %= + MAX_FUZZ_SAMPLE_SIZE + 1; - // Copy random data into input sample data. Cap input data length at 5 MB, - // 1 MB higher than that described by resource rating tier. - total_input_data_length += std::min( - MAX_FUZZ_SAMPLE_SIZE, sample_descriptions[i].buffers.input_data_length); - - // Copy sub sample data. - sample_descriptions[i].subsamples = &subsamples[input_subsample_index]; - if (OPK_AddOverflowUX(input_subsample_index, - sample_descriptions[i].subsamples_length, - &input_subsample_index)) { + // Read input data. + if (fuzzed_sample_description.buffers.input_data_length > + input_buffer_data.remaining_bytes()) { + FreeOutputBuffers(i); return 0; } - if (input_subsample_index > subsamples.size()) return 0; - } // Sample loop. + input_buffers[i] = input_buffer_data.ConsumeBytes( + fuzzed_sample_description.buffers.input_data_length); + sample_descriptions[i].buffers.input_data = input_buffers[i].data(); + sample_descriptions[i].buffers.input_data_length = input_buffers[i].size(); - // Allocate input/output buffers for each sample description. - vector input_buffer(total_input_data_length); - size_t input_buffer_index = 0; - for (size_t i = 0; i < samples_length; i++) { - sample_descriptions[i].buffers.input_data = - &input_buffer[input_buffer_index]; - input_buffer_index += std::min( - MAX_FUZZ_SAMPLE_SIZE, sample_descriptions[i].buffers.input_data_length); + // Set subsample data. + if (fuzzed_sample_description.subsamples_length > + subsample_data.remaining_bytes() / + sizeof(OEMCrypto_SubSampleDescription)) { + FreeOutputBuffers(i); + return 0; + } + if (fuzzed_sample_description.subsamples_length > 0) { + subsamples[i].resize(fuzzed_sample_description.subsamples_length); + subsample_data.ConsumeData( + subsamples[i].data(), + subsamples[i].size() * sizeof(OEMCrypto_SubSampleDescription)); + } + sample_descriptions[i].subsamples = subsamples[i].data(); + sample_descriptions[i].subsamples_length = subsamples[i].size(); - // Create output buffer pointers. If secure buffer is not supported, we - // explicitly convert to clear buffer and fuzz. - if (!InitializeOutputBuffers( - session->session_id(), - sample_descriptions[i].buffers.output_descriptor, i, - secure_fd_array)) { - LOGI( - "[OEMCrypto decrypt CENC fuzz] Secure buffers are not supported. Use " - "clear buffer instead."); - sample_descriptions[i].buffers.output_descriptor.type = - OEMCrypto_BufferType_Clear; - InitializeOutputBuffers(session->session_id(), - sample_descriptions[i].buffers.output_descriptor, - i, secure_fd_array); + // Set IV data. + memcpy(sample_descriptions[i].iv, fuzzed_sample_description.iv, + sizeof(sample_descriptions[i].iv)); + + // Initialize output buffer. + OEMCrypto_DestBufferDesc& output_descriptor = + sample_descriptions[i].buffers.output_descriptor; + const wvoec::OEMCrypto_DestBufferDesc_Fuzz& fuzzed_output_descriptor = + fuzzed_sample_description.buffers.output_descriptor; + output_descriptor.type = fuzzed_output_descriptor.type; + switch (output_descriptor.type) { + case OEMCrypto_BufferType_Clear: + output_descriptor.buffer.clear.clear_buffer = + new OEMCrypto_SharedMemory[fuzzed_output_descriptor.buffer_config]; + output_descriptor.buffer.clear.clear_buffer_length = + fuzzed_output_descriptor.buffer_config; + break; + + case OEMCrypto_BufferType_Secure: + if (OEMCrypto_AllocateSecureBuffer( + session_id, fuzzed_output_descriptor.buffer_config, + &output_descriptor, &secure_fd_array[i]) != OEMCrypto_SUCCESS) { + FreeOutputBuffers(i); + return 0; + } + break; + + case OEMCrypto_BufferType_Direct: + output_descriptor.buffer.direct.is_video = + fuzzed_output_descriptor.buffer_config & 1; + break; } } // Load license and call decrypt_cenc API. - license_api_fuzz.LoadLicense(); - OEMCrypto_SelectKey(session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, + const wvoec::MessageKeyData& key = + license_api_fuzz.session().license().keys[0]; + OEMCrypto_SelectKey(session_id, key.key_id, key.key_id_length, fuzzed_structure.cipher_mode); - OEMCrypto_DecryptCENC(session->session_id(), sample_descriptions.data(), - samples_length, &fuzzed_structure.pattern); - FreeOutputBuffers(session->session_id(), sample_descriptions.data(), - samples_length, secure_fd_array.data()); + OEMCrypto_DecryptCENC(session_id, sample_descriptions.data(), + sample_descriptions.size(), &fuzzed_structure.pattern); + + // Free all output buffers. + FreeOutputBuffers(sample_descriptions.size()); + return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc new file mode 100644 index 00000000..3ee5523b --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); + + FuzzedDataProvider fuzzed_data(data, size); + + if (fuzzed_data.ConsumeBool()) { + license_api_fuzz.license_messages().set_control( + license_api_fuzz.license_messages().control() | + wvoec::kControlAllowHashVerification); + } + + const uint32_t session_id = license_api_fuzz.session().session_id(); + const std::array content_key_id{}; + const uint32_t frame_number = fuzzed_data.ConsumeIntegral(); + std::array sample_buffer{}; + + OEMCrypto_SubSampleDescription subsample; + subsample.num_bytes_clear = 0; + subsample.num_bytes_encrypted = sample_buffer.size(); + subsample.subsample_flags = + OEMCrypto_FirstSubsample | OEMCrypto_LastSubsample; + subsample.block_offset = 0; + + OEMCrypto_SampleDescription sample; + sample.buffers.input_data = sample_buffer.data(); + sample.buffers.input_data_length = sample_buffer.size(); + sample.buffers.output_descriptor.type = OEMCrypto_BufferType_Clear; + sample.buffers.output_descriptor.buffer.clear.clear_buffer = + sample_buffer.data(); + sample.buffers.output_descriptor.buffer.clear.clear_buffer_length = + sample_buffer.size(); + memset(sample.iv, 0, sizeof(sample.iv)); + sample.subsamples = &subsample; + sample.subsamples_length = 1; + + OEMCrypto_CENCEncryptPatternDesc pattern; + pattern.encrypt = 0; + pattern.skip = 0; + + uint32_t failed_frame_number_data; + uint32_t* const failed_frame_number = + fuzzed_data.ConsumeBool() ? &failed_frame_number_data : nullptr; + + const std::vector hash = + fuzzed_data.ConsumeRemainingBytes(); + + license_api_fuzz.LoadLicense(); + OEMCrypto_SelectKey(session_id, content_key_id.data(), content_key_id.size(), + OEMCrypto_CipherMode_CENC); + OEMCrypto_SetDecryptHash(session_id, frame_number, hash.data(), hash.size()); + OEMCrypto_DecryptCENC(session_id, &sample, 1, &pattern); + OEMCrypto_GetHashErrorCode(session_id, failed_frame_number); + + license_api_fuzz.Terminate(); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc index f76fafae..a5d058e3 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc @@ -1,36 +1,81 @@ // Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary // source code may only be used and distributed under the Widevine // License Agreement. + +#include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" namespace wvoec { + void RedirectStdoutToFile() { freopen("log.txt", "a", stdout); } -std::vector> SplitInput(const uint8_t* data, size_t size) { - std::vector> result; - auto current_pos = data; - auto end = data + size; - // Using memmem to find separator - while (const uint8_t* pos = reinterpret_cast( - memmem(current_pos, end - current_pos, kFuzzDataSeparator, - sizeof(kFuzzDataSeparator)))) { - result.push_back({current_pos, pos}); - current_pos = pos + sizeof(kFuzzDataSeparator); +std::vector SplitFuzzedData(const uint8_t* data, size_t size) { + std::vector result; + const uint8_t* const end = data + size; + // Using memmem to find separator. + while ( + const uint8_t* const separator = reinterpret_cast(memmem( + data, end - data, kFuzzDataSeparator, sizeof(kFuzzDataSeparator)))) { + result.push_back({data, static_cast(separator - data)}); + data = separator + sizeof(kFuzzDataSeparator); } - if (current_pos < end) { - result.push_back({current_pos, end}); + if (data < end) { + result.push_back({data, static_cast(end - data)}); } return result; } -void OEMCryptoLicenseAPIFuzz::LoadLicense() { +void InitializeFuzz(SessionUtil& session_util) { + wvoec::global_features.Initialize(); + OEMCrypto_SetSandbox(kTestSandbox, sizeof(kTestSandbox)); + OEMCrypto_Initialize(); + session_util.EnsureTestKeys(); +} + +void SessionFuzz::Initialize() { + InitializeFuzz(session_util_); + session_.open(); +} + +void SessionFuzz::Terminate() { + session_.close(); + OEMCrypto_Terminate(); +} + +void OEMCryptoLicenseAPIFuzz::Initialize() { + session_fuzz_.Initialize(); + session_fuzz_.InstallTestRSAKey(); + session_fuzz_.session().GenerateNonce(); +} + +void OEMCryptoLicenseAPIFuzz::Terminate() { + session_fuzz_.Terminate(); +} + +void OEMCryptoLicenseAPIFuzz::LoadLicense(bool generic_crypto_keys) { license_messages_.SignAndVerifyRequest(); - license_messages_.CreateDefaultResponse(); + if (generic_crypto_keys) { + license_messages_.CreateResponseWithGenericCryptoKeys(); + } else { + license_messages_.CreateDefaultResponse(); + } license_messages_.EncryptAndSignResponse(); OEMCryptoResult sts = license_messages_.LoadResponse(); CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); } +void OEMCryptoProvisioningAPIFuzz::Initialize() { + InitializeFuzz(session_util_); + + // Opens a session and Generates Nonce. + provisioning_messages_.PrepareSession(session_util_.keybox_); +} + +void OEMCryptoProvisioningAPIFuzz::Terminate() { + session_.close(); + OEMCrypto_Terminate(); +} + void OEMCryptoProvisioningAPIFuzz::LoadProvisioning() { provisioning_messages_.SignAndVerifyRequest(); provisioning_messages_.CreateDefaultResponse(); @@ -63,4 +108,5 @@ void CheckStatusAndExitFuzzerOnFailure(OEMCryptoResult result, abort(); } } + } // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h index 2aa1f46c..a60a9cf0 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h @@ -1,134 +1,214 @@ // Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary // source code may only be used and distributed under the Widevine // License Agreement. + #ifndef OEMCRYPTO_FUZZ_HELPER_H_ #define OEMCRYPTO_FUZZ_HELPER_H_ +#include +#include #include #include "FuzzedDataProvider.h" -#include "OEMCryptoCENC.h" #include "oec_device_features.h" #include "oemcrypto_corpus_generator_helper.h" #include "oemcrypto_session_tests_helper.h" -namespace wvoec { // Forward-declare the libFuzzer's mutator callback. Mark it weak so that // the program links successfully even outside of --config=asan-fuzzer // (apparently the only config in which LLVM uses our custom mutator). extern "C" size_t LLVMFuzzerMutate(uint8_t* Data, size_t Size, size_t MaxSize) __attribute__((weak)); -const size_t KB = 1024; -// Maximum signature length. If fuzzed signature length is greater that this, -// this value will be used for signature length. -const size_t MAX_FUZZ_SIGNATURE_LENGTH = 5 * KB; +namespace wvoec { + +constexpr size_t KB = 1024; + +// Default maximum length of fuzzing output parameters. +constexpr size_t MAX_FUZZ_OUTPUT_LENGTH = 5 * KB; + +// Fuzzed data region. +struct FuzzedData { + const uint8_t* data; + size_t size; +}; + // Initial setup to create a valid OEMCrypto state such as initializing crypto // firmware/hardware, installing golden key box etc. in order to fuzz // OEMCrypto APIs. -class InitializeFuzz : public SessionUtil { +void InitializeFuzz(SessionUtil& session_util); + +class SessionFuzz { public: - InitializeFuzz() { - wvoec::global_features.Initialize(); - OEMCrypto_SetSandbox(kTestSandbox, sizeof(kTestSandbox)); - OEMCrypto_Initialize(); - EnsureTestKeys(); + void Initialize(); + + void Terminate(); + + void InstallTestRSAKey() { + session_util_.InstallTestRSAKey(&session_); } - ~InitializeFuzz() { OEMCrypto_Terminate(); } + Session& session() { return session_; } + + const Session& session() const { return session_; } + + private: + SessionUtil session_util_; + Session session_; }; -class OEMCryptoLicenseAPIFuzz : public InitializeFuzz { +class OEMCryptoLicenseAPIFuzz { public: - OEMCryptoLicenseAPIFuzz() : license_messages_(&session_) { - session_.open(); - InstallTestRSAKey(&session_); - session_.GenerateNonce(); - } + OEMCryptoLicenseAPIFuzz() : license_messages_(&session_fuzz_.session()) {} - ~OEMCryptoLicenseAPIFuzz() { session_.close(); } + void Initialize(); + + void Terminate(); + + void LoadLicense() { LoadLicense(false); } + + void LoadLicenseWithGenericCryptoKeys() { LoadLicense(true); } LicenseRoundTrip& license_messages() { return license_messages_; } - Session* session() { return &session_; } + const LicenseRoundTrip& license_messages() const { return license_messages_; } - void LoadLicense(); + Session& session() { return session_fuzz_.session(); } + + const Session& session() const { return session_fuzz_.session(); } private: - Session session_; + void LoadLicense(bool generic_crypto_keys); + + SessionFuzz session_fuzz_; LicenseRoundTrip license_messages_; }; -class OEMCryptoProvisioningAPIFuzz : public InitializeFuzz { +class OEMCryptoProvisioningAPIFuzz { public: OEMCryptoProvisioningAPIFuzz() - : provisioning_messages_(&session_, encoded_rsa_key_) { - // Opens a session and Generates Nonce. - provisioning_messages_.PrepareSession(keybox_); - } + : provisioning_messages_(&session_, session_util_.encoded_rsa_key_) {} - ~OEMCryptoProvisioningAPIFuzz() { session_.close(); } + void Initialize(); + + void Terminate(); void LoadProvisioning(); + ProvisioningRoundTrip& provisioning_messages() { return provisioning_messages_; } - Session* session() { return &session_; } + + const ProvisioningRoundTrip& provisioning_messages() const { + return provisioning_messages_; + } + + Session& session() { return session_; } + + const Session& session() const { return session_; } private: + SessionUtil session_util_; Session session_; ProvisioningRoundTrip provisioning_messages_; }; // Initial setup to create a valid state such as creating session, installing // golden key box etc. in order to fuzz Load Renewal API. -class OEMCryptoRenewalAPIFuzz : public OEMCryptoLicenseAPIFuzz { +class OEMCryptoRenewalAPIFuzz { public: - OEMCryptoRenewalAPIFuzz() : renewal_messages_(&license_messages()) {} + OEMCryptoRenewalAPIFuzz() + : renewal_messages_(&license_api_fuzz_.license_messages()) {} + + void Initialize() { license_api_fuzz_.Initialize(); } + + void Terminate() { license_api_fuzz_.Terminate(); } + + LicenseRoundTrip& license_messages() { + return license_api_fuzz_.license_messages(); + } + + const LicenseRoundTrip& license_messages() const { + return license_api_fuzz_.license_messages(); + } RenewalRoundTrip& renewal_messages() { return renewal_messages_; } + const RenewalRoundTrip& renewal_messages() const { return renewal_messages_; } + private: + OEMCryptoLicenseAPIFuzz license_api_fuzz_; RenewalRoundTrip renewal_messages_; }; -class LicenseWithUsageEntryFuzz : public InitializeFuzz { +class LicenseWithUsageEntryFuzz { public: - LicenseWithUsageEntryFuzz() : license_messages_(&session_) { + LicenseWithUsageEntryFuzz() : license_messages_(&session_fuzz_.session()) { license_messages_.set_pst("my_pst"); } + void Initialize() { session_fuzz_.Initialize(); } + + void Terminate() { session_fuzz_.Terminate(); } + void CreateUsageTableHeader(); - LicenseRoundTrip& license_messages() { return license_messages_; } - const vector& encrypted_usage_header() { - return encrypted_usage_header_; - } + + void InstallTestRSAKey() { session_fuzz_.InstallTestRSAKey(); } + void LoadLicense(); + LicenseRoundTrip& license_messages() { return license_messages_; } + + const LicenseRoundTrip& license_messages() const { return license_messages_; } + + const std::vector& encrypted_usage_header() const { + return encrypted_usage_header_; + } + + Session& session() { return session_fuzz_.session(); } + + const Session& session() const { return session_fuzz_.session(); } + private: - vector encrypted_usage_header_; + SessionFuzz session_fuzz_; LicenseRoundTrip license_messages_; - Session session_; + std::vector encrypted_usage_header_; }; -// Convert data to valid enum value. +// Convert data from FuzzedDataProvider to valid enum value. template -void ConvertDataToValidEnum(T max_enum_value, T* t) { - FuzzedDataProvider fuzzed_enum_data(reinterpret_cast(t), sizeof(T)); - *t = static_cast(fuzzed_enum_data.ConsumeIntegralInRange( - 0, static_cast(max_enum_value))); +T ConvertDataToValidEnum(FuzzedDataProvider& fuzzed_data, T max_enum_value) { + using UnsignedT = + typename std::make_unsigned::type>::type; + return static_cast(fuzzed_data.ConsumeIntegralInRange( + 0, static_cast(max_enum_value))); +} + +// Convert data to valid enum value in place. +template +void ConvertDataToValidEnum(T max_enum_value, T& enum_data) { + using UnsignedT = + typename std::make_unsigned::type>::type; + UnsignedT data; + std::memcpy(&data, &enum_data, sizeof(T)); + const auto max_value = static_cast(max_enum_value); + if (data > max_value) { + enum_data = static_cast(data % (max_value + 1)); + } } // Redirect printf and log statements from oemcrypto functions to a file to // reduce noise void RedirectStdoutToFile(); -// Function to split fuzzer input using delimiter "-_^_". -std::vector> SplitInput(const uint8_t* data, size_t size); +// Split fuzzed data using delimiter "-_^_". +std::vector SplitFuzzedData(const uint8_t* data, size_t size); + // Check the status and exit fuzzer if arguments do not match. This is usually // called to check status of APIs which are called to setup state for fuzzers. void CheckStatusAndExitFuzzerOnFailure(OEMCryptoResult result, OEMCryptoResult expected_status); + } // namespace wvoec #endif // OEMCRYPTO_FUZZ_HELPER_H_ diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_structs.h b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_structs.h index 37b3daf7..42d077c1 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_structs.h +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_structs.h @@ -8,6 +8,26 @@ #include "odk.h" namespace wvoec { + +// OEMCrypto_DestBufferDesc fuzzed properties. +struct OEMCrypto_DestBufferDesc_Fuzz { + OEMCryptoBufferType type; + size_t buffer_config; +}; + +// OEMCrypto_InputOutputPair fuzzed properties. +struct OEMCrypto_InputOutputPair_Fuzz { + size_t input_data_length; + OEMCrypto_DestBufferDesc_Fuzz output_descriptor; +}; + +// OEMCrypto_SampleDescription fuzzed properties. +struct OEMCrypto_SampleDescription_Fuzz { + OEMCrypto_InputOutputPair_Fuzz buffers; + uint8_t iv[16]; + size_t subsamples_length; +}; + struct OEMCrypto_Renewal_Response_Fuzz { // Timer limits in core license response needs to be fuzzed as load renewal // depends on timer limits loaded from license response. @@ -50,16 +70,6 @@ struct OEMCrypto_Generic_Api_Fuzz { // this structure. }; -struct OEMCrypto_Generic_Verify_Fuzz { - // Corpus format is as belowr. - // cipher_mode + algorithm + signature_length + buffer with actual data - OEMCryptoCipherMode cipher_mode; - OEMCrypto_Algorithm algorithm; - size_t signature_length; - // Buffer data is of variable length and not included in - // this structure. -}; - struct OEMCrypto_Generate_RSA_Signature_Fuzz { // Corpus format is as below, let | be separator. // padding_scheme + signature_length + input buffer @@ -72,10 +82,11 @@ struct OEMCrypto_Generate_RSA_Signature_Fuzz { struct OEMCrypto_Copy_Buffer_Fuzz { // Corpus format is as below. // dest_buffer_desc + subsample_flags + input buffer - OEMCrypto_DestBufferDesc dest_buffer_desc; + OEMCrypto_DestBufferDesc_Fuzz dest_buffer_desc; uint8_t subsample_flags; // Input buffer of variable length is not included in this structure. }; + } // namespace wvoec -#endif // OEMCRYPTO_FUZZ_STRUCTS_H_ \ No newline at end of file +#endif // OEMCRYPTO_FUZZ_STRUCTS_H_ diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gyp b/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gyp deleted file mode 100644 index 458e3b85..00000000 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gyp +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary -#source code may only be used and distributed under the Widevine License -#Agreement. -# -# Builds under the CDM ./build.py (target platform) build system -# Refer to the distribution package's README for details. -{ - 'target_defaults': { - 'type': 'executable', - 'includes': [ - 'oemcrypto_fuzztests.gypi', - ], - }, - 'variables': { - # Flag to select appropriate underlying oemcrypto implementation when - # buiding fuzz binaries. - 'oemcrypto_implementation_version%': 'reference', - }, - 'targets': [ - { - 'target_name': 'oemcrypto_load_license_fuzz', - 'sources': [ - 'oemcrypto_load_license_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_provisioning_fuzz', - 'sources': [ - 'oemcrypto_load_provisioning_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_renewal_fuzz', - 'sources': [ - 'oemcrypto_load_renewal_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_license_request_fuzz', - 'sources': [ - 'oemcrypto_license_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_provisioning_request_fuzz', - 'sources': [ - 'oemcrypto_provisioning_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_renewal_request_fuzz', - 'sources': [ - 'oemcrypto_renewal_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_decrypt_cenc_fuzz', - 'sources': [ - 'oemcrypto_decrypt_cenc_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_entitled_content_keys_fuzz', - 'sources': [ - 'oemcrypto_load_entitled_content_keys_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_encrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_encrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_decrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_decrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_sign_fuzz', - 'sources': [ - 'oemcrypto_generic_sign_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_verify_fuzz', - 'sources': [ - 'oemcrypto_generic_verify_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generate_rsa_signature_fuzz', - 'sources': [ - 'oemcrypto_generate_rsa_signature_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_usage_table_header_fuzz', - 'sources': [ - 'oemcrypto_load_usage_table_header_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_load_usage_entry_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_deactivate_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_deactivate_usage_entry_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_report_usage_fuzz', - 'sources': [ - 'oemcrypto_report_usage_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_copy_buffer_fuzz', - 'sources': [ - 'oemcrypto_copy_buffer_fuzz.cc', - ], - }, - ], -} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi b/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi index f1064d86..f8abdecd 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi @@ -103,13 +103,6 @@ '-fcoverage-mapping', ], }], - ['oemcrypto_implementation_version=="reference"', { - # Include oemcrypto reference implementation code for building reference - # implementation fuzz binaries. - 'includes': [ - '../../ref/oec_ref.gypi', - ], - }], ['oemcrypto_implementation_version=="opk"', { # Include oemcrypto opk implementation code for building opk # implementation fuzz binaries. diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc new file mode 100644 index 00000000..cff4bd23 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoProvisioningAPIFuzz& provisioning_api_fuzz = + *new wvoec::OEMCryptoProvisioningAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + provisioning_api_fuzz.Initialize(); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // public_key and public_key_length parameters + size_t public_key_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector public_key(public_key_length_data); + size_t* const public_key_length = + fuzzed_data.ConsumeBool() ? &public_key_length_data : nullptr; + + // public_key_signature and public_key_signature_length parameters + size_t public_key_signature_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector public_key_signature(public_key_signature_length_data); + size_t* const public_key_signature_length = + fuzzed_data.ConsumeBool() ? &public_key_signature_length_data : nullptr; + + // wrapped_private_key and wrapped_private_key_length parameters + size_t wrapped_private_key_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector wrapped_private_key(wrapped_private_key_length_data); + size_t* const wrapped_private_key_length = + fuzzed_data.ConsumeBool() ? &wrapped_private_key_length_data : nullptr; + + // key_type parameter + OEMCrypto_PrivateKeyType key_type_data; + OEMCrypto_PrivateKeyType* const key_type = + fuzzed_data.ConsumeBool() ? &key_type_data : nullptr; + + OEMCrypto_GenerateCertificateKeyPair( + provisioning_api_fuzz.session().session_id(), public_key.data(), + public_key_length, public_key_signature.data(), + public_key_signature_length, wrapped_private_key.data(), + wrapped_private_key_length, key_type); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc index 872b302c..1537323d 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc @@ -2,33 +2,35 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + +#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" - -namespace wvoec { +#include "oemcrypto_fuzz_structs.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; - if (size <= sizeof(OEMCrypto_Generate_RSA_Signature_Fuzz)) { + wvoec::RedirectStdoutToFile(); + + wvoec::OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; + if (size < sizeof(fuzzed_structure)) { return 0; } + FuzzedDataProvider fuzzed_data(data, size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + fuzzed_structure.signature_length %= wvoec::MAX_FUZZ_OUTPUT_LENGTH + 1; + const std::vector message = + fuzzed_data.ConsumeRemainingBytes(); + std::vector signature(fuzzed_structure.signature_length); - // Copy data to fuzzed structure. - memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); - // Creates wrapped rsa key and calls load drm private key. - static OEMCryptoLicenseAPIFuzz license_api_fuzz; - // We cannot allocate buffers of random huge lengths in memory. - // This also slows down the fuzzer. - size_t signature_length = - std::min(MAX_FUZZ_SIGNATURE_LENGTH, fuzzed_structure.signature_length); - vector signature(signature_length); + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); + session_fuzz.InstallTestRSAKey(); OEMCrypto_GenerateRSASignature( - license_api_fuzz.session()->session_id(), data + sizeof(fuzzed_structure), - size - sizeof(fuzzed_structure), signature.data(), &signature_length, + session_fuzz.session().session_id(), message.data(), message.size(), + signature.data(), &fuzzed_structure.signature_length, fuzzed_structure.padding_scheme); + session_fuzz.Terminate(); + return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc deleted file mode 100644 index 19b60b78..00000000 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc +++ /dev/null @@ -1,36 +0,0 @@ -#include "properties.h" -#include "oemcrypto_session_tests_helper.h" - -using namespace wvoec; - -static bool is_init = false; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - SessionUtil session_helper; - if (!is_init) { - wvoec::global_features.Initialize(); - wvoec::global_features.RestrictFilter("*"); - wvutil::Properties::Init(); - is_init = true; - } - - OEMCrypto_Initialize(); - session_helper.EnsureTestKeys(); - - Session s; - s.open(); - s.GenerateDerivedKeysFromKeybox(session_helper.keybox_); - - static const uint32_t SignatureBufferMaxLength = size; - vector signature(SignatureBufferMaxLength); - size_t signature_length = signature.size(); - - OEMCryptoResult sts; - sts = OEMCrypto_GenerateSignature(s.session_id(), data, size, - &signature[0], &signature_length); - - s.close(); - OEMCrypto_Terminate(); - - return 0; -} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc index e36d5508..953a1d26 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc @@ -2,60 +2,64 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - // Split data using separator. - auto inputs = SplitInput(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 2) { return 0; } - OEMCrypto_Generic_Api_Fuzz fuzzed_structure; - if (inputs[0].size() < sizeof(fuzzed_structure)) { + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + if (inputs[0].size < sizeof(fuzzed_structure)) { return 0; } // Copy OEMCrypto_Generic_Api_Fuzz from input data. - memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); - + FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); // Copy iv from input data. - size_t iv_size = inputs[0].size() - sizeof(fuzzed_structure); - if (iv_size == 0) { - return 0; - } - vector iv(iv_size); - memcpy(iv.data(), data + sizeof(fuzzed_structure), iv_size); + constexpr size_t iv_length = 16; + const std::vector iv = fuzzed_data.ConsumeBytes( + fuzzed_data.remaining_bytes() < iv_length ? 0 : iv_length); - // Copy clear buffer from input data. - vector encrypted_buffer(inputs[1].size()); - vector clear_buffer(inputs[1].size()); - memcpy(encrypted_buffer.data(), inputs[1].data(), inputs[1].size()); + // Initialize encrypted and clear buffers. + const std::vector encrypted_buffer(inputs[1].data, + inputs[1].data + inputs[1].size); + std::vector clear_buffer(encrypted_buffer.size()); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_decrypt API. - license_api_fuzz.LoadLicense(); - OEMCryptoResult sts = OEMCrypto_SelectKey( - session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, fuzzed_structure.cipher_mode); - CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); - OEMCrypto_Generic_Decrypt(session->session_id(), encrypted_buffer.data(), + // Select key and decrypt. + wvoec::Session& session = license_api_fuzz.session(); + OEMCrypto_SelectKey(session.session_id(), session.license().keys[1].key_id, + session.license().keys[1].key_id_length, + fuzzed_structure.cipher_mode); + OEMCrypto_Generic_Decrypt(session.session_id(), encrypted_buffer.data(), encrypted_buffer.size(), iv.data(), fuzzed_structure.algorithm, clear_buffer.data()); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc index df0a35e9..dc2632a9 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc @@ -2,60 +2,64 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - // Split data using separator. - auto inputs = SplitInput(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 2) { return 0; } - OEMCrypto_Generic_Api_Fuzz fuzzed_structure; - if (inputs[0].size() < sizeof(fuzzed_structure)) { + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + if (inputs[0].size < sizeof(fuzzed_structure)) { return 0; } // Copy OEMCrypto_Generic_Api_Fuzz from input data. - memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); - + FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); // Copy iv from input data. - size_t iv_size = inputs[0].size() - sizeof(fuzzed_structure); - if (iv_size == 0) { - return 0; - } - vector iv(iv_size); - memcpy(iv.data(), data + sizeof(fuzzed_structure), iv_size); + constexpr size_t iv_length = 16; + const std::vector iv = fuzzed_data.ConsumeBytes( + fuzzed_data.remaining_bytes() < iv_length ? 0 : iv_length); - // Copy clear buffer from input data. - vector clear_buffer(inputs[1].size()); - vector encrypted_buffer(inputs[1].size()); - memcpy(clear_buffer.data(), inputs[1].data(), inputs[1].size()); + // Initialize clear and encrypted buffers. + const std::vector clear_buffer(inputs[1].data, + inputs[1].data + inputs[1].size); + std::vector encrypted_buffer(clear_buffer.size()); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_encrypt API. - license_api_fuzz.LoadLicense(); - OEMCryptoResult sts = OEMCrypto_SelectKey( - session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, fuzzed_structure.cipher_mode); - CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); + // Select key and encrypt. + wvoec::Session& session = license_api_fuzz.session(); + OEMCrypto_SelectKey(session.session_id(), session.license().keys[0].key_id, + session.license().keys[0].key_id_length, + fuzzed_structure.cipher_mode); OEMCrypto_Generic_Encrypt( - session->session_id(), clear_buffer.data(), clear_buffer.size(), - iv.data(), fuzzed_structure.algorithm, encrypted_buffer.data()); + session.session_id(), clear_buffer.data(), clear_buffer.size(), iv.data(), + fuzzed_structure.algorithm, encrypted_buffer.data()); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc index d27415d1..58962124 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc @@ -2,54 +2,56 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + +#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - - OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; if (size < sizeof(fuzzed_structure)) { return 0; } // Copy OEMCrypto_Generic_Api_Fuzz from input data. - memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); - - size_t clear_buffer_size = size - sizeof(fuzzed_structure); - if (clear_buffer_size == 0) { - return 0; - } + FuzzedDataProvider fuzzed_data(data, size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); // Copy clear buffer from input data. - vector clear_buffer(clear_buffer_size); - memcpy(clear_buffer.data(), data + sizeof(fuzzed_structure), - clear_buffer_size); + const std::vector clear_buffer = + fuzzed_data.ConsumeRemainingBytes(); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_sign API. - license_api_fuzz.LoadLicense(); - OEMCryptoResult sts = OEMCrypto_SelectKey( - session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, fuzzed_structure.cipher_mode); - CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); + // Select key and sign. + wvoec::Session& session = license_api_fuzz.session(); + OEMCrypto_SelectKey(session.session_id(), session.license().keys[2].key_id, + session.license().keys[2].key_id_length, + fuzzed_structure.cipher_mode); size_t signature_length = 0; - OEMCrypto_Generic_Sign(session->session_id(), clear_buffer.data(), + OEMCrypto_Generic_Sign(session.session_id(), clear_buffer.data(), clear_buffer.size(), fuzzed_structure.algorithm, nullptr, &signature_length); - vector signature(signature_length); - OEMCrypto_Generic_Sign(session->session_id(), clear_buffer.data(), + std::vector signature(signature_length); + OEMCrypto_Generic_Sign(session.session_id(), clear_buffer.data(), clear_buffer.size(), fuzzed_structure.algorithm, signature.data(), &signature_length); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc index 759286d3..57383344 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc @@ -2,66 +2,59 @@ // source code may only be used and distributed under the Widevine // License Agreement. -#include -#include +#include +#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); +namespace { - OEMCrypto_Generic_Verify_Fuzz fuzzed_structure; - if (size < sizeof(fuzzed_structure)) { - return 0; - } - // Copy OEMCrypto_Generic_Verify_Fuzz from input data. - memcpy(&fuzzed_structure, data, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; - size_t in_buffer_size = size - sizeof(fuzzed_structure); - if (in_buffer_size == 0) { - return 0; - } - // Copy clear buffer from input data. - vector in_buffer(in_buffer_size); - memcpy(in_buffer.data(), data + sizeof(fuzzed_structure), in_buffer_size); +} // namespace - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_verify API. - license_api_fuzz.LoadLicense(); - OEMCrypto_SelectKey(session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - OEMCrypto_CipherMode_CENC); - // Calculate signature for in buffer. - size_t signature_length = 0; - OEMCrypto_Generic_Sign(session->session_id(), in_buffer.data(), - in_buffer.size(), fuzzed_structure.algorithm, nullptr, - &signature_length); - vector signature(signature_length); - OEMCrypto_Generic_Sign(session->session_id(), in_buffer.data(), - in_buffer.size(), fuzzed_structure.algorithm, - signature.data(), &signature_length); - - OEMCrypto_SelectKey(session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_structure.cipher_mode); - signature_length = - std::min(MAX_FUZZ_SIGNATURE_LENGTH, fuzzed_structure.signature_length); - signature.resize(signature_length); - OEMCrypto_Generic_Verify(session->session_id(), in_buffer.data(), - in_buffer.size(), fuzzed_structure.algorithm, - signature.data(), signature_length); +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Split data using separator. + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); + if (inputs.size() < 2) { + return 0; + } + + // Deserialize fuzzed data. + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + if (inputs[0].size < sizeof(fuzzed_structure)) { + return 0; + } + FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); + const std::vector buffer = + fuzzed_data.ConsumeRemainingBytes(); + const std::vector signature(inputs[1].data, + inputs[1].data + inputs[1].size); + + // Select key and verify. + wvoec::Session& session = license_api_fuzz.session(); + OEMCrypto_SelectKey(session.session_id(), session.license().keys[3].key_id, + session.license().keys[3].key_id_length, + fuzzed_structure.cipher_mode); + OEMCrypto_Generic_Verify(session.session_id(), buffer.data(), buffer.size(), + fuzzed_structure.algorithm, signature.data(), + signature.size()); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc new file mode 100644 index 00000000..ea71f8ae --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc @@ -0,0 +1,41 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // bcc and bcc_length parameters + size_t bcc_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector bcc(bcc_length_data); + size_t* const bcc_length = + fuzzed_data.ConsumeBool() ? &bcc_length_data : nullptr; + + // additional_signature and additional_signature_length parameters + size_t additional_signature_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector additional_signature(additional_signature_length_data); + size_t* const additional_signature_length = + fuzzed_data.ConsumeBool() ? &additional_signature_length_data : nullptr; + + OEMCrypto_GetBootCertificateChain(bcc.data(), bcc_length, + additional_signature.data(), + additional_signature_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc new file mode 100644 index 00000000..e81f9565 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc @@ -0,0 +1,24 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + std::vector random_data( + FuzzedDataProvider(data, size) + .ConsumeIntegralInRange(0, wvoec::MAX_FUZZ_OUTPUT_LENGTH)); + OEMCrypto_GetRandom(random_data.data(), random_data.size()); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc new file mode 100644 index 00000000..310999c5 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc @@ -0,0 +1,25 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); + FuzzedDataProvider fuzzed_data(data, size); + const OEMCrypto_PrivateKeyType key_type = wvoec::ConvertDataToValidEnum( + fuzzed_data, OEMCrypto_PrivateKeyType_MaxValue); + const std::vector wrapped_private_key = + fuzzed_data.ConsumeRemainingBytes(); + OEMCrypto_InstallOemPrivateKey(session_fuzz.session().session_id(), key_type, + wrapped_private_key.data(), + wrapped_private_key.size()); + session_fuzz.Terminate(); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc index 52d34938..a0e53429 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc @@ -2,27 +2,26 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); + // Reject the input if it is less than fuzz data structure size. - if (size < sizeof(OEMCrypto_Request_Fuzz)) { + if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) { return 0; } // Input for license request API will be modified by OEMCrypto, hence it // cannot be a const. Fuzzer complains if const identifier is removed of data, // hence copying data into a non const pointer. - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - license_api_fuzz.license_messages().InjectFuzzedRequestData(input, size); - delete[] input; + std::vector input(data, data + size); + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); + license_api_fuzz.license_messages().InjectFuzzedRequestData(input.data(), + input.size()); + license_api_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc index fbb33e67..f0a9b45c 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc @@ -2,65 +2,55 @@ // source code may only be used and distributed under the Widevine // License Agreement. -#include "FuzzedDataProvider.h" -#include "oemcrypto_fuzz_helper.h" -#include "oemcrypto_fuzz_structs.h" +#include -namespace wvoec { +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); // Corpus format is as below, let | be separator. // message buffer with key data | entitled content key object array with // offsets and lengths to read key data from message buffer. // Split data using separator. - auto inputs = SplitInput(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 2) { return 0; } - FuzzedDataProvider fuzzed_entitled_content_key_array(inputs[1].data(), - inputs[1].size()); - - // Message to be verified. Return 0 if key data buffer is empty. - if (inputs[0].size() == 0) { - return 0; - } - // Copy data to OEMCrypto_EntitledContentKeyObject array. - size_t entitled_content_key_object_size = - sizeof(OEMCrypto_EntitledContentKeyObject); - size_t entitled_content_key_array_length = - fuzzed_entitled_content_key_array.remaining_bytes() / - entitled_content_key_object_size; - if (entitled_content_key_array_length == 0) { - return 0; - } - OEMCrypto_EntitledContentKeyObject* entitled_content_key_array = - new OEMCrypto_EntitledContentKeyObject[entitled_content_key_array_length]; - - for (size_t i = 0; i < entitled_content_key_array_length; i++) { - fuzzed_entitled_content_key_array.ConsumeData( - &entitled_content_key_array[i], entitled_content_key_object_size); + std::vector entitled_content_keys( + inputs[1].size / sizeof(OEMCrypto_EntitledContentKeyObject)); + if (!entitled_content_keys.empty()) { + memcpy(entitled_content_keys.data(), inputs[1].data, + entitled_content_keys.size() * + sizeof(OEMCrypto_EntitledContentKeyObject)); } - OEMCryptoLicenseAPIFuzz license_api_fuzz; + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); + // Setting up state. Load default entitlement license to load entitlement // keys into sessions key table. license_api_fuzz.license_messages().set_license_type( OEMCrypto_EntitlementLicense); license_api_fuzz.LoadLicense(); + + // Create entitled key session. + OEMCrypto_SESSION key_session; + const OEMCryptoResult result = OEMCrypto_CreateEntitledKeySession( + license_api_fuzz.session().session_id(), &key_session); + wvoec::CheckStatusAndExitFuzzerOnFailure(result, OEMCrypto_SUCCESS); + // Call OEMCrypto_LoadEntitledContentKeys with fuzzed buffers. - Session* session = license_api_fuzz.session(); - uint8_t* fuzzed_key_data = inputs[0].data(); - size_t fuzzed_key_data_size = inputs[0].size(); - OEMCrypto_LoadEntitledContentKeys( - session->session_id(), fuzzed_key_data, fuzzed_key_data_size, - entitled_content_key_array_length, entitled_content_key_array); - delete[] entitled_content_key_array; + const std::vector message(inputs[0].data, + inputs[0].data + inputs[0].size); + OEMCrypto_LoadEntitledContentKeys(key_session, message.data(), message.size(), + entitled_content_keys.size(), + entitled_content_keys.data()); + + license_api_fuzz.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc index 64f5f4b5..20b16f02 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc @@ -4,27 +4,26 @@ #include "oemcrypto_fuzz_helper.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - if (size < sizeof(ODK_ParsedLicense) + sizeof(MessageData)) { + wvoec::RedirectStdoutToFile(); + + if (size < sizeof(ODK_ParsedLicense) + sizeof(wvoec::MessageData)) { return 0; } - OEMCryptoLicenseAPIFuzz license_api_fuzz; + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); license_api_fuzz.license_messages().SignAndVerifyRequest(); // Interpreting input fuzz data as unencrypted (core_response + license // message data) from license server. license_api_fuzz.license_messages().InjectFuzzedResponseData(data, size); // Convert OEMCrypto_LicenseType in core_response to a valid enum value. - ConvertDataToValidEnum( + wvoec::ConvertDataToValidEnum( OEMCrypto_LicenseType_MaxValue, - &license_api_fuzz.license_messages().core_response().license_type); + license_api_fuzz.license_messages().core_response().license_type); license_api_fuzz.license_messages().EncryptAndSignResponse(); license_api_fuzz.license_messages().LoadResponse(); + license_api_fuzz.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc index 757ab241..bda7ce3b 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc @@ -4,17 +4,16 @@ #include "oemcrypto_fuzz_helper.h" -namespace wvoec { - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - if (size < sizeof(ODK_ParsedProvisioning) + sizeof(RSAPrivateKeyMessage)) { + wvoec::RedirectStdoutToFile(); + + if (size < + sizeof(ODK_ParsedProvisioning) + sizeof(wvoec::RSAPrivateKeyMessage)) { return 0; } - OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; + wvoec::OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; + provisioning_api_fuzz.Initialize(); provisioning_api_fuzz.provisioning_messages().SignAndVerifyRequest(); // Interpreting input fuzz data as unencrypted(core_response + provisioning // message data) from provisioning server. @@ -22,6 +21,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { size); provisioning_api_fuzz.provisioning_messages().EncryptAndSignResponse(); provisioning_api_fuzz.provisioning_messages().LoadResponse(); + provisioning_api_fuzz.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc index 1b6ecfc6..8957ee05 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc @@ -2,41 +2,41 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include "FuzzedDataProvider.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - if (size < sizeof(OEMCrypto_Renewal_Response_Fuzz)) { - return 0; - } + wvoec::RedirectStdoutToFile(); + // Copy input data to OEMCrypto_Renewal_Response_Fuzz and rest of message // into encrypted license_renewal_response. - OEMCrypto_Renewal_Response_Fuzz fuzzed_data; - memcpy(&fuzzed_data, data, sizeof(fuzzed_data)); - const uint8_t* renewal_response = - data + sizeof(OEMCrypto_Renewal_Response_Fuzz); - const size_t renewal_response_size = - size - sizeof(OEMCrypto_Renewal_Response_Fuzz); + wvoec::OEMCrypto_Renewal_Response_Fuzz fuzzed_structure; + if (size < sizeof(fuzzed_structure)) { + return 0; + } + FuzzedDataProvider fuzzed_data(data, size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + const std::vector renewal_response = + fuzzed_data.ConsumeRemainingBytes(); - OEMCryptoRenewalAPIFuzz renewal_response_fuzz; + wvoec::OEMCryptoRenewalAPIFuzz renewal_response_fuzz; + renewal_response_fuzz.Initialize(); renewal_response_fuzz.license_messages().SignAndVerifyRequest(); renewal_response_fuzz.license_messages().CreateDefaultResponse(); + // Inject timer limits from fuzzed input to timer_limits field from // core license response. - renewal_response_fuzz.license_messages().InjectFuzzedTimerLimits(fuzzed_data); + renewal_response_fuzz.license_messages().InjectFuzzedTimerLimits( + fuzzed_structure); renewal_response_fuzz.license_messages().EncryptAndSignResponse(); renewal_response_fuzz.license_messages().LoadResponse(); // Call renewal response API using fuzzed data. renewal_response_fuzz.renewal_messages().SignAndVerifyRequest(); renewal_response_fuzz.renewal_messages().InjectFuzzedResponseData( - fuzzed_data, renewal_response, renewal_response_size); + fuzzed_structure, renewal_response.data(), renewal_response.size()); renewal_response_fuzz.renewal_messages().LoadResponse(); + renewal_response_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc index ed47b0b2..de64eb1f 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc @@ -5,57 +5,62 @@ #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { -LicenseWithUsageEntryFuzz entry; +namespace { + +// Avoid calling non-trivial destructor. +wvoec::LicenseWithUsageEntryFuzz& entry = *new wvoec::LicenseWithUsageEntryFuzz; + +OEMCryptoResult LoadUsageEntryWithFuzzedData(OEMCrypto_SESSION session, + const uint8_t* data, size_t size) { + uint32_t usage_entry_number; + if (size < sizeof(usage_entry_number)) { + return OEMCrypto_ERROR_SHORT_BUFFER; + } + memcpy(&usage_entry_number, data, sizeof(usage_entry_number)); + const std::vector buffer(data + sizeof(usage_entry_number), + data + size); + return OEMCrypto_LoadUsageEntry(session, usage_entry_number, buffer.data(), + buffer.size()); +} + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + entry.Initialize(); + return 0; +} + // The custom mutator to mutate created encrypted usage entry. extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, size_t max_size, unsigned int seed) { entry.CreateUsageTableHeader(); - Session* s = entry.license_messages().session(); - s->open(); - entry.InstallTestRSAKey(s); - uint32_t usage_entry_number = 0; - memcpy(&usage_entry_number, data, sizeof(uint32_t)); - if (OEMCrypto_LoadUsageEntry(s->session_id(), usage_entry_number, - data + sizeof(uint32_t), - size - sizeof(uint32_t)) != OEMCrypto_SUCCESS) { - s->CreateNewUsageEntry(); - vector encrypted_usage_header; - s->UpdateUsageEntry(&encrypted_usage_header); - vector encrypted_usage_entry = s->encrypted_usage_entry(); - usage_entry_number = s->usage_entry_number(); + entry.session().open(); + entry.InstallTestRSAKey(); + if (LoadUsageEntryWithFuzzedData(entry.session().session_id(), data, size) != + OEMCrypto_SUCCESS) { + entry.session().CreateNewUsageEntry(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); + const uint32_t usage_entry_number = entry.session().usage_entry_number(); + const std::vector& encrypted_usage_entry = + entry.session().encrypted_usage_entry(); + size = sizeof(usage_entry_number) + encrypted_usage_entry.size(); + if (size > max_size) { + return 0; + } // Copy created usage entry number and usage entry to data and mutate it. - memcpy(data, &usage_entry_number, sizeof(uint32_t)); - memcpy(data + sizeof(uint32_t), encrypted_usage_entry.data(), + memcpy(data, &usage_entry_number, sizeof(usage_entry_number)); + memcpy(data + sizeof(usage_entry_number), encrypted_usage_entry.data(), encrypted_usage_entry.size()); - size = sizeof(uint32_t) + encrypted_usage_entry.size(); } - s->close(); + entry.session().close(); return LLVMFuzzerMutate(data, size, max_size); } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - - uint32_t usage_entry_number = 0; - if (size < sizeof(usage_entry_number)) { - return 0; - } - - memcpy(&usage_entry_number, data, sizeof(usage_entry_number)); - const uint8_t* extra_data = data + sizeof(usage_entry_number); - size_t extra_data_size = size - sizeof(usage_entry_number); - if (extra_data_size == 0) { - return 0; - } - - Session s; - s.open(); - OEMCrypto_LoadUsageEntry(s.session_id(), usage_entry_number, extra_data, - extra_data_size); - s.close(); + entry.session().open(); + LoadUsageEntryWithFuzzedData(entry.session().session_id(), data, size); + entry.session().close(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc index 8d3000af..ebf92fa2 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc @@ -5,32 +5,32 @@ #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { - // The custom mutator to mutate created encrypted usage table header. extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, size_t max_size, unsigned int seed) { - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); if (OEMCrypto_LoadUsageTableHeader(data, size) != OEMCrypto_SUCCESS) { entry.CreateUsageTableHeader(); - if (size < entry.encrypted_usage_header().size()) { + size = entry.encrypted_usage_header().size(); + if (size > max_size) { return 0; } // Copy created usage table header to data and mutate it. memcpy(data, entry.encrypted_usage_header().data(), entry.encrypted_usage_header().size()); - size = entry.encrypted_usage_header().size(); } + entry.Terminate(); return LLVMFuzzerMutate(data, size, max_size); } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); + // Initialize OEMCrypto and call API. - InitializeFuzz initialize_fuzz; + wvoec::SessionUtil session_util; + InitializeFuzz(session_util); OEMCrypto_LoadUsageTableHeader(data, size); + OEMCrypto_Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc new file mode 100644 index 00000000..1abd6fe4 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc @@ -0,0 +1,29 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine Master +// License Agreement. + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); + entry.CreateUsageTableHeader(); + entry.InstallTestRSAKey(); + entry.session().CreateNewUsageEntry(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); + entry.session().close(); + + entry.session().open(); + entry.session().ReloadUsageEntry(); + OEMCrypto_MoveEntry( + entry.session().session_id(), + FuzzedDataProvider(data, size).ConsumeIntegral()); + + entry.Terminate(); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc index 3fae8e6c..231cf406 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc @@ -1,42 +1,42 @@ -#include -#include +#include #include "opk_dispatcher.h" #include "opk_init.h" -#include "tos_transport_interface.h" -namespace wvoec { +namespace { void OpenOEMCryptoTASession() { - ODK_Message request; - ODK_Message response; - uint8_t response_buffer[0x1000]; uint8_t request_body[] = { - 0x06, // TAG_UINT32 - 0x09, 0x00, 0x00, 0x00, // API value (0x09) - 0x01, // TAG_BOOL - 0x00, // value (false) - 0x0a // TAG_EOM + 0x06, // TAG_UINT32 + 0x09, 0x00, 0x00, 0x00, // API value (0x09) + 0x07, // TAG_UINT64 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x01, // TAG_BOOL + 0x00, // value (false) + 0x0a // TAG_EOM }; - request = ODK_Message_Create(request_body, sizeof(request_body)); + ODK_Message request = ODK_Message_Create(request_body, sizeof(request_body)); + ODK_Message_SetSize(&request, sizeof(request_body)); + ODK_Message response; OPK_DispatchMessage(&request, &response); } void InitializeOEMCryptoTA() { - ODK_Message init_request; - ODK_Message init_response; - uint8_t response_buffer[0x1000]; - uint8_t init_request_body[] = { - 0x06, // TAG_UINT32 - 0x01, 0x00, 0x00, 0x00, // API value(0x01) - 0x0a // TAG_EOM + uint8_t request_body[] = { + 0x06, // TAG_UINT32 + 0x01, 0x00, 0x00, 0x00, // API value (0x01) + 0x07, // TAG_UINT64 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x0a // TAG_EOM }; - - init_request = - ODK_Message_Create(init_request_body, sizeof(init_request_body)); - OPK_DispatchMessage(&init_request, &init_response); + ODK_Message request = ODK_Message_Create(request_body, sizeof(request_body)); + ODK_Message_SetSize(&request, sizeof(request_body)); + ODK_Message response; + OPK_DispatchMessage(&request, &response); } +} // namespace + extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { OPK_Initialize(); InitializeOEMCryptoTA(); @@ -45,18 +45,11 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - ODK_Message request; + std::vector request_body(data, data + size); + ODK_Message request = + ODK_Message_Create(request_body.data(), request_body.size()); + ODK_Message_SetSize(&request, request_body.size()); ODK_Message response; - unsigned char response_buffer[0x1000]; - - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - - request = ODK_Message_Create(input, size); OPK_DispatchMessage(&request, &response); - - delete[] input; return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp index b5a73a11..0fd1787e 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp +++ b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp @@ -16,114 +16,36 @@ }, 'targets': [ { - 'target_name': 'oemcrypto_opk_load_license_fuzz', - 'sources': [ - 'oemcrypto_load_license_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_provisioning_fuzz', - 'sources': [ - 'oemcrypto_load_provisioning_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_renewal_fuzz', - 'sources': [ - 'oemcrypto_load_renewal_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_license_request_fuzz', - 'sources': [ - 'oemcrypto_license_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_provisioning_request_fuzz', - 'sources': [ - 'oemcrypto_provisioning_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_renewal_request_fuzz', - 'sources': [ - 'oemcrypto_renewal_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_decrypt_cenc_fuzz', - 'sources': [ - 'oemcrypto_decrypt_cenc_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_entitled_content_keys_fuzz', - 'sources': [ - 'oemcrypto_load_entitled_content_keys_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_encrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_encrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_decrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_decrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_sign_fuzz', - 'sources': [ - 'oemcrypto_generic_sign_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_verify_fuzz', - 'sources': [ - 'oemcrypto_generic_verify_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generate_rsa_signature_fuzz', - 'sources': [ - 'oemcrypto_generate_rsa_signature_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_usage_table_header_fuzz', - 'sources': [ - 'oemcrypto_load_usage_table_header_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_load_usage_entry_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_deactivate_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_deactivate_usage_entry_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_report_usage_fuzz', - 'sources': [ - 'oemcrypto_report_usage_fuzz.cc', - ], - }, - { 'target_name': 'oemcrypto_opk_copy_buffer_fuzz', 'sources': [ 'oemcrypto_copy_buffer_fuzz.cc', ], - }, - { + }, + { + 'target_name': 'oemcrypto_opk_create_and_remove_entitled_key_session_fuzz', + 'sources': [ + 'oemcrypto_create_and_remove_entitled_key_session_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_deactivate_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_deactivate_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_decrypt_cenc_fuzz', + 'sources': [ + 'oemcrypto_decrypt_cenc_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_decrypt_hash_fuzz', + 'sources': [ + 'oemcrypto_decrypt_hash_fuzz.cc', + ], + }, + { 'target_name': 'oemcrypto_opk_dispatcher_fuzz', 'include_dirs': [ '<(oemcrypto_dir)/opk/serialization/common', @@ -144,5 +66,149 @@ '<(oemcrypto_dir)/opk/ports/trusty/serialization_adapter/shared_memory.c', ], }, + { + 'target_name': 'oemcrypto_opk_generate_certificate_key_pair_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generate_rsa_signature_fuzz', + 'sources': [ + 'oemcrypto_generate_rsa_signature_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_decrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_decrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_encrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_encrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_sign_fuzz', + 'sources': [ + 'oemcrypto_generic_sign_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_verify_fuzz', + 'sources': [ + 'oemcrypto_generic_verify_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_boot_certificate_chain_fuzz', + 'sources': [ + 'oemcrypto_get_boot_certificate_chain_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_random_fuzz', + 'sources': [ + 'oemcrypto_get_random_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_install_oem_private_key_fuzz', + 'sources': [ + 'oemcrypto_install_oem_private_key_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_license_request_fuzz', + 'sources': [ + 'oemcrypto_license_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_entitled_content_keys_fuzz', + 'sources': [ + 'oemcrypto_load_entitled_content_keys_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_license_fuzz', + 'sources': [ + 'oemcrypto_load_license_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_provisioning_fuzz', + 'sources': [ + 'oemcrypto_load_provisioning_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_renewal_fuzz', + 'sources': [ + 'oemcrypto_load_renewal_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_load_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_load_usage_table_header_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_move_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_move_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_provisioning_request_fuzz', + 'sources': [ + 'oemcrypto_provisioning_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_query_key_control_fuzz', + 'sources': [ + 'oemcrypto_query_key_control_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_renewal_request_fuzz', + 'sources': [ + 'oemcrypto_renewal_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_report_usage_fuzz', + 'sources': [ + 'oemcrypto_report_usage_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_reuse_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_reuse_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_select_key_fuzz', + 'sources': [ + 'oemcrypto_select_key_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_shrink_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_shrink_usage_table_header_fuzz.cc', + ], + }, ], } diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc index b66aab6d..7e709f65 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc @@ -2,27 +2,26 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); + // If input size is less than fuzz data structure size, reject the input. - if (size < sizeof(OEMCrypto_Request_Fuzz)) { + if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) { return 0; } // Input for provisioning request API will be modified by OEMCrypto, hence it // cannot be a const. Fuzzer complains if const identifier is removed of data, // hence copying data into a non const pointer. - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; - provisioning_api_fuzz.provisioning_messages().InjectFuzzedRequestData(input, - size); - delete[] input; + std::vector input(data, data + size); + wvoec::OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; + provisioning_api_fuzz.Initialize(); + provisioning_api_fuzz.provisioning_messages().InjectFuzzedRequestData( + input.data(), input.size()); + provisioning_api_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc new file mode 100644 index 00000000..fb971874 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc @@ -0,0 +1,43 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicense(); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // key_control_block and key_control_block_length parameters + size_t key_control_block_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector key_control_block(key_control_block_length_data); + size_t* const key_control_block_length = + fuzzed_data.ConsumeBool() ? &key_control_block_length_data : nullptr; + + const std::vector content_key_id = + fuzzed_data.ConsumeRemainingBytes(); + + OEMCrypto_QueryKeyControl(license_api_fuzz.session().session_id(), + content_key_id.data(), content_key_id.size(), + key_control_block.data(), key_control_block_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc index 8b7fd79d..658bdc13 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc @@ -2,26 +2,26 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); + // If input size is less than fuzz data structure, reject the input. - if (size < sizeof(OEMCrypto_Request_Fuzz)) { + if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) { return 0; } // Input for renewal request API will be modified by OEMCrypto, hence it // cannot be a const. Fuzzer complains if const identifier is removed of data, // hence copying data into a non const pointer. - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - OEMCryptoRenewalAPIFuzz renewal_api_fuzz; - renewal_api_fuzz.renewal_messages().InjectFuzzedRequestData(input, size); - delete[] input; + std::vector input(data, data + size); + wvoec::OEMCryptoRenewalAPIFuzz renewal_api_fuzz; + renewal_api_fuzz.Initialize(); + renewal_api_fuzz.renewal_messages().InjectFuzzedRequestData(input.data(), + input.size()); + renewal_api_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc index 3b3813a8..e943acdb 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc @@ -2,45 +2,46 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include + +#include "FuzzedDataProvider.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { -const size_t MAX_FUZZ_PST_REPORT_BUFFER_LENGTH = 5 * MB; +namespace { + +constexpr size_t MAX_FUZZ_PST_REPORT_BUFFER_LENGTH = 5 * wvoec::MB; + +} // namespace + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); - size_t pst_buffer_length = 0; - if (size <= sizeof(pst_buffer_length)) { - return 0; - } - - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - // Open a session, create a usage entry. - Session* session = entry.license_messages().session(); - session->open(); - entry.InstallTestRSAKey(session); - session->GenerateNonce(); - session->CreateNewUsageEntry(); - vector encrypted_usage_header; - session->UpdateUsageEntry(&encrypted_usage_header); + entry.InstallTestRSAKey(); + entry.session().CreateNewUsageEntry(); + entry.session().GenerateNonce(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); // Sets pst for usage entry. entry.LoadLicense(); - memcpy(&pst_buffer_length, data, sizeof(pst_buffer_length)); - const uint8_t* extra_data = data + sizeof(pst_buffer_length); - size_t extra_data_size = size - sizeof(pst_buffer_length); - // We cannot allocate a huge buffer, hence limiting buffer size to - // MAX_FUZZ_PST_REPORT_BUFFER_LENGTH. - pst_buffer_length = - std::min(MAX_FUZZ_PST_REPORT_BUFFER_LENGTH, pst_buffer_length); - vector pst_report_buffer(pst_buffer_length); - // Call API with fuzzed pst_buffer_length, pst. - OEMCrypto_ReportUsage(session->session_id(), extra_data, extra_data_size, - pst_report_buffer.data(), &pst_buffer_length); - session->close(); + FuzzedDataProvider fuzzed_data(data, size); + + // pst_report_buffer and pst_report_buffer_length parameters + size_t pst_report_buffer_length_data = + fuzzed_data.ConsumeIntegralInRange( + 0, MAX_FUZZ_PST_REPORT_BUFFER_LENGTH); + std::vector pst_report_buffer(pst_report_buffer_length_data); + size_t* const pst_report_buffer_length = + fuzzed_data.ConsumeBool() ? &pst_report_buffer_length_data : nullptr; + + const std::vector pst = fuzzed_data.ConsumeRemainingBytes(); + + OEMCrypto_ReportUsage(entry.session().session_id(), pst.data(), pst.size(), + pst_report_buffer.data(), pst_report_buffer_length); + + entry.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc new file mode 100644 index 00000000..eea4a09a --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc @@ -0,0 +1,26 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine Master +// License Agreement. + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); + entry.CreateUsageTableHeader(); + entry.InstallTestRSAKey(); + entry.session().CreateNewUsageEntry(); + entry.session().close(); + + entry.session().open(); + OEMCrypto_ReuseUsageEntry( + entry.session().session_id(), + FuzzedDataProvider(data, size).ConsumeIntegral()); + + entry.Terminate(); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_select_key_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_select_key_fuzz.cc new file mode 100644 index 00000000..0bf0a18a --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_select_key_fuzz.cc @@ -0,0 +1,38 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicense(); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + const OEMCryptoCipherMode cipher_mode = + wvoec::ConvertDataToValidEnum(fuzzed_data, OEMCrypto_CipherMode_MaxValue); + + const std::vector content_key_id = + fuzzed_data.ConsumeRemainingBytes(); + + OEMCrypto_SelectKey(license_api_fuzz.session().session_id(), + content_key_id.data(), content_key_id.size(), + cipher_mode); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc new file mode 100644 index 00000000..4806ed5e --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc @@ -0,0 +1,34 @@ +// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); + entry.CreateUsageTableHeader(); + + FuzzedDataProvider fuzzed_data(data, size); + + const uint32_t new_entry_count = fuzzed_data.ConsumeIntegral(); + + // header_buffer and header_buffer_length parameters + size_t header_buffer_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector header_buffer(header_buffer_length_data); + size_t* const header_buffer_length = + fuzzed_data.ConsumeBool() ? &header_buffer_length_data : nullptr; + + OEMCrypto_ShrinkUsageTableHeader(new_entry_count, header_buffer.data(), + header_buffer_length); + + entry.Terminate(); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp index bd72a5c8..2fa9a5fe 100644 --- a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp +++ b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp @@ -14,106 +14,178 @@ }, 'targets': [ { - 'target_name': 'oemcrypto_load_license_fuzz', + 'target_name': 'oemcrypto_copy_buffer_fuzz', 'sources': [ - 'oemcrypto_load_license_fuzz.cc', + 'oemcrypto_copy_buffer_fuzz.cc', ], - }, - { - 'target_name': 'oemcrypto_load_provisioning_fuzz', + }, + { + 'target_name': 'oemcrypto_create_and_remove_entitled_key_session_fuzz', 'sources': [ - 'oemcrypto_load_provisioning_fuzz.cc', + 'oemcrypto_create_and_remove_entitled_key_session_fuzz.cc', ], - }, - { - 'target_name': 'oemcrypto_load_renewal_fuzz', - 'sources': [ - 'oemcrypto_load_renewal_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_license_request_fuzz', - 'sources': [ - 'oemcrypto_license_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_provisioning_request_fuzz', - 'sources': [ - 'oemcrypto_provisioning_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_renewal_request_fuzz', - 'sources': [ - 'oemcrypto_renewal_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_decrypt_cenc_fuzz', - 'sources': [ - 'oemcrypto_decrypt_cenc_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_entitled_content_keys_fuzz', - 'sources': [ - 'oemcrypto_load_entitled_content_keys_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_encrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_encrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_decrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_decrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_sign_fuzz', - 'sources': [ - 'oemcrypto_generic_sign_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_verify_fuzz', - 'sources': [ - 'oemcrypto_generic_verify_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generate_rsa_signature_fuzz', - 'sources': [ - 'oemcrypto_generate_rsa_signature_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_usage_table_header_fuzz', - 'sources': [ - 'oemcrypto_load_usage_table_header_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_load_usage_entry_fuzz.cc', - ], - }, - { + }, + { 'target_name': 'oemcrypto_deactivate_usage_entry_fuzz', 'sources': [ 'oemcrypto_deactivate_usage_entry_fuzz.cc', ], - }, - { + }, + { + 'target_name': 'oemcrypto_decrypt_cenc_fuzz', + 'sources': [ + 'oemcrypto_decrypt_cenc_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_decrypt_hash_fuzz', + 'sources': [ + 'oemcrypto_decrypt_hash_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generate_certificate_key_pair_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generate_rsa_signature_fuzz', + 'sources': [ + 'oemcrypto_generate_rsa_signature_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_decrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_decrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_encrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_encrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_sign_fuzz', + 'sources': [ + 'oemcrypto_generic_sign_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_verify_fuzz', + 'sources': [ + 'oemcrypto_generic_verify_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_boot_certificate_chain_fuzz', + 'sources': [ + 'oemcrypto_get_boot_certificate_chain_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_random_fuzz', + 'sources': [ + 'oemcrypto_get_random_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_install_oem_private_key_fuzz', + 'sources': [ + 'oemcrypto_install_oem_private_key_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_license_request_fuzz', + 'sources': [ + 'oemcrypto_license_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_entitled_content_keys_fuzz', + 'sources': [ + 'oemcrypto_load_entitled_content_keys_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_license_fuzz', + 'sources': [ + 'oemcrypto_load_license_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_provisioning_fuzz', + 'sources': [ + 'oemcrypto_load_provisioning_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_renewal_fuzz', + 'sources': [ + 'oemcrypto_load_renewal_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_load_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_load_usage_table_header_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_move_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_move_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_provisioning_request_fuzz', + 'sources': [ + 'oemcrypto_provisioning_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_query_key_control_fuzz', + 'sources': [ + 'oemcrypto_query_key_control_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_renewal_request_fuzz', + 'sources': [ + 'oemcrypto_renewal_request_fuzz.cc', + ], + }, + { 'target_name': 'oemcrypto_report_usage_fuzz', 'sources': [ 'oemcrypto_report_usage_fuzz.cc', ], - }, + }, + { + 'target_name': 'oemcrypto_reuse_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_reuse_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_select_key_fuzz', + 'sources': [ + 'oemcrypto_select_key_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_shrink_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_shrink_usage_table_header_fuzz.cc', + ], + }, ], } diff --git a/oemcrypto/test/oec_decrypt_fallback_chain.cpp b/oemcrypto/test/oec_decrypt_fallback_chain.cpp index 8eebf9bc..cbf552bf 100644 --- a/oemcrypto/test/oec_decrypt_fallback_chain.cpp +++ b/oemcrypto/test/oec_decrypt_fallback_chain.cpp @@ -198,26 +198,64 @@ OEMCryptoResult DecryptFallbackChain::DecryptSubsampleHalf( // Used for OEMCrypto Fuzzing: Corpus format is as below, let | be separator. // cipher_mode + pattern + sample_data for all samples | -// subsample_data for all samples +// input_data for all samples | subsample_data for all samples void WriteDecryptCencCorpus( OEMCryptoCipherMode cipher_mode, const OEMCrypto_SampleDescription* samples_description, const OEMCrypto_CENCEncryptPatternDesc* pattern, size_t samples_length) { const std::string file_name = GetFileName("oemcrypto_decrypt_cenc_fuzz_seed_corpus"); + + // Cipher mode and Pattern. OEMCrypto_Decrypt_Cenc_Fuzz decrypt_cenc_fuzz_struct; decrypt_cenc_fuzz_struct.cipher_mode = cipher_mode; decrypt_cenc_fuzz_struct.pattern = *pattern; - // Cipher mode and Pattern. AppendToFile(file_name, reinterpret_cast(&decrypt_cenc_fuzz_struct), sizeof(OEMCrypto_Decrypt_Cenc_Fuzz)); // Sample data for all samples. for (size_t i = 0; i < samples_length; i++) { + OEMCrypto_SampleDescription_Fuzz sample_description_data; + sample_description_data.buffers.input_data_length = + samples_description[i].buffers.input_data_length; + sample_description_data.buffers.output_descriptor.type = + samples_description[i].buffers.output_descriptor.type; + switch (sample_description_data.buffers.output_descriptor.type) { + case OEMCrypto_BufferType_Clear: + sample_description_data.buffers.output_descriptor.buffer_config = + samples_description[i] + .buffers.output_descriptor.buffer.clear.clear_buffer_length; + break; + + case OEMCrypto_BufferType_Secure: + sample_description_data.buffers.output_descriptor.buffer_config = + samples_description[i] + .buffers.output_descriptor.buffer.secure.secure_buffer_length; + break; + + case OEMCrypto_BufferType_Direct: + sample_description_data.buffers.output_descriptor.buffer_config = + samples_description[i] + .buffers.output_descriptor.buffer.direct.is_video; + break; + } + memcpy(sample_description_data.iv, samples_description[i].iv, + sizeof(sample_description_data.iv)); + sample_description_data.subsamples_length = + samples_description[i].subsamples_length; AppendToFile(file_name, - reinterpret_cast(&samples_description[i]), - sizeof(OEMCrypto_SampleDescription)); + reinterpret_cast(&sample_description_data), + sizeof(OEMCrypto_SampleDescription_Fuzz)); + } + AppendSeparator(file_name); + + // Input data for all samples. + for (size_t i = 0; i < samples_length; i++) { + AppendToFile(file_name, + reinterpret_cast( + samples_description[i].buffers.input_data), + samples_description[i].buffers.input_data_length); } AppendSeparator(file_name); diff --git a/oemcrypto/test/oec_session_util.cpp b/oemcrypto/test/oec_session_util.cpp index 7977a7f3..edeb798e 100644 --- a/oemcrypto/test/oec_session_util.cpp +++ b/oemcrypto/test/oec_session_util.cpp @@ -58,6 +58,27 @@ using oemcrypto_core_message::features::CoreMessageFeatures; constexpr size_t kTestSubsampleSectionSize = 256; +// Fill objects by consuming a source buffer of fuzzed data. +class FuzzedData { + public: + FuzzedData(const uint8_t* source, size_t source_size) + : source_(source), source_size_(source_size) {} + + // Fill the destination buffer with fuzzed data. + void Fill(void* destination, size_t destination_size) { + if (source_ && destination) { + const size_t fill_size = std::min(source_size_, destination_size); + memcpy(destination, source_, fill_size); + source_ += fill_size; + source_size_ -= fill_size; + } + } + + private: + const uint8_t* source_; + size_t source_size_; +}; + // Encrypt a block of data using CTR mode. void EncryptCTR(const vector& in_buffer, const uint8_t* key, const uint8_t* starting_iv, vector* out_buffer) { @@ -459,14 +480,16 @@ void ProvisioningRoundTrip::SignResponse() { } void ProvisioningRoundTrip::InjectFuzzedResponseData(const uint8_t* data, - size_t size UNUSED) { + size_t size) { // Interpreting fuzz data as unencrypted core_response + message_data - const size_t core_response_size = sizeof(ODK_ParsedProvisioning); + FuzzedData fuzzed_data(data, size); + // Copy core_response from data and serialize. - memcpy(&core_response_, data, core_response_size); + fuzzed_data.Fill(&core_response_, sizeof(core_response_)); // Copy provisioning message data into response_data. - memcpy(&response_data_, data + core_response_size, sizeof(response_data_)); + fuzzed_data.Fill(&response_data_, sizeof(response_data_)); + // Set nonce to one from session to pass nonce checks. response_data_.nonce = session()->nonce(); } @@ -682,11 +705,13 @@ void LicenseRoundTrip::InjectFuzzedTimerLimits( } void LicenseRoundTrip::InjectFuzzedResponseData(const uint8_t* data, - size_t size UNUSED) { + size_t size) { // Interpreting fuzz data as unencrypted core_response + message_data - const size_t core_response_size = sizeof(ODK_ParsedLicense); + FuzzedData fuzzed_data(data, size); + // Copy core_response from data. - memcpy(&core_response_, data, core_response_size); + fuzzed_data.Fill(&core_response_, sizeof(core_response_)); + // Maximum number of keys could be kMaxNumKeys(30). key_array_length can be // any random value as it is read from fuzz data. // Key data array(MessageKeyData keys[kMaxNumKeys]) will be looped over @@ -697,10 +722,12 @@ void LicenseRoundTrip::InjectFuzzedResponseData(const uint8_t* data, if (core_response_.key_array_length > kMaxNumKeys) { core_response_.key_array_length = kMaxNumKeys; } + // For corpus data, this value gets set to 4, but we need to test other // scenarios too, hence reading key_array_length value. set_num_keys(core_response_.key_array_length); ConvertDataToValidBools(&core_response_); + // TODO(b/157520981): Once assertion bug is fixed, for loop can be removed. // Workaround for the above bug: key_data.length and key_id.length are being // used in AES decryption process and are expected to be a multiple of 16. An @@ -721,9 +748,9 @@ void LicenseRoundTrip::InjectFuzzedResponseData(const uint8_t* data, // Copy response_data from data and set nonce to match one in request to pass // nonce validations. - memcpy(&response_data_, data + core_response_size, sizeof(response_data_)); + fuzzed_data.Fill(&response_data_, sizeof(response_data_)); for (uint32_t i = 0; i < num_keys_; ++i) { - response_data_.keys[i].control.nonce = session()->nonce(); + response_data_.keys[i].control.nonce = htonl(session()->nonce()); } } @@ -1592,6 +1619,42 @@ void Session::TestDecryptCTR(bool select_key_first, } } +void Session::TestDecryptEntitled(OEMCryptoResult expected_result, + OEMCrypto_SESSION session_id, + const uint8_t* content_key_id, + size_t content_key_id_length) { + OEMCryptoResult select_result = OEMCrypto_SUCCESS; + // Select the key (from FillSimpleMessage) + select_result = + OEMCrypto_SelectKey(session_id, content_key_id, content_key_id_length, + OEMCrypto_CipherMode_CENC); + + vector unencrypted_data; + vector output_buffer; + vector encrypted_data(kTestSubsampleSectionSize); + + vector in_buffer(256); + vector out_buffer(in_buffer.size()); + OEMCrypto_SampleDescription sample_description; + OEMCrypto_SubSampleDescription subsample_description; + ASSERT_NO_FATAL_FAILURE(GenerateSimpleSampleDescription( + in_buffer, out_buffer, &sample_description, &subsample_description)); + OEMCrypto_CENCEncryptPatternDesc pattern = {0, 0}; + + EncryptCTR(unencrypted_data, content_key_id, &sample_description.iv[0], + &encrypted_data); + // Try to decrypt the data with oemcrypto session id. + const OEMCryptoResult decrypt_result = + OEMCrypto_DecryptCENC(session_id, &sample_description, 1, &pattern); + + // We only have a few errors that we test are reported. + ASSERT_NO_FATAL_FAILURE( + TestDecryptResult(expected_result, select_result, decrypt_result)) + << "Either SelectKey or DecryptCENC should return " << expected_result + << ", but they returned " << select_result << " and " << decrypt_result + << ", respectively."; +} + void Session::TestDecryptResult(OEMCryptoResult expected_result, OEMCryptoResult actual_select_result, OEMCryptoResult actual_decrypt_result) { diff --git a/oemcrypto/test/oec_session_util.h b/oemcrypto/test/oec_session_util.h index bd67d582..1105ed4b 100644 --- a/oemcrypto/test/oec_session_util.h +++ b/oemcrypto/test/oec_session_util.h @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -573,6 +574,12 @@ class Session { void TestDecryptCTR(bool select_key_first = true, OEMCryptoResult expected_result = OEMCrypto_SUCCESS, size_t key_index = 0); + // Encrypt some data and pass to OEMCrypto_DecryptCENC to verify decryption + // for entitled sessions. + void TestDecryptEntitled(OEMCryptoResult expected_result = OEMCrypto_SUCCESS, + OEMCrypto_SESSION session = 0, + const uint8_t* content_key_id = nullptr, + size_t content_key_id_length = 0); // Verify that an attempt to select an expired key either succeeds, or gives // an actionable error code. void TestSelectExpired(size_t key_index); diff --git a/oemcrypto/test/oemcrypto_test.cpp b/oemcrypto/test/oemcrypto_test.cpp index 78d99413..6a8356ae 100644 --- a/oemcrypto/test/oemcrypto_test.cpp +++ b/oemcrypto/test/oemcrypto_test.cpp @@ -228,11 +228,29 @@ class OEMCryptoClientTest : public ::testing::Test, public SessionUtil { uint8_t subsample_flags) { if (ShouldGenerateCorpus() && input_buffer != nullptr && dest_buffer_descriptor != nullptr) { - OEMCrypto_Copy_Buffer_Fuzz fuzzed_structure; - fuzzed_structure.dest_buffer_desc = *dest_buffer_descriptor; - fuzzed_structure.subsample_flags = subsample_flags; const std::string file_name = GetFileName("oemcrypto_copy_buffer_fuzz_seed_corpus"); + + OEMCrypto_Copy_Buffer_Fuzz fuzzed_structure; + fuzzed_structure.dest_buffer_desc.type = dest_buffer_descriptor->type; + switch (fuzzed_structure.dest_buffer_desc.type) { + case OEMCrypto_BufferType_Clear: + fuzzed_structure.dest_buffer_desc.buffer_config = + dest_buffer_descriptor->buffer.clear.clear_buffer_length; + break; + + case OEMCrypto_BufferType_Secure: + fuzzed_structure.dest_buffer_desc.buffer_config = + dest_buffer_descriptor->buffer.secure.secure_buffer_length; + break; + + case OEMCrypto_BufferType_Direct: + fuzzed_structure.dest_buffer_desc.buffer_config = + dest_buffer_descriptor->buffer.direct.is_video; + break; + } + fuzzed_structure.subsample_flags = subsample_flags; + // Corpus for copy buffer fuzzer should be in the format: // (dest_buffer_descriptor | subsample_flags | input_buffer). AppendToFile(file_name, reinterpret_cast(&fuzzed_structure), @@ -266,7 +284,7 @@ TEST_F(OEMCryptoClientTest, FreeUnallocatedSecureBufferNoFailure) { */ TEST_F(OEMCryptoClientTest, VersionNumber) { const std::string log_message = - "OEMCrypto unit tests for API 17. Tests last updated 2022-04-13"; + "OEMCrypto unit tests for API 17.1. Tests last updated 2022-06-17"; cout << " " << log_message << "\n"; cout << " " << "These tests are part of Android T." @@ -275,7 +293,7 @@ TEST_F(OEMCryptoClientTest, VersionNumber) { // If any of the following fail, then it is time to update the log message // above. EXPECT_EQ(ODK_MAJOR_VERSION, 17); - EXPECT_EQ(ODK_MINOR_VERSION, 1); + EXPECT_EQ(ODK_MINOR_VERSION, 2); EXPECT_EQ(kCurrentAPI, 17u); OEMCrypto_Security_Level level = OEMCrypto_SecurityLevel(); EXPECT_GT(level, OEMCrypto_Level_Unknown); @@ -684,6 +702,7 @@ TEST_F(OEMCryptoClientTest, PreventNonceFlood2API16) { ASSERT_NO_FATAL_FAILURE(s.open()); s.GenerateNonce(&error_counter); } + wvutil::TestSleep::SyncFakeClock(); const int64_t test_end = wvutil::Clock().GetCurrentTime(); int valid_counter = loop_count - error_counter; // Either oemcrypto should enforce a delay, or it should return an error from @@ -721,6 +740,7 @@ TEST_F(OEMCryptoClientTest, PreventNonceFlood3API16) { s[j].GenerateNonce(&error_counter); } } + wvutil::TestSleep::SyncFakeClock(); const int64_t test_end = wvutil::Clock().GetCurrentTime(); int valid_counter = request_counter - error_counter; // Either oemcrypto should enforce a delay, or it should return an error from @@ -2070,13 +2090,13 @@ class OEMCryptoEntitlementLicenseTest : public OEMCryptoLicenseTest { } }; -// This verifies that entitlement keys and entitled content keys can be loaded. +/** This verifies that entitlement keys and entitled content keys can be loaded. + */ TEST_P(OEMCryptoEntitlementLicenseTest, LoadEntitlementKeysAPI17) { LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); entitled_message_1.SetEntitledKeySession(key_session_id); @@ -2092,7 +2112,6 @@ TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysAPI17) { uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); @@ -2113,19 +2132,19 @@ TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysAPI17) { /*load_even=*/false, /*load_odd=*/false, OEMCrypto_SUCCESS)); } -// This verifies that entitled content keys cannot be loaded if we have not yet -// loaded the entitlement keys. +/** + * This verifies that entitled content keys cannot be loaded if we have not yet + * loaded the entitlement keys. + */ TEST_P(OEMCryptoEntitlementLicenseTest, LoadEntitlementKeysNoEntitlementKeysAPI17) { license_messages_.set_license_type(OEMCrypto_EntitlementLicense); ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); - uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); @@ -2133,8 +2152,10 @@ TEST_P(OEMCryptoEntitlementLicenseTest, ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadKeys(false)); } -// This verifies that entitled content keys cannot be loaded if we have loaded -// the wrong entitlement keys. +/** + * This verifies that entitled content keys cannot be loaded if we have loaded + * the wrong entitlement keys. + */ TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysNoEntitlementKeysAPI17) { license_messages_.set_license_type(OEMCrypto_EntitlementLicense); @@ -2144,7 +2165,6 @@ TEST_P(OEMCryptoEntitlementLicenseTest, uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); @@ -2153,15 +2173,16 @@ TEST_P(OEMCryptoEntitlementLicenseTest, /*load_even=*/true, /*load_odd=*/true, OEMCrypto_ERROR_INVALID_CONTEXT)); } -// This verifies that entitled content keys cannot be loaded if we have loaded -// the wrong entitlement keys. +/** + * This verifies that entitled content keys cannot be loaded if we have loaded + * the wrong entitlement keys. + */ TEST_P(OEMCryptoEntitlementLicenseTest, LoadEntitlementKeysWrongEntitlementKeysAPI17) { LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); @@ -2177,7 +2198,6 @@ TEST_P(OEMCryptoEntitlementLicenseTest, uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); @@ -2188,19 +2208,21 @@ TEST_P(OEMCryptoEntitlementLicenseTest, /*load_even=*/true, /*load_odd=*/true, OEMCrypto_KEY_NOT_ENTITLED)); } -// This verifies that entitled content keys cannot be loaded if we specify an -// entitled key session that has not been created. +/** + * This verifies that entitled content keys cannot be loaded if we specify an + * entitled key session that has not been created. + */ TEST_P(OEMCryptoEntitlementLicenseTest, LoadEntitlementKeysWrongEntitledKeySessionAPI17) { LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); - entitled_message_1.SetEntitledKeySession(0); + const uint32_t wrong_key_session_id = key_session_id == 0 ? 1 : 0; + entitled_message_1.SetEntitledKeySession(wrong_key_session_id); ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadKeys(false)); } @@ -2210,28 +2232,34 @@ TEST_P(OEMCryptoEntitlementLicenseTest, uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); - entitled_message_1.SetEntitledKeySession(0); + const uint32_t wrong_key_session_id = key_session_id == 0 ? 1 : 0; + entitled_message_1.SetEntitledKeySession(wrong_key_session_id); ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadCasKeys( /*load_even=*/true, /*load_odd=*/true, OEMCrypto_ERROR_INVALID_ENTITLED_KEY_SESSION)); } -// This verifies that entitled content keys cannot be loaded if we specify an -// entitled key session that is actually an oemcrypto session. +/** + * This verifies that entitled content keys cannot be loaded if we specify an + * entitled key session that is actually an oemcrypto session. + */ TEST_P(OEMCryptoEntitlementLicenseTest, LoadEntitlementKeysOemcryptoSessionAPI17) { LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); + if (session_.session_id() == key_session_id) { + GTEST_SKIP() + << "Skipping test because entitled and entitlement sessions are both " + << key_session_id << "."; + } entitled_message_1.SetEntitledKeySession(session_.session_id()); ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadKeys(false)); } @@ -2242,7 +2270,6 @@ TEST_P(OEMCryptoEntitlementLicenseTest, uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( session_.session_id(), &key_session_id)); - ASSERT_NE(key_session_id, 0u); EntitledMessage entitled_message_1(&license_messages_); entitled_message_1.FillKeyArray(); @@ -3069,15 +3096,16 @@ TEST_P(OEMCryptoLicenseTest, SelectKeyEntitledKeyNotThereAPI17) { ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadKeys(true)); const char* content_key_id = "no_key"; - ASSERT_EQ( - OEMCrypto_ERROR_NO_CONTENT_KEY, - OEMCrypto_SelectKey(key_session_id, - reinterpret_cast(content_key_id), - strlen(content_key_id), OEMCrypto_CipherMode_CENC)); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_ERROR_INVALID_CONTEXT, key_session_id, + reinterpret_cast(content_key_id), + strlen(content_key_id))); } -// Select key with entitlement license fails if the key id is entitlement key -// id. +/** + * Select key with entitlement license fails if the key id is entitlement key + * id. + */ TEST_P(OEMCryptoLicenseTest, SelectKeyEntitlementKeyAPI17) { license_messages_.set_license_type(OEMCrypto_EntitlementLicense); ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); @@ -3093,11 +3121,15 @@ TEST_P(OEMCryptoLicenseTest, SelectKeyEntitlementKeyAPI17) { entitled_message_1.SetEntitledKeySession(key_session_id); ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadKeys(true)); - OEMCryptoResult res = OEMCrypto_SelectKey( - session_.session_id(), session_.license().keys[0].key_id, - session_.license().keys[0].key_id_length, OEMCrypto_CipherMode_CENC); - EXPECT_TRUE(res == OEMCrypto_ERROR_INVALID_CONTEXT || - res == OEMCrypto_ERROR_NO_CONTENT_KEY); + if (session_.session_id() == key_session_id) { + GTEST_SKIP() + << "Skipping test because entitled and entitlement sessions are both " + << key_session_id << "."; + } + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_ERROR_INVALID_CONTEXT, session_.session_id(), + session_.license().keys[0].key_id, + session_.license().keys[0].key_id_length)); } // This verifies that entitled key sessions can be created and removed. @@ -3126,6 +3158,28 @@ TEST_P(OEMCryptoLicenseTest, EntitledKeySessionsAPI17) { OEMCrypto_RemoveEntitledKeySession(key_session_id_2)); } +TEST_P(OEMCryptoLicenseTest, + EntitledKeySessionsCloseWithOEMCryptoSessionAPI17) { + license_messages_.set_license_type(OEMCrypto_EntitlementLicense); + ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages_.LoadResponse()); + + uint32_t key_session_id_1; + ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( + session_.session_id(), &key_session_id_1)); + // Close the OEMCrypto session. + session_.close(); + // All entitled key sessions associated with the OEMCrypto session should + // already be been destroyed, + OEMCryptoResult sts = OEMCrypto_RemoveEntitledKeySession(key_session_id_1); + EXPECT_TRUE(sts == OEMCrypto_ERROR_INVALID_ENTITLED_KEY_SESSION || + sts == OEMCrypto_ERROR_INVALID_SESSION); + // Open a new session just for OEMCryptoLicenseTest TearDown. + session_.open(); +} + // This verifies that multiple entitled key sessions can be created. They can // load and select keys independently. TEST_P(OEMCryptoLicenseTest, EntitledKeySessionMultipleKeySessionsAPI17) { @@ -3145,15 +3199,24 @@ TEST_P(OEMCryptoLicenseTest, EntitledKeySessionMultipleKeySessionsAPI17) { entitled_message_1.SetContentKeyId(0, content_key_id_1); ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadKeys(true)); // We can select content key 1 in entitled key session 1. - ASSERT_EQ( - OEMCrypto_SUCCESS, - OEMCrypto_SelectKey(key_session_id_1, - reinterpret_cast(content_key_id_1), - strlen(content_key_id_1), OEMCrypto_CipherMode_CENC)); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_SUCCESS, key_session_id_1, + reinterpret_cast(content_key_id_1), + strlen(content_key_id_1))); + // Create another entitled key session. uint32_t key_session_id_2; - ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( - session_.session_id(), &key_session_id_2)); + OEMCryptoResult status = OEMCrypto_CreateEntitledKeySession( + session_.session_id(), &key_session_id_2); + // For DRM, but not for CAS, we allow there to be only a single entitled + // session. + if (!global_features.supports_cas && + (key_session_id_2 == key_session_id_1 || + status == OEMCrypto_ERROR_TOO_MANY_SESSIONS)) { + GTEST_SKIP() + << "Skipping test because multiple entitled sessions not supported."; + } + ASSERT_EQ(OEMCrypto_SUCCESS, status); // Entitled key sessions should have unique ids. ASSERT_NE(key_session_id_1, key_session_id_2); @@ -3164,23 +3227,22 @@ TEST_P(OEMCryptoLicenseTest, EntitledKeySessionMultipleKeySessionsAPI17) { entitled_message_2.SetContentKeyId(0, content_key_id_2); ASSERT_NO_FATAL_FAILURE(entitled_message_2.LoadKeys(true)); // We can select content key 2 in entitled key session 2. - ASSERT_EQ( - OEMCrypto_SUCCESS, - OEMCrypto_SelectKey(key_session_id_2, - reinterpret_cast(content_key_id_2), - strlen(content_key_id_2), OEMCrypto_CipherMode_CENC)); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_SUCCESS, key_session_id_2, + reinterpret_cast(content_key_id_2), + strlen(content_key_id_2))); + // Content key id 1 is not in entitled key session 2. - ASSERT_EQ( - OEMCrypto_ERROR_NO_CONTENT_KEY, - OEMCrypto_SelectKey(key_session_id_2, - reinterpret_cast(content_key_id_1), - strlen(content_key_id_1), OEMCrypto_CipherMode_CENC)); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_ERROR_NO_CONTENT_KEY, key_session_id_2, + reinterpret_cast(content_key_id_1), + strlen(content_key_id_1))); + // Content key id 2 is not in entitled key session 1. - ASSERT_EQ( - OEMCrypto_ERROR_NO_CONTENT_KEY, - OEMCrypto_SelectKey(key_session_id_1, - reinterpret_cast(content_key_id_2), - strlen(content_key_id_2), OEMCrypto_CipherMode_CENC)); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_ERROR_NO_CONTENT_KEY, key_session_id_1, + reinterpret_cast(content_key_id_2), + strlen(content_key_id_2))); } // This verifies that within an entitled key session, each entitlement key can @@ -3204,28 +3266,27 @@ TEST_P(OEMCryptoLicenseTest, entitled_message_1.SetContentKeyId(0, content_key_id_1); ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadKeys(true)); // We can select content key 1 in entitled key session. - ASSERT_EQ( - OEMCrypto_SUCCESS, - OEMCrypto_SelectKey(key_session_id, - reinterpret_cast(content_key_id_1), - strlen(content_key_id_1), OEMCrypto_CipherMode_CENC)); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_SUCCESS, key_session_id, + reinterpret_cast(content_key_id_1), + strlen(content_key_id_1))); + // Load content key with new content id. const char* content_key_id_2 = "content_key_id_2"; entitled_message_1.SetContentKeyId(0, content_key_id_2); ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadKeys(true)); // We can select content key 2 in entitled key session. - ASSERT_EQ( - OEMCrypto_SUCCESS, - OEMCrypto_SelectKey(key_session_id, - reinterpret_cast(content_key_id_2), - strlen(content_key_id_2), OEMCrypto_CipherMode_CENC)); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_SUCCESS, key_session_id, + reinterpret_cast(content_key_id_2), + strlen(content_key_id_2))); + // Content key one is no longer in the entitled key session as they use the // same entitlement key. - ASSERT_EQ( - OEMCrypto_ERROR_NO_CONTENT_KEY, - OEMCrypto_SelectKey(key_session_id, - reinterpret_cast(content_key_id_1), - strlen(content_key_id_1), OEMCrypto_CipherMode_CENC)); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_ERROR_NO_CONTENT_KEY, key_session_id, + reinterpret_cast(content_key_id_1), + strlen(content_key_id_1))); } // Decrypt should fail if the license is entitlement license, and the decrypt @@ -3249,11 +3310,10 @@ TEST_P(OEMCryptoLicenseTest, const char* content_key_id = "content_key_id"; entitled_message.SetContentKeyId(0, content_key_id); ASSERT_NO_FATAL_FAILURE(entitled_message.LoadKeys(true)); - ASSERT_EQ( - OEMCrypto_SUCCESS, - OEMCrypto_SelectKey(key_session_id, - reinterpret_cast(content_key_id), - strlen(content_key_id), OEMCrypto_CipherMode_CENC)); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptEntitled( + OEMCrypto_SUCCESS, key_session_id, + reinterpret_cast(content_key_id), + strlen(content_key_id))); vector in_buffer(256); vector out_buffer(in_buffer.size()); @@ -3262,11 +3322,12 @@ TEST_P(OEMCryptoLicenseTest, ASSERT_NO_FATAL_FAILURE(GenerateSimpleSampleDescription( in_buffer, out_buffer, &sample_description, &subsample_description)); OEMCrypto_CENCEncryptPatternDesc pattern = {0, 0}; - - // Try to decrypt the data with oemcrypto session id. - EXPECT_EQ(OEMCrypto_DecryptCENC(session_.session_id(), &sample_description, 1, - &pattern), - OEMCrypto_ERROR_INVALID_CONTEXT); + if (global_features.supports_cas || session_.session_id() != key_session_id) { + // Try to decrypt the data with oemcrypto session id. + EXPECT_EQ(OEMCrypto_DecryptCENC(session_.session_id(), &sample_description, + 1, &pattern), + OEMCrypto_ERROR_INVALID_CONTEXT); + } // Decrypt the data with entitled key session id succeed. EXPECT_EQ( OEMCrypto_DecryptCENC(key_session_id, &sample_description, 1, &pattern), @@ -3297,8 +3358,14 @@ TEST_P(OEMCryptoEntitlementLicenseTest, ReassociateEntitledKeySessionAPI17) { ASSERT_NO_FATAL_FAILURE(entitled_message.LoadKeys(true)); // Now reassociate the entitled key session to the second OEMCrypto session. - ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_ReassociateEntitledKeySession( - key_session_id, session2.session_id())); + OEMCryptoResult status = OEMCrypto_ReassociateEntitledKeySession( + key_session_id, session2.session_id()); + if (status == OEMCrypto_ERROR_NOT_IMPLEMENTED && + !global_features.supports_cas) { + GTEST_SKIP() << "Skipping test because " + "OEMCrypto_ReassociateEntitledKeySession not implemented."; + } + ASSERT_EQ(OEMCrypto_SUCCESS, status); // session2 does not have entitlement keys. ASSERT_NO_FATAL_FAILURE(entitled_message.LoadKeys(false)); @@ -3467,7 +3534,7 @@ TEST_P(OEMCryptoLicenseTest, QueryKeyControl) { // clear key control block (KCB) in the license response. An OEMCrypto v17.1+ // implementation should be able to handle the clear KCB in the 16.4.x response // and load the license correctly. -TEST_F(OEMCryptoSessionTests, ClearKcbAPI16_4) { +TEST_F(OEMCryptoSessionTests, ClearKcbAPI17) { Session s; ASSERT_NO_FATAL_FAILURE(s.open()); ASSERT_NO_FATAL_FAILURE(InstallTestRSAKey(&s)); @@ -3838,7 +3905,8 @@ TEST_P(OEMCryptoLicenseOverflowTest, TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths( [](size_t response_message_length, LicenseRoundTrip* license_messages) { auto& pst = license_messages->core_response().pst; - pst.offset = response_message_length - pst.length + 1; + pst.offset = response_message_length; + if (pst.length == 0) pst.length = 1; }); } @@ -3881,8 +3949,8 @@ TEST_P( [](size_t response_message_length, LicenseRoundTrip* license_messages) { auto& srm_restriction_data = license_messages->core_response().srm_restriction_data; - srm_restriction_data.offset = - response_message_length - srm_restriction_data.length + 1; + srm_restriction_data.offset = response_message_length; + if (srm_restriction_data.length == 0) srm_restriction_data.length = 1; }); } @@ -5045,6 +5113,7 @@ TEST_P(OEMCryptoSessionTestsDecryptTests, MakeBuffers(); EncryptData(); OEMCryptoResult result = DecryptCENC(); + FreeSecureBuffers(); // Closing the session and opening it for next iteration. // If it is last iteration, session will be closed in teardown method of // class. @@ -5054,6 +5123,9 @@ TEST_P(OEMCryptoSessionTestsDecryptTests, return result; }; TestHugeLengthDoesNotCrashAPI(oemcrypto_function, 1, 2 * MiB, kCheckStatus); + + // Avoid double free when test teardown calls FreeSecureBuffers() + MakeBuffers(); } TEST_P(OEMCryptoSessionTestsDecryptTests, @@ -5119,6 +5191,7 @@ TEST_P(OEMCryptoSessionTestsDecryptTests, MakeBuffers(); EncryptData(); OEMCryptoResult result = DecryptCENC(); + FreeSecureBuffers(); // Closing the session and opening it for next iteration. // If it is last iteration, session will be closed in teardown method of // class. @@ -5128,6 +5201,9 @@ TEST_P(OEMCryptoSessionTestsDecryptTests, return result; }; TestHugeLengthDoesNotCrashAPI(oemcrypto_function, 1, 2 * MiB, kCheckStatus); + + // Avoid double free when test teardown calls FreeSecureBuffers() + MakeBuffers(); } // Based on the resource rating, OEMCrypto should be able to handle the maximum @@ -5239,6 +5315,7 @@ TEST_P(OEMCryptoSessionTestsDecryptTests, ContinueDecryptionAfterIdleAndWake) { ASSERT_NO_FATAL_FAILURE(MakeBuffers()); ASSERT_NO_FATAL_FAILURE(EncryptData()); ASSERT_NO_FATAL_FAILURE(TestDecryptCENC()); + FreeSecureBuffers(); // Set state to idle then wake again and try to reencrypt/decrypt ASSERT_NO_FATAL_FAILURE( OEMCrypto_Idle(OEMCrypto_IdleState::OEMCrypto_CpuSuspend, 0)); @@ -6363,7 +6440,9 @@ class OEMCryptoLoadsCertificateAlternates : public OEMCryptoLoadsCertificate { OEMCryptoResult sts = provisioning_messages.LoadResponse(); key_loaded_ = (OEMCrypto_SUCCESS == sts); if (key_loaded_) { - encoded_rsa_key_ = provisioning_messages.encoded_rsa_key(); + uint8_t* ptr = provisioning_messages.response_data().rsa_key; + size_t len = provisioning_messages.response_data().rsa_key_length; + encoded_rsa_key_ = std::vector(ptr, ptr + len); wrapped_rsa_key_ = provisioning_messages.wrapped_rsa_key(); EXPECT_GT(wrapped_rsa_key_.size(), 0u); EXPECT_EQ(nullptr, find(wrapped_rsa_key_, encoded_rsa_key_)); @@ -7511,15 +7590,17 @@ class OEMCryptoGenericCryptoTest : public OEMCryptoRefreshTest { if (ShouldGenerateCorpus()) { const std::string file_name = GetFileName("oemcrypto_generic_verify_fuzz_seed_corpus"); - OEMCrypto_Generic_Verify_Fuzz fuzzed_structure; + OEMCrypto_Generic_Api_Fuzz fuzzed_structure; fuzzed_structure.cipher_mode = OEMCrypto_CipherMode_CENC; fuzzed_structure.algorithm = algorithm; - fuzzed_structure.signature_length = signature_length; // Cipher mode and algorithm. AppendToFile(file_name, reinterpret_cast(&fuzzed_structure), sizeof(fuzzed_structure)); AppendToFile(file_name, reinterpret_cast(clear_buffer), clear_buffer_length); + AppendSeparator(file_name); + AppendToFile(file_name, reinterpret_cast(signature), + signature_length); } return OEMCrypto_Generic_Verify(session, clear_buffer, clear_buffer_length, algorithm, signature, signature_length); @@ -8487,6 +8568,9 @@ class OEMCryptoUsageTableTest : public OEMCryptoGenericCryptoTest { TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryUpdateUsageEntryForHugeHeaderBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { if (buffer_length < encrypted_usage_header_.size()) { return OEMCrypto_ERROR_SHORT_BUFFER; @@ -8514,6 +8598,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryUpdateUsageEntryForHugeUsageEntryBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -8538,6 +8625,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryDeactivateUsageEntryForHugePstBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; std::string pst("pst"); @@ -8557,6 +8647,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryLoadUsageTableHeaderForHugeHeader) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { if (buffer_length < encrypted_usage_header_.size()) { return OEMCrypto_ERROR_SHORT_BUFFER; @@ -8581,6 +8674,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P( OEMCryptoUsageTableTest, OEMCryptoMemoryLoadUsageTableHeaderForHugeHeaderStartingHeaderLengthFrom1) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -8597,6 +8693,9 @@ TEST_P( TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryLoadUsageEntryForHugeUsageEntryBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -8639,6 +8738,9 @@ TEST_P(OEMCryptoUsageTableTest, } TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugeReportBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -8665,6 +8767,9 @@ TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugeReportBuffer) { } TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugePstBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -8685,6 +8790,9 @@ TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugePstBuffer) { TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryShrinkUsageTableHeaderForHugeHeaderBufferLength) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } LicenseWithUsageEntry entry0; entry0.set_pst("pst 0"); entry0.MakeOfflineAndClose(this); diff --git a/oemcrypto/test/oemcrypto_unittests.gypi b/oemcrypto/test/oemcrypto_unittests.gypi index 3fbd0e4e..c644a755 100644 --- a/oemcrypto/test/oemcrypto_unittests.gypi +++ b/oemcrypto/test/oemcrypto_unittests.gypi @@ -10,6 +10,7 @@ 'static_libcpp%' : 'false', }, 'sources': [ + 'GEN_api_lock_file.c', 'oec_device_features.cpp', 'oec_decrypt_fallback_chain.cpp', 'oec_key_deriver.cpp', diff --git a/oemcrypto/util/include/oemcrypto_key_deriver.h b/oemcrypto/util/include/oemcrypto_key_deriver.h index 4a525470..fdcf3ecf 100644 --- a/oemcrypto/util/include/oemcrypto_key_deriver.h +++ b/oemcrypto/util/include/oemcrypto_key_deriver.h @@ -47,6 +47,11 @@ class KeyDeriver { bool DeriveEncryptionKey(const std::vector& enc_key_context, std::vector* enc_key); + // Derive renewed device key. Use on KeyDeriver initialized with old device + // key. |context| should be just the context field, eg A_priv+CA_token. + bool DeriveRenewedDeviceKey(const std::vector& context, + std::vector* renewed_device_key); + ~KeyDeriver() {} private: diff --git a/oemcrypto/util/include/oemcrypto_rsa_key.h b/oemcrypto/util/include/oemcrypto_rsa_key.h index d66f527a..e1d6db17 100644 --- a/oemcrypto/util/include/oemcrypto_rsa_key.h +++ b/oemcrypto/util/include/oemcrypto_rsa_key.h @@ -268,6 +268,13 @@ class RsaPrivateKey { // Returns an empty vector on error. std::vector Serialize() const; + // Serializes the key's private exponent in network-byte-order + // using I2OSP primitive as defined by RFC3447 Section 4.1. The + // exact length of the exponent will depend on the exponents value, + // not the modulus size. + // Returns an empty vector on error. + std::vector GetPrivateExponent() const; + // Signs the provided |message| using the RSA signing algorithm // specified by |algorithm|. See RsaSignatureAlgorithm for // details on each algorithm. diff --git a/oemcrypto/util/src/oemcrypto_key_deriver.cpp b/oemcrypto/util/src/oemcrypto_key_deriver.cpp index 2d65a29c..df8d8fb5 100644 --- a/oemcrypto/util/src/oemcrypto_key_deriver.cpp +++ b/oemcrypto/util/src/oemcrypto_key_deriver.cpp @@ -40,6 +40,31 @@ bool Derive256Key(Cmac* cmac, uint8_t counter_base, const uint8_t* ctx, } return Derive128KeyAppend(cmac, counter_base + 1, ctx, ctx_size, derived_key); } + +bool NistKdf(Cmac* cmac, const std::vector& label, + const std::vector& context, size_t bits, + std::vector* renewed_device_key) { + const std::vector size_bits_big_endian = { + static_cast(bits >> 24), static_cast(bits >> 16), + static_cast(bits >> 8), static_cast(bits)}; + const size_t kAesBlockSizeBits = 16 * 8; + + if (bits % kAesBlockSizeBits != 0) return false; + if (renewed_device_key == nullptr) { + return false; + } + renewed_device_key->clear(); + bool res = false; + for (size_t counter = 0; counter < bits / kAesBlockSizeBits; counter++) { + cmac->Reset(); + res = cmac->Update(counter + 1) && cmac->Update(label) && + cmac->Update(0x00) && cmac->Update(context) && + cmac->Update(size_bits_big_endian) && + cmac->FinalizeAppend(renewed_device_key); + if (!res) break; + } + return res; +} } // namespace // static @@ -150,5 +175,20 @@ bool KeyDeriver::DeriveEncryptionKey( return DeriveEncryptionKey(enc_key_context.data(), enc_key_context.size(), enc_key); } + +bool KeyDeriver::DeriveRenewedDeviceKey( + const std::vector& context, + std::vector* renewed_device_key) { + if (renewed_device_key == nullptr) { + LOGE("Output key buffer is null"); + return false; + } + const std::string kKeyboxRenewalLabel = "Keyboxv4"; + const std::vector kKeyboxRenewalLabelVec(kKeyboxRenewalLabel.begin(), + kKeyboxRenewalLabel.end()); + + return NistKdf(cmac_.get(), kKeyboxRenewalLabelVec, context, 0x80, + renewed_device_key); +} } // namespace util } // namespace wvoec diff --git a/oemcrypto/util/src/oemcrypto_rsa_key.cpp b/oemcrypto/util/src/oemcrypto_rsa_key.cpp index f77b2c11..ec4e6bb3 100644 --- a/oemcrypto/util/src/oemcrypto_rsa_key.cpp +++ b/oemcrypto/util/src/oemcrypto_rsa_key.cpp @@ -326,6 +326,27 @@ bool RsaPublicKey::IsMatchingPrivateKey( return RsaKeysAreMatchingPair(GetRsaKey(), private_key.GetRsaKey()); } +std::vector RsaPrivateKey::GetPrivateExponent() const { + const BIGNUM* d = RSA_get0_d(key_); + if (d == nullptr) { + LOGE("Private exponent must not be null"); + return {}; + } + // Get the required length for the data. + const size_t length = BN_num_bytes(d); + if (length <= 0) { + LOGE("Private exponent length must be positive"); + return {}; + } + std::vector serialized_private_exponent(length, 0); + if (static_cast(BN_bn2bin(d, serialized_private_exponent.data())) != + length) { + LOGE("Failed to convert the private exponent"); + return {}; + } + return serialized_private_exponent; +} + OEMCryptoResult RsaPublicKey::Serialize(uint8_t* buffer, size_t* buffer_size) const { if (buffer_size == nullptr) { diff --git a/third_party/boringssl/boringssl.gyp b/third_party/boringssl/boringssl.gyp index 6a62ae56..4268292a 100644 --- a/third_party/boringssl/boringssl.gyp +++ b/third_party/boringssl/boringssl.gyp @@ -4,6 +4,7 @@ 'asm_target_arch%': 'none', 'has_nasm%': 'false', 'nasm_path%': 'nasm.exe', + 'use_msan%': 'false', }, 'target_defaults': { @@ -67,8 +68,10 @@ # This massive, nested conditional block will select the correct batch # of assembly language files for the current OS and CPU architecture, or # it will turn off assembly language files entirely if the - # |asm_target_arch| has been set to "none". - ['asm_target_arch=="none" or (OS=="win" and has_nasm!="true")', { + # |asm_target_arch| has been set to "none", |use_msan| has been set to + # "true", or NASM is not available on Windows. + ['asm_target_arch=="none" or use_msan=="true" or (OS=="win" and \ + has_nasm!="true")', { 'defines': [ 'OPENSSL_NO_ASM', ], diff --git a/third_party/cn-cbor.gypi b/third_party/cn-cbor.gypi new file mode 100644 index 00000000..71eb3ec9 --- /dev/null +++ b/third_party/cn-cbor.gypi @@ -0,0 +1,20 @@ +{ + 'sources': [ + 'cn-cbor/src/cn-cbor.c', + 'cn-cbor/src/cn-error.c', + 'cn-cbor/src/cn-encoder.c', + 'cn-cbor/src/cn-get.c', + 'cn-cbor/src/cn-print.c', + 'cn-cbor/src/cn-create.c', + ], + 'include_dirs': [ + 'cn-cbor/src', + 'cn-cbor/include', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'cn-cbor/src', + 'cn-cbor/include', + ], + } +} diff --git a/third_party/cose-c.gyp b/third_party/cose-c.gyp new file mode 100644 index 00000000..7c6d13be --- /dev/null +++ b/third_party/cose-c.gyp @@ -0,0 +1,49 @@ +{ + 'variables': { + 'privacy_crypto_impl%': 'boringssl', + 'boringssl_libcrypto_path%': 'boringssl/boringssl.gyp:crypto', + }, + 'targets': [ + { + 'target_name': 'cose-c', + 'type': 'static_library', + 'sources': [ + 'COSE-C/src/Cose.cpp', + 'COSE-C/src/cbor.cpp', + 'COSE-C/src/CoseKey.cpp', + 'COSE-C/src/Sign.cpp', + 'COSE-C/src/Sign1.cpp', + 'COSE-C/src/openssl.cpp', + ], + 'includes': [ + 'cn-cbor.gypi', + '../util/libcrypto_dependency.gypi', + ], + 'include_dirs': [ + 'COSE-C/include', + 'COSE-C/src', + 'open-dice/third_party/cose-c/include', + ], + 'defines': [ + 'UNIT_TEST', + 'COSE_C_USE_OPENSSL', + # vanilla COSE-C does not build with boringssl due to lack of ccm. We + # do not use the COSE-C functions that call these ccm ciphers, so just + # redefining the symbols to avoid headache + 'EVP_aes_128_ccm()=EVP_aes_128_gcm()', + 'EVP_aes_256_ccm()=EVP_aes_256_gcm()', + 'EVP_aes_192_ccm()=EVP_aes_192_gcm()', + 'EVP_CTRL_CCM_SET_L=0x14', + 'EVP_CTRL_CCM_GET_TAG=EVP_CTRL_GCM_GET_TAG', + 'EVP_CTRL_CCM_SET_TAG=EVP_CTRL_GCM_SET_TAG', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'COSE-C/include', + 'COSE-C/src', + 'open-dice/third_party/cose-c/include', + ], + } + }, + ], +} diff --git a/util/test/test_clock.cpp b/util/test/test_clock.cpp index 18331bb6..33edd9c3 100644 --- a/util/test/test_clock.cpp +++ b/util/test/test_clock.cpp @@ -2,7 +2,9 @@ // source code may only be used and distributed under the Widevine License // Agreement. // -// Clock - A fake clock just for running tests. +// Clock - A fake clock just for running tests. This is used when running +// OEMCrypto unit tests. It is not used when tests include the CE CDM source +// code because that uses the clock in cdm/test_host.cpp instead. #include diff --git a/util/test/test_sleep.cpp b/util/test/test_sleep.cpp index 281e0429..439a46d5 100644 --- a/util/test/test_sleep.cpp +++ b/util/test/test_sleep.cpp @@ -14,6 +14,7 @@ #endif #include +#include #include #include @@ -53,6 +54,18 @@ void TestSleep::Sleep(unsigned int seconds) { if (callback_ != nullptr) callback_->ElapseTime(milliseconds); } +void TestSleep::SleepUntil(int64_t desired_time) { + SyncFakeClock(); + const int64_t now = Clock().GetCurrentTime(); + if (desired_time < now) { + LOGE("Test Clock skew sleeping from time %" PRId64 " to %" PRId64, now, + desired_time); + return; + } + const unsigned int sleep_time = static_cast(desired_time - now); + TestSleep::Sleep(sleep_time); +} + void TestSleep::SyncFakeClock() { // Syncing can be done by sleeping 0 seconds. Sleep(0); diff --git a/util/test/test_sleep.h b/util/test/test_sleep.h index 155b89dc..f20e27a7 100644 --- a/util/test/test_sleep.h +++ b/util/test/test_sleep.h @@ -13,7 +13,9 @@ namespace wvutil { class TestSleep { public: - // The callback is called when the clock should be advanced. + // The callback is called when the test clock should be advanced. If the + // system uses a real clock, it is used to sync the real and test + // clock. Otherwise it is used to simulate sleep in the test clock. class CallBack { public: virtual void ElapseTime(int64_t milliseconds) = 0; @@ -27,6 +29,9 @@ class TestSleep { // callback exists, this calls the callback. static void Sleep(unsigned int seconds); + // Like sleep, above, except it sleeps until the specified time. + static void SleepUntil(int64_t desired_time); + // If we are using a real clock and a fake clock, then the real clock advances // a little while we are doing work, but the fake one only advances when we // sleep. This function advances the fake clock to be in sync with the real