diff --git a/oemcrypto/odk/Android.bp b/oemcrypto/odk/Android.bp index 3b7d807..544c838 100644 --- a/oemcrypto/odk/Android.bp +++ b/oemcrypto/odk/Android.bp @@ -14,6 +14,7 @@ package { // all of the 'license_kinds' from "vendor_widevine_license" // to get the below license kinds: // legacy_by_exception_only (by exception only) + // legacy_proprietary (by exception only) default_applicable_licenses: ["vendor_widevine_license"], } @@ -37,6 +38,7 @@ cc_library_static { proprietary: true, owner: "widevine", + min_sdk_version: "UpsideDownCake", } // ---------------------------------------------------------------- @@ -93,6 +95,10 @@ cc_test { "libwv_kdo", ], + shared_libs: [ + "libprotobuf-cpp-lite", + ], + srcs: [ "test/odk_test.cpp", "test/odk_test_helper.cpp", diff --git a/oemcrypto/odk/include/OEMCryptoCENCCommon.h b/oemcrypto/odk/include/OEMCryptoCENCCommon.h index ce51b8d..a4e5438 100644 --- a/oemcrypto/odk/include/OEMCryptoCENCCommon.h +++ b/oemcrypto/odk/include/OEMCryptoCENCCommon.h @@ -106,6 +106,8 @@ typedef enum OEMCryptoResult { OPK_ERROR_REMOTE_CALL = OPK_ERROR_BASE, OPK_ERROR_INCOMPATIBLE_VERSION = OPK_ERROR_BASE + 1, OPK_ERROR_NO_PERSISTENT_DATA = OPK_ERROR_BASE + 2, + OPK_ERROR_PREHOOK_FAILURE = OPK_ERROR_BASE + 3, + OPK_ERROR_POSTHOOK_FAILURE = OPK_ERROR_BASE + 4, } OEMCryptoResult; /* clang-format on */ @@ -139,11 +141,23 @@ 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; /** - * Used to indicate a substring of a signed message in OEMCrypto_LoadKeys and - * other functions which must verify that a parameter is contained within a + * The base for (delayed) timers, i.e. from what time the (delayed) timer + * starts. + */ +typedef enum OEMCrypto_TimerDelayBase { + OEMCrypto_License_Start = 0, + OEMCrypto_License_Load = 1, + OEMCrypto_First_Decrypt = 2, + OEMCrypto_TimerDelayBase_MaxValue = OEMCrypto_First_Decrypt, +} OEMCrypto_TimerDelayBase; + +/** + * Used to indicate a substring of a signed message in ODK_ParseLicense + * and other functions which must verify that a parameter is contained within a * signed message. */ typedef struct { @@ -209,7 +223,7 @@ typedef struct { /** * Points to the relevant fields for a content key. The fields are extracted - * from the License Response message offered to OEMCrypto_LoadKeys(). Each + * from the License Response message offered to ODK_ParseLicense(). Each * field points to one of the components of the key. Key data, key control, * and both IV fields are 128 bits (16 bytes): * @param key_id: the unique id of this key. @@ -226,7 +240,7 @@ typedef struct { * the content key from the key_data field. * * The memory for the OEMCrypto_KeyObject fields is allocated and freed - * by the caller of OEMCrypto_LoadKeys(). + * by the caller of ODK_ParseLicense(). */ typedef struct { OEMCrypto_Substring key_id; diff --git a/oemcrypto/odk/include/core_message_deserialize.h b/oemcrypto/odk/include/core_message_deserialize.h index 545a806..a52c5fd 100644 --- a/oemcrypto/odk/include/core_message_deserialize.h +++ b/oemcrypto/odk/include/core_message_deserialize.h @@ -55,6 +55,18 @@ bool CoreProvisioningRequestFromMessage( const std::string& oemcrypto_core_message, ODK_ProvisioningRequest* core_provisioning_request); +/** + * Counterpart (deserializer) of ODK_PrepareCoreProvisioning40Request + * (serializer) + * + * Parameters: + * [in] oemcrypto_core_message + * [out] core_provisioning_request + */ +bool CoreProvisioning40RequestFromMessage( + const std::string& oemcrypto_core_message, + ODK_Provisioning40Request* core_provisioning_request); + /** * Counterpart (deserializer) of ODK_PrepareCoreRenewedProvisioningRequest * (serializer) diff --git a/oemcrypto/odk/include/core_message_features.h b/oemcrypto/odk/include/core_message_features.h index 16289c6..1365dd8 100644 --- a/oemcrypto/odk/include/core_message_features.h +++ b/oemcrypto/odk/include/core_message_features.h @@ -8,6 +8,7 @@ #include #include +#include #include namespace oemcrypto_core_message { @@ -25,10 +26,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. - uint32_t maximum_major_version = 17; - uint32_t maximum_minor_version = 0; + // number. The default is 18.3. + uint32_t maximum_major_version = 18; + uint32_t maximum_minor_version = 3; bool operator==(const CoreMessageFeatures &other) const; bool operator!=(const CoreMessageFeatures &other) const { diff --git a/oemcrypto/odk/include/core_message_serialize.h b/oemcrypto/odk/include/core_message_serialize.h index bd6d635..a76b79f 100644 --- a/oemcrypto/odk/include/core_message_serialize.h +++ b/oemcrypto/odk/include/core_message_serialize.h @@ -39,7 +39,7 @@ using oemcrypto_core_message::features::CoreMessageFeatures; * [out] oemcrypto_core_message */ bool CreateCoreLicenseResponse(const CoreMessageFeatures& features, - const ODK_ParsedLicense& parsed_lic, + const ODK_Packing_ParsedLicense& parsed_lic, const ODK_LicenseRequest& core_request, const std::string& core_request_sha256, std::string* oemcrypto_core_message); @@ -72,6 +72,21 @@ bool CreateCoreProvisioningResponse(const CoreMessageFeatures& features, const ODK_ParsedProvisioning& parsed_prov, const ODK_ProvisioningRequest& core_request, std::string* oemcrypto_core_message); + +/** + * Counterpart (serializer) of ODK_ParseProvisioning40 (deserializer) + * struct-input variant + * + * Parameters: + * [in] features feature support for response message. + * [in] core_request + * [out] oemcrypto_core_message + */ +bool CreateCoreProvisioning40Response( + const CoreMessageFeatures& features, + const ODK_Provisioning40Request& core_request, + std::string* oemcrypto_core_message); + } // namespace serialize } // namespace oemcrypto_core_message diff --git a/oemcrypto/odk/include/core_message_serialize_proto.h b/oemcrypto/odk/include/core_message_serialize_proto.h index de75362..73d7b73 100644 --- a/oemcrypto/odk/include/core_message_serialize_proto.h +++ b/oemcrypto/odk/include/core_message_serialize_proto.h @@ -17,6 +17,7 @@ #include #include +#include "OEMCryptoCENCCommon.h" #include "core_message_features.h" #include "core_message_types.h" #include "license_protocol.pb.h" @@ -42,8 +43,8 @@ bool CreateCoreLicenseResponseFromProto( const oemcrypto_core_message::features::CoreMessageFeatures& features, const std::string& serialized_license, const ODK_LicenseRequest& core_request, - const std::string& core_request_sha256, const bool nonce_required, - const bool uses_padding, std::string* oemcrypto_core_message); + const std::string& core_request_sha256, bool nonce_required, + bool uses_padding, std::string* oemcrypto_core_message); /** * Counterpart (serializer) of ODK_ParseProvisioning (deserializer) @@ -59,6 +60,7 @@ bool CreateCoreProvisioningResponseFromProto( const oemcrypto_core_message::features::CoreMessageFeatures& features, const std::string& serialized_provisioning_response, const ODK_ProvisioningRequest& core_request, + OEMCrypto_PrivateKeyType device_key_type, std::string* oemcrypto_core_message); } // namespace serialize diff --git a/oemcrypto/odk/include/core_message_types.h b/oemcrypto/odk/include/core_message_types.h index 5315913..d268aef 100644 --- a/oemcrypto/odk/include/core_message_types.h +++ b/oemcrypto/odk/include/core_message_types.h @@ -30,23 +30,25 @@ * KDO provides a corresponding writer. * * Table: ODK vs KDO (s: serialize; d: deserialize) - * +----------------------------------------+---------------------------------------+ - * | ODK | KDO | - * +---+------------------------------------+---+-----------------------------------+ - * | s | ODK_PrepareCoreLicenseRequest | d | CoreLicenseRequestFromMessage | - * | +------------------------------------+ +-----------------------------------+ - * | | ODK_PrepareCoreRenewalRequest | | CoreRenewalRequestFromMessage | - * | +------------------------------------+ +-----------------------------------+ - * | | ODK_PrepareCoreProvisioningRequest | | CoreProvisioningRequestFromMessage| - * | +------------------------------------+ +-----------------------------------+ - * | | ODK_PrepareCommonRequest | | CoreCommonRequestFromMessage | - * +---+------------------------------------+---+-----------------------------------+ - * | d | ODK_ParseLicense | s | CreateCoreLicenseResponse | - * | +------------------------------------+ +-----------------------------------+ - * | | ODK_ParseRenewal | | CreateCoreRenewalResponse | - * | +------------------------------------+ +-----------------------------------+ - * | | ODK_ParseProvisioning | | CreateCoreProvisioningResponse | - * +---+------------------------------------+---+-----------------------------------+ + * +------------------------------------------+------------------------------------------+ + * | ODK | KDO | + * +---+--------------------------------------+---+--------------------------------------+ + * | s | ODK_PrepareCoreLicenseRequest | d | CoreLicenseRequestFromMessage | + * | +--------------------------------------+ +--------------------------------------+ + * | | ODK_PrepareCoreRenewalRequest | | CoreRenewalRequestFromMessage | + * | +--------------------------------------+ +--------------------------------------+ + * | | ODK_PrepareCoreProvisioningRequest | | CoreProvisioningRequestFromMessage | + * | | ODK_PrepareCoreProvisioning40Request | | CoreProvisioning40RequestFromMessage | + * | +--------------------------------------+ +--------------------------------------+ + * | | ODK_PrepareCommonRequest | | CoreCommonRequestFromMessage | + * +---+--------------------------------------+---+--------------------------------------+ + * | d | ODK_ParseLicense | s | CreateCoreLicenseResponse | + * | +--------------------------------------+ +--------------------------------------+ + * | | ODK_ParseRenewal | | CreateCoreRenewalResponse | + * | +--------------------------------------+ +--------------------------------------+ + * | | ODK_ParseProvisioning | | CreateCoreProvisioningResponse | + * | | ODK_ParseProvisioning40 | | CreateCoreProvisioning40Response | + * +---+--------------------------------------+---+--------------------------------------+ * *********************************************************************/ // clang-format on @@ -66,12 +68,27 @@ namespace oemcrypto_core_message { * Input structure for CreateCommonResponse */ struct ODK_CommonRequest { + uint32_t message_type; + uint32_t message_length; uint16_t api_minor_version; uint16_t api_major_version; uint32_t nonce; uint32_t session_id; }; +struct ODK_MessageCounter { + uint64_t master_generation_number; + uint32_t provisioning_count; + uint32_t license_count; + uint32_t decrypt_count; + uint16_t major_version; + uint16_t minor_version; + uint16_t patch_version; + uint8_t soc_vendor[16]; + uint8_t chipset_model[16]; + uint8_t extra[12]; +}; + /** * Output structure for CoreLicenseRequestFromMessage * Input structure for CreateCoreLicenseResponse @@ -81,6 +98,7 @@ struct ODK_LicenseRequest { uint16_t api_major_version; uint32_t nonce; uint32_t session_id; + ODK_MessageCounter counter_info; }; /** @@ -108,6 +126,20 @@ struct ODK_ProvisioningRequest { std::string device_id; uint16_t renewal_type; std::string renewal_data; + ODK_MessageCounter counter_info; +}; + +/** + * Output structure for CoreProvisioningRequest40FromMessage + * Input structure for CreateCoreProvisioning40Response + */ +struct ODK_Provisioning40Request { + uint16_t api_minor_version; + uint16_t api_major_version; + uint32_t nonce; + uint32_t session_id; + std::string device_info; + ODK_MessageCounter counter_info; }; } // namespace oemcrypto_core_message diff --git a/oemcrypto/odk/include/odk.h b/oemcrypto/odk/include/odk.h index e3499da..16af94a 100644 --- a/oemcrypto/odk/include/odk.h +++ b/oemcrypto/odk/include/odk.h @@ -259,6 +259,8 @@ OEMCryptoResult ODK_DeactivateUsageEntry(ODK_ClockValues* clock_values); * of the message. (in) size of buffer reserved for the core message, in * bytes. (out) actual length of the core message, in bytes. * @param[in] nonce_values: pointer to the session's nonce data. + * @param[in] message_count_info: information used for server-side anomaly + * detection * * @retval OEMCrypto_SUCCESS * @retval OEMCrypto_ERROR_SHORT_BUFFER: core_message_size is too small @@ -269,7 +271,8 @@ OEMCryptoResult ODK_DeactivateUsageEntry(ODK_ClockValues* clock_values); */ OEMCryptoResult ODK_PrepareCoreLicenseRequest( uint8_t* message, size_t message_length, size_t* core_message_size, - const ODK_NonceValues* nonce_values); + const ODK_NonceValues* nonce_values, + const ODK_MessageCounterInfo* counter_info); /** * Modifies the message to include a core renewal request at the beginning of @@ -337,11 +340,8 @@ OEMCryptoResult ODK_PrepareCoreRenewalRequest(uint8_t* message, * of the message. (in) size of buffer reserved for the core message, in * bytes. (out) actual length of the core message, in bytes. * @param[in] nonce_values: pointer to the session's nonce data. - * @param[in] device_id: For devices with a keybox, this is the device ID from - * the keybox. For devices with an OEM Certificate, this is a device - * unique id string. - * @param[in] device_id_length: length of device_id. The device ID can be at - * most 64 bytes. + * @param[in] message_count_info: information used for server-side anomaly + * detection * * @retval OEMCrypto_SUCCESS * @retval OEMCrypto_ERROR_SHORT_BUFFER: core_message_size is too small @@ -352,8 +352,44 @@ OEMCryptoResult ODK_PrepareCoreRenewalRequest(uint8_t* message, */ OEMCryptoResult ODK_PrepareCoreProvisioningRequest( uint8_t* message, size_t message_length, size_t* core_message_length, - const ODK_NonceValues* nonce_values, const uint8_t* device_id, - size_t device_id_length); + const ODK_NonceValues* nonce_values, + const ODK_MessageCounterInfo* counter_info); + +/** + * Modifies the message to include a core provisioning 4.0 request at the + * beginning of the message buffer. The values in nonce_values are used to + * populate the message. + * + * This shall be called by OEMCrypto from + * OEMCrypto_PrepAndSignProvisioningRequest. + * + * NOTE: if the message pointer is null and/or input core_message_length is + * zero, this function returns OEMCrypto_ERROR_SHORT_BUFFER and sets output + * core_message_size to the size needed. + * + * @param[in,out] message: Pointer to memory for the entire message. Modified by + * the ODK library. + * @param[in] message_length: length of the entire message buffer. + * @param[in,out] core_message_size: length of the core message at the beginning + * of the message. (in) size of buffer reserved for the core message, in + * bytes. (out) actual length of the core message, in bytes. + * @param[in] nonce_values: pointer to the session's nonce data. + * @param[in] device_info: Encoded device hardware info in CBOR format. + * @param[in] device_info_length: length of device_info. + * @param[in] message_count_info: information used for server-side anomaly + * detection + * + * @retval OEMCrypto_SUCCESS + * @retval OEMCrypto_ERROR_SHORT_BUFFER: core_message_size is too small + * @retval OEMCrypto_ERROR_INVALID_CONTEXT + * + * @version + * This method is new in version 18 of the API. + */ +OEMCryptoResult ODK_PrepareCoreProvisioning40Request( + uint8_t* message, size_t message_length, size_t* core_message_length, + const ODK_NonceValues* nonce_values, const uint8_t* device_info, + size_t device_info_length, const ODK_MessageCounterInfo* counter_info); /** * Modifies the message to include a core renewal provisioning request at the @@ -515,6 +551,7 @@ OEMCryptoResult ODK_RefreshV15Values(const ODK_TimerLimits* timer_limits, * and false when called for OEMCrypto_ReloadLicense. * @param[in] usage_entry_present: true if the session has a new usage entry * associated with it created via OEMCrypto_CreateNewUsageEntry. + * @param[in] system_time_seconds: The current system's time in seconds. * @param[in,out] timer_limits: The session's timer limits. These will be * updated. * @param[in,out] clock_values: The session's clock values. These will be @@ -522,13 +559,19 @@ OEMCryptoResult ODK_RefreshV15Values(const ODK_TimerLimits* timer_limits, * @param[in,out] nonce_values: The session's nonce values. These will be * updated. * @param[out] parsed_license: the destination for the data. + * @param[out] timer_value: set if playback timer should be started. * * @retval OEMCrypto_SUCCESS * @retval ODK_ERROR_CORE_MESSAGE: if the message did not parse correctly, or * there were other incorrect values. An error should be returned to the * CDM layer. * @retval ODK_UNSUPPORTED_API - * @retval OEMCrypto_ERROR_INVALID_NONCE + * @retval ODK_SET_TIMER: if the playback timer has been started successfully + * @retval ODK_DISABLE_TIMER: if the playtime timer has been started + * successfully then is disabled. + * @retval ODK_TIMER_EXPIRED: if the license is attempted to be loaded after the + * rental duration expires. + * @retval OEMCrypto_ERROR_INVALĂ„ID_NONCE * * @version * This method is new in version 16 of the API. @@ -536,8 +579,9 @@ OEMCryptoResult ODK_RefreshV15Values(const ODK_TimerLimits* timer_limits, OEMCryptoResult ODK_ParseLicense( const uint8_t* message, size_t message_length, size_t core_message_length, bool initial_license_load, bool usage_entry_present, - ODK_TimerLimits* timer_limits, ODK_ClockValues* clock_values, - ODK_NonceValues* nonce_values, ODK_ParsedLicense* parsed_license); + uint64_t system_time_seconds, ODK_TimerLimits* timer_limits, + ODK_ClockValues* clock_values, ODK_NonceValues* nonce_values, + ODK_ParsedLicense* parsed_license, uint64_t* timer_value); /** * The function ODK_ParseRenewal will parse the message and verify its @@ -564,7 +608,8 @@ OEMCryptoResult ODK_ParseLicense( * @param[in] message_length: length of the entire message buffer. * @param[in] core_message_size: length of the core message, at the beginning of * the message buffer. - * @param[in] nonce_values: pointer to the session's nonce data. + * @param[in,out] nonce_values: pointer to the session's nonce data. These might + * be updated if the server returns a lower API version. * @param[in] system_time_seconds: the current time on OEMCrypto's clock, in * seconds. * @param[in] timer_limits: timer limits specified in the license. @@ -591,7 +636,7 @@ OEMCryptoResult ODK_ParseLicense( */ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, size_t core_message_length, - const ODK_NonceValues* nonce_values, + ODK_NonceValues* nonce_values, uint64_t system_time_seconds, const ODK_TimerLimits* timer_limits, ODK_ClockValues* clock_values, @@ -604,8 +649,8 @@ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, * If the message does not parse correctly, ODK_ParseProvisioning will return * an error that OEMCrypto should return to the CDM layer above. * - * If the API in the message is larger than 16, then ODK_UNSUPPORTED_API is - * returned. + * If the API in the message is larger than ODK_MAJOR_VERSION, then + * ODK_UNSUPPORTED_API is returned. * * ODK_ParseProvisioning shall verify that nonce_values->nonce and * nonce_values->session_id are the same as those in the message. Otherwise @@ -620,11 +665,13 @@ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, * @param[in] message_length: length of the entire message buffer. * @param[in] core_message_size: length of the core message, at the beginning of * the message buffer. - * @param[in] nonce_values: pointer to the session's nonce data. + * @param[in/out] nonce_values: pointer to the session's nonce data. These might + * be updated if the server returns a lower API version. * @param[in] device_id: a pointer to a buffer containing the device ID of the * device. The ODK function will verify it matches that in the message. * @param[in] device_id_length: the length of the device ID. - * @param[out] parsed_response: destination for the parse data. + * @param[out] counter_info: destination for counter portion of parse data. + * @param[out] parsed_response: destination for response portion of parse data. * * @retval OEMCrypto_SUCCESS * @retval ODK_ERROR_CORE_MESSAGE: the message did not parse correctly, or there @@ -638,9 +685,45 @@ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, */ OEMCryptoResult ODK_ParseProvisioning( const uint8_t* message, size_t message_length, size_t core_message_length, - const ODK_NonceValues* nonce_values, const uint8_t* device_id, + ODK_NonceValues* nonce_values, const uint8_t* device_id, size_t device_id_length, ODK_ParsedProvisioning* parsed_response); +/** + * The function ODK_ParseProvisioning40 will parse the message and verify the + * nonce values match those in the request. + * + * If the message does not parse correctly, ODK_ParseProvisioning40 will return + * an error that OEMCrypto should return to the CDM layer above. + * + * If the API in the message is larger than ODK_MAJOR_VERSION, then + * ODK_UNSUPPORTED_API is returned. + * + * ODK_ParseProvisioning40 shall verify that nonce_values->nonce and + * nonce_values->session_id are the same as those in the message. Otherwise + * it shall return OEMCrypto_ERROR_INVALID_NONCE. + * + * @param[in] message: pointer to the message buffer. + * @param[in] message_length: length of the entire message buffer. + * @param[in] core_message_size: length of the core message, at the beginning of + * the message buffer. + * @param[in,out] nonce_values: pointer to the session's nonce data. These might + * be updated if the server returns a lower API version. + * + * @retval OEMCrypto_SUCCESS + * @retval ODK_ERROR_CORE_MESSAGE: the message did not parse correctly, or there + * were other incorrect values. An error should be returned to the CDM + * layer. + * @retval ODK_UNSUPPORTED_API + * @retval OEMCrypto_ERROR_INVALID_NONCE + * + * @version + * This method is new in version 18 of the API. + */ +OEMCryptoResult ODK_ParseProvisioning40(const uint8_t* message, + size_t message_length, + size_t core_message_length, + ODK_NonceValues* nonce_values); + /** * The function ODK_ParseProvisioning will parse the message and verify the * API version is at most the version passed in. diff --git a/oemcrypto/odk/include/odk_message.h b/oemcrypto/odk/include/odk_message.h index 075f28c..cdbf26b 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 fba3c3a..1debc12 100644 --- a/oemcrypto/odk/include/odk_structs.h +++ b/oemcrypto/odk/include/odk_structs.h @@ -15,11 +15,11 @@ extern "C" { #include "odk_target.h" /* The version of this library. */ -#define ODK_MAJOR_VERSION 17 -#define ODK_MINOR_VERSION 1 +#define ODK_MAJOR_VERSION 18 +#define ODK_MINOR_VERSION 3 /* ODK Version string. Date changed automatically on each release. */ -#define ODK_RELEASE_DATE "ODK v17.1 2022-06-17" +#define ODK_RELEASE_DATE "ODK v18.3 2023-07-07" /* The lowest version number for an ODK message. */ #define ODK_FIRST_VERSION 16 @@ -28,6 +28,11 @@ extern "C" { #define ODK_DEVICE_ID_LEN_MAX 64 #define ODK_SHA256_HASH_SIZE 32 #define ODK_KEYBOX_RENEWAL_DATA_SIZE 1600 +/* The max length of the encoded device info in CBOR format. Make sure it gets + * updated when more device info is included. Refer to + * https://www.rfc-editor.org/rfc/rfc8949.html#name-specification-of-the-cbor-e + * for an estimation of the required length. */ +#define ODK_DEVICE_INFO_LEN_MAX 768 /// @addtogroup odk_timer /// @{ @@ -92,7 +97,8 @@ typedef struct { * * @param time_of_license_request_signed: Time that the license request was * signed, based on OEMCrypto's system clock. This value shall be stored - * and reloaded with usage entry as time_of_license_received. + * and reloaded with usage entry as time_of_license_received. This is + * also used to track the start of the rental clock time. * @param time_of_first_decrypt: Time of the first decrypt or call select key, * based on OEMCrypto's system clock. This is 0 if the license has not * been used to decrypt any data. This value shall be stored and reloaded @@ -161,6 +167,47 @@ typedef struct { /// @addtogroup odk_parser /// @{ +/** + * This counter information is used by the license and provisioning servers to + * keep track of requests. Values should be updated after every successful + * provisioning request, license request, and decrypt call. + * + * @param provisioning_count: number of times a provisioning request was made on + * this device in the current instance. May be reset to 0 on device power off. + * @param license_count: number of times a license request was made on this + * device in the current instance. May be reset to 0 on device power off. + * @param decrypt_count: number of times OEMCrypto_DecryptCENC() has been called + * on this device in the current instance. May be reset to 0 on device power + * off. + * @param master_generation_number: current master generation number value from + * the OEMCrypto usage table. Persists across reboots. + * @param soc_vendor: name of the system-on-a-chip vendor for the device, + * limited to 16 bytes + * @param chipset_model: name of the chipset on the device, limited to 16 bytes + * @param major_version: major version of the TA binary. This is different from + * the OEMCrypto version that is being implemented. + * @param minor_version: minor version of the TA binary, if applicable. This is + * different from the OEMCrypto version that is being implemented. + * @param patch_version: patch version of the TA binary, if applicable. This is + * different from the OEMCrypto version that is being implemented. + * @param extra: unused in V18 + * + * @version + * This struct was added in API version 18. + */ +typedef struct { + uint64_t master_generation_number; + uint32_t provisioning_count; + uint32_t license_count; + uint32_t decrypt_count; + uint16_t major_version; + uint16_t minor_version; + uint16_t patch_version; + uint8_t soc_vendor[16]; + uint8_t chipset_model[16]; + uint8_t extra[12]; +} ODK_MessageCounterInfo; + /** * The parsed license structure contains information from the license * message. The function ODK_ParseLicense will fill in the fields of this @@ -178,11 +225,12 @@ typedef struct { * @param timer_limits: time limits of the for the license. * @param watermarking: specifies if device supports watermarking. * @param dtcp2_required: specifies if device supports DTCP. + * @param renewal_delay_base: what time the timer starting is based off of. * @param key_array_length: number of keys present. * @param key_array: set of keys to be installed. * * @version - * This struct changed in API version 17. + * This struct changed in API version 18. */ typedef struct { OEMCrypto_Substring enc_mac_keys_iv; @@ -194,10 +242,51 @@ typedef struct { ODK_TimerLimits timer_limits; uint32_t watermarking; OEMCrypto_DTCP2_CMI_Packet dtcp2_required; + OEMCrypto_TimerDelayBase renewal_delay_base; uint32_t key_array_length; OEMCrypto_KeyObject key_array[ODK_MAX_NUM_KEYS]; } ODK_ParsedLicense; +/** + * The parsed license structure contains information from the license + * message. The function ODK_ParseLicense will fill in the fields of this + * message. All substrings are contained within the message body. + * + * @param enc_mac_keys_iv: IV for decrypting new mac_key. Size is 128 bits. + * @param enc_mac_keys: encrypted mac_keys for generating new mac_keys. Size is + * 512 bits. + * @param pst: the Provider Session Token. + * @param srm_restriction_data: optional data specifying the minimum SRM + * version. + * @param license_type: specifies if the license contains content keys or + * entitlement keys. + * @param nonce_required: indicates if the license requires a nonce. + * @param timer_limits: time limits of the for the license. + * @param watermarking: specifies if device supports watermarking. + * @param dtcp2_required: specifies if device supports DTCP. + * @param renewal_delay_base: what time the timer starting is based off of. + * @param key_array_length: number of keys present. + * @param key_array: set of keys to be installed. This is a pointer to an array + * to allow packing a number of keys greater than |ODK_MAX_NUM_KEYS|. + * + * @version + * This struct changed in API version 18. + */ +typedef struct { + OEMCrypto_Substring enc_mac_keys_iv; + OEMCrypto_Substring enc_mac_keys; + OEMCrypto_Substring pst; + OEMCrypto_Substring srm_restriction_data; + OEMCrypto_LicenseType license_type; + bool nonce_required; + ODK_TimerLimits timer_limits; + uint32_t watermarking; + OEMCrypto_DTCP2_CMI_Packet dtcp2_required; + OEMCrypto_TimerDelayBase renewal_delay_base; + uint32_t key_array_length; + OEMCrypto_KeyObject* key_array; +} ODK_Packing_ParsedLicense; + /** * The parsed provisioning structure contains information from the license * message. The function ODK_ParseProvisioning will fill in the fields of diff --git a/oemcrypto/odk/src/core_message_deserialize.cpp b/oemcrypto/odk/src/core_message_deserialize.cpp index 2e69641..30e68c4 100644 --- a/oemcrypto/odk/src/core_message_deserialize.cpp +++ b/oemcrypto/odk/src/core_message_deserialize.cpp @@ -11,10 +11,10 @@ #include #include "OEMCryptoCENCCommon.h" +#include "odk_message.h" #include "odk_serialize.h" #include "odk_structs.h" #include "odk_structs_priv.h" -#include "serialization_base.h" namespace oemcrypto_core_message { namespace deserialize { @@ -89,12 +89,62 @@ bool ParseRequest(uint32_t message_type, } // namespace +static bool GetNonceFromMessage(const std::string& oemcrypto_core_message, + ODK_NonceValues* nonce_values) { + if (nonce_values == nullptr) return false; + if (oemcrypto_core_message.size() < sizeof(ODK_CoreMessage)) return false; + + ODK_CoreMessage core_message; + const uint8_t* buf = + reinterpret_cast(oemcrypto_core_message.c_str()); + ODK_Message msg = ODK_Message_Create(const_cast(buf), + oemcrypto_core_message.size()); + ODK_Message_SetSize(&msg, sizeof(ODK_CoreMessage)); + Unpack_ODK_CoreMessage(&msg, &core_message); + if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK) return false; + *nonce_values = core_message.nonce_values; + return true; +} + +bool CopyCounterInfo(ODK_MessageCounter* dest, ODK_MessageCounterInfo* src) { + if (!src || !dest) return false; + + dest->master_generation_number = src->master_generation_number; + dest->license_count = src->license_count; + dest->provisioning_count = src->provisioning_count; + dest->decrypt_count = src->decrypt_count; + dest->major_version = src->major_version; + dest->minor_version = src->minor_version; + dest->patch_version = src->patch_version; + memcpy(&dest->soc_vendor, &src->soc_vendor, sizeof(dest->soc_vendor)); + memcpy(&dest->chipset_model, &src->chipset_model, + sizeof(dest->chipset_model)); + memcpy(&dest->extra, &src->extra, sizeof(dest->extra)); + return true; +} + bool CoreLicenseRequestFromMessage(const std::string& oemcrypto_core_message, ODK_LicenseRequest* core_license_request) { + ODK_NonceValues nonce; + if (!GetNonceFromMessage(oemcrypto_core_message, &nonce)) return false; + if (nonce.api_major_version <= 17) { + const auto unpacker = Unpack_ODK_PreparedLicenseRequestV17; + ODK_PreparedLicenseRequestV17 prepared_license = {}; + return ParseRequest(ODK_License_Request_Type, oemcrypto_core_message, + core_license_request, &prepared_license, unpacker); + } const auto unpacker = Unpack_ODK_PreparedLicenseRequest; ODK_PreparedLicenseRequest prepared_license = {}; - return ParseRequest(ODK_License_Request_Type, oemcrypto_core_message, - core_license_request, &prepared_license, unpacker); + if (!ParseRequest(ODK_License_Request_Type, oemcrypto_core_message, + core_license_request, &prepared_license, unpacker)) { + return false; + } + if (!CopyCounterInfo(&core_license_request->counter_info, + &prepared_license.counter_info)) { + return false; + } + + return true; } bool CoreRenewalRequestFromMessage(const std::string& oemcrypto_core_message, @@ -112,26 +162,82 @@ bool CoreRenewalRequestFromMessage(const std::string& oemcrypto_core_message, bool CoreProvisioningRequestFromMessage( const std::string& oemcrypto_core_message, ODK_ProvisioningRequest* core_provisioning_request) { - const auto unpacker = Unpack_ODK_PreparedProvisioningRequest; - ODK_PreparedProvisioningRequest prepared_provision = {}; - if (!ParseRequest(ODK_Provisioning_Request_Type, oemcrypto_core_message, + // Need to partially parse in order to get the nonce values, which will tell + // us the major/minor version + ODK_NonceValues nonce; + if (!GetNonceFromMessage(oemcrypto_core_message, &nonce)) return false; + + if (nonce.api_major_version == 18) { + // Use special case unpacker for v18.0 + const auto unpacker = nonce.api_minor_version == 0 + ? Unpack_ODK_PreparedProvisioningRequestV180 + : Unpack_ODK_PreparedProvisioningRequest; + ODK_PreparedProvisioningRequest prepared_provision = {}; + + if (!ParseRequest(ODK_Provisioning_Request_Type, oemcrypto_core_message, + core_provisioning_request, &prepared_provision, + unpacker)) { + return false; + } + + if (!CopyCounterInfo(&core_provisioning_request->counter_info, + &prepared_provision.counter_info)) { + return false; + } + } else { + // V17 and older + const auto unpacker = Unpack_ODK_PreparedProvisioningRequestV17; + ODK_PreparedProvisioningRequestV17 prepared_provision = {}; + if (!ParseRequest(ODK_Provisioning_Request_Type, oemcrypto_core_message, + core_provisioning_request, &prepared_provision, + unpacker)) { + return false; + } + const uint8_t* device_id = prepared_provision.device_id; + const uint32_t device_id_length = prepared_provision.device_id_length; + if (device_id_length > ODK_DEVICE_ID_LEN_MAX) { + return false; + } + if (device_id_length > 0) { + uint8_t zero[ODK_DEVICE_ID_LEN_MAX] = {}; + if (memcmp(zero, device_id + device_id_length, + ODK_DEVICE_ID_LEN_MAX - device_id_length) != 0) { + return false; + } + core_provisioning_request->device_id.assign( + reinterpret_cast(device_id), device_id_length); + } + core_provisioning_request->renewal_type = OEMCrypto_NoRenewal; + core_provisioning_request->renewal_data.clear(); + } + return true; +} + +bool CoreProvisioning40RequestFromMessage( + const std::string& oemcrypto_core_message, + ODK_Provisioning40Request* core_provisioning_request) { + const auto unpacker = Unpack_ODK_PreparedProvisioning40Request; + ODK_PreparedProvisioning40Request prepared_provision = {}; + if (!ParseRequest(ODK_Provisioning40_Request_Type, oemcrypto_core_message, core_provisioning_request, &prepared_provision, unpacker)) { return false; } - const uint8_t* device_id = prepared_provision.device_id; - const uint32_t device_id_length = prepared_provision.device_id_length; - if (device_id_length > ODK_DEVICE_ID_LEN_MAX) { + if (!CopyCounterInfo(&core_provisioning_request->counter_info, + &prepared_provision.counter_info)) { return false; } - uint8_t zero[ODK_DEVICE_ID_LEN_MAX] = {}; - if (memcmp(zero, device_id + device_id_length, - ODK_DEVICE_ID_LEN_MAX - device_id_length)) { + const uint8_t* device_info = prepared_provision.device_info; + const uint32_t device_info_length = prepared_provision.device_info_length; + if (device_info_length > ODK_DEVICE_INFO_LEN_MAX) { return false; } - core_provisioning_request->device_id.assign( - reinterpret_cast(device_id), device_id_length); - core_provisioning_request->renewal_type = OEMCrypto_NoRenewal; - core_provisioning_request->renewal_data.clear(); + uint8_t zero[ODK_DEVICE_INFO_LEN_MAX] = {}; + if (memcmp(zero, device_info + device_info_length, + ODK_DEVICE_INFO_LEN_MAX - device_info_length) != 0) { + return false; + } + core_provisioning_request->device_info.assign( + reinterpret_cast(device_info), device_info_length); return true; } @@ -152,7 +258,7 @@ bool CoreRenewedProvisioningRequestFromMessage( } uint8_t zero[ODK_DEVICE_ID_LEN_MAX] = {}; if (memcmp(zero, device_id + device_id_length, - ODK_DEVICE_ID_LEN_MAX - device_id_length)) { + ODK_DEVICE_ID_LEN_MAX - device_id_length) != 0) { return false; } core_provisioning_request->device_id.assign( @@ -173,8 +279,16 @@ bool CoreCommonRequestFromMessage(const std::string& oemcrypto_core_message, ODK_CommonRequest* common_request) { const auto unpacker = Unpack_ODK_PreparedCommonRequest; ODK_PreparedCommonRequest prepared_common = {}; - return ParseRequest(ODK_Common_Request_Type, oemcrypto_core_message, - common_request, &prepared_common, unpacker); + const bool success = + ParseRequest(ODK_Common_Request_Type, oemcrypto_core_message, + common_request, &prepared_common, unpacker); + + if (success) { + const auto& core_message = prepared_common.core_message; + common_request->message_type = core_message.message_type; + common_request->message_length = core_message.message_length; + } + return success; } } // namespace deserialize diff --git a/oemcrypto/odk/src/core_message_features.cpp b/oemcrypto/odk/src/core_message_features.cpp index 615e477..b8cae56 100644 --- a/oemcrypto/odk/src/core_message_features.cpp +++ b/oemcrypto/odk/src/core_message_features.cpp @@ -4,6 +4,8 @@ #include "core_message_features.h" +#include + namespace oemcrypto_core_message { namespace features { const CoreMessageFeatures CoreMessageFeatures::kDefaultFeatures; @@ -23,7 +25,10 @@ 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; + case 18: + features.maximum_minor_version = 3; // 18.3 break; default: features.maximum_minor_version = 0; diff --git a/oemcrypto/odk/src/core_message_serialize.cpp b/oemcrypto/odk/src/core_message_serialize.cpp index 3c3590e..5edd352 100644 --- a/oemcrypto/odk/src/core_message_serialize.cpp +++ b/oemcrypto/odk/src/core_message_serialize.cpp @@ -25,13 +25,13 @@ namespace { * computing the API version of the response. * * Template arguments: - * T: struct to be deserialized by odk * S: kdo input struct */ -template +template bool CreateResponseHeader(const CoreMessageFeatures& features, - ODK_MessageType message_type, const S& core_request, - T& response) { + ODK_MessageType message_type, + ODK_CoreMessage* response_header, + const S& core_request) { // Bad major version. if ((features.maximum_major_version > ODK_MAJOR_VERSION) || (features.maximum_major_version == ODK_MAJOR_VERSION && @@ -40,20 +40,24 @@ bool CreateResponseHeader(const CoreMessageFeatures& features, return false; } - auto* header = &response.request.core_message; - header->message_type = message_type; - header->nonce_values.api_major_version = core_request.api_major_version; - header->nonce_values.api_minor_version = core_request.api_minor_version; - header->nonce_values.nonce = core_request.nonce; - header->nonce_values.session_id = core_request.session_id; + response_header->message_type = message_type; + response_header->nonce_values.api_major_version = + core_request.api_major_version; + response_header->nonce_values.api_minor_version = + core_request.api_minor_version; + response_header->nonce_values.nonce = core_request.nonce; + response_header->nonce_values.session_id = core_request.session_id; // The message API version for the response is the minimum of our version and // the request's version. if (core_request.api_major_version > features.maximum_major_version) { - header->nonce_values.api_major_version = features.maximum_major_version; - header->nonce_values.api_minor_version = features.maximum_minor_version; + response_header->nonce_values.api_major_version = + features.maximum_major_version; + response_header->nonce_values.api_minor_version = + features.maximum_minor_version; } else if (core_request.api_major_version == features.maximum_major_version && core_request.api_minor_version > features.maximum_minor_version) { - header->nonce_values.api_minor_version = features.maximum_minor_version; + response_header->nonce_values.api_minor_version = + features.maximum_minor_version; } return true; } @@ -63,19 +67,18 @@ bool CreateResponseHeader(const CoreMessageFeatures& features, * * Template arguments: * T: struct to be deserialized by odk - * S: kdo input struct * P: auto-generated serializing function for |T| */ -template -bool CreateResponse(ODK_MessageType message_type, const S& core_request, - std::string* oemcrypto_core_message, T& response, +template +bool CreateResponse(ODK_MessageType message_type, + std::string* oemcrypto_core_message, + ODK_CoreMessage* response_header, T& response, const P& packer) { if (!oemcrypto_core_message) { return false; } - auto* header = &response.request.core_message; - if (header->message_type != message_type || - header->nonce_values.api_major_version < ODK_FIRST_VERSION) { + if (response_header->message_type != message_type || + response_header->nonce_values.api_major_version < ODK_FIRST_VERSION) { // This indicates CreateResponseHeader was not called. return false; } @@ -89,8 +92,8 @@ bool CreateResponse(ODK_MessageType message_type, const S& core_request, } uint32_t message_length = static_cast(ODK_Message_GetSize(&msg)); - msg = ODK_Message_Create(buf.data() + sizeof(header->message_type), - sizeof(header->message_length)); + msg = ODK_Message_Create(buf.data() + sizeof(response_header->message_type), + sizeof(response_header->message_length)); Pack_uint32_t(&msg, &message_length); oemcrypto_core_message->assign(reinterpret_cast(buf.data()), message_length); @@ -98,10 +101,10 @@ bool CreateResponse(ODK_MessageType message_type, const S& core_request, } bool CopyDeviceId(const ODK_ProvisioningRequest& src, - ODK_ProvisioningResponse* dest) { + ODK_ProvisioningResponseV16* dest) { auto& request = dest->request; const std::string& device_id = src.device_id; - if (request.device_id_length > sizeof(request.device_id)) { + if (device_id.size() > sizeof(request.device_id)) { return false; } request.device_id_length = static_cast(device_id.size()); @@ -113,56 +116,24 @@ bool CopyDeviceId(const ODK_ProvisioningRequest& src, } // namespace bool CreateCoreLicenseResponse(const CoreMessageFeatures& features, - const ODK_ParsedLicense& parsed_lic, + const ODK_Packing_ParsedLicense& parsed_lic, const ODK_LicenseRequest& core_request, const std::string& core_request_sha256, std::string* oemcrypto_core_message) { - ODK_LicenseResponse license_response{ - {}, const_cast(&parsed_lic)}; - if (!CreateResponseHeader(features, ODK_License_Response_Type, core_request, - license_response)) { + ODK_Packing_LicenseResponse license_response{ + {}, const_cast(&parsed_lic), {}}; + if (!CreateResponseHeader(features, ODK_License_Response_Type, + &license_response.core_message, core_request)) { return false; } - if (ODK_MAX_NUM_KEYS < license_response.parsed_license->key_array_length) { - return false; - } - if (license_response.request.core_message.nonce_values.api_major_version == - 16) { - ODK_LicenseResponseV16 license_response_v16; - license_response_v16.request = license_response.request; - license_response_v16.parsed_license.enc_mac_keys_iv = - license_response.parsed_license->enc_mac_keys_iv; - license_response_v16.parsed_license.enc_mac_keys = - license_response.parsed_license->enc_mac_keys; - license_response_v16.parsed_license.pst = - license_response.parsed_license->pst; - license_response_v16.parsed_license.srm_restriction_data = - license_response.parsed_license->srm_restriction_data; - license_response_v16.parsed_license.license_type = - license_response.parsed_license->license_type; - license_response_v16.parsed_license.nonce_required = - license_response.parsed_license->nonce_required; - license_response_v16.parsed_license.timer_limits = - license_response.parsed_license->timer_limits; - license_response_v16.parsed_license.key_array_length = - license_response.parsed_license->key_array_length; - uint32_t i; - for (i = 0; i < license_response_v16.parsed_license.key_array_length && - i < license_response.parsed_license->key_array_length; - i++) { - license_response_v16.parsed_license.key_array[i] = - license_response.parsed_license->key_array[i]; - } - if (core_request_sha256.size() != sizeof(license_response_v16.request_hash)) + if (license_response.core_message.nonce_values.api_major_version == 16) { + if (core_request_sha256.size() != sizeof(license_response.request_hash)) return false; - memcpy(license_response_v16.request_hash, core_request_sha256.data(), - sizeof(license_response_v16.request_hash)); - return CreateResponse(ODK_License_Response_Type, core_request, - oemcrypto_core_message, license_response_v16, - Pack_ODK_LicenseResponseV16); + memcpy(license_response.request_hash, core_request_sha256.data(), + sizeof(license_response.request_hash)); } - return CreateResponse(ODK_License_Response_Type, core_request, - oemcrypto_core_message, license_response, + return CreateResponse(ODK_License_Response_Type, oemcrypto_core_message, + &license_response.core_message, license_response, Pack_ODK_LicenseResponse); } @@ -173,13 +144,14 @@ bool CreateCoreRenewalResponse(const CoreMessageFeatures& features, ODK_RenewalResponse renewal_response{{}, core_request.playback_time_seconds}; renewal_response.request.playback_time = core_request.playback_time_seconds; renewal_response.renewal_duration_seconds = renewal_duration_seconds; - if (!CreateResponseHeader(features, ODK_Renewal_Response_Type, core_request, - renewal_response)) { + if (!CreateResponseHeader(features, ODK_Renewal_Response_Type, + &renewal_response.request.core_message, + core_request)) { return false; } - return CreateResponse(ODK_Renewal_Response_Type, core_request, - oemcrypto_core_message, renewal_response, - Pack_ODK_RenewalResponse); + return CreateResponse(ODK_Renewal_Response_Type, oemcrypto_core_message, + &renewal_response.request.core_message, + renewal_response, Pack_ODK_RenewalResponse); } bool CreateCoreProvisioningResponse(const CoreMessageFeatures& features, @@ -188,17 +160,42 @@ bool CreateCoreProvisioningResponse(const CoreMessageFeatures& features, std::string* oemcrypto_core_message) { ODK_ProvisioningResponse prov_response{ {}, const_cast(&parsed_prov)}; - if (!CopyDeviceId(core_request, &prov_response)) { - return false; - } if (!CreateResponseHeader(features, ODK_Provisioning_Response_Type, - core_request, prov_response)) { + &prov_response.core_message, core_request)) { return false; } - return CreateResponse(ODK_Provisioning_Response_Type, core_request, - oemcrypto_core_message, prov_response, + + if (prov_response.core_message.nonce_values.api_major_version <= 17) { + ODK_ProvisioningResponseV16 prov_response_v16; + if (!CopyDeviceId(core_request, &prov_response_v16)) { + return false; + } + prov_response_v16.request.core_message = prov_response.core_message; + prov_response_v16.parsed_provisioning = prov_response.parsed_provisioning; + return CreateResponse(ODK_Provisioning_Response_Type, + oemcrypto_core_message, + &prov_response_v16.request.core_message, + prov_response_v16, Pack_ODK_ProvisioningResponseV16); + } + + return CreateResponse(ODK_Provisioning_Response_Type, oemcrypto_core_message, + &prov_response.core_message, prov_response, Pack_ODK_ProvisioningResponse); } +bool CreateCoreProvisioning40Response( + const CoreMessageFeatures& features, + const ODK_Provisioning40Request& core_request, + std::string* oemcrypto_core_message) { + ODK_Provisioning40Response prov_response = {}; + if (!CreateResponseHeader(features, ODK_Provisioning_Response_Type, + &prov_response.core_message, core_request)) { + return false; + } + return CreateResponse(ODK_Provisioning_Response_Type, oemcrypto_core_message, + &prov_response.core_message, prov_response, + Pack_ODK_Provisioning40Response); +} + } // namespace serialize } // namespace oemcrypto_core_message diff --git a/oemcrypto/odk/src/core_message_serialize_proto.cpp b/oemcrypto/odk/src/core_message_serialize_proto.cpp index 5132bda..61c5031 100644 --- a/oemcrypto/odk/src/core_message_serialize_proto.cpp +++ b/oemcrypto/odk/src/core_message_serialize_proto.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "core_message_serialize.h" #include "license_protocol.pb.h" @@ -83,7 +84,8 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features, return false; } - ODK_ParsedLicense parsed_lic{}; + ODK_Packing_ParsedLicense parsed_lic{}; + std::vector key_array; bool any_content = false; bool any_entitlement = false; @@ -110,12 +112,8 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features, } else { any_content = true; } - if (parsed_lic.key_array_length >= ODK_MAX_NUM_KEYS) { - return false; - } - uint32_t& n = parsed_lic.key_array_length; - parsed_lic.key_array[n++] = - KeyContainerToOecKey(serialized_license, k, uses_padding); + key_array.push_back( + KeyContainerToOecKey(serialized_license, k, uses_padding)); break; } default: { @@ -147,6 +145,19 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features, } parsed_lic.nonce_required = nonce_required; const auto& policy = lic.policy(); + switch (policy.initial_renewal_delay_base()) { + case video_widevine::License_Policy::LICENSE_LOAD: + parsed_lic.renewal_delay_base = OEMCrypto_License_Load; + break; + case video_widevine::License_Policy::FIRST_DECRYPT: + parsed_lic.renewal_delay_base = OEMCrypto_First_Decrypt; + break; + case video_widevine::License_Policy::TIMER_DELAY_BASE_UNSPECIFIED: + case video_widevine::License_Policy::LICENSE_START: + default: + parsed_lic.renewal_delay_base = OEMCrypto_License_Start; + break; + } ODK_TimerLimits& timer_limits = parsed_lic.timer_limits; timer_limits.soft_enforce_rental_duration = policy.soft_enforce_rental_duration(); @@ -160,23 +171,23 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features, policy.renewal_delay_seconds() + policy.renewal_recovery_duration_seconds(); + parsed_lic.key_array = key_array.data(); + parsed_lic.key_array_length = static_cast(key_array.size()); + return CreateCoreLicenseResponse(features, parsed_lic, core_request, core_request_sha256, oemcrypto_core_message); } -bool CreateCoreProvisioningResponseFromProto( - const CoreMessageFeatures& features, +bool DeserializeProvisioningResponse( const std::string& serialized_provisioning_resp, - const ODK_ProvisioningRequest& core_request, - std::string* oemcrypto_core_message) { - ODK_ParsedProvisioning parsed_prov{}; + const OEMCrypto_PrivateKeyType device_key_type, + ODK_ParsedProvisioning& parsed_prov) { video_widevine::ProvisioningResponse prov; if (!prov.ParseFromString(serialized_provisioning_resp)) { return false; } - parsed_prov.key_type = - OEMCrypto_RSA_Private_Key; // TODO(b/148404408): ECC or RSA + parsed_prov.key_type = device_key_type; if (prov.has_device_rsa_key()) { parsed_prov.enc_private_key = GetOecSubstring(serialized_provisioning_resp, prov.device_rsa_key()); @@ -189,7 +200,19 @@ bool CreateCoreProvisioningResponseFromProto( parsed_prov.encrypted_message_key = GetOecSubstring(serialized_provisioning_resp, prov.wrapping_key()); } + return true; +} +bool CreateCoreProvisioningResponseFromProto( + const CoreMessageFeatures& features, + const std::string& serialized_provisioning_resp, + const ODK_ProvisioningRequest& core_request, + const OEMCrypto_PrivateKeyType device_key_type, + std::string* oemcrypto_core_message) { + ODK_ParsedProvisioning parsed_prov{}; + if (!DeserializeProvisioningResponse(serialized_provisioning_resp, + device_key_type, parsed_prov)) + return false; return CreateCoreProvisioningResponse(features, parsed_prov, core_request, oemcrypto_core_message); } diff --git a/oemcrypto/odk/src/odk.c b/oemcrypto/odk/src/odk.c index 4f28389..3ade4a7 100644 --- a/oemcrypto/odk/src/odk.c +++ b/oemcrypto/odk/src/odk.c @@ -6,14 +6,15 @@ #include #include +#include #include +#include "odk_message.h" #include "odk_overflow.h" #include "odk_serialize.h" #include "odk_structs.h" #include "odk_structs_priv.h" #include "odk_util.h" -#include "serialization_base.h" /* @ private odk functions */ @@ -31,7 +32,7 @@ static OEMCryptoResult ODK_PrepareRequest( /* The core message should be at the beginning of the buffer, and with a * shorter length. */ - if (sizeof(ODK_CoreMessage) > prepared_request_buffer_length) { + if (ODK_CORE_MESSAGE_SIZE > prepared_request_buffer_length) { return ODK_ERROR_CORE_MESSAGE; } ODK_CoreMessage* core_message = (ODK_CoreMessage*)prepared_request_buffer; @@ -45,12 +46,23 @@ static OEMCryptoResult ODK_PrepareRequest( * message buffer has been correctly initialized by the caller. */ switch (message_type) { case ODK_License_Request_Type: { - core_message->message_length = ODK_LICENSE_REQUEST_SIZE; - if (sizeof(ODK_PreparedLicenseRequest) > prepared_request_buffer_length) { - return ODK_ERROR_CORE_MESSAGE; + if (nonce_values->api_major_version > 17) { + core_message->message_length = ODK_LICENSE_REQUEST_SIZE; + if (sizeof(ODK_PreparedLicenseRequest) > + prepared_request_buffer_length) { + return ODK_ERROR_CORE_MESSAGE; + } + Pack_ODK_PreparedLicenseRequest( + &msg, (ODK_PreparedLicenseRequest*)prepared_request_buffer); + } else { + core_message->message_length = ODK_LICENSE_REQUEST_SIZE_V17; + if (sizeof(ODK_PreparedLicenseRequestV17) > + prepared_request_buffer_length) { + return ODK_ERROR_CORE_MESSAGE; + } + Pack_ODK_PreparedLicenseRequestV17( + &msg, (ODK_PreparedLicenseRequestV17*)prepared_request_buffer); } - Pack_ODK_PreparedLicenseRequest( - &msg, (ODK_PreparedLicenseRequest*)prepared_request_buffer); break; } case ODK_Renewal_Request_Type: { @@ -63,13 +75,33 @@ static OEMCryptoResult ODK_PrepareRequest( break; } case ODK_Provisioning_Request_Type: { - core_message->message_length = ODK_PROVISIONING_REQUEST_SIZE; - if (sizeof(ODK_PreparedProvisioningRequest) > + if (nonce_values->api_major_version > 17) { + core_message->message_length = ODK_PROVISIONING_REQUEST_SIZE; + if (sizeof(ODK_PreparedProvisioningRequest) > + prepared_request_buffer_length) { + return ODK_ERROR_CORE_MESSAGE; + } + Pack_ODK_PreparedProvisioningRequest( + &msg, (ODK_PreparedProvisioningRequest*)prepared_request_buffer); + } else { + core_message->message_length = ODK_PROVISIONING_REQUEST_SIZE_V17; + if (sizeof(ODK_PreparedProvisioningRequestV17) > + prepared_request_buffer_length) { + return ODK_ERROR_CORE_MESSAGE; + } + Pack_ODK_PreparedProvisioningRequestV17( + &msg, (ODK_PreparedProvisioningRequestV17*)prepared_request_buffer); + } + break; + } + case ODK_Provisioning40_Request_Type: { + core_message->message_length = ODK_PROVISIONING40_REQUEST_SIZE; + if (sizeof(ODK_PreparedProvisioning40Request) > prepared_request_buffer_length) { return ODK_ERROR_CORE_MESSAGE; } - Pack_ODK_PreparedProvisioningRequest( - &msg, (ODK_PreparedProvisioningRequest*)prepared_request_buffer); + Pack_ODK_PreparedProvisioning40Request( + &msg, (ODK_PreparedProvisioning40Request*)prepared_request_buffer); break; } case ODK_Renewed_Provisioning_Request_Type: { @@ -169,15 +201,26 @@ static OEMCryptoResult ODK_ParseCoreHeader(const uint8_t* message, /* @@ prepare request functions */ OEMCryptoResult ODK_PrepareCoreLicenseRequest( - uint8_t* message, size_t message_length, size_t* core_message_length, - const ODK_NonceValues* nonce_values) { - if (core_message_length == NULL || nonce_values == NULL) { + uint8_t* message, size_t message_length, size_t* core_message_size, + const ODK_NonceValues* nonce_values, + const ODK_MessageCounterInfo* counter_info) { + if (core_message_size == NULL || nonce_values == NULL || + counter_info == NULL) { return ODK_ERROR_CORE_MESSAGE; } - ODK_PreparedLicenseRequest license_request = {0}; - return ODK_PrepareRequest( - message, message_length, core_message_length, ODK_License_Request_Type, - nonce_values, &license_request, sizeof(ODK_PreparedLicenseRequest)); + if (nonce_values->api_major_version > 17) { + ODK_PreparedLicenseRequest license_request = {0}; + memcpy(&license_request.counter_info, counter_info, + sizeof(license_request.counter_info)); + return ODK_PrepareRequest( + message, message_length, core_message_size, ODK_License_Request_Type, + nonce_values, &license_request, sizeof(ODK_PreparedLicenseRequest)); + } else { + ODK_PreparedLicenseRequestV17 license_request = {0}; + return ODK_PrepareRequest( + message, message_length, core_message_size, ODK_License_Request_Type, + nonce_values, &license_request, sizeof(ODK_PreparedLicenseRequestV17)); + } } OEMCryptoResult ODK_PrepareCoreRenewalRequest(uint8_t* message, @@ -230,23 +273,53 @@ OEMCryptoResult ODK_PrepareCoreRenewalRequest(uint8_t* message, OEMCryptoResult ODK_PrepareCoreProvisioningRequest( uint8_t* message, size_t message_length, size_t* core_message_length, - const ODK_NonceValues* nonce_values, const uint8_t* device_id, - size_t device_id_length) { - if (core_message_length == NULL || nonce_values == NULL) { + const ODK_NonceValues* nonce_values, + const ODK_MessageCounterInfo* counter_info) { + if (core_message_length == NULL || nonce_values == NULL || + counter_info == NULL) { return ODK_ERROR_CORE_MESSAGE; } - ODK_PreparedProvisioningRequest provisioning_request = {0}; - if (device_id_length > sizeof(provisioning_request.device_id)) { + if (nonce_values->api_major_version > 17) { + ODK_PreparedProvisioningRequest provisioning_request = {0}; + memcpy(&provisioning_request.counter_info, counter_info, + sizeof(ODK_MessageCounterInfo)); + + return ODK_PrepareRequest(message, message_length, core_message_length, + ODK_Provisioning_Request_Type, nonce_values, + &provisioning_request, + sizeof(ODK_PreparedProvisioningRequest)); + } else { + ODK_PreparedProvisioningRequestV17 provisioning_request = {0}; + return ODK_PrepareRequest(message, message_length, core_message_length, + ODK_Provisioning_Request_Type, nonce_values, + &provisioning_request, + sizeof(ODK_PreparedProvisioningRequestV17)); + } +} + +OEMCryptoResult ODK_PrepareCoreProvisioning40Request( + uint8_t* message, size_t message_length, size_t* core_message_length, + const ODK_NonceValues* nonce_values, const uint8_t* device_info, + size_t device_info_length, const ODK_MessageCounterInfo* counter_info) { + if (core_message_length == NULL || nonce_values == NULL || + counter_info == NULL) { return ODK_ERROR_CORE_MESSAGE; } - provisioning_request.device_id_length = (uint32_t)device_id_length; - if (device_id) { - memcpy(provisioning_request.device_id, device_id, device_id_length); + ODK_PreparedProvisioning40Request provisioning_request = {0}; + if (device_info_length > sizeof(provisioning_request.device_info)) { + return ODK_ERROR_CORE_MESSAGE; } + provisioning_request.device_info_length = (uint32_t)device_info_length; + if (device_info) { + memcpy(provisioning_request.device_info, device_info, device_info_length); + } + memcpy(&provisioning_request.counter_info, counter_info, + sizeof(provisioning_request.counter_info)); + return ODK_PrepareRequest(message, message_length, core_message_length, - ODK_Provisioning_Request_Type, nonce_values, + ODK_Provisioning40_Request_Type, nonce_values, &provisioning_request, - sizeof(ODK_PreparedProvisioningRequest)); + sizeof(provisioning_request)); } OEMCryptoResult ODK_PrepareCoreRenewedProvisioningRequest( @@ -285,14 +358,15 @@ OEMCryptoResult ODK_PrepareCoreRenewedProvisioningRequest( OEMCryptoResult ODK_ParseLicense( const uint8_t* message, size_t message_length, size_t core_message_length, bool initial_license_load, bool usage_entry_present, - ODK_TimerLimits* timer_limits, ODK_ClockValues* clock_values, - ODK_NonceValues* nonce_values, ODK_ParsedLicense* parsed_license) { + uint64_t system_time_seconds, ODK_TimerLimits* timer_limits, + ODK_ClockValues* clock_values, ODK_NonceValues* nonce_values, + ODK_ParsedLicense* parsed_license, uint64_t* timer_value) { if (message == NULL || timer_limits == NULL || clock_values == NULL || nonce_values == NULL || parsed_license == NULL) { return ODK_ERROR_CORE_MESSAGE; } - const OEMCryptoResult err = + OEMCryptoResult err = ODK_ParseCoreHeader(message, message_length, core_message_length, ODK_License_Response_Type, nonce_values); if (err != OEMCrypto_SUCCESS) { @@ -303,68 +377,14 @@ OEMCryptoResult ODK_ParseLicense( license_response.parsed_license = parsed_license; ODK_Message msg = ODK_Message_Create((uint8_t*)message, message_length); + ODK_Message_SetSize(&msg, core_message_length); - if (nonce_values->api_major_version == 16) { - ODK_LicenseResponseV16 license_response_v16 = {0}; - Unpack_ODK_LicenseResponseV16(&msg, &license_response_v16); - if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || - ODK_Message_GetOffset(&msg) != core_message_length) { - return ODK_ERROR_CORE_MESSAGE; - } + Unpack_ODK_LicenseResponse(&msg, &license_response); - // Need to manually set parsed_license fields to - // license_response_v16.parsed_license field values since - // license_response_v16 is no longer a pointer so parsed_license doesn't get - // updated during the unpacking. - parsed_license->enc_mac_keys_iv = - license_response_v16.parsed_license.enc_mac_keys_iv; - parsed_license->enc_mac_keys = - license_response_v16.parsed_license.enc_mac_keys; - parsed_license->pst = license_response_v16.parsed_license.pst; - parsed_license->srm_restriction_data = - license_response_v16.parsed_license.srm_restriction_data; - parsed_license->license_type = - license_response_v16.parsed_license.license_type; - parsed_license->nonce_required = - license_response_v16.parsed_license.nonce_required; - parsed_license->timer_limits = - license_response_v16.parsed_license.timer_limits; - parsed_license->key_array_length = - license_response_v16.parsed_license.key_array_length; - uint32_t i; - for (i = 0; i < parsed_license->key_array_length; i++) { - parsed_license->key_array[i] = - license_response_v16.parsed_license.key_array[i]; - } - // Set fields not used in V16 to default values. - parsed_license->watermarking = 0; - // Set fields not used in V16 to default values. - parsed_license->dtcp2_required.dtcp2_required = 0; - parsed_license->dtcp2_required.cmi_descriptor_0.id = 0; - parsed_license->dtcp2_required.cmi_descriptor_0.extension = 0; - parsed_license->dtcp2_required.cmi_descriptor_0.length = 1; - parsed_license->dtcp2_required.cmi_descriptor_0.data = 0; - parsed_license->dtcp2_required.cmi_descriptor_1.id = 1; - parsed_license->dtcp2_required.cmi_descriptor_1.extension = 0; - parsed_license->dtcp2_required.cmi_descriptor_1.length = 3; - parsed_license->dtcp2_required.cmi_descriptor_1.data[0] = 0; - parsed_license->dtcp2_required.cmi_descriptor_1.data[1] = 0; - parsed_license->dtcp2_required.cmi_descriptor_1.data[2] = 0; - parsed_license->dtcp2_required.cmi_descriptor_2.id = 2; - parsed_license->dtcp2_required.cmi_descriptor_2.extension = 0; - parsed_license->dtcp2_required.cmi_descriptor_2.length = 3; - parsed_license->dtcp2_required.cmi_descriptor_2.data[0] = 0; - parsed_license->dtcp2_required.cmi_descriptor_2.data[1] = 0; - parsed_license->dtcp2_required.cmi_descriptor_2.data[2] = 0; - license_response.request = license_response_v16.request; - } else { - Unpack_ODK_LicenseResponse(&msg, &license_response); - - if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || - ODK_Message_GetOffset(&msg) != core_message_length) { - return ODK_ERROR_CORE_MESSAGE; - } + if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || + ODK_Message_GetOffset(&msg) != core_message_length) { + return ODK_ERROR_CORE_MESSAGE; } /* If the license has a provider session token (pst), then OEMCrypto should @@ -382,26 +402,38 @@ OEMCryptoResult ODK_ParseLicense( */ if (parsed_license->nonce_required && initial_license_load) { if (nonce_values->nonce != - license_response.request.core_message.nonce_values.nonce || + license_response.core_message.nonce_values.nonce || nonce_values->session_id != - license_response.request.core_message.nonce_values.session_id) { + license_response.core_message.nonce_values.session_id) { return OEMCrypto_ERROR_INVALID_NONCE; } } else { /* !initial_license_load, or can't tell if initial. */ - nonce_values->nonce = - license_response.request.core_message.nonce_values.nonce; + nonce_values->nonce = license_response.core_message.nonce_values.nonce; nonce_values->session_id = - license_response.request.core_message.nonce_values.session_id; + license_response.core_message.nonce_values.session_id; + /* Start the rental clock if not already started for reloading an offline + * license without a nonce. */ + if (!parsed_license->nonce_required && + clock_values->time_of_license_request_signed == 0) { + clock_values->time_of_license_request_signed = system_time_seconds; + } } + bool license_load = + (parsed_license->renewal_delay_base == OEMCrypto_License_Load); *timer_limits = parsed_license->timer_limits; /* And update the clock values state. */ clock_values->timer_status = ODK_CLOCK_TIMER_STATUS_LICENSE_LOADED; + if (nonce_values->api_major_version == 18 && license_load) { + err = ODK_AttemptFirstPlayback(system_time_seconds, timer_limits, + clock_values, timer_value); + return err; + } return OEMCrypto_SUCCESS; } OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, size_t core_message_length, - const ODK_NonceValues* nonce_values, + ODK_NonceValues* nonce_values, uint64_t system_time, const ODK_TimerLimits* timer_limits, ODK_ClockValues* clock_values, @@ -413,7 +445,7 @@ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, const OEMCryptoResult err = ODK_ParseCoreHeader(message, message_length, core_message_length, - ODK_Renewal_Response_Type, NULL); + ODK_Renewal_Response_Type, nonce_values); if (err != OEMCrypto_SUCCESS) { return err; } @@ -439,10 +471,14 @@ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, */ /* If a renewal request is lost in transit, we should throw it out and create * a new one. We use the timestamp to make sure we have the latest request. - * We only do this if playback has already started. This allows us to reload - * an offline license and also reload a renewal before starting playback. + * We only do this if a renewal has been requested for this session. This + * allows us to reload an offline license and also reload a renewal from a + * previous session before starting playback. + * TODO: b/290249855 - This is reversed. It should be "!=" instead of "<". + * We will not fix this in the current release, because it is already in + * production code. Instead, this will be fixed in v19. */ - if (clock_values->timer_status != ODK_CLOCK_TIMER_STATUS_LICENSE_LOADED && + if (clock_values->time_of_renewal_request > 0 && clock_values->time_of_renewal_request < renewal_response.request.playback_time) { return ODK_STALE_RENEWAL; @@ -454,7 +490,7 @@ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, OEMCryptoResult ODK_ParseProvisioning( const uint8_t* message, size_t message_length, size_t core_message_length, - const ODK_NonceValues* nonce_values, const uint8_t* device_id, + ODK_NonceValues* nonce_values, const uint8_t* device_id, size_t device_id_length, ODK_ParsedProvisioning* parsed_response) { if (message == NULL || nonce_values == NULL || device_id == NULL || parsed_response == NULL) { @@ -462,44 +498,88 @@ OEMCryptoResult ODK_ParseProvisioning( } const OEMCryptoResult err = ODK_ParseCoreHeader(message, message_length, core_message_length, - ODK_Provisioning_Response_Type, NULL); + ODK_Provisioning_Response_Type, nonce_values); if (err != OEMCrypto_SUCCESS) { return err; } - ODK_ProvisioningResponse provisioning_response = {0}; - provisioning_response.parsed_provisioning = parsed_response; - if (device_id_length > ODK_DEVICE_ID_LEN_MAX) { + if (nonce_values->api_major_version <= 17) { + // Do v16/v17 + ODK_ProvisioningResponseV16 provisioning_response = {0}; + provisioning_response.parsed_provisioning = parsed_response; + + if (device_id_length > ODK_DEVICE_ID_LEN_MAX) { + return ODK_ERROR_CORE_MESSAGE; + } + + ODK_Message msg = ODK_Message_Create((uint8_t*)message, message_length); + ODK_Message_SetSize(&msg, core_message_length); + Unpack_ODK_ProvisioningResponseV16(&msg, &provisioning_response); + if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || + ODK_Message_GetOffset(&msg) != core_message_length) { + return ODK_ERROR_CORE_MESSAGE; + } + /* always verify nonce_values for Renewal and Provisioning responses */ + if (!ODK_NonceValuesEqualExcludingVersion( + nonce_values, + &(provisioning_response.request.core_message.nonce_values))) { + return OEMCrypto_ERROR_INVALID_NONCE; + } + + if (crypto_memcmp(device_id, provisioning_response.request.device_id, + device_id_length) != 0) { + return ODK_ERROR_CORE_MESSAGE; + } + } else { + // v18 + ODK_ProvisioningResponse provisioning_response = {0}; + provisioning_response.parsed_provisioning = parsed_response; + + ODK_Message msg = ODK_Message_Create((uint8_t*)message, message_length); + ODK_Message_SetSize(&msg, core_message_length); + Unpack_ODK_ProvisioningResponse(&msg, &provisioning_response); + if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || + ODK_Message_GetOffset(&msg) != core_message_length) { + return ODK_ERROR_CORE_MESSAGE; + } + /* always verify nonce_values for Renewal and Provisioning responses */ + if (!ODK_NonceValuesEqualExcludingVersion( + nonce_values, &(provisioning_response.core_message.nonce_values))) { + return OEMCrypto_ERROR_INVALID_NONCE; + } + } + + return OEMCrypto_SUCCESS; +} + +OEMCryptoResult ODK_ParseProvisioning40(const uint8_t* message, + size_t message_length, + size_t core_message_length, + ODK_NonceValues* nonce_values) { + if (message == NULL || nonce_values == NULL) { return ODK_ERROR_CORE_MESSAGE; } + const OEMCryptoResult err = + ODK_ParseCoreHeader(message, message_length, core_message_length, + ODK_Provisioning_Response_Type, nonce_values); + if (err != OEMCrypto_SUCCESS) { + return err; + } + ODK_Provisioning40Response provisioning_response = {0}; ODK_Message msg = ODK_Message_Create((uint8_t*)message, message_length); ODK_Message_SetSize(&msg, core_message_length); - Unpack_ODK_ProvisioningResponse(&msg, &provisioning_response); + Unpack_ODK_Provisioning40Response(&msg, &provisioning_response); if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || ODK_Message_GetOffset(&msg) != core_message_length) { return ODK_ERROR_CORE_MESSAGE; } /* always verify nonce_values for Renewal and Provisioning responses */ if (!ODK_NonceValuesEqualExcludingVersion( - nonce_values, - &(provisioning_response.request.core_message.nonce_values))) { + nonce_values, &(provisioning_response.core_message.nonce_values))) { return OEMCrypto_ERROR_INVALID_NONCE; } - if (crypto_memcmp(device_id, provisioning_response.request.device_id, - device_id_length) != 0) { - return ODK_ERROR_CORE_MESSAGE; - } - - const uint8_t zero[ODK_DEVICE_ID_LEN_MAX] = {0}; - /* check bytes beyond device_id_length are 0 */ - if (crypto_memcmp(zero, - provisioning_response.request.device_id + device_id_length, - ODK_DEVICE_ID_LEN_MAX - device_id_length) != 0) { - return ODK_ERROR_CORE_MESSAGE; - } - return OEMCrypto_SUCCESS; } diff --git a/oemcrypto/odk/src/odk.gyp b/oemcrypto/odk/src/odk.gyp index b874247..4aa79a4 100644 --- a/oemcrypto/odk/src/odk.gyp +++ b/oemcrypto/odk/src/odk.gyp @@ -9,6 +9,7 @@ 'target_name': 'odk', 'type': 'static_library', 'standalone_static_library' : 1, + 'hard_dependency': 1, 'include_dirs': [ '../include', '../../include', diff --git a/oemcrypto/odk/src/odk_endian.h b/oemcrypto/odk/src/odk_endian.h index 1e9f50d..58a2fd7 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_message.c b/oemcrypto/odk/src/odk_message.c index df29d23..7cc05c0 100644 --- a/oemcrypto/odk/src/odk_message.c +++ b/oemcrypto/odk/src/odk_message.c @@ -8,20 +8,13 @@ #include #include +#include "odk_assert.h" #include "odk_message_priv.h" -/* - * C11 defines static_assert in assert.h. If it is available, force a compile - * time error if the abstract ODK_Message struct size does not match its - * implementation. If static_assert is not available, the runtime assert in - * InitMessage will catch the mismatch at the time a message is initialized. - */ -#ifdef static_assert -static_assert( +odk_static_assert( sizeof(ODK_Message) >= sizeof(ODK_Message_Impl), "sizeof(ODK_Message) is too small. You can increase " "SIZE_OF_ODK_MESSAGE_IMPL in odk_message.h to make it large enough."); -#endif /* * Create a message structure that references a separate data buffer. An @@ -34,7 +27,6 @@ static_assert( * unchanged by this function. */ ODK_Message ODK_Message_Create(uint8_t* buffer, size_t capacity) { - assert(sizeof(ODK_Message) >= sizeof(ODK_Message_Impl)); ODK_Message message; ODK_Message_Impl* message_impl = (ODK_Message_Impl*)&message; message_impl->base = buffer; diff --git a/oemcrypto/odk/src/odk_overflow.c b/oemcrypto/odk/src/odk_overflow.c index 0ebc084..37c3bb9 100644 --- a/oemcrypto/odk/src/odk_overflow.c +++ b/oemcrypto/odk/src/odk_overflow.c @@ -2,6 +2,8 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include "odk_overflow.h" + #include #include diff --git a/oemcrypto/odk/src/odk_serialize.c b/oemcrypto/odk/src/odk_serialize.c index 5c58200..eec0266 100644 --- a/oemcrypto/odk/src/odk_serialize.c +++ b/oemcrypto/odk/src/odk_serialize.c @@ -6,6 +6,8 @@ * This code is auto-generated, do not edit */ +#include "odk_serialize.h" + #include "odk_structs_priv.h" #include "serialization_base.h" @@ -45,7 +47,8 @@ static void Pack_ODK_TimerLimits(ODK_Message* msg, ODK_TimerLimits const* obj) { } static void Pack_ODK_ParsedLicense(ODK_Message* msg, - ODK_ParsedLicense const* obj) { + ODK_Packing_ParsedLicense const* obj, + const ODK_NonceValues* nonce_values) { /* hand-coded */ if (obj->key_array_length > ODK_MAX_NUM_KEYS) { ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); @@ -58,47 +61,31 @@ static void Pack_ODK_ParsedLicense(ODK_Message* msg, Pack_enum(msg, obj->license_type); Pack_bool(msg, &obj->nonce_required); Pack_ODK_TimerLimits(msg, &obj->timer_limits); - Pack_uint32_t(msg, &obj->watermarking); - Pack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); - if (obj->dtcp2_required.dtcp2_required) { - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); - Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); - Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); - Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); - Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); + if (nonce_values->api_major_version >= 17) { + Pack_uint32_t(msg, &obj->watermarking); + Pack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); + if (obj->dtcp2_required.dtcp2_required) { + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); + Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); + Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); + Pack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); + Pack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); + } } - Pack_uint32_t(msg, &obj->key_array_length); - size_t i; - for (i = 0; i < (size_t)obj->key_array_length; i++) { - Pack_OEMCrypto_KeyObject(msg, &obj->key_array[i]); + if (nonce_values->api_major_version >= 18) { + Pack_enum(msg, obj->renewal_delay_base); } -} - -static void Pack_ODK_ParsedLicenseV16(ODK_Message* msg, - ODK_ParsedLicenseV16 const* obj) { - /* hand-coded */ - if (obj->key_array_length > ODK_MAX_NUM_KEYS) { - ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); - return; - } - Pack_OEMCrypto_Substring(msg, &obj->enc_mac_keys_iv); - Pack_OEMCrypto_Substring(msg, &obj->enc_mac_keys); - Pack_OEMCrypto_Substring(msg, &obj->pst); - Pack_OEMCrypto_Substring(msg, &obj->srm_restriction_data); - Pack_enum(msg, obj->license_type); - Pack_bool(msg, &obj->nonce_required); - Pack_ODK_TimerLimits(msg, &obj->timer_limits); Pack_uint32_t(msg, &obj->key_array_length); size_t i; for (i = 0; i < (size_t)obj->key_array_length; i++) { @@ -114,11 +101,31 @@ static void Pack_ODK_ParsedProvisioning(ODK_Message* msg, Pack_OEMCrypto_Substring(msg, &obj->encrypted_message_key); } +static void Pack_ODK_MessageCounterInfo(ODK_Message* msg, + ODK_MessageCounterInfo const* obj) { + Pack_uint64_t(msg, &obj->master_generation_number); + Pack_uint32_t(msg, &obj->provisioning_count); + Pack_uint32_t(msg, &obj->license_count); + Pack_uint32_t(msg, &obj->decrypt_count); + Pack_uint16_t(msg, &obj->major_version); + Pack_uint16_t(msg, &obj->minor_version); + Pack_uint16_t(msg, &obj->patch_version); + PackArray(msg, &obj->soc_vendor[0], sizeof(obj->soc_vendor)); + PackArray(msg, &obj->chipset_model[0], sizeof(obj->chipset_model)); + PackArray(msg, &obj->extra[0], sizeof(obj->extra)); +} + /* @@ odk serialize */ void Pack_ODK_PreparedLicenseRequest(ODK_Message* msg, ODK_PreparedLicenseRequest const* obj) { Pack_ODK_CoreMessage(msg, &obj->core_message); + Pack_ODK_MessageCounterInfo(msg, &obj->counter_info); +} + +void Pack_ODK_PreparedLicenseRequestV17( + ODK_Message* msg, ODK_PreparedLicenseRequestV17 const* obj) { + Pack_ODK_CoreMessage(msg, &obj->core_message); } void Pack_ODK_PreparedRenewalRequest(ODK_Message* msg, @@ -130,10 +137,28 @@ void Pack_ODK_PreparedRenewalRequest(ODK_Message* msg, void Pack_ODK_PreparedProvisioningRequest( ODK_Message* msg, const ODK_PreparedProvisioningRequest* obj) { Pack_ODK_CoreMessage(msg, &obj->core_message); + // Fake device_id_length for older servers, since we removed device id from + // the v18 request + uint32_t device_id_len = 64; + Pack_uint32_t(msg, &device_id_len); + Pack_ODK_MessageCounterInfo(msg, &obj->counter_info); +} + +void Pack_ODK_PreparedProvisioningRequestV17( + ODK_Message* msg, const ODK_PreparedProvisioningRequestV17* obj) { + Pack_ODK_CoreMessage(msg, &obj->core_message); Pack_uint32_t(msg, &obj->device_id_length); PackArray(msg, &obj->device_id[0], sizeof(obj->device_id)); } +void Pack_ODK_PreparedProvisioning40Request( + ODK_Message* msg, const ODK_PreparedProvisioning40Request* obj) { + Pack_ODK_CoreMessage(msg, &obj->core_message); + Pack_uint32_t(msg, &obj->device_info_length); + PackArray(msg, &obj->device_info[0], sizeof(obj->device_info)); + Pack_ODK_MessageCounterInfo(msg, &obj->counter_info); +} + void Pack_ODK_PreparedRenewedProvisioningRequest( ODK_Message* msg, const ODK_PreparedRenewedProvisioningRequest* obj) { Pack_ODK_CoreMessage(msg, &obj->core_message); @@ -147,16 +172,14 @@ void Pack_ODK_PreparedRenewedProvisioningRequest( /* @@ kdo serialize */ void Pack_ODK_LicenseResponse(ODK_Message* msg, - ODK_LicenseResponse const* obj) { - Pack_ODK_PreparedLicenseRequest(msg, &obj->request); - Pack_ODK_ParsedLicense(msg, (const ODK_ParsedLicense*)obj->parsed_license); -} - -void Pack_ODK_LicenseResponseV16(ODK_Message* msg, - ODK_LicenseResponseV16 const* obj) { - Pack_ODK_PreparedLicenseRequest(msg, &obj->request); - Pack_ODK_ParsedLicenseV16(msg, &obj->parsed_license); - PackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + ODK_Packing_LicenseResponse const* obj) { + Pack_ODK_CoreMessage(msg, &obj->core_message); + Pack_ODK_ParsedLicense(msg, + (const ODK_Packing_ParsedLicense*)obj->parsed_license, + &obj->core_message.nonce_values); + if ((&obj->core_message.nonce_values)->api_major_version == 16) { + PackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + } } void Pack_ODK_RenewalResponse(ODK_Message* msg, @@ -167,11 +190,23 @@ void Pack_ODK_RenewalResponse(ODK_Message* msg, void Pack_ODK_ProvisioningResponse(ODK_Message* msg, const ODK_ProvisioningResponse* obj) { - Pack_ODK_PreparedProvisioningRequest(msg, &obj->request); + Pack_ODK_CoreMessage(msg, &obj->core_message); Pack_ODK_ParsedProvisioning( msg, (const ODK_ParsedProvisioning*)obj->parsed_provisioning); } +void Pack_ODK_ProvisioningResponseV16(ODK_Message* msg, + const ODK_ProvisioningResponseV16* obj) { + Pack_ODK_PreparedProvisioningRequestV17(msg, &obj->request); + Pack_ODK_ParsedProvisioning( + msg, (const ODK_ParsedProvisioning*)obj->parsed_provisioning); +} + +void Pack_ODK_Provisioning40Response(ODK_Message* msg, + const ODK_Provisioning40Response* obj) { + Pack_ODK_CoreMessage(msg, &obj->core_message); +} + /* @ deserialize */ /* @@ private deserialize */ @@ -207,72 +242,40 @@ static void Unpack_ODK_TimerLimits(ODK_Message* msg, ODK_TimerLimits* obj) { Unpack_uint64_t(msg, &obj->initial_renewal_duration_seconds); } -static void Unpack_ODK_ParsedLicense(ODK_Message* msg, ODK_ParsedLicense* obj) { +static void Unpack_ODK_ParsedLicense(ODK_Message* msg, ODK_ParsedLicense* obj, + const ODK_NonceValues* nonce_values) { Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys_iv); 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); - Unpack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); - if (obj->dtcp2_required.dtcp2_required) { - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); - Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); - Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); - Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); - Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); - } else { - obj->dtcp2_required.dtcp2_required = 0; - obj->dtcp2_required.cmi_descriptor_0.id = 0; - obj->dtcp2_required.cmi_descriptor_0.extension = 0; - obj->dtcp2_required.cmi_descriptor_0.length = 0; - obj->dtcp2_required.cmi_descriptor_0.data = 0; - obj->dtcp2_required.cmi_descriptor_1.id = 0; - obj->dtcp2_required.cmi_descriptor_1.extension = 0; - obj->dtcp2_required.cmi_descriptor_1.length = 0; - obj->dtcp2_required.cmi_descriptor_1.data[0] = 0; - obj->dtcp2_required.cmi_descriptor_1.data[1] = 0; - obj->dtcp2_required.cmi_descriptor_1.data[2] = 0; - obj->dtcp2_required.cmi_descriptor_2.id = 0; - obj->dtcp2_required.cmi_descriptor_2.extension = 0; - obj->dtcp2_required.cmi_descriptor_2.length = 0; - obj->dtcp2_required.cmi_descriptor_2.data[0] = 0; - obj->dtcp2_required.cmi_descriptor_2.data[1] = 0; - obj->dtcp2_required.cmi_descriptor_2.data[2] = 0; + if (nonce_values->api_major_version >= 17) { + Unpack_uint32_t(msg, &obj->watermarking); + Unpack_uint8_t(msg, &obj->dtcp2_required.dtcp2_required); + if (obj->dtcp2_required.dtcp2_required) { + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.id); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.extension); + Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_0.length); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_0.data); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.id); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.extension); + Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_1.length); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[0]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[1]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_1.data[2]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.id); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.extension); + Unpack_uint16_t(msg, &obj->dtcp2_required.cmi_descriptor_2.length); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[0]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[1]); + Unpack_uint8_t(msg, &obj->dtcp2_required.cmi_descriptor_2.data[2]); + } } - Unpack_uint32_t(msg, &obj->key_array_length); - if (obj->key_array_length > ODK_MAX_NUM_KEYS) { - ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); - return; + if (nonce_values->api_major_version >= 18) { + Unpack_OEMCrypto_TimerDelayBase(msg, &obj->renewal_delay_base); } - uint32_t i; - for (i = 0; i < obj->key_array_length; i++) { - Unpack_OEMCrypto_KeyObject(msg, &obj->key_array[i]); - } -} - -static void Unpack_ODK_ParsedLicenseV16(ODK_Message* msg, - ODK_ParsedLicenseV16* obj) { - Unpack_OEMCrypto_Substring(msg, &obj->enc_mac_keys_iv); - 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_bool(msg, &obj->nonce_required); - Unpack_ODK_TimerLimits(msg, &obj->timer_limits); Unpack_uint32_t(msg, &obj->key_array_length); if (obj->key_array_length > ODK_MAX_NUM_KEYS) { ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); @@ -286,17 +289,37 @@ 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); } +static void Unpack_ODK_MessageCounterInfo(ODK_Message* msg, + ODK_MessageCounterInfo* obj) { + Unpack_uint64_t(msg, &obj->master_generation_number); + Unpack_uint32_t(msg, &obj->provisioning_count); + Unpack_uint32_t(msg, &obj->license_count); + Unpack_uint32_t(msg, &obj->decrypt_count); + Unpack_uint16_t(msg, &obj->major_version); + Unpack_uint16_t(msg, &obj->minor_version); + Unpack_uint16_t(msg, &obj->patch_version); + UnpackArray(msg, &obj->soc_vendor[0], sizeof(obj->soc_vendor)); + UnpackArray(msg, &obj->chipset_model[0], sizeof(obj->chipset_model)); + UnpackArray(msg, &obj->extra[0], sizeof(obj->extra)); +} + /* @ kdo deserialize */ void Unpack_ODK_PreparedLicenseRequest(ODK_Message* msg, ODK_PreparedLicenseRequest* obj) { Unpack_ODK_CoreMessage(msg, &obj->core_message); + Unpack_ODK_MessageCounterInfo(msg, &obj->counter_info); +} + +void Unpack_ODK_PreparedLicenseRequestV17(ODK_Message* msg, + ODK_PreparedLicenseRequestV17* obj) { + Unpack_ODK_CoreMessage(msg, &obj->core_message); } void Unpack_ODK_PreparedRenewalRequest(ODK_Message* msg, @@ -308,10 +331,34 @@ void Unpack_ODK_PreparedRenewalRequest(ODK_Message* msg, void Unpack_ODK_PreparedProvisioningRequest( ODK_Message* msg, ODK_PreparedProvisioningRequest* obj) { Unpack_ODK_CoreMessage(msg, &obj->core_message); + // Fake device_id_length for older servers, since we removed device id from + // the v18 request + uint32_t device_id_len = 0; + Unpack_uint32_t(msg, &device_id_len); + Unpack_ODK_MessageCounterInfo(msg, &obj->counter_info); +} + +void Unpack_ODK_PreparedProvisioningRequestV180( + ODK_Message* msg, ODK_PreparedProvisioningRequest* obj) { + Unpack_ODK_CoreMessage(msg, &obj->core_message); + Unpack_ODK_MessageCounterInfo(msg, &obj->counter_info); +} + +void Unpack_ODK_PreparedProvisioningRequestV17( + ODK_Message* msg, ODK_PreparedProvisioningRequestV17* obj) { + Unpack_ODK_CoreMessage(msg, &obj->core_message); Unpack_uint32_t(msg, &obj->device_id_length); UnpackArray(msg, &obj->device_id[0], sizeof(obj->device_id)); } +void Unpack_ODK_PreparedProvisioning40Request( + ODK_Message* msg, ODK_PreparedProvisioning40Request* obj) { + Unpack_ODK_CoreMessage(msg, &obj->core_message); + Unpack_uint32_t(msg, &obj->device_info_length); + UnpackArray(msg, &obj->device_info[0], sizeof(obj->device_info)); + Unpack_ODK_MessageCounterInfo(msg, &obj->counter_info); +} + void Unpack_ODK_PreparedRenewedProvisioningRequest( ODK_Message* msg, ODK_PreparedRenewedProvisioningRequest* obj) { Unpack_ODK_CoreMessage(msg, &obj->core_message); @@ -329,15 +376,12 @@ void Unpack_ODK_PreparedCommonRequest(ODK_Message* msg, /* @@ odk deserialize */ void Unpack_ODK_LicenseResponse(ODK_Message* msg, ODK_LicenseResponse* obj) { - Unpack_ODK_PreparedLicenseRequest(msg, &obj->request); - Unpack_ODK_ParsedLicense(msg, obj->parsed_license); -} - -void Unpack_ODK_LicenseResponseV16(ODK_Message* msg, - ODK_LicenseResponseV16* obj) { - Unpack_ODK_PreparedLicenseRequest(msg, &obj->request); - Unpack_ODK_ParsedLicenseV16(msg, &obj->parsed_license); - UnpackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + Unpack_ODK_CoreMessage(msg, &obj->core_message); + Unpack_ODK_ParsedLicense(msg, obj->parsed_license, + &obj->core_message.nonce_values); + if ((&obj->core_message.nonce_values)->api_major_version == 16) { + UnpackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + } } void Unpack_ODK_RenewalResponse(ODK_Message* msg, ODK_RenewalResponse* obj) { @@ -347,6 +391,17 @@ void Unpack_ODK_RenewalResponse(ODK_Message* msg, ODK_RenewalResponse* obj) { void Unpack_ODK_ProvisioningResponse(ODK_Message* msg, ODK_ProvisioningResponse* obj) { - Unpack_ODK_PreparedProvisioningRequest(msg, &obj->request); + Unpack_ODK_CoreMessage(msg, &obj->core_message); Unpack_ODK_ParsedProvisioning(msg, obj->parsed_provisioning); } + +void Unpack_ODK_ProvisioningResponseV16(ODK_Message* msg, + ODK_ProvisioningResponseV16* obj) { + Unpack_ODK_PreparedProvisioningRequestV17(msg, &obj->request); + Unpack_ODK_ParsedProvisioning(msg, obj->parsed_provisioning); +} + +void Unpack_ODK_Provisioning40Response(ODK_Message* msg, + ODK_Provisioning40Response* obj) { + Unpack_ODK_CoreMessage(msg, &obj->core_message); +} diff --git a/oemcrypto/odk/src/odk_serialize.h b/oemcrypto/odk/src/odk_serialize.h index 0904700..1ec74b6 100644 --- a/oemcrypto/odk/src/odk_serialize.h +++ b/oemcrypto/odk/src/odk_serialize.h @@ -8,8 +8,8 @@ #ifndef WIDEVINE_ODK_SRC_ODK_SERIALIZE_H_ #define WIDEVINE_ODK_SRC_ODK_SERIALIZE_H_ +#include "odk_message.h" #include "odk_structs_priv.h" -#include "serialization_base.h" #ifdef __cplusplus extern "C" { @@ -18,37 +18,56 @@ extern "C" { /* odk pack */ void Pack_ODK_PreparedLicenseRequest(ODK_Message* msg, const ODK_PreparedLicenseRequest* obj); +void Pack_ODK_PreparedLicenseRequestV17( + ODK_Message* msg, const ODK_PreparedLicenseRequestV17* obj); void Pack_ODK_PreparedRenewalRequest(ODK_Message* msg, const ODK_PreparedRenewalRequest* obj); void Pack_ODK_PreparedProvisioningRequest( ODK_Message* msg, const ODK_PreparedProvisioningRequest* obj); +void Pack_ODK_PreparedProvisioningRequestV17( + ODK_Message* msg, const ODK_PreparedProvisioningRequestV17* obj); +void Pack_ODK_PreparedProvisioning40Request( + ODK_Message* msg, const ODK_PreparedProvisioning40Request* obj); void Pack_ODK_PreparedRenewedProvisioningRequest( ODK_Message* msg, const ODK_PreparedRenewedProvisioningRequest* obj); /* odk unpack */ void Unpack_ODK_CoreMessage(ODK_Message* msg, ODK_CoreMessage* obj); void Unpack_ODK_LicenseResponse(ODK_Message* msg, ODK_LicenseResponse* obj); -void Unpack_ODK_LicenseResponseV16(ODK_Message* msg, - ODK_LicenseResponseV16* obj); void Unpack_ODK_RenewalResponse(ODK_Message* msg, ODK_RenewalResponse* obj); void Unpack_ODK_ProvisioningResponse(ODK_Message* msg, ODK_ProvisioningResponse* obj); +void Unpack_ODK_ProvisioningResponseV16(ODK_Message* msg, + ODK_ProvisioningResponseV16* obj); +void Unpack_ODK_Provisioning40Response(ODK_Message* msg, + ODK_Provisioning40Response* obj); /* kdo pack */ -void Pack_ODK_LicenseResponse(ODK_Message* msg, const ODK_LicenseResponse* obj); -void Pack_ODK_LicenseResponseV16(ODK_Message* msg, - const ODK_LicenseResponseV16* obj); +void Pack_ODK_LicenseResponse(ODK_Message* msg, + const ODK_Packing_LicenseResponse* obj); void Pack_ODK_RenewalResponse(ODK_Message* msg, const ODK_RenewalResponse* obj); void Pack_ODK_ProvisioningResponse(ODK_Message* msg, const ODK_ProvisioningResponse* obj); +void Pack_ODK_ProvisioningResponseV16(ODK_Message* msg, + const ODK_ProvisioningResponseV16* obj); +void Pack_ODK_Provisioning40Response(ODK_Message* msg, + const ODK_Provisioning40Response* obj); /* kdo unpack */ void Unpack_ODK_PreparedLicenseRequest(ODK_Message* msg, ODK_PreparedLicenseRequest* obj); +void Unpack_ODK_PreparedLicenseRequestV17(ODK_Message* msg, + ODK_PreparedLicenseRequestV17* obj); void Unpack_ODK_PreparedRenewalRequest(ODK_Message* msg, ODK_PreparedRenewalRequest* obj); void Unpack_ODK_PreparedProvisioningRequest( ODK_Message* msg, ODK_PreparedProvisioningRequest* obj); +void Unpack_ODK_PreparedProvisioningRequestV180( + ODK_Message* msg, ODK_PreparedProvisioningRequest* obj); +void Unpack_ODK_PreparedProvisioningRequestV17( + ODK_Message* msg, ODK_PreparedProvisioningRequestV17* obj); +void Unpack_ODK_PreparedProvisioning40Request( + ODK_Message* msg, ODK_PreparedProvisioning40Request* obj); void Unpack_ODK_PreparedRenewedProvisioningRequest( ODK_Message* msg, ODK_PreparedRenewedProvisioningRequest* obj); diff --git a/oemcrypto/odk/src/odk_structs_priv.h b/oemcrypto/odk/src/odk_structs_priv.h index 3fe73ee..5306a4b 100644 --- a/oemcrypto/odk/src/odk_structs_priv.h +++ b/oemcrypto/odk/src/odk_structs_priv.h @@ -25,8 +25,10 @@ typedef uint32_t ODK_MessageType; #define ODK_Provisioning_Request_Type ((ODK_MessageType)5u) #define ODK_Provisioning_Response_Type ((ODK_MessageType)6u) #define ODK_Renewed_Provisioning_Request_Type ((ODK_MessageType)11u) +#define ODK_Provisioning40_Request_Type ((ODK_MessageType)12u) -// Reserve future message types to support forward compatibility. +// TODO(b/244580447): Reserve future message types to support +// forward compatibility. #define ODK_Release_Request_Type ((ODK_MessageType)7u) #define ODK_Release_Response_Type ((ODK_MessageType)8u) #define ODK_Common_Request_Type ((ODK_MessageType)9u) @@ -40,18 +42,35 @@ typedef struct { typedef struct { ODK_CoreMessage core_message; + ODK_MessageCounterInfo counter_info; } ODK_PreparedLicenseRequest; +typedef struct { + ODK_CoreMessage core_message; +} ODK_PreparedLicenseRequestV17; + typedef struct { ODK_CoreMessage core_message; uint64_t playback_time; } ODK_PreparedRenewalRequest; +typedef struct { + ODK_CoreMessage core_message; + ODK_MessageCounterInfo counter_info; +} ODK_PreparedProvisioningRequest; + typedef struct { ODK_CoreMessage core_message; uint32_t device_id_length; uint8_t device_id[ODK_DEVICE_ID_LEN_MAX]; -} ODK_PreparedProvisioningRequest; +} ODK_PreparedProvisioningRequestV17; + +typedef struct { + ODK_CoreMessage core_message; + uint32_t device_info_length; + uint8_t device_info[ODK_DEVICE_INFO_LEN_MAX]; + ODK_MessageCounterInfo counter_info; +} ODK_PreparedProvisioning40Request; typedef struct { ODK_CoreMessage core_message; @@ -67,27 +86,16 @@ typedef struct { } ODK_PreparedCommonRequest; typedef struct { - OEMCrypto_Substring enc_mac_keys_iv; - OEMCrypto_Substring enc_mac_keys; - OEMCrypto_Substring pst; - OEMCrypto_Substring srm_restriction_data; - OEMCrypto_LicenseType license_type; - bool nonce_required; - ODK_TimerLimits timer_limits; - uint32_t key_array_length; - OEMCrypto_KeyObject key_array[ODK_MAX_NUM_KEYS]; -} ODK_ParsedLicenseV16; - -typedef struct { - ODK_PreparedLicenseRequest request; + ODK_CoreMessage core_message; ODK_ParsedLicense* parsed_license; + uint8_t request_hash[ODK_SHA256_HASH_SIZE]; } ODK_LicenseResponse; typedef struct { - ODK_PreparedLicenseRequest request; - ODK_ParsedLicenseV16 parsed_license; + ODK_CoreMessage core_message; + ODK_Packing_ParsedLicense* parsed_license; uint8_t request_hash[ODK_SHA256_HASH_SIZE]; -} ODK_LicenseResponseV16; +} ODK_Packing_LicenseResponse; typedef struct { ODK_PreparedRenewalRequest request; @@ -95,18 +103,33 @@ typedef struct { } ODK_RenewalResponse; typedef struct { - ODK_PreparedProvisioningRequest request; + ODK_CoreMessage core_message; ODK_ParsedProvisioning* parsed_provisioning; } ODK_ProvisioningResponse; +// Used by V16 and V17 +typedef struct { + ODK_PreparedProvisioningRequestV17 request; + ODK_ParsedProvisioning* parsed_provisioning; +} ODK_ProvisioningResponseV16; + +typedef struct { + ODK_CoreMessage core_message; +} ODK_Provisioning40Response; + // These are the sum of sizeof of each individual member of the request structs // without any padding added by the compiler. Make sure they get updated when // request structs change. Refer to test suite OdkSizeTest in // ../test/odk_test.cpp for validations of each of the defined request sizes. -#define ODK_LICENSE_REQUEST_SIZE 20u +#define ODK_CORE_MESSAGE_SIZE 20u +#define ODK_LICENSE_REQUEST_SIZE 90u +#define ODK_LICENSE_REQUEST_SIZE_V17 20u #define ODK_RENEWAL_REQUEST_SIZE 28u -#define ODK_PROVISIONING_REQUEST_SIZE 88u +#define ODK_PROVISIONING_REQUEST_SIZE 94u +#define ODK_PROVISIONING_REQUEST_SIZE_V17 88u +#define ODK_PROVISIONING40_REQUEST_SIZE 862u #define ODK_RENEWED_PROVISIONING_REQUEST_SIZE 1694u +#define ODK_MESSAGECOUNTERINFO_SIZE 70u // These are the possible timer status values. #define ODK_CLOCK_TIMER_STATUS_UNDEFINED 0u // Should not happen. diff --git a/oemcrypto/odk/src/odk_timer.c b/oemcrypto/odk/src/odk_timer.c index 1b09551..6994532 100644 --- a/oemcrypto/odk/src/odk_timer.c +++ b/oemcrypto/odk/src/odk_timer.c @@ -254,11 +254,6 @@ OEMCryptoResult ODK_InitializeSessionValues(ODK_TimerLimits* timer_limits, if (timer_limits == NULL || clock_values == NULL || nonce_values == NULL) { return OEMCrypto_ERROR_INVALID_CONTEXT; } - /* Check that the API version passed in from OEMCrypto matches the version of - * this ODK library. */ - if (api_major_version != ODK_MAJOR_VERSION) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } timer_limits->soft_enforce_rental_duration = false; timer_limits->soft_enforce_playback_duration = false; timer_limits->earliest_playback_start_seconds = 0; @@ -268,7 +263,7 @@ OEMCryptoResult ODK_InitializeSessionValues(ODK_TimerLimits* timer_limits, ODK_InitializeClockValues(clock_values, 0); - nonce_values->api_major_version = ODK_MAJOR_VERSION; + nonce_values->api_major_version = api_major_version; nonce_values->api_minor_version = ODK_MINOR_VERSION; nonce_values->nonce = 0; nonce_values->session_id = session_id; @@ -300,6 +295,7 @@ OEMCryptoResult ODK_InitializeClockValues(ODK_ClockValues* clock_values, clock_values->time_of_license_request_signed = system_time_seconds; clock_values->time_of_first_decrypt = 0; clock_values->time_of_last_decrypt = 0; + clock_values->time_of_renewal_request = 0; clock_values->time_when_timer_expires = 0; clock_values->timer_status = ODK_CLOCK_TIMER_STATUS_LICENSE_NOT_LOADED; clock_values->status = kUnused; diff --git a/oemcrypto/odk/src/serialization_base.c b/oemcrypto/odk/src/serialization_base.c index 30af34c..b84385b 100644 --- a/oemcrypto/odk/src/serialization_base.c +++ b/oemcrypto/odk/src/serialization_base.c @@ -108,10 +108,40 @@ 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_OEMCrypto_TimerDelayBase(ODK_Message* message, + OEMCrypto_TimerDelayBase* value) { + assert(value); + uint32_t v32 = 0; + Unpack_uint32_t(message, &v32); + if (v32 <= OEMCrypto_TimerDelayBase_MaxValue) { + *value = (OEMCrypto_TimerDelayBase)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 7b69e11..299e047 100644 --- a/oemcrypto/odk/src/serialization_base.h +++ b/oemcrypto/odk/src/serialization_base.h @@ -25,7 +25,12 @@ 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_OEMCrypto_TimerDelayBase(ODK_Message* message, + OEMCrypto_TimerDelayBase* 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/fuzzing/Android.bp b/oemcrypto/odk/test/fuzzing/Android.bp index 3b8fe6d..f351217 100644 --- a/oemcrypto/odk/test/fuzzing/Android.bp +++ b/oemcrypto/odk/test/fuzzing/Android.bp @@ -11,6 +11,7 @@ package { // all of the 'license_kinds' from "vendor_widevine_license" // to get the below license kinds: // legacy_by_exception_only (by exception only) + // legacy_proprietary (by exception only) default_applicable_licenses: ["vendor_widevine_license"], } diff --git a/oemcrypto/odk/test/fuzzing/corpus_generator/Android.bp b/oemcrypto/odk/test/fuzzing/corpus_generator/Android.bp index 78519cb..0a0c0ae 100644 --- a/oemcrypto/odk/test/fuzzing/corpus_generator/Android.bp +++ b/oemcrypto/odk/test/fuzzing/corpus_generator/Android.bp @@ -18,6 +18,7 @@ package { // all of the 'license_kinds' from "vendor_widevine_license" // to get the below license kinds: // legacy_by_exception_only (by exception only) + // legacy_proprietary (by exception only) default_applicable_licenses: ["vendor_widevine_license"], } diff --git a/oemcrypto/odk/test/fuzzing/corpus_generator/odk_corpus_generator.c b/oemcrypto/odk/test/fuzzing/corpus_generator/odk_corpus_generator.c index 0a2d074..655bd06 100644 --- a/oemcrypto/odk/test/fuzzing/corpus_generator/odk_corpus_generator.c +++ b/oemcrypto/odk/test/fuzzing/corpus_generator/odk_corpus_generator.c @@ -113,15 +113,14 @@ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length, OEMCryptoResult ODK_PrepareCoreProvisioningRequest( uint8_t* message, size_t message_length, size_t* core_message_length, - const ODK_NonceValues* nonce_values, const uint8_t* device_id, - size_t device_id_length) { + const ODK_NonceValues* nonce_values, + const ODK_MessageCounterInfo* counter_info) { OEMCryptoResult (*original_function)(uint8_t*, size_t, size_t*, - const ODK_NonceValues*, const uint8_t*, - size_t); + const ODK_NonceValues*, + const ODK_MessageCounterInfo*); original_function = dlsym(RTLD_NEXT, "ODK_PrepareCoreProvisioningRequest"); - OEMCryptoResult oem_crypto_result = - (*original_function)(message, message_length, core_message_length, - nonce_values, device_id, device_id_length); + OEMCryptoResult oem_crypto_result = (*original_function)( + message, message_length, core_message_length, nonce_values, counter_info); char* file_name = GetFileName("provisioning_request_corpus"); // Provisioning Request format expected by fuzzer - [Core Provisioning @@ -134,18 +133,19 @@ OEMCryptoResult ODK_PrepareCoreProvisioningRequest( OEMCryptoResult ODK_ParseProvisioning( const uint8_t* message, size_t message_length, size_t core_message_length, const ODK_NonceValues* nonce_values, const uint8_t* device_id, - size_t device_id_length, ODK_ParsedProvisioning* parsed_response) { + size_t device_id_length, ODK_MessageCounterInfo* counter_info, + ODK_ParsedProvisioning* parsed_response) { struct ODK_ParseProvisioning_Args parse_provisioning_args; parse_provisioning_args.nonce_values = *nonce_values; memcpy(parse_provisioning_args.device_id, device_id, device_id_length); parse_provisioning_args.device_id_length = device_id_length; - OEMCryptoResult (*original_function)(const uint8_t*, size_t, size_t, - const ODK_NonceValues*, const uint8_t*, - size_t, ODK_ParsedProvisioning*); + OEMCryptoResult (*original_function)( + const uint8_t*, size_t, size_t, const ODK_NonceValues*, const uint8_t*, + size_t, ODK_MessageCounterInfo*, ODK_ParsedProvisioning*); original_function = dlsym(RTLD_NEXT, "ODK_ParseProvisioning"); OEMCryptoResult oem_crypto_result = (*original_function)( message, message_length, core_message_length, nonce_values, device_id, - device_id_length, parsed_response); + device_id_length, counter_info, parsed_response); char* file_name = GetFileName("provisioning_response_corpus"); // Provisioning Response format expected by fuzzer - diff --git a/oemcrypto/odk/test/fuzzing/odk_fuzz.gyp b/oemcrypto/odk/test/fuzzing/odk_fuzz.gyp index 7602e0a..694e3ac 100644 --- a/oemcrypto/odk/test/fuzzing/odk_fuzz.gyp +++ b/oemcrypto/odk/test/fuzzing/odk_fuzz.gyp @@ -23,7 +23,7 @@ '-Wno-error=cast-qual', ], 'cflags_cc': [ - '-std=c++11', + '-std=c++14', '-g3', '-O0', '-fsanitize=fuzzer,address,undefined', diff --git a/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp b/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp index 1f3b230..04905f1 100644 --- a/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp +++ b/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp @@ -4,8 +4,12 @@ #include "fuzzing/odk_fuzz_helper.h" #include +#include +#include "core_message_types.h" #include "odk.h" +#include "odk_attributes.h" +#include "odk_structs.h" namespace oemcrypto_core_message { using features::CoreMessageFeatures; @@ -39,7 +43,11 @@ OEMCryptoResult odk_serialize_LicenseRequest( const void* in UNUSED, uint8_t* out, size_t* size, const ODK_LicenseRequest& core_license_request UNUSED, const ODK_NonceValues* nonce_values) { - return ODK_PrepareCoreLicenseRequest(out, SIZE_MAX, size, nonce_values); + // TODO(mattfedd): hook up counters to fuzzer + const ODK_MessageCounterInfo counter_info = {0, 0, 0, 0, 0, + 0, 0, {0}, {0}, {0}}; + return ODK_PrepareCoreLicenseRequest(out, SIZE_MAX, size, nonce_values, + &counter_info); } OEMCryptoResult odk_serialize_RenewalRequest( @@ -54,12 +62,13 @@ OEMCryptoResult odk_serialize_RenewalRequest( OEMCryptoResult odk_serialize_ProvisioningRequest( const void* in UNUSED, uint8_t* out, size_t* size, - const ODK_ProvisioningRequest& core_provisioning, + const ODK_ProvisioningRequest& core_provisioning UNUSED, const ODK_NonceValues* nonce_values) { - const std::string& device_id = core_provisioning.device_id; - return ODK_PrepareCoreProvisioningRequest( - out, SIZE_MAX, size, nonce_values, - reinterpret_cast(device_id.data()), device_id.size()); + // TODO(mattfedd): hook up counters to fuzzer + const ODK_MessageCounterInfo counter_info = {0, 0, 0, 0, 0, + 0, 0, {0}, {0}, {0}}; + return ODK_PrepareCoreProvisioningRequest(out, SIZE_MAX, size, nonce_values, + &counter_info); } OEMCryptoResult odk_deserialize_LicenseResponse(const uint8_t* message, @@ -69,9 +78,9 @@ OEMCryptoResult odk_deserialize_LicenseResponse(const uint8_t* message, ODK_ParsedLicense* parsed_lic) { return ODK_ParseLicense(message, SIZE_MAX, core_message_length, static_cast(a->initial_license_load), - static_cast(a->usage_entry_present), + static_cast(a->usage_entry_present), 0, &a->timer_limits, &a->clock_values, nonce_values, - parsed_lic); + parsed_lic, nullptr); } OEMCryptoResult odk_deserialize_RenewalResponse( @@ -119,13 +128,32 @@ bool kdo_serialize_LicenseResponse(const ODK_ParseLicense_Args* args, const ODK_ParsedLicense& parsed_lic, std::string* oemcrypto_core_message) { const auto& nonce_values = args->nonce_values; - ODK_LicenseRequest core_request{nonce_values.api_minor_version, - nonce_values.api_major_version, - nonce_values.nonce, nonce_values.session_id}; + const ODK_MessageCounter counter_info = {0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; + ODK_LicenseRequest core_request{ + nonce_values.api_minor_version, nonce_values.api_major_version, + nonce_values.nonce, nonce_values.session_id, counter_info}; std::string core_request_sha_256( reinterpret_cast(args->request_hash), ODK_SHA256_HASH_SIZE); + ODK_Packing_ParsedLicense parsed_license; + parsed_license.enc_mac_keys_iv = parsed_lic.enc_mac_keys_iv; + parsed_license.enc_mac_keys = parsed_lic.enc_mac_keys; + parsed_license.pst = parsed_lic.pst; + parsed_license.srm_restriction_data = parsed_lic.srm_restriction_data; + parsed_license.license_type = parsed_lic.license_type; + parsed_license.nonce_required = parsed_lic.nonce_required; + parsed_license.timer_limits = parsed_lic.timer_limits; + parsed_license.watermarking = parsed_lic.watermarking; + parsed_license.dtcp2_required = parsed_lic.dtcp2_required; + parsed_license.renewal_delay_base = parsed_lic.renewal_delay_base; + parsed_license.key_array_length = parsed_lic.key_array_length; + std::vector key_array; + size_t i; + for (i = 0; i < parsed_lic.key_array_length; i++) { + key_array.push_back(parsed_lic.key_array[i]); + } + parsed_license.key_array = key_array.data(); return serialize::CreateCoreLicenseResponse( - CoreMessageFeatures::kDefaultFeatures, parsed_lic, core_request, + CoreMessageFeatures::kDefaultFeatures, parsed_license, core_request, core_request_sha_256, oemcrypto_core_message); } @@ -151,11 +179,17 @@ bool kdo_serialize_ProvisioningResponse( if (args->device_id_length > sizeof(args->device_id)) { return false; } + const ODK_MessageCounter counter_info = {0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; ODK_ProvisioningRequest core_request{ - nonce_values.api_minor_version, nonce_values.api_major_version, - nonce_values.nonce, nonce_values.session_id, + nonce_values.api_minor_version, + nonce_values.api_major_version, + nonce_values.nonce, + nonce_values.session_id, std::string(reinterpret_cast(args->device_id), - args->device_id_length)}; + args->device_id_length), + 0, + "", + counter_info}; return serialize::CreateCoreProvisioningResponse( CoreMessageFeatures::kDefaultFeatures, parsed_prov, core_request, oemcrypto_core_message); diff --git a/oemcrypto/odk/test/odk_core_message_test.cpp b/oemcrypto/odk/test/odk_core_message_test.cpp index 22051b2..db476ad 100644 --- a/oemcrypto/odk/test/odk_core_message_test.cpp +++ b/oemcrypto/odk/test/odk_core_message_test.cpp @@ -2,14 +2,30 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include #include +#include +#include #include "OEMCryptoCENCCommon.h" +#include "core_message_deserialize.h" +#include "core_message_features.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.h" #include "gtest/gtest.h" #include "odk.h" #include "third_party/absl/strings/escaping.h" namespace wvodk_test { + +using oemcrypto_core_message::ODK_CommonRequest; +using oemcrypto_core_message::ODK_ProvisioningRequest; +using oemcrypto_core_message::deserialize::CoreCommonRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreProvisioningRequestFromMessage; +using oemcrypto_core_message::features::CoreMessageFeatures; +using oemcrypto_core_message::serialize:: + CreateCoreProvisioningResponseFromProto; + TEST(CoreMessageTest, RenwalRequest) { std::string oem = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst" @@ -36,4 +52,145 @@ TEST(CoreMessageTest, RenwalRequest) { char* m = reinterpret_cast(message); VLOG(0) << absl::BytesToHexString(std::string(m, core_message_length)); } + +TEST(CoreMessageTest, ParseCoreCommonRequestFromMessage) { + // Core message header format: + // message_type : 4 bytes + // message_length : 4 bytes + // minor_version : 2 bytes + // major_version : 2 bytes + // nonce : 4 bytes + // session_id : 4 bytes + const char kv16CoreMessageLicenseRequest[] = + "0000000100000014000300100000000100000001"; + std::string oemcrypto_core_message = + absl::HexStringToBytes(kv16CoreMessageLicenseRequest); + ODK_CommonRequest odk_common_request; + ASSERT_TRUE(CoreCommonRequestFromMessage(oemcrypto_core_message, + &odk_common_request)); + EXPECT_EQ(odk_common_request.message_type, 1); + EXPECT_EQ(odk_common_request.message_length, 20); + EXPECT_EQ(odk_common_request.api_minor_version, 3); + EXPECT_EQ(odk_common_request.api_major_version, 16); + EXPECT_EQ(odk_common_request.nonce, 1); + EXPECT_EQ(odk_common_request.session_id, 1); +} + +struct TestParameters_18V0 { + std::string message; + uint16_t expected_api_minor_version; + uint16_t expected_api_major_version; + uint32_t expected_nonce; + uint32_t expected_session_id; + uint64_t expected_master_generation_number; +}; + +void PrintTo(const TestParameters_18V0& p, std::ostream* os) { + *os << "request = " << p.message << ", expected : {version = v" + << p.expected_api_major_version << "." << p.expected_api_minor_version + << ", nonce = " << p.expected_nonce + << ", session_id = " << p.expected_session_id + << ", master_generation_number = " << p.expected_master_generation_number + << "}"; +} + +class ProvisioningRoundTripTest_18V0 + : public ::testing::Test, + public ::testing::WithParamInterface {}; + +// Make sure that the first version of the V18 provisioning request (no hidden +// 4-byte value, all 0s in message counter struct) will still parse with +// current v18 code. This test is in this file rather than odk_test.cpp +// because of the use of absl::HexStringToBytes +TEST_P(ProvisioningRoundTripTest_18V0, ProvisioningRoundtrip) { + TestParameters_18V0 tc = GetParam(); + + ODK_ProvisioningRequest request; + + // Make sure we can parse the request + ASSERT_TRUE(CoreProvisioningRequestFromMessage( + absl::HexStringToBytes(tc.message), &request)); + EXPECT_EQ(request.api_minor_version, tc.expected_api_minor_version); + EXPECT_EQ(request.api_major_version, tc.expected_api_major_version); + EXPECT_EQ(request.nonce, tc.expected_nonce); + EXPECT_EQ(request.session_id, tc.expected_session_id); + + if (request.api_major_version >= 18) { + EXPECT_EQ(request.counter_info.master_generation_number, + tc.expected_master_generation_number); + } + + // Make sure we can create a response from that request with the same core + // message + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + std::string serialized_provisioning_resp; + video_widevine::ProvisioningResponse provisioning_response; + provisioning_response.set_device_certificate("device_certificate"); + provisioning_response.set_device_rsa_key("device_rsa_key"); + provisioning_response.set_device_rsa_key_iv("device_rsa_key_iv"); + if (!provisioning_response.SerializeToString(&serialized_provisioning_resp)) { + FAIL() << "Cannot set up prov response"; + } + std::string oemcrypto_core_message; + EXPECT_TRUE(CreateCoreProvisioningResponseFromProto( + features, serialized_provisioning_resp, request, + OEMCrypto_RSA_Private_Key, &oemcrypto_core_message)); + + // Extract core message from generated prov response and match values with + // request + ODK_CommonRequest odk_common_request; + ASSERT_TRUE(CoreCommonRequestFromMessage(oemcrypto_core_message, + &odk_common_request)); + EXPECT_EQ(odk_common_request.message_type, 6u); + EXPECT_EQ(odk_common_request.nonce, tc.expected_nonce); + EXPECT_EQ(odk_common_request.session_id, tc.expected_session_id); +} + +std::vector TestCases() { + return std::vector{ + // Source: ODKTest ProvisionRequestRoundtrip running on v18.0 ODK checkout + {"000000050000005a00000012deadbeefcafebabe12345678abcdffff0000000c0000003" + "200000154001200000004ffffffffffffffffffffffffffffffffdddddddddddddddddd" + "ddddddddddddddeeeeeeeeeeeeeeeeeeeeeeee", + 0, 18, 0xdeadbeef, 0xcafebabe, 0x12345678abcdffff}, + // same as previous request, but replace counter info with all 0s + {"000000050000005a00000012deadbeefcafebabe0000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000", + 0, 18, 0xdeadbeef, 0xcafebabe, 0x0}, + // Source: ODKTest ProvisionRequestRoundtrip running on v17.2 ODK checkout + {"000000050000005800020011deadbeefcafebabe00000020fffffffffffffffffffffff" + "fffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000" + "0000000000000000000000000000000000", + 2, 17, 0xdeadbeef, 0xcafebabe, 0x0}, + // Source: ODKTest ProvisionRequestRoundtrip running on v18.2 ODK checkout + {"000000050000005e00020012deadbeefcafebabe0000004012345678abcdffff0000000" + "c0000003200000154001200020004ffffffffffffffffffffffffffffffffdddddddddd" + "ddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeee", + 2, 18, 0xdeadbeef, 0xcafebabe, 0x12345678abcdffff}, + // Source: CDM unit tests on oemcrypto-v18 internal commit 5c77383 (pre + // v18.0 -> v18.1 ODK bump) + {"000000050000005a00000012b85dfa09000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000", + 0, 18, 0xb85dfa09, 0x0, 0x0}, + // Same as above but non-zero counter info + {"000000050000005a00000012b85dfa09000000001000000000000001000000000000000" + "00000000000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000", + 0, 18, 0xb85dfa09, 0x0, 0x1000000000000001}, + // Source: CDM unit tests on oemcrypto-v18 internal commit fc46827a (post + // v18.0 -> v18.1 ODK bump) + {"000000050000005e000100127c8ac703000000000000004000000000000000000000000" + "00000000000000000001200010000746573740000000000000000000000007465737400" + "0000000000000000000000000000000000000000000000", + 1, 18, 0x7c8ac703, 0x0, 0x0}, + }; +} + +INSTANTIATE_TEST_SUITE_P(ProvisioningRoundTripTests_18V0, + ProvisioningRoundTripTest_18V0, + ::testing::ValuesIn(TestCases())); + } // namespace wvodk_test diff --git a/oemcrypto/odk/test/odk_golden_v16.cpp b/oemcrypto/odk/test/odk_golden_v16.cpp new file mode 100644 index 0000000..2e80b0a --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v16.cpp @@ -0,0 +1,4132 @@ +// 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 + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.h" +#include "gtest/gtest.h" +#include "odk.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, + device_key_type_, &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + OEMCrypto_PrivateKeyType device_key_type_ = OEMCrypto_RSA_Private_Key; + 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_ = true; + 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_GOLDEN_DATA="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 0000000..786c678 --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v17.cpp @@ -0,0 +1,3846 @@ +// 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 + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.h" +#include "gtest/gtest.h" +#include "odk.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, + device_key_type_, &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + OEMCrypto_PrivateKeyType device_key_type_ = OEMCrypto_RSA_Private_Key; + 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_ = true; + 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_GOLDEN_DATA="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_golden_v18.cpp b/oemcrypto/odk/test/odk_golden_v18.cpp new file mode 100644 index 0000000..c1adfb1 --- /dev/null +++ b/oemcrypto/odk/test/odk_golden_v18.cpp @@ -0,0 +1,4574 @@ +// 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 + +#include "core_message_deserialize.h" +#include "core_message_serialize.h" +#include "core_message_serialize_proto.h" +#include "core_message_types.h" +#include "gtest/gtest.h" +#include "odk.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 ODKGoldenProvisionV18 : 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, + device_key_type_, &generated_core_message)); + EXPECT_EQ(core_response_, generated_core_message); + } + + OEMCrypto_PrivateKeyType device_key_type_ = OEMCrypto_RSA_Private_Key; + std::string core_request_; + std::string core_response_; + std::string provisioning_response_; +}; + +class ODKGoldenLicenseV18 : 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_ = true; + bool uses_padding_ = true; // This will change for v19. + std::string core_request_; + std::string core_response_; + std::string serialized_license_; + std::string core_request_sha256_; +}; + +class ODKGoldenRenewalV18 : 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_GOLDEN_DATA="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), prov20ecc +// and prov30. For v18, Prov 4.0 does not use a core message. +// GTEST_FILTER='*CorePIGTest.OfflineNoNonce*" +////////////////////////////////////////////////////////////////////// +TEST_F(ODKGoldenProvisionV18, CorePIGTest_OfflineNoNonce_prov20) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x02, 0x00, 0x12, + 0xcf, 0x3a, 0x5f, 0x1b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x30, 0x00, 0x02, 0x00, 0x12, + 0xcf, 0x3a, 0x5f, 0x1b, 0x00, 0x00, 0x00, 0x05, 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, 0xcc, 0x78, 0xcb, 0xbc, 0xf8, 0xb6, 0x81, 0xfb, 0x5c, + 0x39, 0xf0, 0xef, 0x36, 0xea, 0x95, 0x47, 0x23, 0x84, 0x25, 0xb2, 0xba, + 0x6a, 0xe3, 0xed, 0x74, 0xdf, 0x38, 0xe7, 0x93, 0x3e, 0x48, 0xac, 0x92, + 0x13, 0x95, 0xa0, 0x78, 0x0d, 0x4c, 0x8f, 0xb8, 0x01, 0xe8, 0x7b, 0xc9, + 0x55, 0xc6, 0x03, 0x28, 0x33, 0xa4, 0x8c, 0x16, 0xc7, 0x6c, 0xa4, 0xae, + 0xb4, 0x5e, 0xd9, 0xea, 0x84, 0x29, 0xf2, 0xa7, 0x6a, 0xe8, 0xe6, 0x1c, + 0x56, 0xd6, 0x01, 0xea, 0x31, 0xc7, 0x94, 0x71, 0x9c, 0x53, 0x43, 0x75, + 0x94, 0xfe, 0x89, 0x70, 0x7b, 0xd5, 0xf7, 0xcf, 0x3d, 0xc9, 0x7b, 0x1a, + 0x56, 0xd2, 0x8b, 0x1b, 0x44, 0xf8, 0x51, 0x36, 0x57, 0x33, 0x7a, 0x3f, + 0x8d, 0xa5, 0x9d, 0x97, 0x4a, 0x02, 0x90, 0x62, 0x93, 0xc9, 0x02, 0x74, + 0x2c, 0x8d, 0xc1, 0x95, 0xef, 0xcc, 0x71, 0xd0, 0xc7, 0x1e, 0xff, 0x67, + 0x75, 0x84, 0x44, 0x18, 0xa1, 0x98, 0xdd, 0xca, 0x55, 0x2b, 0x75, 0x33, + 0xfc, 0x50, 0x87, 0x6c, 0xbb, 0x72, 0x5a, 0xc7, 0xcf, 0x9d, 0xed, 0x60, + 0x28, 0x29, 0x77, 0x14, 0xd7, 0x2e, 0xb2, 0x27, 0x37, 0xa7, 0x5b, 0x80, + 0x5c, 0xe8, 0x22, 0xe8, 0xde, 0x93, 0xe4, 0x79, 0xa9, 0x2d, 0xb4, 0xfc, + 0x57, 0x1a, 0xa6, 0x2b, 0xb9, 0xc6, 0x22, 0x51, 0x9e, 0x2d, 0x56, 0x00, + 0x6d, 0xc6, 0x79, 0x7a, 0x6f, 0xf4, 0x53, 0xe5, 0xc4, 0x27, 0x94, 0xa0, + 0x4b, 0x83, 0x1a, 0x43, 0xb0, 0x4b, 0x13, 0x3c, 0x56, 0x5d, 0x1c, 0x98, + 0x0d, 0xab, 0xbd, 0x7b, 0xd9, 0x4e, 0x26, 0x19, 0x69, 0xaf, 0x5a, 0xcd, + 0xcf, 0x3e, 0xae, 0xc2, 0x39, 0x8c, 0xa0, 0xb4, 0x9d, 0x72, 0xd4, 0x98, + 0xdc, 0x53, 0x92, 0x3f, 0xc8, 0xd2, 0x7e, 0xfd, 0x00, 0xfb, 0x22, 0x8e, + 0xdc, 0xc2, 0x09, 0xd3, 0xb6, 0x0c, 0x0e, 0xe7, 0x04, 0xd2, 0x2b, 0x98, + 0x4d, 0x7c, 0x9a, 0xae, 0x4e, 0xa4, 0x84, 0x3c, 0x44, 0x10, 0x65, 0x90, + 0xdc, 0x1b, 0x82, 0xd0, 0x38, 0xb1, 0x40, 0x02, 0xf7, 0xf0, 0xbb, 0xcf, + 0x8a, 0x6b, 0xd3, 0xd0, 0x88, 0x52, 0xb4, 0x2e, 0x92, 0xa3, 0xcb, 0x65, + 0xff, 0xbd, 0x5c, 0xe5, 0x6a, 0xba, 0x7c, 0x67, 0x6f, 0x52, 0xa9, 0xf4, + 0xde, 0xf1, 0x47, 0xca, 0x0c, 0x25, 0xcd, 0xa8, 0x37, 0x88, 0x10, 0x08, + 0xef, 0x0a, 0x30, 0x53, 0xed, 0xe2, 0x7c, 0x1a, 0x55, 0x89, 0x6c, 0x7d, + 0xfb, 0x6a, 0x71, 0xda, 0x0f, 0x02, 0xf1, 0x69, 0x85, 0x07, 0x5b, 0xbd, + 0x7d, 0xe7, 0x5c, 0x21, 0xd3, 0xfc, 0xb6, 0x80, 0xcb, 0x63, 0x77, 0xdf, + 0x24, 0x12, 0x33, 0x86, 0x5d, 0xd0, 0xa5, 0xaf, 0x21, 0x52, 0x2c, 0xaf, + 0x4d, 0xbe, 0xcc, 0x3d, 0x14, 0x96, 0x97, 0x04, 0xb5, 0x7c, 0xf3, 0x44, + 0x82, 0x63, 0xea, 0x17, 0xa2, 0x09, 0xaa, 0x24, 0xc2, 0xdf, 0x04, 0xd4, + 0x3f, 0xb0, 0x67, 0xbc, 0x4c, 0xe2, 0x0e, 0xad, 0xfc, 0xe6, 0xa0, 0x9d, + 0x8c, 0xb6, 0x40, 0x09, 0x82, 0x9f, 0xe3, 0xda, 0x47, 0xb5, 0xbf, 0x0d, + 0xb4, 0xa7, 0x2b, 0xee, 0xc2, 0x89, 0x34, 0x33, 0x76, 0xa6, 0x3d, 0xbe, + 0xd6, 0x81, 0xa5, 0x94, 0xb9, 0x81, 0x90, 0xae, 0x89, 0xe4, 0x10, 0xbd, + 0x7c, 0xbe, 0x81, 0xbc, 0x18, 0x05, 0xb4, 0x13, 0xf1, 0xe8, 0xba, 0xdb, + 0x3e, 0x04, 0xc4, 0xb3, 0x31, 0x14, 0x19, 0xec, 0xe9, 0x16, 0x69, 0x10, + 0xbf, 0x64, 0xb0, 0x94, 0x26, 0xd2, 0xd7, 0x01, 0xd0, 0x8b, 0x53, 0xf8, + 0xd8, 0x54, 0xdb, 0x6e, 0x0f, 0x2d, 0xc6, 0x99, 0x06, 0xbf, 0xfe, 0x9e, + 0x35, 0x83, 0x4c, 0xda, 0xb5, 0x90, 0x71, 0xc4, 0x90, 0xeb, 0x01, 0x83, + 0xde, 0x6d, 0xfc, 0xaf, 0x04, 0x5f, 0xd6, 0x25, 0x4d, 0x8a, 0x93, 0x47, + 0xac, 0x7d, 0x52, 0xea, 0xfe, 0x34, 0xad, 0xce, 0x2d, 0xd5, 0xd7, 0x78, + 0xce, 0xe5, 0x8e, 0x5c, 0x00, 0x2e, 0xc9, 0x6c, 0x48, 0x6e, 0x4f, 0x19, + 0x6f, 0x3f, 0xa8, 0x79, 0x6c, 0x6e, 0x1f, 0xd9, 0x9d, 0x9f, 0xf4, 0x62, + 0x25, 0x84, 0x35, 0x30, 0xf2, 0xd2, 0xbd, 0x2a, 0xec, 0x2d, 0xc3, 0xa3, + 0x02, 0xff, 0x9b, 0xfd, 0x6b, 0x8e, 0x0b, 0x16, 0x18, 0xf2, 0x99, 0xb8, + 0x15, 0x9a, 0x1c, 0x8f, 0x89, 0x02, 0x07, 0xed, 0x66, 0x69, 0x35, 0x13, + 0x25, 0xf6, 0xfb, 0x30, 0x8c, 0x94, 0xb6, 0x98, 0xc0, 0x8b, 0xfd, 0x47, + 0xbe, 0x66, 0x84, 0x51, 0x59, 0x6d, 0x1c, 0x00, 0x7a, 0xa1, 0x35, 0xf4, + 0x67, 0xf1, 0xa6, 0xc4, 0x30, 0xb4, 0x85, 0x74, 0x2e, 0x3e, 0x28, 0x22, + 0x51, 0xfe, 0x54, 0x88, 0xcc, 0x8a, 0xe4, 0x04, 0xc6, 0x10, 0xbd, 0x5b, + 0x91, 0x02, 0xb0, 0x37, 0x7d, 0x3b, 0xcd, 0x98, 0x2e, 0x8c, 0x5f, 0x63, + 0x7e, 0x58, 0x58, 0x18, 0x13, 0x1d, 0x32, 0x29, 0x3e, 0xb8, 0x95, 0xed, + 0x2b, 0xc1, 0xd0, 0xab, 0x33, 0x9c, 0x82, 0xa9, 0xcf, 0xcf, 0x21, 0x2e, + 0x7c, 0x05, 0xe7, 0xa7, 0xbb, 0xc1, 0x63, 0x4a, 0x1e, 0xb5, 0x04, 0x13, + 0x30, 0x34, 0xa1, 0x8b, 0x5a, 0x84, 0x53, 0x66, 0x42, 0xed, 0xc3, 0xd7, + 0x14, 0xf5, 0xf4, 0x19, 0x78, 0x95, 0xd1, 0x16, 0xc9, 0x5c, 0xbd, 0x05, + 0xf9, 0xe0, 0xe0, 0x96, 0x8c, 0x51, 0x3f, 0xb4, 0x38, 0x78, 0x59, 0x79, + 0xe8, 0xbc, 0x66, 0x26, 0xc2, 0x46, 0xee, 0xbb, 0x58, 0xfa, 0x06, 0xfe, + 0x24, 0x54, 0x8c, 0x06, 0xe5, 0xc1, 0x58, 0x74, 0x22, 0xb6, 0x94, 0x17, + 0xe6, 0x27, 0x09, 0xab, 0x5b, 0x89, 0x3a, 0xbd, 0x29, 0x8b, 0xc7, 0xf4, + 0x67, 0x51, 0x79, 0xf7, 0x34, 0x2c, 0xb1, 0x84, 0x5f, 0xd8, 0x46, 0xf6, + 0x30, 0xc3, 0xf6, 0xb6, 0x11, 0x2d, 0x0a, 0x6f, 0x0c, 0x54, 0x37, 0x13, + 0x26, 0x4c, 0x17, 0xe8, 0x08, 0x68, 0x84, 0xea, 0xad, 0x48, 0x8b, 0x65, + 0x20, 0xa5, 0x3e, 0x54, 0x15, 0x25, 0xae, 0xb6, 0x2f, 0xae, 0xf3, 0x4f, + 0xb5, 0x5a, 0xb2, 0x26, 0xb6, 0xcb, 0xe4, 0xcf, 0x30, 0x4b, 0x79, 0xba, + 0xd3, 0xd4, 0xb5, 0x7e, 0xe5, 0xc4, 0x2f, 0xf7, 0x39, 0xd6, 0x75, 0xd6, + 0xb2, 0x8d, 0xab, 0x44, 0xe5, 0x5e, 0x0f, 0x87, 0xa2, 0x1d, 0xc0, 0x1e, + 0xa4, 0xe4, 0xf4, 0x90, 0x47, 0x40, 0xb8, 0xec, 0x3d, 0x7e, 0x9a, 0x90, + 0x8c, 0x56, 0x92, 0x82, 0xd7, 0x37, 0xe2, 0x50, 0x39, 0x29, 0xc4, 0x6c, + 0xa6, 0x57, 0xfc, 0xfc, 0xe1, 0x5e, 0xa4, 0x5b, 0xa8, 0xec, 0x05, 0x09, + 0xfd, 0xcf, 0x4f, 0xb7, 0x82, 0x4e, 0xb1, 0xfc, 0x95, 0x74, 0x0a, 0x17, + 0xdc, 0xc5, 0xc4, 0x1e, 0x6a, 0x60, 0x9f, 0x62, 0x77, 0x31, 0x69, 0xdc, + 0x2d, 0x13, 0x2a, 0x6b, 0xa3, 0x0c, 0x69, 0xfd, 0x7d, 0x1f, 0x52, 0xde, + 0xbb, 0xfd, 0x4d, 0x94, 0xf2, 0x55, 0xfb, 0x3b, 0x28, 0xd0, 0xc1, 0x5d, + 0xe4, 0xe9, 0x72, 0xa3, 0x70, 0x08, 0x00, 0xc5, 0x07, 0x37, 0x89, 0x50, + 0xd7, 0x08, 0x42, 0x39, 0x10, 0xa6, 0xb9, 0xb5, 0x23, 0x3d, 0xd7, 0xd3, + 0x7b, 0x94, 0x45, 0x11, 0x0f, 0x60, 0x0a, 0x55, 0x28, 0xb9, 0x16, 0xfa, + 0x53, 0xa1, 0x7c, 0x6d, 0x19, 0x8b, 0xad, 0x11, 0x5e, 0x67, 0xb1, 0xba, + 0xc9, 0x71, 0x9b, 0xf8, 0x43, 0x3d, 0x98, 0xe5, 0x5f, 0x49, 0x90, 0xf3, + 0x6c, 0x59, 0x67, 0xea, 0x1f, 0xe1, 0x61, 0x57, 0x1d, 0xb5, 0x31, 0x3f, + 0x24, 0x4e, 0x42, 0x4a, 0xfd, 0x28, 0xea, 0x46, 0x62, 0x4a, 0x89, 0xa8, + 0xd6, 0x62, 0x5e, 0x51, 0x16, 0x69, 0x83, 0x23, 0x51, 0x91, 0x2b, 0x27, + 0xe0, 0xf0, 0x76, 0x1b, 0x6f, 0x67, 0xf6, 0xfc, 0x03, 0xf0, 0x45, 0x94, + 0xed, 0xd2, 0x6f, 0xcc, 0x2c, 0x24, 0xdd, 0x5a, 0x2e, 0xa6, 0xac, 0xf2, + 0x25, 0x5a, 0x61, 0x62, 0xff, 0x30, 0x34, 0xd3, 0x6e, 0xde, 0x15, 0x19, + 0xe2, 0xde, 0x9c, 0xfb, 0x77, 0x73, 0x3c, 0x11, 0xd6, 0x69, 0x78, 0x4e, + 0x37, 0x88, 0x61, 0xe4, 0xfd, 0x42, 0xf6, 0x5f, 0xc0, 0x00, 0x8a, 0x14, + 0x71, 0xc4, 0x7f, 0x54, 0xc3, 0xd8, 0x87, 0x6a, 0x08, 0x92, 0x3d, 0x2d, + 0x57, 0x0c, 0x0f, 0x56, 0x57, 0x02, 0xa9, 0x1f, 0x74, 0xcc, 0x96, 0x65, + 0x90, 0x17, 0xbf, 0xf5, 0x30, 0x19, 0x27, 0x37, 0xea, 0xe1, 0xe9, 0xa7, + 0xbe, 0x92, 0x9d, 0x88, 0xe1, 0x39, 0x92, 0x49, 0x1e, 0xc7, 0x18, 0x31, + 0x8f, 0x9f, 0x68, 0x2f, 0x56, 0x7d, 0x63, 0xb1, 0x8a, 0xe5, 0xba, 0x23, + 0x75, 0x1b, 0x3f, 0xd0, 0x71, 0xad, 0x74, 0x1a, 0x02, 0xc5, 0x21, 0x10, + 0x3f, 0x06, 0x7c, 0x36, 0x3d, 0x65, 0x98, 0x16, 0xc2, 0x90, 0x1a, 0xe6, + 0x4c, 0xa8, 0x52, 0xe1, 0x64, 0xde, 0xd9, 0xa7, 0x04, 0x2d, 0x32, 0x36, + 0xeb, 0x5c, 0xa7, 0x95, 0x15, 0x91, 0x15, 0x9a, 0x1f, 0x7f, 0x5c, 0xa3, + 0x55, 0x04, 0x2b, 0x9f, 0x89, 0xd0, 0x8e, 0xac, 0x4f, 0x95, 0x13, 0x8b, + 0x9c, 0x56, 0x6c, 0x9f, 0x82, 0xe0, 0x5a, 0x44, 0x83, 0x89, 0x25, 0x34, + 0x60, 0x86, 0x37, 0xd7, 0x58, 0x71, 0xa2, 0x21, 0x4f, 0x6a, 0x27, 0xff, + 0xf4, 0x02, 0x2b, 0x31, 0xd8, 0xec, 0x5a, 0x7d, 0xe8, 0x55, 0x19, 0x12, + 0x10, 0x26, 0x06, 0x38, 0x1f, 0xe5, 0x86, 0x4d, 0x00, 0x08, 0x3c, 0x7a, + 0x49, 0x29, 0xfd, 0x0b, 0x77, 0x1a, 0xaa, 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, 0xec, 0xf5, 0x92, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xaa, 0x2e, 0x47, 0xb8, 0x48, 0x93, 0xf1, 0x45, 0x3f, 0xca, 0x0f, + 0xbc, 0xdf, 0x3a, 0x3f, 0x44, 0x82, 0xee, 0x0c, 0xd3, 0xc3, 0x8f, 0xeb, + 0x8c, 0xda, 0x35, 0xa7, 0x39, 0x20, 0xff, 0xd5, 0x4a, 0x71, 0x50, 0xfd, + 0x22, 0x4a, 0x9e, 0x1a, 0x51, 0x33, 0x90, 0xa8, 0xf3, 0xe9, 0xe1, 0x66, + 0xa8, 0xcd, 0x8f, 0xfb, 0x23, 0x27, 0x94, 0xb5, 0xd7, 0x79, 0xbd, 0x03, + 0x98, 0x74, 0x6c, 0x7e, 0xfc, 0x8a, 0x85, 0x4e, 0x5f, 0x98, 0x33, 0x77, + 0x67, 0xb9, 0xc8, 0x90, 0xc4, 0xfc, 0x63, 0x1f, 0x45, 0xd7, 0x67, 0x9f, + 0x1f, 0xf1, 0x9e, 0x30, 0x36, 0xd6, 0xd2, 0x31, 0x73, 0x4c, 0x64, 0x20, + 0x61, 0x18, 0x1c, 0xe8, 0xad, 0x65, 0xdb, 0x6e, 0x8e, 0xb5, 0x80, 0x22, + 0x98, 0xe2, 0xcb, 0x65, 0x28, 0xc1, 0xd0, 0x24, 0xc0, 0x9d, 0xf6, 0x94, + 0x02, 0x74, 0x16, 0x1e, 0xe2, 0x0e, 0xf0, 0x37, 0x41, 0x59, 0x00, 0x3a, + 0x76, 0x25, 0x67, 0xb3, 0x77, 0xcf, 0xcc, 0x1f, 0xbf, 0x3d, 0x30, 0x42, + 0xa6, 0xf1, 0xb6, 0x7b, 0x5f, 0x3b, 0x5d, 0x88, 0x13, 0x9a, 0xe1, 0xbf, + 0x05, 0x74, 0x72, 0x33, 0x94, 0x9e, 0x5a, 0xc9, 0x29, 0x09, 0x04, 0x46, + 0x3f, 0x7c, 0x8d, 0xe8, 0xd2, 0xc1, 0x69, 0xb2, 0xb4, 0x0d, 0xca, 0x5f, + 0x6c, 0x7e, 0x99, 0x28, 0x8c, 0x77, 0x07, 0xec, 0x7c, 0xe2, 0x4f, 0xc0, + 0x90, 0xd2, 0xac, 0x76, 0x87, 0x8e, 0x99, 0x39, 0x19, 0x67, 0x96, 0x18, + 0xc9, 0xe6, 0xc8, 0xd4, 0x18, 0xd9, 0x13, 0x85, 0xbc, 0xee, 0x93, 0xdd, + 0xf2, 0x2b, 0xf2, 0x15, 0x40, 0x8d, 0xf2, 0x78, 0xc6, 0x69, 0xc5, 0xe3, + 0x05, 0x6e, 0x28, 0x40, 0xe4, 0x11, 0xcf, 0x20, 0xee, 0x53, 0xea, 0x62, + 0x5f, 0x57, 0x89, 0xf5, 0xe2, 0x77, 0x52, 0x18, 0x4d, 0x39, 0xcc, 0x84, + 0x73, 0x5a, 0x18, 0x22, 0x81, 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, 0x5d, 0xc0, 0xcb, 0x28, 0xe6, 0x81, 0x2d, 0xc6, + 0xc1, 0x5f, 0x8e, 0x3e, 0x6c, 0x4e, 0xfc, 0xf5, 0x7e, 0x1e, 0xfa, 0xf7, + 0x9b, 0x0d, 0x99, 0x48, 0x40, 0x25, 0x9d, 0x2e, 0x9a, 0x26, 0x5a, 0xa4, + 0xae, 0xd4, 0xd1, 0xee, 0x42, 0x61, 0xc7, 0x44, 0x92, 0x25, 0x55, 0x27, + 0x23, 0x9f, 0x40, 0xc2, 0x28, 0xe7, 0xd2, 0x00, 0x52, 0x07, 0xb7, 0xf0, + 0xe7, 0x56, 0x7f, 0xd6, 0xcb, 0x89, 0x8a, 0x6d, 0x7f, 0xf9, 0x2e, 0x0e, + 0xf8, 0x69, 0x1a, 0xa3, 0x5f, 0xbd, 0xd1, 0xd1, 0x98, 0xf8, 0x3f, 0x6f, + 0x94, 0x72, 0x29, 0x50, 0x6e, 0x5e, 0xdd, 0xc6, 0x1e, 0xf5, 0xfd, 0xe8, + 0x2c, 0x19, 0x22, 0x28, 0xcc, 0x3a, 0x98, 0x7a, 0x9e, 0x28, 0x3d, 0x52, + 0xbf, 0xc4, 0x72, 0xd7, 0x9b, 0x7e, 0xdf, 0xb6, 0x1a, 0x81, 0x05, 0x7d, + 0x6b, 0x5f, 0xcc, 0xa9, 0x16, 0x3d, 0x07, 0x4b, 0xa3, 0xa2, 0xbc, 0x5f, + 0x22, 0x20, 0x8a, 0x81, 0x2c, 0xe3, 0x90, 0x4f, 0x05, 0x09, 0xef, 0xbb, + 0xf6, 0x6e, 0xdd, 0x04, 0x3e, 0x6d, 0x7e, 0x93, 0x5d, 0x59, 0x2c, 0xc6, + 0x6d, 0xde, 0x7c, 0xe0, 0x24, 0xf6, 0x5d, 0x40, 0x3d, 0x09, 0x12, 0x80, + 0x02, 0x0d, 0x3a, 0x4b, 0xe8, 0x5b, 0x15, 0xdd, 0x25, 0x5a, 0x6f, 0x00, + 0xa7, 0xad, 0x43, 0xc5, 0x48, 0x65, 0x06, 0x1b, 0x47, 0xd2, 0xef, 0xd0, + 0xd1, 0x56, 0xca, 0x9f, 0x2a, 0xe4, 0xae, 0x49, 0x69, 0x1f, 0x2e, 0x07, + 0x58, 0x2a, 0xfd, 0x33, 0xd6, 0x11, 0x9b, 0x18, 0xe5, 0x53, 0x6a, 0x6a, + 0x23, 0x2c, 0x9d, 0x3d, 0xb0, 0x36, 0x76, 0x82, 0x0e, 0x1f, 0xd8, 0x06, + 0x66, 0x84, 0x5d, 0x53, 0x9b, 0x84, 0x01, 0x04, 0x7b, 0xa0, 0x81, 0x16, + 0x75, 0x22, 0xdc, 0x36, 0xaf, 0x6f, 0xc3, 0xd5, 0xe4, 0x1b, 0x0e, 0x16, + 0xba, 0x15, 0xea, 0xd1, 0xeb, 0xad, 0x0b, 0x2b, 0x9a, 0xd6, 0x83, 0xf8, + 0xfb, 0x7d, 0xa1, 0x3a, 0x6c, 0xcf, 0x59, 0x4c, 0x38, 0xcc, 0x6b, 0x47, + 0xba, 0x41, 0x52, 0x22, 0xdb, 0x82, 0x8b, 0xfb, 0xe6, 0xc2, 0xc6, 0x42, + 0x92, 0x48, 0xa1, 0x9a, 0x68, 0x7b, 0xbf, 0x32, 0xe4, 0xf2, 0xcf, 0x6e, + 0x22, 0xae, 0x1e, 0x47, 0x0d, 0x09, 0x65, 0x2b, 0x8f, 0xc5, 0x8e, 0x82, + 0x33, 0x53, 0xa1, 0xd6, 0xd2, 0x8a, 0x46, 0x82, 0xf9, 0x17, 0xd3, 0xa4, + 0x5e, 0x61, 0xf9, 0xd5, 0xbd, 0xae, 0x40, 0xaf, 0x38, 0xe1, 0xbe, 0xb7, + 0x58, 0x76, 0x24, 0x65, 0x9e, 0x69, 0x10, 0x83, 0x98, 0xcd, 0xbf, 0x34, + 0x4a, 0x11, 0x72, 0xd3, 0xa4, 0x4d, 0xe2, 0x7f, 0xaa, 0x4f, 0xbb, 0x1c, + 0xae, 0x44, 0x22, 0x12, 0xdc, 0x63, 0xd7, 0x3a, 0xb0, 0xd4, 0xe5, 0xec, + 0x37, 0xec, 0x36, 0xf1, 0xc9, 0x42, 0xef, 0x76, 0x99, 0xe3, 0x8a, 0xd5, + 0x8a, 0x84, 0xbf, 0x4a, 0x60, 0x63, 0xc9, 0xc1, 0xe9, 0x86, 0xce, 0xbf, + 0xff, 0xa5, 0xc8, 0xa5, 0x2f, 0xc8, 0xb1, 0x80, 0xdb, 0x09, 0x18, 0xd5, + 0x10, 0xc0, 0x0a, 0x96, 0xaf, 0x9f, 0x23, 0xb3, 0x6a, 0x52, 0x85, 0xfc, + 0x2c, 0xa7, 0xa5, 0xa1, 0x89, 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, 0x20, 0x02, 0x22, 0x04, 0x1b, 0x5f, 0x3a, 0xcf, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + device_key_type_ = OEMCrypto_RSA_Private_Key; + RunTest(); +} + +TEST_F(ODKGoldenProvisionV18, CorePIGTest_OfflineNoNonce_prov20ecc) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x02, 0x00, 0x12, + 0xac, 0x0a, 0xc5, 0x83, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x30, 0x00, 0x02, 0x00, 0x12, + 0xac, 0x0a, 0xc5, 0x83, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x95, + 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, 0x90, 0x01, 0x81, 0x65, 0x7c, 0xa2, 0x52, 0x38, 0x6e, 0x34, 0x7e, + 0x52, 0x27, 0xfb, 0xcc, 0x3e, 0x6b, 0x16, 0x58, 0x3a, 0xde, 0x26, 0x5c, + 0x41, 0x95, 0x03, 0xdb, 0x25, 0xd9, 0x48, 0x41, 0xeb, 0xc0, 0xef, 0x04, + 0xd3, 0x41, 0xa9, 0x16, 0xc7, 0xf5, 0x68, 0x22, 0x53, 0x61, 0xde, 0x81, + 0xc0, 0x73, 0x9f, 0x12, 0x2a, 0x40, 0x65, 0x46, 0xdd, 0x6e, 0xdb, 0x72, + 0xac, 0x4b, 0x20, 0x6e, 0x71, 0x62, 0x6e, 0x86, 0x2f, 0x98, 0x1b, 0xec, + 0x7e, 0xd7, 0x1d, 0x79, 0xc7, 0x57, 0x28, 0x9f, 0x71, 0x48, 0xb0, 0x9c, + 0xff, 0x59, 0xa8, 0x97, 0xb0, 0x11, 0x56, 0xfa, 0x70, 0x9e, 0x3e, 0x40, + 0xda, 0x80, 0x64, 0xa6, 0x20, 0xaf, 0x5c, 0x73, 0xe2, 0x39, 0x26, 0xb7, + 0xd1, 0xa3, 0x52, 0x08, 0xe7, 0xa7, 0xac, 0x31, 0xc2, 0x5b, 0x72, 0x28, + 0x00, 0x30, 0xfe, 0x10, 0xbe, 0x3d, 0xec, 0x16, 0xe0, 0xd1, 0x4a, 0xd5, + 0x6e, 0x46, 0xef, 0x8d, 0xde, 0xb6, 0xc1, 0x8a, 0x0e, 0xde, 0xaf, 0xe7, + 0x5b, 0x03, 0xc3, 0x12, 0x10, 0x8f, 0xef, 0xc7, 0x4f, 0x16, 0x00, 0xae, + 0x22, 0xb8, 0x65, 0xf3, 0x3d, 0x63, 0x36, 0x3a, 0x01, 0x1a, 0xca, 0x07, + 0x0a, 0xb8, 0x02, 0x08, 0x02, 0x12, 0x10, 0x48, 0x4c, 0x97, 0x33, 0xdd, + 0x59, 0x35, 0xad, 0x65, 0x6f, 0xbf, 0x74, 0xa0, 0x5d, 0x51, 0xbb, 0x18, + 0x8b, 0xdc, 0x95, 0xa2, 0x06, 0x22, 0x5b, 0x30, 0x59, 0x30, 0x13, 0x06, + 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, + 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x42, 0x60, + 0x66, 0x81, 0x7c, 0x62, 0x5b, 0x89, 0x52, 0x73, 0xae, 0xc0, 0xcc, 0x5d, + 0x28, 0x5a, 0x82, 0xb2, 0xea, 0xea, 0xd8, 0x8c, 0x77, 0xab, 0x32, 0x5d, + 0x51, 0xb5, 0xe4, 0xae, 0x53, 0x8e, 0xc9, 0xde, 0x97, 0x7e, 0x8e, 0x47, + 0xd6, 0xb9, 0xb7, 0x49, 0x1a, 0xee, 0x3d, 0xc7, 0x3e, 0x81, 0x96, 0x83, + 0xef, 0x19, 0xe7, 0xbc, 0xdf, 0x76, 0x6a, 0x3e, 0xe9, 0x54, 0x15, 0x0a, + 0x04, 0xd8, 0x28, 0xd9, 0xd4, 0x01, 0x3a, 0x0c, 0x77, 0x69, 0x64, 0x65, + 0x76, 0x69, 0x6e, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x48, 0x02, 0x52, 0xaa, + 0x01, 0x08, 0x01, 0x10, 0x00, 0x1a, 0x81, 0x01, 0x04, 0xb8, 0x88, 0x06, + 0x02, 0x12, 0x58, 0x1b, 0x04, 0x6a, 0x25, 0x3a, 0x68, 0xd2, 0xeb, 0x61, + 0xe2, 0x4f, 0xa1, 0x4d, 0x55, 0x39, 0x85, 0x4c, 0xb1, 0xfe, 0x04, 0x01, + 0xd4, 0x5f, 0x2e, 0xd2, 0x80, 0xde, 0x27, 0xd2, 0x37, 0x54, 0x04, 0x85, + 0x8b, 0xfa, 0x4a, 0x31, 0x7f, 0x4b, 0x8d, 0x74, 0xfe, 0xd5, 0xdc, 0x85, + 0x36, 0xd5, 0x0c, 0xc6, 0x4e, 0x3b, 0x7a, 0xd6, 0xe9, 0x5d, 0x49, 0x41, + 0x9f, 0x00, 0xac, 0x89, 0x6e, 0x73, 0x75, 0x86, 0xfe, 0x9a, 0xa2, 0x50, + 0xf2, 0x19, 0xcf, 0xf5, 0x2e, 0x75, 0x21, 0x3a, 0x09, 0x76, 0x21, 0x6e, + 0x03, 0xa6, 0x46, 0x0f, 0xff, 0xa2, 0xfb, 0xf1, 0xa2, 0xbe, 0x62, 0x19, + 0x0e, 0xdc, 0x0d, 0x82, 0xb7, 0x20, 0x95, 0x81, 0x3c, 0xad, 0xa8, 0x3e, + 0x18, 0x20, 0x58, 0xc9, 0x4d, 0x75, 0xf0, 0x45, 0xa7, 0x8c, 0x9b, 0xc5, + 0xbb, 0x31, 0xa0, 0xd9, 0x25, 0x22, 0x20, 0x03, 0x0c, 0x37, 0x13, 0xa7, + 0x1a, 0x35, 0x44, 0x7c, 0x57, 0x7b, 0xfb, 0x47, 0x6d, 0x4b, 0x40, 0xf8, + 0xe8, 0x4b, 0x66, 0x44, 0x0d, 0x99, 0xe8, 0x0a, 0xcf, 0x00, 0x25, 0xdd, + 0xfd, 0x38, 0xbb, 0x12, 0x66, 0x30, 0x64, 0x02, 0x30, 0x20, 0x0e, 0x49, + 0x58, 0x0b, 0x5b, 0x5e, 0x6f, 0x9b, 0xa8, 0x78, 0x55, 0xce, 0xde, 0x43, + 0xef, 0x57, 0xa7, 0x86, 0xc2, 0x28, 0x76, 0xbf, 0x54, 0xc8, 0x99, 0x72, + 0x71, 0xdd, 0x14, 0xc7, 0x72, 0xf1, 0x1e, 0xcc, 0x6c, 0x2d, 0x75, 0xfd, + 0x99, 0x84, 0x34, 0xa4, 0x99, 0x39, 0x79, 0xe5, 0x28, 0x02, 0x30, 0x33, + 0x20, 0x1e, 0xc4, 0x98, 0x75, 0xe7, 0xac, 0x6f, 0xb2, 0x90, 0x3b, 0xe1, + 0x12, 0xd1, 0x8b, 0x88, 0xbf, 0xd6, 0x27, 0x6d, 0x80, 0x2a, 0x90, 0xd6, + 0x8d, 0xfd, 0x3c, 0x61, 0xfb, 0x45, 0xb2, 0xce, 0x8e, 0x6d, 0x65, 0x0d, + 0x61, 0x78, 0xf4, 0x0d, 0x8f, 0xbb, 0x47, 0xa7, 0xf7, 0x45, 0xca, 0x1a, + 0xa2, 0x04, 0x0a, 0x9a, 0x01, 0x08, 0x01, 0x12, 0x10, 0xc6, 0x10, 0x80, + 0x8e, 0xce, 0x58, 0x74, 0x5c, 0x0f, 0xb3, 0xda, 0x8c, 0xeb, 0x33, 0x3d, + 0x8a, 0x18, 0xed, 0xad, 0xab, 0x97, 0x06, 0x22, 0x78, 0x30, 0x76, 0x30, + 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, + 0x2b, 0x81, 0x04, 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0x0b, 0x5c, 0xca, + 0xda, 0x33, 0x99, 0x3b, 0xf6, 0xd9, 0xa7, 0xec, 0x5c, 0x91, 0xb5, 0x1d, + 0x07, 0x63, 0x38, 0x25, 0xad, 0x59, 0x2c, 0x14, 0x00, 0xf2, 0xc7, 0x5f, + 0x36, 0xec, 0xa0, 0x68, 0x21, 0xa2, 0xbd, 0x8a, 0xd3, 0xb2, 0x0c, 0x76, + 0x90, 0xef, 0x99, 0xe9, 0x57, 0xc6, 0x60, 0x1c, 0x3d, 0x89, 0x03, 0xd6, + 0xe1, 0xb3, 0x5d, 0x83, 0x94, 0xe9, 0x39, 0xea, 0xd5, 0xac, 0x00, 0x5b, + 0x4a, 0x14, 0xd7, 0xc2, 0x08, 0xa8, 0x1c, 0x05, 0xe2, 0x3b, 0x50, 0xe9, + 0x8c, 0x64, 0x32, 0x92, 0xa8, 0x5f, 0x7e, 0x33, 0xd6, 0x99, 0xcd, 0x09, + 0xe6, 0x18, 0x13, 0x2f, 0x16, 0x3a, 0x7e, 0xbf, 0xa8, 0x28, 0xd9, 0xd4, + 0x01, 0x48, 0x03, 0x12, 0x80, 0x03, 0x81, 0x6f, 0xdc, 0x22, 0x5d, 0x32, + 0x26, 0x9e, 0x8b, 0x54, 0x18, 0x11, 0x11, 0x1f, 0xa4, 0x4f, 0x58, 0x95, + 0xd0, 0x74, 0x19, 0xd3, 0x72, 0xa5, 0x5b, 0x30, 0xe5, 0xa9, 0x8f, 0x11, + 0x99, 0x1a, 0x0d, 0x9c, 0x27, 0xd9, 0xc8, 0xe7, 0xff, 0xf0, 0x08, 0xc7, + 0xcf, 0xb2, 0x94, 0x94, 0xd4, 0x56, 0x7f, 0xf5, 0xd8, 0x31, 0x9e, 0xd6, + 0xd1, 0x3f, 0xbc, 0x52, 0x48, 0x30, 0x33, 0x61, 0x41, 0x5b, 0x3d, 0xa6, + 0xf5, 0xb1, 0xd0, 0x73, 0x53, 0x75, 0x16, 0xf4, 0xb7, 0xe0, 0x6f, 0x2e, + 0xe1, 0x34, 0x63, 0x96, 0x72, 0x79, 0x72, 0xe8, 0xf8, 0x4a, 0x37, 0xf4, + 0x73, 0xbb, 0x8e, 0x5e, 0x73, 0x6c, 0xdd, 0x14, 0x2d, 0xe8, 0xb6, 0xc0, + 0xf2, 0xbb, 0x34, 0xca, 0x6d, 0x9c, 0x1b, 0xde, 0xf6, 0x48, 0xe2, 0xce, + 0xd7, 0x98, 0x42, 0x51, 0x03, 0x3a, 0x54, 0x74, 0x0d, 0xcf, 0x2d, 0xc4, + 0x77, 0x6b, 0x5d, 0x7a, 0xd0, 0xf0, 0x1a, 0xec, 0x59, 0xa8, 0xb7, 0x87, + 0x2c, 0x3d, 0x5a, 0xd2, 0x4d, 0x2d, 0xf8, 0xc6, 0x71, 0x87, 0x0d, 0xda, + 0x88, 0x93, 0xf7, 0x60, 0xd9, 0xd9, 0x3d, 0x4b, 0x8d, 0x6c, 0x43, 0x57, + 0x17, 0x7e, 0x89, 0xc6, 0x56, 0x4c, 0xd4, 0x51, 0xe7, 0x8a, 0x7d, 0x91, + 0x73, 0xda, 0xfa, 0x32, 0xb7, 0xd5, 0xdf, 0xb9, 0xe4, 0x45, 0x22, 0x45, + 0xc5, 0x8b, 0x5e, 0x0f, 0xe9, 0x77, 0x8c, 0x8e, 0xd6, 0x18, 0x02, 0xad, + 0x47, 0xd4, 0x22, 0xdc, 0x9e, 0xf1, 0xbb, 0xf1, 0x5b, 0x9f, 0x5d, 0xde, + 0xa8, 0x16, 0xfa, 0x80, 0x33, 0xa8, 0x31, 0x36, 0x71, 0xb1, 0x04, 0x7b, + 0xc2, 0x88, 0xe9, 0x9b, 0xc5, 0xd2, 0x32, 0xd4, 0x0c, 0xef, 0xfe, 0x4d, + 0x5a, 0xe9, 0x85, 0xb5, 0x00, 0x7e, 0x67, 0xd5, 0xe9, 0x16, 0x1b, 0x97, + 0xc5, 0xea, 0xf6, 0xfe, 0x52, 0xc9, 0x04, 0xd0, 0x07, 0xe8, 0x49, 0x6e, + 0x3e, 0x9f, 0x1f, 0xdb, 0xb1, 0xfe, 0x7a, 0x40, 0xd6, 0x07, 0x71, 0x20, + 0x83, 0x22, 0x29, 0x20, 0x4b, 0xa5, 0x56, 0xac, 0x78, 0x2a, 0x76, 0x1b, + 0xe8, 0x08, 0x3e, 0x1b, 0xf8, 0x4f, 0xae, 0xc6, 0x45, 0x5d, 0x2b, 0xdc, + 0x1f, 0x0b, 0x22, 0xdb, 0x77, 0xd7, 0xf4, 0xde, 0x5e, 0xa8, 0x0c, 0x43, + 0x92, 0xb6, 0xa6, 0x09, 0x0d, 0xc9, 0xce, 0xcb, 0xf8, 0xb3, 0x0d, 0x05, + 0x25, 0xf0, 0xee, 0x5f, 0x8a, 0xc7, 0xf4, 0x0f, 0xf1, 0xb6, 0x59, 0x48, + 0xa8, 0xd0, 0x46, 0xec, 0xdf, 0x73, 0xb7, 0xfe, 0x2b, 0xda, 0x6a, 0xe6, + 0x52, 0x4c, 0xc4, 0x5b, 0xd3, 0xf3, 0x40, 0x76, 0xbf, 0xc9, 0x7a, 0x85, + 0xe1, 0x68, 0xce, 0x69, 0x53, 0x43, 0xc9, 0x3f, 0x86, 0xdb, 0x5d, 0x98, + 0x8e, 0xdb, 0x3c, 0x4a, 0x4f, 0xc6, 0x18, 0x73, 0x00, 0xf4, 0xb3, 0x93, + 0xec, 0x37, 0x16, 0x73, 0xbb, 0x74, 0x20, 0x03, 0x20, 0x02, 0x22, 0x04, + 0x83, 0xc5, 0x0a, 0xac, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + device_key_type_ = OEMCrypto_ECC_Private_Key; + RunTest(); +} + +TEST_F(ODKGoldenProvisionV18, CorePIGTest_OfflineNoNonce_prov30) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x02, 0x00, 0x12, + 0x7f, 0x32, 0x70, 0x49, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x30, 0x00, 0x02, 0x00, 0x12, + 0x7f, 0x32, 0x70, 0x49, 0x00, 0x00, 0x00, 0x05, 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, 0xea, 0x1f, 0x31, 0x8d, 0x3c, 0xa8, 0xa5, 0x43, 0x25, + 0xf6, 0x92, 0xb0, 0x49, 0x4b, 0xdc, 0x4b, 0x17, 0x61, 0x0e, 0x1d, 0x8c, + 0x85, 0x00, 0x21, 0x35, 0x84, 0x54, 0x56, 0x53, 0x0a, 0x34, 0x08, 0x34, + 0x87, 0x67, 0x03, 0xa6, 0x07, 0x72, 0x11, 0x23, 0x36, 0xcd, 0x5a, 0x84, + 0x24, 0x48, 0x6a, 0x6c, 0x71, 0x5e, 0xf0, 0x28, 0x24, 0xaf, 0x83, 0xbb, + 0x4f, 0x54, 0x38, 0xc3, 0x3d, 0xfc, 0xb7, 0x79, 0x01, 0x87, 0xf2, 0x6e, + 0xac, 0xfe, 0x80, 0x5d, 0xcb, 0xbe, 0x95, 0x29, 0x76, 0x79, 0xda, 0xf6, + 0xd4, 0x7b, 0x7a, 0xd9, 0xb4, 0x32, 0xd3, 0xa8, 0x6d, 0x14, 0xc0, 0xac, + 0x36, 0xab, 0x77, 0xc3, 0xbd, 0xd5, 0x79, 0x72, 0x0b, 0x21, 0xc9, 0x44, + 0x07, 0x57, 0x86, 0x43, 0xe1, 0x2a, 0x3e, 0x8e, 0x7e, 0x1d, 0x50, 0x64, + 0x09, 0x0f, 0x0c, 0x76, 0x0b, 0xb6, 0x36, 0xe0, 0x64, 0x62, 0x4e, 0xda, + 0xc1, 0x56, 0x08, 0x8b, 0x13, 0x3d, 0x80, 0x3f, 0x26, 0x0e, 0xa0, 0x4a, + 0xc5, 0x95, 0x51, 0xcd, 0x15, 0x41, 0x44, 0x17, 0x78, 0xc6, 0xec, 0x00, + 0x5b, 0x47, 0xad, 0x21, 0xf7, 0x4b, 0x98, 0xed, 0x1d, 0x82, 0x6d, 0x22, + 0xfc, 0xcb, 0x07, 0x69, 0x7c, 0x96, 0x57, 0xd7, 0x01, 0xe1, 0xc3, 0x64, + 0x92, 0xc8, 0xc0, 0xe1, 0x00, 0x31, 0xc2, 0xf9, 0x44, 0x37, 0x5c, 0x60, + 0xe3, 0x4f, 0x61, 0x79, 0xec, 0x7d, 0xed, 0xb6, 0xfa, 0x05, 0x1b, 0xf4, + 0xd5, 0xb5, 0x15, 0xb4, 0x03, 0xab, 0x36, 0xc5, 0xb8, 0xcc, 0xd1, 0x58, + 0x21, 0xfe, 0x1f, 0xa7, 0x75, 0xaa, 0xbe, 0x8e, 0x7b, 0x47, 0x93, 0x7c, + 0xf2, 0x28, 0xbd, 0x07, 0x26, 0x38, 0x99, 0x5d, 0x2b, 0x39, 0xad, 0x67, + 0x26, 0x1d, 0xee, 0xb5, 0xd5, 0x84, 0x5c, 0x6d, 0x2a, 0x21, 0x2b, 0x17, + 0x8a, 0x33, 0x1c, 0x57, 0x64, 0xd2, 0x59, 0x85, 0x6c, 0xae, 0xd1, 0x4d, + 0x8a, 0x90, 0xcd, 0xc2, 0xd4, 0x75, 0xb8, 0x1a, 0x27, 0xbb, 0xa5, 0x6e, + 0xb6, 0xe2, 0x79, 0xa8, 0x4c, 0xb0, 0x89, 0x5a, 0xe8, 0x96, 0x7f, 0xf0, + 0x21, 0x57, 0xec, 0x16, 0x83, 0x46, 0x2c, 0x52, 0xec, 0xb7, 0xee, 0x5b, + 0x16, 0xbd, 0x11, 0xd3, 0xa8, 0x6c, 0x33, 0x43, 0x9e, 0x63, 0x4c, 0x60, + 0x33, 0xcd, 0xc2, 0xad, 0x1f, 0xfa, 0x16, 0x9d, 0xea, 0x37, 0x96, 0x76, + 0x61, 0x7a, 0x81, 0x1f, 0x10, 0xa6, 0x77, 0x5e, 0x8a, 0x0f, 0xe0, 0xbf, + 0x17, 0x25, 0x63, 0x90, 0x88, 0x9d, 0xa0, 0xcf, 0xe1, 0x79, 0xa2, 0x68, + 0x5a, 0x79, 0x98, 0x17, 0xac, 0x83, 0x3d, 0x37, 0xd2, 0x60, 0x56, 0x05, + 0x71, 0x33, 0xbf, 0xe6, 0x14, 0x39, 0x38, 0xb3, 0xc9, 0xa4, 0x8c, 0xc5, + 0x50, 0x77, 0xbf, 0x6e, 0xc2, 0xa7, 0x44, 0x49, 0x8e, 0x68, 0x79, 0xd2, + 0x66, 0x3b, 0xba, 0xad, 0x05, 0x39, 0xeb, 0x27, 0xc9, 0xbf, 0xa2, 0x31, + 0x31, 0x52, 0x71, 0xdd, 0xe2, 0x24, 0xbe, 0xc5, 0xcc, 0x0a, 0x19, 0xc9, + 0x98, 0x75, 0xde, 0xc2, 0x21, 0x74, 0x63, 0x71, 0xb0, 0x33, 0xbc, 0x3f, + 0xfb, 0x01, 0x43, 0xb9, 0x53, 0xf7, 0xcd, 0x02, 0xeb, 0xca, 0x4f, 0x1c, + 0xb0, 0xdf, 0x1a, 0xcf, 0x04, 0xb0, 0x49, 0xaf, 0xce, 0x23, 0x0a, 0x4e, + 0x61, 0x29, 0xe9, 0x92, 0xea, 0x9c, 0x35, 0xed, 0xb4, 0x7c, 0x40, 0x92, + 0x7d, 0x55, 0xf8, 0x3e, 0xc1, 0xf0, 0x36, 0xd7, 0xca, 0xee, 0xa1, 0x5d, + 0x56, 0xf2, 0x8a, 0x1e, 0xce, 0xcc, 0xb6, 0x86, 0x39, 0x6d, 0x87, 0xdc, + 0x85, 0xbc, 0x56, 0xdc, 0xf5, 0x2e, 0x17, 0xa0, 0xf2, 0x9d, 0xc3, 0xdd, + 0xa3, 0x56, 0xd8, 0x8e, 0x00, 0x8a, 0xb6, 0x27, 0x87, 0xe0, 0x8e, 0x79, + 0x13, 0x05, 0x48, 0xd2, 0xb0, 0x21, 0x8d, 0x86, 0xb3, 0x7a, 0xef, 0xea, + 0x4f, 0x57, 0x6a, 0xe0, 0xb5, 0x59, 0xe2, 0x80, 0xa8, 0x0f, 0x60, 0x05, + 0x1b, 0x9e, 0x55, 0xc1, 0x64, 0xab, 0x7f, 0x63, 0xf4, 0x02, 0x5a, 0xb5, + 0x58, 0xa9, 0xbc, 0x43, 0x28, 0x41, 0xaa, 0x8a, 0x5b, 0xde, 0xd1, 0x88, + 0xb3, 0x52, 0x39, 0x4d, 0x6c, 0x3f, 0x6e, 0x88, 0x11, 0x80, 0xda, 0xa1, + 0x8a, 0x04, 0x5d, 0x30, 0x98, 0xc4, 0xe8, 0x28, 0x90, 0x4d, 0x9b, 0x92, + 0x61, 0x9f, 0xdb, 0xf1, 0x9b, 0xbf, 0xd4, 0xd9, 0x83, 0x74, 0x6f, 0xee, + 0x95, 0x2e, 0x64, 0x05, 0x84, 0xf5, 0x51, 0xb6, 0xc9, 0x3f, 0xf8, 0xbd, + 0xf9, 0x21, 0x92, 0x2f, 0x08, 0xe1, 0x43, 0x13, 0x94, 0x97, 0x18, 0x50, + 0x7f, 0x3f, 0x85, 0xf9, 0x15, 0xab, 0x6a, 0x17, 0x3c, 0x5a, 0x5e, 0x26, + 0xf1, 0x47, 0xdd, 0x06, 0x58, 0x40, 0x27, 0x5d, 0x2f, 0xe6, 0xa1, 0x91, + 0xb2, 0xfd, 0xdb, 0x49, 0x89, 0x7e, 0x78, 0x85, 0x81, 0xfc, 0x6d, 0xf8, + 0x29, 0x7a, 0x1f, 0x76, 0x69, 0xb1, 0x17, 0x2f, 0xb9, 0x29, 0x17, 0x55, + 0x25, 0x2e, 0x7c, 0xca, 0xdc, 0x1d, 0xee, 0xb0, 0x8f, 0xf6, 0x62, 0x5d, + 0x05, 0xe2, 0xb4, 0x47, 0x83, 0x1c, 0xbe, 0x69, 0x85, 0x7b, 0xc9, 0xd9, + 0x95, 0x2f, 0x2a, 0xa1, 0x79, 0x9b, 0xeb, 0x93, 0x5f, 0x1a, 0xa9, 0x0f, + 0x1a, 0xaf, 0xfb, 0x3a, 0xee, 0x0a, 0x69, 0x69, 0xab, 0x33, 0xbb, 0x2b, + 0x6b, 0x53, 0x77, 0xd8, 0xd9, 0xcc, 0x60, 0xe3, 0xbe, 0x6d, 0x24, 0x4f, + 0x0c, 0x0b, 0x6f, 0x09, 0x4d, 0xa3, 0x64, 0x47, 0x71, 0x07, 0x23, 0x3a, + 0x11, 0xd5, 0x2b, 0xc6, 0x13, 0xf8, 0xe7, 0x2b, 0x88, 0x94, 0xfe, 0x70, + 0xe8, 0x40, 0x16, 0x7f, 0x3a, 0xac, 0x06, 0xa1, 0x44, 0xa3, 0xa9, 0xd2, + 0xff, 0xb7, 0xa1, 0x86, 0x95, 0x15, 0x2b, 0xc5, 0x83, 0x10, 0xb8, 0x72, + 0x14, 0x24, 0x97, 0x8a, 0xf5, 0x45, 0xa8, 0x1b, 0x1c, 0xfa, 0x52, 0xab, + 0x25, 0x8a, 0x2c, 0xed, 0x48, 0x8f, 0xe4, 0x3b, 0xc1, 0x61, 0xcb, 0xb6, + 0x85, 0xb1, 0x32, 0x57, 0xaf, 0x3e, 0x5a, 0x14, 0x93, 0xc9, 0xd3, 0x97, + 0xc0, 0x6e, 0x67, 0x22, 0xfe, 0x3c, 0xf3, 0x79, 0xaa, 0x4e, 0x35, 0x84, + 0x7d, 0x27, 0xd0, 0x84, 0x53, 0x1d, 0x91, 0xba, 0x3b, 0x06, 0x36, 0xa6, + 0xdd, 0xbd, 0x9e, 0x91, 0x31, 0x88, 0xed, 0xee, 0x8c, 0xe9, 0x68, 0x9c, + 0x00, 0x52, 0x1a, 0xbb, 0x45, 0x75, 0x2f, 0x9a, 0x81, 0xf7, 0xe8, 0xf8, + 0x76, 0x71, 0xd3, 0x3e, 0x9b, 0x7e, 0x13, 0x92, 0x6a, 0x70, 0x55, 0x3f, + 0x48, 0xef, 0xbd, 0xd6, 0x9f, 0x5e, 0x9c, 0x0c, 0x68, 0x22, 0xba, 0x71, + 0x7d, 0x36, 0x11, 0xe1, 0xe5, 0xd8, 0x00, 0xa8, 0xce, 0x2c, 0x89, 0x79, + 0xbf, 0x5b, 0x02, 0xac, 0xda, 0xd4, 0x68, 0x4f, 0xdf, 0x8d, 0xe3, 0x07, + 0x38, 0x39, 0xd1, 0xe0, 0x4d, 0xb4, 0xdc, 0x79, 0x2c, 0x04, 0x68, 0xb4, + 0xed, 0x53, 0x2e, 0x2e, 0x0e, 0xbe, 0xee, 0xae, 0x33, 0xad, 0x80, 0x9c, + 0x77, 0x9d, 0xc1, 0x61, 0x9c, 0x5e, 0x19, 0x72, 0x51, 0xeb, 0xc8, 0x1c, + 0xc9, 0xd2, 0xd3, 0x54, 0x6f, 0xe6, 0x88, 0x37, 0x2b, 0x35, 0x00, 0xb1, + 0xd4, 0x8b, 0xa6, 0xb2, 0x1b, 0x73, 0x5b, 0xdf, 0x93, 0xb2, 0x96, 0x77, + 0x4b, 0x2d, 0xf2, 0x9f, 0xf7, 0xd0, 0xb4, 0x78, 0x5d, 0xe5, 0x6d, 0x6c, + 0xa3, 0xd0, 0xf5, 0xc7, 0xd2, 0x00, 0x2f, 0xa2, 0xfc, 0x0c, 0xb0, 0x9f, + 0x63, 0x53, 0xe9, 0x08, 0xc1, 0x51, 0x85, 0x73, 0x6a, 0xfa, 0x01, 0xe5, + 0xf6, 0x7c, 0xcb, 0xdd, 0x53, 0x53, 0x47, 0xa1, 0xb8, 0x64, 0xb1, 0xda, + 0xd7, 0xd7, 0xef, 0x9a, 0x62, 0x53, 0x8f, 0x4b, 0xbe, 0x0f, 0x3c, 0x12, + 0x3b, 0x2c, 0xda, 0x5b, 0x12, 0x43, 0x81, 0xf5, 0x3c, 0x8a, 0x21, 0x0f, + 0x52, 0x6b, 0x81, 0x85, 0xaa, 0xbd, 0xae, 0x3f, 0x2f, 0x46, 0x2b, 0x4a, + 0x19, 0x6b, 0xa2, 0x69, 0x2f, 0xbe, 0x50, 0x79, 0x71, 0xa1, 0x03, 0x0d, + 0x29, 0xe5, 0xc0, 0xe5, 0xc4, 0x32, 0x77, 0x4c, 0xbb, 0x3b, 0xb7, 0x8e, + 0xa4, 0xc5, 0xd7, 0x58, 0x83, 0x40, 0x25, 0x20, 0x8e, 0xa0, 0x7f, 0x9a, + 0x9f, 0x62, 0x2f, 0xb1, 0xce, 0x95, 0x53, 0x29, 0xd3, 0x39, 0xd4, 0x7a, + 0xe6, 0x96, 0x73, 0x5f, 0x65, 0xbe, 0x8e, 0x8c, 0x59, 0x88, 0xf4, 0x1b, + 0x40, 0x13, 0xca, 0x74, 0x39, 0x6f, 0xef, 0x08, 0xbc, 0xdb, 0x9a, 0x1c, + 0x38, 0xa7, 0x67, 0x2f, 0x96, 0x78, 0x87, 0x3a, 0xfa, 0xf7, 0x29, 0x16, + 0x1d, 0x73, 0x6b, 0x1f, 0xdf, 0x1d, 0x91, 0xd3, 0x93, 0x1f, 0xef, 0x06, + 0xa1, 0xef, 0x19, 0x28, 0x61, 0xe0, 0x09, 0xae, 0x69, 0xa3, 0x41, 0x2f, + 0x28, 0x35, 0x00, 0xe4, 0xd3, 0x85, 0xc4, 0x69, 0x34, 0x63, 0xee, 0xc7, + 0xa0, 0x31, 0x02, 0x92, 0x63, 0x54, 0xeb, 0x24, 0x68, 0xf8, 0x44, 0x80, + 0x86, 0x9b, 0x21, 0xf0, 0x85, 0xb0, 0x84, 0xaa, 0xe8, 0xe3, 0xf0, 0x3a, + 0x61, 0xe8, 0x5d, 0xf6, 0x66, 0xac, 0x05, 0xd1, 0xc0, 0x4b, 0x5d, 0xe0, + 0xa8, 0x63, 0xf6, 0xcd, 0xba, 0x97, 0x40, 0x55, 0xa0, 0xe7, 0x3b, 0xc2, + 0x2e, 0x05, 0x61, 0x06, 0x89, 0x18, 0x5f, 0x22, 0xb7, 0x00, 0x3f, 0x63, + 0xed, 0xcb, 0x8d, 0x2c, 0xf5, 0xc5, 0x6e, 0xb4, 0xca, 0x4f, 0x83, 0x12, + 0x10, 0x99, 0x21, 0x38, 0x4a, 0xd4, 0x11, 0x68, 0x1a, 0xfc, 0x9c, 0xd2, + 0xea, 0xc2, 0xaa, 0x60, 0xcb, 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, 0xad, 0xf6, 0x92, 0xa2, + 0x06, 0x22, 0x8e, 0x02, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xbc, 0x6d, 0x9d, 0x5a, 0xd1, 0x9f, 0x64, 0xca, 0xb2, 0x2c, 0x8f, + 0x69, 0x1d, 0xa5, 0x41, 0x3a, 0xcc, 0x01, 0x86, 0xf7, 0x69, 0x77, 0x25, + 0x58, 0xed, 0x4a, 0xbe, 0xbd, 0x24, 0x73, 0xd9, 0xa3, 0x21, 0xac, 0x6e, + 0xf1, 0x12, 0xf0, 0x3c, 0xcc, 0x12, 0x09, 0x46, 0x15, 0x2f, 0xd7, 0xbd, + 0x9e, 0x06, 0xd3, 0x44, 0x72, 0xe7, 0x33, 0x3a, 0xa7, 0x1e, 0xab, 0x4a, + 0x73, 0x09, 0x45, 0xf7, 0x7e, 0x94, 0x6b, 0xb2, 0xc8, 0xf2, 0xea, 0xd6, + 0xf1, 0xfe, 0x20, 0xd2, 0x34, 0x5b, 0x02, 0x9e, 0x41, 0xae, 0x56, 0xa9, + 0x3d, 0x17, 0xa4, 0x68, 0x16, 0xda, 0xb5, 0xe7, 0x9b, 0x2c, 0xc6, 0xf8, + 0x51, 0x1f, 0x34, 0xd5, 0x16, 0x67, 0x77, 0x17, 0x95, 0xbf, 0x3d, 0x19, + 0x1e, 0xe0, 0x02, 0x76, 0xab, 0xa1, 0xbd, 0x0a, 0x88, 0xc1, 0x3c, 0x51, + 0xc2, 0x71, 0x1b, 0x28, 0x90, 0x74, 0x6e, 0x06, 0xb1, 0x04, 0xa2, 0x4f, + 0xae, 0x43, 0x03, 0xce, 0xf8, 0x31, 0x97, 0x04, 0xf6, 0x74, 0xae, 0xb8, + 0x82, 0x8e, 0x6c, 0x08, 0x4f, 0xbf, 0x2b, 0xac, 0x45, 0xdc, 0x19, 0x41, + 0x2b, 0x64, 0x53, 0x4d, 0x10, 0x5a, 0x36, 0x46, 0xba, 0xd5, 0xae, 0xa1, + 0xdb, 0xce, 0x42, 0x60, 0xa6, 0xe4, 0x80, 0x65, 0x8c, 0xed, 0x29, 0x89, + 0x8b, 0xe9, 0x3b, 0xe6, 0x33, 0xb1, 0xf1, 0x63, 0x3a, 0x6c, 0x91, 0x49, + 0x6b, 0xd6, 0xc1, 0x1a, 0x52, 0x55, 0x5d, 0x03, 0x9e, 0x92, 0xa3, 0x15, + 0x84, 0x1c, 0x3a, 0x39, 0x80, 0x9a, 0x7a, 0x70, 0xe0, 0xd0, 0x2d, 0x52, + 0xf0, 0x04, 0x7e, 0x88, 0xb5, 0x2d, 0x8e, 0x97, 0x85, 0x88, 0xb3, 0x3d, + 0xb4, 0xd4, 0x21, 0x41, 0x0d, 0x4b, 0x92, 0xb9, 0x77, 0xb1, 0xff, 0x10, + 0x56, 0x8a, 0x0d, 0x94, 0xbe, 0x5b, 0x77, 0x2e, 0x5f, 0xd7, 0x63, 0xdd, + 0xbc, 0x87, 0x1c, 0x67, 0x93, 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, 0x34, 0xdf, 0x8b, 0x7b, + 0x40, 0x3f, 0x6b, 0xbe, 0xb7, 0x47, 0x72, 0x7e, 0x9c, 0x8e, 0x5b, 0xc1, + 0x4a, 0x4e, 0xe7, 0x60, 0x72, 0x43, 0x51, 0x5e, 0x1d, 0x3e, 0x82, 0x53, + 0x89, 0x6a, 0x4f, 0x48, 0x8d, 0x50, 0xd1, 0x74, 0x2c, 0x3d, 0x6d, 0xa0, + 0xf0, 0xc9, 0x4e, 0x80, 0xcb, 0xf6, 0x12, 0xb2, 0xf0, 0xc1, 0x03, 0xa0, + 0x8e, 0xb6, 0x1b, 0x75, 0x94, 0x72, 0x42, 0x0d, 0x8e, 0xa9, 0x94, 0xd7, + 0x5b, 0x17, 0x9d, 0x3a, 0xad, 0x09, 0x5b, 0x0d, 0x29, 0x08, 0x67, 0xaf, + 0xee, 0x72, 0x65, 0x03, 0xa5, 0xe2, 0xf4, 0x49, 0xd2, 0x8c, 0x26, 0x7c, + 0x5e, 0xb3, 0x42, 0x90, 0x57, 0xe2, 0x28, 0x26, 0xb2, 0x9e, 0x32, 0x6b, + 0xdd, 0x2b, 0x2f, 0x12, 0x64, 0xea, 0xd0, 0x6b, 0xd8, 0xf7, 0x53, 0x21, + 0x57, 0x2f, 0x12, 0x1d, 0xc7, 0x88, 0x0a, 0xfb, 0x70, 0x3d, 0x9b, 0x15, + 0xd1, 0xdb, 0x6c, 0xe7, 0x25, 0xf3, 0x87, 0xdd, 0xa0, 0x3b, 0xc1, 0x99, + 0x33, 0xbe, 0x50, 0x36, 0x5b, 0x50, 0x62, 0x0a, 0xc4, 0xae, 0x09, 0x36, + 0x32, 0x8e, 0x19, 0xdc, 0x79, 0x80, 0xd4, 0xe0, 0x82, 0xa2, 0x73, 0xf3, + 0x5f, 0x69, 0x56, 0xcc, 0xe2, 0x29, 0xbd, 0xae, 0x9d, 0xc8, 0x15, 0xdb, + 0xf8, 0xb2, 0xda, 0xfb, 0x04, 0xac, 0x45, 0xaa, 0x6d, 0x3b, 0x7b, 0x26, + 0x87, 0xa5, 0xee, 0x34, 0x46, 0x81, 0x0e, 0xb4, 0x37, 0x2e, 0x6b, 0x8e, + 0x60, 0xc5, 0x6e, 0xec, 0x88, 0x5a, 0x71, 0x34, 0x80, 0x1a, 0xc5, 0x4b, + 0x6c, 0x07, 0x01, 0x2a, 0x39, 0x50, 0x9b, 0x67, 0xa3, 0xc1, 0x5c, 0xee, + 0x9f, 0x8e, 0xd7, 0x3e, 0xe4, 0x7f, 0xd4, 0x11, 0x86, 0xa4, 0x38, 0xa9, + 0xdf, 0x7f, 0xb7, 0x1e, 0x50, 0xe1, 0x34, 0xbe, 0x01, 0x69, 0x5e, 0xad, + 0xbf, 0xcf, 0xba, 0xc8, 0x9d, 0x04, 0x42, 0xf7, 0x3f, 0xf2, 0xaa, 0x92, + 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, 0x49, 0x70, 0x32, 0x7f, 0x2a, 0x80, 0x02, 0x4a, 0x5c, 0x04, 0x01, + 0xf6, 0xa8, 0xcb, 0x49, 0x2f, 0xed, 0x48, 0x46, 0x15, 0xad, 0xa8, 0x0b, + 0x01, 0xb1, 0xf4, 0xcc, 0x79, 0x08, 0xb6, 0x82, 0x46, 0x3e, 0xdd, 0xc8, + 0x66, 0x4a, 0x84, 0xb3, 0xcb, 0x6a, 0xfb, 0xc4, 0x70, 0xca, 0xdf, 0x29, + 0x90, 0x25, 0x2a, 0x28, 0xd3, 0x7d, 0xcb, 0x3e, 0x95, 0x4e, 0xf8, 0x92, + 0xa2, 0xce, 0xe6, 0x21, 0x8e, 0x49, 0x29, 0x41, 0x0c, 0x64, 0x8c, 0x75, + 0xd6, 0x95, 0x69, 0xa0, 0xeb, 0x7d, 0xc9, 0x12, 0x60, 0x16, 0x31, 0xc9, + 0x9b, 0x40, 0xad, 0x58, 0x15, 0x1a, 0x9f, 0x81, 0xc1, 0x16, 0xec, 0x10, + 0xa4, 0x5a, 0x4e, 0xd0, 0x97, 0x60, 0xa0, 0x36, 0xc9, 0xfe, 0x42, 0x65, + 0xea, 0xd9, 0xf8, 0xa8, 0x3d, 0x19, 0xfe, 0xde, 0x1f, 0x57, 0x94, 0xf8, + 0x32, 0xab, 0xca, 0x9b, 0xfe, 0x5c, 0x21, 0x37, 0xb1, 0xc4, 0xf0, 0x2a, + 0x5a, 0xd7, 0x6a, 0xab, 0xd9, 0x7d, 0xd7, 0xa0, 0xb8, 0xb7, 0x35, 0x05, + 0xe7, 0xf4, 0xa7, 0xfc, 0xf9, 0x46, 0xe1, 0x84, 0x39, 0x14, 0x4c, 0xaa, + 0x69, 0x04, 0x39, 0x4a, 0x0b, 0xfb, 0x89, 0x9a, 0x39, 0x0b, 0x8c, 0xb4, + 0xd9, 0x3e, 0x96, 0xef, 0x7a, 0xb5, 0x13, 0xc7, 0x4e, 0x57, 0x3a, 0xd8, + 0xc9, 0x58, 0x0b, 0x76, 0xea, 0x21, 0xd3, 0x98, 0x26, 0xe7, 0xbb, 0x46, + 0xe4, 0x06, 0x91, 0x08, 0xf0, 0x10, 0xd6, 0x95, 0x31, 0x7f, 0x47, 0x95, + 0x79, 0x2b, 0xb8, 0x84, 0xeb, 0x9a, 0xc7, 0x89, 0x48, 0x12, 0xd3, 0x64, + 0xbe, 0x57, 0xfd, 0xc4, 0x26, 0x60, 0xc0, 0x01, 0xb7, 0x23, 0x40, 0xff, + 0x3d, 0x41, 0x51, 0xe8, 0x63, 0x74, 0x2d, 0xa5, 0x99, 0xaa, 0x73, 0xc0, + 0xad, 0xa5, 0xf7, 0x8d, 0x9a, 0xae, 0x13, 0xc9, 0x9b, 0x0e, 0x98, 0x0f, + 0xe7, 0xa7, 0x80, 0x5d, 0xf1, 0xe2, 0xf2, 0x27, 0x12, 0x34, 0x2f, 0x0c, + }; + provisioning_response_ = + std::string(reinterpret_cast(provisioning_response_raw), + sizeof(provisioning_response_raw)); + device_key_type_ = OEMCrypto_RSA_Private_Key; + RunTest(); +} + +////////////////////////////////////////////////////////////////////// +// License tests. +// All license requests from fake_l1, +// GTEST_FILTER="*PIG*:*CdmUseCase*Case1*" +////////////////////////////////////////////////////////////////////// + +TEST_F(ODKGoldenLicenseV18, CorePIGTest_OfflineNoNonce) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xd5, 0xb0, 0xe6, 0x63, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x00, 0x99, 0x00, 0x02, 0x00, 0x12, + 0xd5, 0xb0, 0xe6, 0x63, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 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, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x83, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x02, 0x12, 0x08, 0xc2, 0xb4, 0x77, 0xd5, + 0x84, 0xc8, 0x31, 0xbf, 0x0a, 0x20, 0x33, 0x45, 0x44, 0x46, 0x41, 0x33, + 0x37, 0x36, 0x46, 0x46, 0x44, 0x31, 0x31, 0x37, 0x45, 0x31, 0x30, 0x33, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x90, + 0x1c, 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, + 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x00, 0xd5, 0xb0, 0xe6, 0x63, 0xa0, 0x00, 0x00, 0x00, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xd4, + 0x66, 0x29, 0xee, 0x8b, 0x7c, 0x4e, 0x3b, 0x7e, 0x05, 0x51, 0xaf, 0xb8, + 0x94, 0xf4, 0xa7, 0xdc, 0xc7, 0x91, 0xb1, 0x3c, 0xbf, 0x9c, 0xb4, 0xf0, + 0x98, 0x18, 0xa4, 0xed, 0x97, 0xcd, 0xf9, 0x12, 0x10, 0xdb, 0x10, 0x29, + 0x51, 0xba, 0x34, 0x50, 0x67, 0x56, 0xbe, 0xe6, 0x8e, 0x31, 0x47, 0x90, + 0xa6, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x8c, 0xe5, 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(ODKGoldenLicenseV18, CorePIGTest_OfflineWithPST) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xea, 0x26, 0x31, 0x90, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x00, 0x99, 0x00, 0x02, 0x00, 0x12, + 0xea, 0x26, 0x31, 0x90, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xc2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x16, 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, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x38, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x26, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x49, 0x32, 0x16, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x57, 0x69, 0x74, 0x68, 0x50, + 0x53, 0x54, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x41, 0x31, 0x42, 0x34, 0x37, + 0x45, 0x41, 0x34, 0x44, 0x42, 0x30, 0x30, 0x34, 0x30, 0x31, 0x30, 0x30, + 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, + 0x90, 0x1c, 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, + 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, + 0x20, 0x01, 0x1a, 0x50, 0x6c, 0x21, 0x6a, 0x29, 0x1a, 0x78, 0x10, 0xd8, + 0xa0, 0x83, 0x56, 0x61, 0x43, 0x0d, 0x71, 0x29, 0xe7, 0x65, 0x34, 0x41, + 0xa5, 0x8b, 0x47, 0x19, 0x8d, 0x33, 0x2d, 0xb5, 0xbb, 0xfd, 0x6c, 0x30, + 0xa6, 0x01, 0x7d, 0xb2, 0x27, 0x53, 0xfa, 0x6d, 0xa5, 0x91, 0x59, 0x7c, + 0xf7, 0x25, 0x3d, 0x94, 0x44, 0xd0, 0x08, 0xba, 0x29, 0x80, 0xca, 0x02, + 0xb2, 0x84, 0x70, 0x8b, 0xb1, 0x4a, 0xcf, 0x0a, 0x1a, 0x03, 0xf2, 0x2d, + 0xa0, 0x07, 0x7f, 0x57, 0xbb, 0xf4, 0xe0, 0x33, 0x61, 0xd4, 0x92, 0x3a, + 0x12, 0x10, 0xe9, 0xc4, 0x28, 0x4e, 0x79, 0x62, 0x1a, 0x43, 0x99, 0xe6, + 0x99, 0x4f, 0xbf, 0x2e, 0x04, 0xb8, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xea, 0x26, + 0x31, 0x90, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x4d, 0xad, 0x9d, 0x20, + 0x56, 0xbe, 0x73, 0x9d, 0xbd, 0x78, 0x62, 0x79, 0x20, 0x63, 0x07, 0x34, + 0xa2, 0x79, 0x8e, 0x6f, 0x07, 0x82, 0x39, 0x98, 0x8d, 0xcf, 0x33, 0x40, + 0xc8, 0xb2, 0x32, 0x8a, 0x12, 0x10, 0x23, 0xa0, 0xc0, 0x02, 0xa1, 0x77, + 0x01, 0x80, 0xb3, 0xbc, 0xee, 0x5d, 0xf7, 0xb3, 0xd5, 0x3f, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x20, 0x8c, 0xe5, 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(ODKGoldenLicenseV18, CorePIGTest_OfflineHWSecureRequired) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x60, 0xa7, 0x85, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x02, 0x00, 0x12, + 0x60, 0xa7, 0x85, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xcb, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1f, 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, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x41, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x2f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xb7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa5, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x59, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x52, 0x32, 0x1f, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x48, 0x57, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x28, + 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x0a, 0x20, 0x30, 0x44, 0x41, 0x31, 0x30, 0x33, 0x41, 0x34, + 0x35, 0x34, 0x43, 0x46, 0x42, 0x46, 0x43, 0x46, 0x30, 0x39, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x12, 0x1d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x90, 0x1c, 0x28, + 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, + 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x20, 0x01, 0x1a, + 0x50, 0x95, 0xe5, 0x5f, 0x39, 0xfc, 0x34, 0x15, 0x00, 0x87, 0x88, 0x86, + 0x3d, 0x5a, 0x3b, 0xa2, 0xad, 0x51, 0x7d, 0xbc, 0xe0, 0x72, 0x99, 0x13, + 0xeb, 0x9d, 0x5c, 0xda, 0x92, 0x99, 0x5b, 0xe1, 0x3a, 0xc5, 0xe1, 0xc6, + 0x0b, 0x7b, 0x7e, 0x04, 0x4c, 0x17, 0x49, 0x26, 0x3a, 0xc4, 0xb1, 0xfb, + 0xec, 0x38, 0xce, 0x27, 0xc7, 0x54, 0x3b, 0x80, 0xec, 0xb1, 0x8e, 0xc9, + 0x5c, 0xa0, 0x70, 0xa1, 0x4d, 0x72, 0xee, 0xd6, 0x43, 0xfa, 0x28, 0xfe, + 0x58, 0x0a, 0x89, 0xe0, 0x0d, 0x8b, 0xe1, 0xe6, 0xbd, 0x12, 0x10, 0x93, + 0x88, 0x4d, 0xad, 0x48, 0x45, 0x49, 0x2b, 0x3d, 0x1a, 0xe8, 0xe8, 0xb3, + 0x60, 0x56, 0x8f, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x60, 0xa7, 0x85, 0x0d, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x0c, 0xd1, 0x21, 0xd5, 0xed, 0x86, 0xf2, + 0xf5, 0x00, 0xd7, 0xd1, 0x23, 0x29, 0x58, 0x3c, 0x0c, 0x14, 0x25, 0x9c, + 0xe4, 0x1f, 0x28, 0xc6, 0xc2, 0x7d, 0x8a, 0x21, 0xa0, 0xb6, 0x81, 0x34, + 0x85, 0x12, 0x10, 0x73, 0x6e, 0x1b, 0x2c, 0x67, 0xa4, 0x8e, 0x1d, 0xe1, + 0xc1, 0x8b, 0x5e, 0x86, 0x51, 0xf6, 0x24, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x60, 0xa7, 0x85, 0x0d, 0xac, 0x00, 0x40, + 0x10, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x05, 0x20, + 0x02, 0x1a, 0x20, 0x84, 0x6e, 0x3d, 0x07, 0x57, 0x27, 0x4e, 0xd6, 0x1c, + 0x89, 0xeb, 0xe9, 0x9b, 0xba, 0x3a, 0x65, 0xbf, 0x60, 0xe9, 0x96, 0x66, + 0xee, 0xc1, 0xbf, 0xa5, 0xc8, 0x24, 0x4e, 0x58, 0x28, 0x93, 0x81, 0x12, + 0x10, 0xac, 0x3f, 0x24, 0x40, 0xa5, 0x05, 0x66, 0x3c, 0x77, 0x98, 0xf0, + 0xce, 0x29, 0xed, 0xa6, 0xa5, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x20, + 0x8c, 0xe5, 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(ODKGoldenLicenseV18, Both_CdmUseCase_Streaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x8a, 0x97, 0xdf, 0x06, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x8a, 0x97, 0xdf, 0x06, 0x00, 0x00, 0x00, 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, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0xbb, 0xbe, 0x77, 0xd5, + 0x84, 0xc8, 0x31, 0xbf, 0x0a, 0x20, 0x43, 0x38, 0x42, 0x32, 0x39, 0x37, + 0x33, 0x43, 0x38, 0x33, 0x35, 0x43, 0x32, 0x43, 0x32, 0x30, 0x30, 0x43, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x8a, 0x97, 0xdf, 0x06, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xf1, 0x2c, + 0xbc, 0x3b, 0x17, 0x0f, 0x1c, 0xcd, 0xa6, 0xe5, 0xf6, 0x4b, 0xb2, 0xf2, + 0xd1, 0xbc, 0x19, 0x30, 0x1a, 0xa1, 0xc5, 0x9d, 0x0f, 0xba, 0xd7, 0x42, + 0x5c, 0xca, 0x96, 0xcf, 0x94, 0x79, 0x12, 0x10, 0xb7, 0xa8, 0xb0, 0xe3, + 0xdc, 0x06, 0x9f, 0xb0, 0x93, 0x59, 0x91, 0xf7, 0x48, 0xc3, 0x6f, 0x40, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x97, + 0xdf, 0x06, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x1d, 0xf6, 0x3a, 0x48, + 0xc4, 0x4b, 0x74, 0x6d, 0x79, 0x67, 0x9b, 0x16, 0xdb, 0x08, 0x92, 0x9c, + 0x08, 0x2c, 0x90, 0x70, 0x75, 0x38, 0x5e, 0x62, 0x39, 0xfc, 0x85, 0xc3, + 0x21, 0x96, 0x4b, 0x21, 0x12, 0x10, 0x4d, 0xcc, 0x09, 0x05, 0x88, 0x2c, + 0x92, 0xd4, 0x9e, 0x4b, 0x9b, 0x21, 0xd3, 0xea, 0x77, 0x50, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x97, 0xdf, 0x06, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xdd, 0xc1, 0x7b, 0x64, 0x3b, 0xdf, + 0x15, 0x56, 0x5a, 0x7d, 0xd1, 0xcb, 0x3a, 0xf5, 0xbb, 0xcd, 0x96, 0x89, + 0x12, 0xb2, 0xe7, 0xf7, 0x4c, 0xe3, 0x2c, 0xb4, 0x41, 0x54, 0xc3, 0xe6, + 0x8b, 0x3a, 0x12, 0x10, 0xfc, 0x3b, 0xae, 0x9f, 0x0c, 0x76, 0x3d, 0x25, + 0x81, 0x38, 0x64, 0xc6, 0xa6, 0x37, 0x6c, 0x4d, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x97, 0xdf, 0x06, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xb9, 0xd9, 0x58, 0x45, 0xa9, 0x41, 0x23, 0xf6, + 0x79, 0x8c, 0x02, 0x8f, 0x70, 0xc6, 0xb5, 0x09, 0xb7, 0x02, 0xf5, 0x37, + 0xf2, 0xeb, 0x66, 0x43, 0x92, 0x56, 0x2a, 0xe8, 0x37, 0x50, 0x40, 0x74, + 0x12, 0x10, 0x34, 0x3f, 0xf8, 0x2f, 0x7f, 0x13, 0x58, 0xf6, 0x76, 0x12, + 0xcb, 0xc8, 0x9d, 0xce, 0x0a, 0x63, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x8a, 0x97, 0xdf, 0x06, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x1d, 0x4a, 0xa0, 0xb2, 0x00, 0xb0, 0x41, 0xa3, 0xf2, 0xe5, + 0x4f, 0xf8, 0x19, 0x20, 0xe5, 0x35, 0xb1, 0x03, 0x65, 0xca, 0xe9, 0x76, + 0x07, 0x0d, 0xbc, 0xfc, 0xc3, 0xa1, 0xa4, 0x9b, 0x28, 0xe2, 0x12, 0x10, + 0x29, 0xb9, 0x38, 0x4d, 0x17, 0x06, 0x80, 0x42, 0x27, 0xb2, 0xdb, 0x59, + 0x01, 0x0f, 0x5d, 0x89, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x8c, + 0xe5, 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(ODKGoldenLicenseV18, Both_CdmUseCase_Streaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x3f, 0xf4, 0x18, 0xc2, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x3f, 0xf4, 0x18, 0xc2, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0xc8, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1d, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xb4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa0, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x50, 0x32, 0x1d, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x61, + 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, + 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x0a, 0x20, 0x39, 0x45, 0x36, 0x35, 0x39, 0x36, 0x32, 0x34, 0x36, 0x35, + 0x33, 0x32, 0x31, 0x36, 0x37, 0x36, 0x30, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, + 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, 0x20, 0x28, 0x28, 0x00, 0x30, 0x00, + 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x01, 0x78, 0x00, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xfd, 0x23, + 0x53, 0x7d, 0xef, 0x21, 0xc4, 0x41, 0xd9, 0x91, 0xf7, 0xa1, 0x0b, 0x59, + 0x8e, 0x3c, 0x01, 0x6a, 0xa9, 0x61, 0x4e, 0x41, 0x01, 0xa5, 0x83, 0x09, + 0xe4, 0x6c, 0x00, 0xe5, 0xbd, 0x8d, 0xa2, 0x2d, 0x3e, 0x60, 0x04, 0xaf, + 0xd9, 0xf2, 0x26, 0x2e, 0xc2, 0x90, 0xad, 0x20, 0xec, 0xb1, 0x59, 0xa6, + 0xac, 0xf1, 0xae, 0x41, 0xea, 0x30, 0x4d, 0x26, 0x4a, 0x9e, 0x7d, 0xb6, + 0x49, 0x9c, 0x56, 0x7d, 0x15, 0xa4, 0x87, 0x5d, 0x8e, 0x8d, 0xa8, 0x04, + 0xb1, 0xd9, 0x35, 0xec, 0xe2, 0x28, 0x12, 0x10, 0xb8, 0x54, 0x5f, 0x94, + 0x08, 0xe2, 0xfb, 0x04, 0x1b, 0x37, 0x88, 0xf3, 0xa7, 0x04, 0x4f, 0x60, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf4, 0x18, 0xc2, 0xa0, 0x00, 0x40, 0x00, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xce, 0xaa, 0x42, 0x05, 0x73, 0x6a, 0x3f, 0x91, 0xd4, 0x59, + 0xfb, 0xa4, 0xed, 0x70, 0xc4, 0x52, 0x1b, 0xfa, 0xd0, 0x9f, 0x65, 0x60, + 0x0c, 0xee, 0xa5, 0x93, 0x79, 0x56, 0x4d, 0x99, 0x66, 0xad, 0x12, 0x10, + 0x3d, 0xab, 0x36, 0xe6, 0xcd, 0xe5, 0xcc, 0x8a, 0x3b, 0xb9, 0x6f, 0x1c, + 0xd7, 0xad, 0x17, 0x01, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0xf4, 0x18, 0xc2, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0xe2, 0x32, 0x82, 0xee, 0xfd, 0x30, 0x86, 0x68, 0xb7, 0xce, 0x0b, 0x68, + 0x7b, 0xcb, 0x83, 0xb4, 0xff, 0xa5, 0x9e, 0xa9, 0xcf, 0x11, 0x95, 0x49, + 0xf8, 0xea, 0x8b, 0x6e, 0x58, 0x9b, 0x4e, 0x0b, 0x12, 0x10, 0x91, 0x14, + 0x07, 0x38, 0xdd, 0x0a, 0xc3, 0xf6, 0xa6, 0x11, 0x61, 0x7a, 0x92, 0x61, + 0xf0, 0x5c, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xf4, 0x18, 0xc2, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x48, 0x07, + 0xdd, 0x06, 0xf2, 0x01, 0x7b, 0xa1, 0x7a, 0x5a, 0xee, 0x4a, 0x73, 0x79, + 0x7d, 0x51, 0x60, 0x4a, 0x84, 0xb6, 0x15, 0xae, 0x61, 0xbd, 0xdc, 0xe6, + 0xc6, 0x7f, 0x19, 0xf1, 0xdc, 0x30, 0x12, 0x10, 0xc6, 0x67, 0x0a, 0x18, + 0x38, 0xc6, 0x3b, 0xb9, 0x9a, 0xc3, 0x89, 0xbe, 0x87, 0xdd, 0xf8, 0x02, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf4, + 0x18, 0xc2, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x09, 0x89, 0x2c, 0x1f, + 0x09, 0x67, 0x21, 0xe2, 0x8f, 0x58, 0x5e, 0xab, 0x45, 0x07, 0xdf, 0x92, + 0x38, 0x8a, 0xa9, 0x93, 0x5d, 0xcd, 0xba, 0x37, 0x22, 0x50, 0x78, 0x8c, + 0x0d, 0x56, 0x83, 0xcb, 0x12, 0x10, 0xd6, 0x1c, 0x3c, 0xf8, 0xbb, 0xdb, + 0xbc, 0x96, 0xec, 0x78, 0x07, 0x36, 0x8a, 0x09, 0x1d, 0x31, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf4, 0x18, 0xc2, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xc1, 0xf8, 0xd9, 0xfd, 0x70, 0xb4, + 0x8a, 0x36, 0xbb, 0x0f, 0x20, 0x7d, 0x99, 0xb0, 0x8a, 0x1f, 0x49, 0x59, + 0xd9, 0x76, 0xd3, 0x10, 0x6e, 0x74, 0xea, 0x3a, 0x11, 0xc2, 0x5a, 0xc0, + 0x95, 0x87, 0x12, 0x10, 0x9a, 0x39, 0xb1, 0xa7, 0x58, 0x34, 0x90, 0x41, + 0x5d, 0xb2, 0x86, 0x8e, 0x43, 0x87, 0x06, 0x43, 0x0a, 0x10, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, + 0x3d, 0x3d, 0x20, 0xb2, 0xe5, 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(ODKGoldenLicenseV18, Both_CdmUseCase_StreamingQuickStart_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xb9, 0x93, 0x15, 0xdf, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xb9, 0x93, 0x15, 0xdf, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x9e, 0xf9, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x46, 0x31, 0x44, 0x43, 0x33, 0x46, + 0x37, 0x43, 0x42, 0x32, 0x37, 0x46, 0x36, 0x42, 0x34, 0x39, 0x31, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x14, + 0x28, 0x28, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0xb9, 0x93, 0x15, 0xdf, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x09, 0xd2, + 0x95, 0xac, 0x6d, 0x8d, 0xa8, 0x93, 0x1f, 0x8d, 0x99, 0x6c, 0xa7, 0x97, + 0xd6, 0x74, 0x4c, 0x12, 0x65, 0x2e, 0x28, 0xce, 0x56, 0x61, 0xfe, 0x1f, + 0x4c, 0xa2, 0x16, 0xdb, 0xa2, 0xc0, 0x12, 0x10, 0xad, 0xf5, 0x6f, 0xa0, + 0x90, 0xbc, 0xec, 0x90, 0x45, 0x9a, 0x26, 0x89, 0xfa, 0x0e, 0x05, 0xe9, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x93, + 0x15, 0xdf, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x38, 0xf3, 0x56, 0x63, + 0x38, 0x08, 0xd9, 0xa9, 0xc4, 0x6c, 0x2b, 0xc7, 0xf4, 0x20, 0x96, 0xc6, + 0xfc, 0xe9, 0x77, 0x2c, 0x2f, 0x3b, 0x4c, 0x95, 0x29, 0x72, 0x77, 0x89, + 0xfb, 0x00, 0x5a, 0xba, 0x12, 0x10, 0x04, 0xc0, 0xd8, 0x71, 0x49, 0x0f, + 0xe8, 0x5a, 0xbe, 0x79, 0x8b, 0x26, 0xff, 0x0e, 0xea, 0x32, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x93, 0x15, 0xdf, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x52, 0x05, 0xcd, 0x54, 0xd0, 0x57, + 0xd7, 0x20, 0x73, 0xfb, 0xc9, 0x17, 0x6a, 0x00, 0x97, 0x2c, 0x46, 0xef, + 0xac, 0x89, 0x76, 0x6e, 0x9d, 0x75, 0x1c, 0x77, 0x0d, 0x78, 0x4f, 0x92, + 0x8a, 0x66, 0x12, 0x10, 0x20, 0xb2, 0xd6, 0xe0, 0xdb, 0x28, 0x17, 0xd0, + 0x6c, 0x73, 0x43, 0x61, 0x26, 0x85, 0x6b, 0xff, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x93, 0x15, 0xdf, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x1f, 0x33, 0xf5, 0x6b, 0x0b, 0x3d, 0x66, 0x80, + 0xd7, 0xfc, 0x54, 0xc0, 0x0b, 0x62, 0x64, 0x3a, 0x86, 0x9b, 0xb2, 0x59, + 0x7f, 0xaa, 0x60, 0xb9, 0x63, 0x1f, 0x61, 0xf1, 0xeb, 0xdd, 0xd5, 0x6a, + 0x12, 0x10, 0x57, 0xe6, 0x99, 0x9b, 0x03, 0x81, 0x00, 0x53, 0x19, 0xbb, + 0x33, 0xf5, 0x46, 0xe8, 0xea, 0xe7, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0xb9, 0x93, 0x15, 0xdf, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x5d, 0xb3, 0x31, 0x70, 0x1a, 0x43, 0x40, 0xd8, 0x5c, 0xfa, + 0x2f, 0x33, 0x24, 0x0a, 0x9c, 0xa4, 0xd1, 0xc6, 0x7a, 0x78, 0x06, 0x79, + 0x77, 0xc9, 0x91, 0x32, 0x1d, 0x50, 0xae, 0x22, 0xaa, 0x04, 0x12, 0x10, + 0xc4, 0x0f, 0x3e, 0x4c, 0xef, 0x41, 0xb0, 0xd2, 0x55, 0x6d, 0x58, 0x8c, + 0x67, 0x61, 0x32, 0x14, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xd8, + 0xe5, 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(ODKGoldenLicenseV18, Both_CdmUseCase_StreamingQuickStart_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xbc, 0xec, 0x1a, 0x0e, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xbc, 0xec, 0x1a, 0x0e, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0xd2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x27, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x48, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xac, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x22, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xaa, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x76, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x5a, 0x32, 0x27, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x69, + 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x61, 0x6e, 0x5f, + 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, + 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, + 0x36, 0x44, 0x38, 0x46, 0x38, 0x37, 0x31, 0x34, 0x36, 0x45, 0x32, 0x42, + 0x44, 0x31, 0x39, 0x37, 0x31, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x01, 0x18, 0x00, 0x20, 0x14, 0x28, 0x28, 0x30, 0x00, 0x38, 0x00, + 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, + 0x78, 0x01, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0x88, 0x47, 0xab, 0x96, + 0x76, 0x99, 0xbc, 0xd2, 0xf8, 0xef, 0xb2, 0xcf, 0x1f, 0x30, 0xc4, 0x2e, + 0x14, 0x74, 0xee, 0x87, 0x04, 0x39, 0x62, 0x92, 0xcf, 0xbd, 0x86, 0xb0, + 0x21, 0xd2, 0x38, 0xa0, 0x6d, 0x3f, 0xe4, 0x15, 0x91, 0xbb, 0xda, 0xe0, + 0x21, 0x98, 0x23, 0xc4, 0x32, 0x2a, 0x47, 0x5a, 0xa1, 0x96, 0x5e, 0xae, + 0xf4, 0x6f, 0xc3, 0x2b, 0x88, 0xdc, 0xe3, 0x2a, 0x76, 0x96, 0x33, 0xd7, + 0xff, 0x9f, 0x39, 0x06, 0x43, 0x49, 0x4d, 0xdc, 0x04, 0xcd, 0x39, 0xe7, + 0x18, 0xde, 0x10, 0xe0, 0x12, 0x10, 0xa7, 0x26, 0xd7, 0x8e, 0xbf, 0xcc, + 0xbb, 0x23, 0xb5, 0xdd, 0xb2, 0x21, 0x63, 0x97, 0x67, 0x91, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x00, 0xbc, 0xec, 0x1a, 0x0e, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x21, 0xe3, 0xf4, 0xb8, 0x06, 0x1a, 0x58, 0x7a, 0xf1, 0x2e, 0x1b, 0x1e, + 0xc3, 0x0e, 0x16, 0x98, 0x68, 0xb4, 0x64, 0x51, 0xca, 0xa3, 0x32, 0x93, + 0x29, 0xb7, 0xb7, 0x1a, 0x1b, 0xdf, 0xf7, 0x83, 0x12, 0x10, 0x3d, 0xb1, + 0x0b, 0x85, 0x88, 0x4c, 0xf7, 0x90, 0xd2, 0xb9, 0xa5, 0x29, 0x40, 0x26, + 0xe5, 0x0b, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0xbc, 0xec, 0x1a, 0x0e, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xde, 0x6f, + 0x93, 0xf4, 0x98, 0x0a, 0xd6, 0x51, 0x7b, 0x13, 0x3e, 0x78, 0xbb, 0xf4, + 0xb1, 0xf7, 0xa9, 0x3b, 0xcc, 0x0a, 0xc7, 0x47, 0xaa, 0x36, 0xa7, 0xa4, + 0x6c, 0x95, 0x37, 0xbd, 0xa5, 0x71, 0x12, 0x10, 0x89, 0x36, 0xbf, 0x1b, + 0x08, 0x80, 0x93, 0xa6, 0x16, 0x19, 0x1c, 0x1d, 0x12, 0xee, 0xbc, 0xfa, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbc, 0xec, + 0x1a, 0x0e, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xea, 0x7e, 0x0f, 0x41, + 0x82, 0x35, 0xab, 0xbd, 0x29, 0xa6, 0xb0, 0x6b, 0x71, 0xde, 0x44, 0x63, + 0xd0, 0xd4, 0xcf, 0xb7, 0xb0, 0xac, 0xa7, 0x13, 0xb0, 0x32, 0xad, 0x59, + 0x17, 0x0f, 0x12, 0x09, 0x12, 0x10, 0xf6, 0x90, 0x09, 0xf1, 0xb0, 0x2a, + 0xf5, 0xf7, 0x59, 0x5b, 0x80, 0x70, 0x61, 0x9c, 0x52, 0x4b, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbc, 0xec, 0x1a, 0x0e, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xba, 0xbe, 0x6e, 0x4f, 0x61, 0x3a, + 0xea, 0xb8, 0x1f, 0xc8, 0x4e, 0xc3, 0x89, 0x62, 0xc7, 0xc6, 0x66, 0xb6, + 0x46, 0x0b, 0xac, 0x83, 0x70, 0xd7, 0x9b, 0x06, 0x64, 0x18, 0xe9, 0x1c, + 0xf7, 0xdb, 0x12, 0x10, 0xb2, 0xb3, 0x5d, 0x04, 0xd3, 0xfc, 0xf5, 0xd6, + 0x9d, 0x45, 0x30, 0x93, 0xab, 0x0a, 0xb0, 0x8c, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbc, 0xec, 0x1a, 0x0e, 0xa0, 0x00, + 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x72, 0xff, 0xef, 0x83, 0xc9, 0x46, 0x33, 0xa3, + 0x9f, 0x9d, 0x12, 0xf0, 0xac, 0xad, 0xc0, 0x11, 0x0f, 0x22, 0x54, 0xe5, + 0x46, 0x95, 0xe3, 0x9e, 0x24, 0x34, 0x2c, 0x38, 0x4f, 0x33, 0xaf, 0xb3, + 0x12, 0x10, 0x9b, 0xe8, 0xf0, 0x81, 0x44, 0x2d, 0x03, 0x83, 0x41, 0x96, + 0xa2, 0x2f, 0x27, 0x1c, 0x01, 0xbb, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x20, 0xec, 0xe5, 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(ODKGoldenLicenseV18, Both_CdmUseCase_SevenHardTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x58, 0x6b, 0xd9, 0xcf, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x58, 0x6b, 0xd9, 0xcf, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x3c, 0xff, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x41, 0x31, 0x41, 0x36, 0x46, 0x44, + 0x32, 0x33, 0x35, 0x39, 0x30, 0x31, 0x36, 0x38, 0x31, 0x41, 0x31, 0x34, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x6b, 0xd9, 0xcf, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x25, 0xcf, + 0x8b, 0xa2, 0xd5, 0xaa, 0x7b, 0x7b, 0x03, 0x9c, 0xbc, 0x83, 0x08, 0xe2, + 0xbd, 0xdd, 0xab, 0xd4, 0x32, 0x13, 0x75, 0xa1, 0x3f, 0x89, 0x73, 0x89, + 0x7b, 0x7f, 0xae, 0x91, 0x75, 0xdc, 0x12, 0x10, 0xb6, 0xed, 0xbf, 0x9e, + 0xf9, 0xae, 0xae, 0x70, 0x91, 0xf9, 0x75, 0x8c, 0xa6, 0xf2, 0x0c, 0xf3, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x6b, + 0xd9, 0xcf, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xcf, 0xf5, 0xf1, 0xa0, + 0x71, 0x28, 0x33, 0x90, 0xb7, 0xf3, 0x5c, 0xf3, 0xab, 0xd2, 0xc9, 0x06, + 0xf4, 0xd8, 0x02, 0xf1, 0x0a, 0xe3, 0x35, 0x11, 0xd8, 0x43, 0x49, 0x3f, + 0xab, 0x11, 0x66, 0x56, 0x12, 0x10, 0xa0, 0xff, 0xb1, 0x20, 0xe9, 0xc1, + 0xc4, 0xcb, 0x5a, 0x6b, 0xc8, 0x14, 0xd1, 0x93, 0x92, 0xbf, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x6b, 0xd9, 0xcf, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x7e, 0xa7, 0x9a, 0xea, 0xb1, 0x3f, + 0xbb, 0x43, 0x8f, 0x87, 0x6f, 0xc3, 0x22, 0x08, 0xb2, 0xf8, 0xdc, 0x23, + 0xf0, 0xe7, 0x39, 0xd5, 0xf3, 0xcd, 0x8c, 0x61, 0xaf, 0xc5, 0x5e, 0xed, + 0x2a, 0xb8, 0x12, 0x10, 0x16, 0x35, 0xe9, 0x61, 0x87, 0x0d, 0xeb, 0xc0, + 0x49, 0x23, 0x1e, 0x81, 0x6d, 0x4c, 0x0f, 0x3d, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x6b, 0xd9, 0xcf, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xbc, 0x0d, 0x2c, 0xc4, 0xea, 0x97, 0x35, 0x58, + 0x2d, 0x68, 0x59, 0xe9, 0x5a, 0xde, 0x62, 0x4d, 0x2c, 0x3f, 0xd6, 0xf5, + 0xd4, 0x9d, 0x0c, 0xd4, 0x12, 0x94, 0xa4, 0xee, 0x18, 0xe3, 0x6c, 0x84, + 0x12, 0x10, 0x1f, 0x33, 0xdf, 0xba, 0xfb, 0x62, 0xc3, 0x89, 0xa5, 0x42, + 0xd1, 0x0f, 0x2f, 0x9a, 0xe0, 0x5d, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x6b, 0xd9, 0xcf, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xc6, 0x7a, 0xc8, 0x0b, 0x86, 0x53, 0x8f, 0x95, 0xf0, 0x42, + 0x84, 0xc4, 0xc0, 0x1b, 0x95, 0x71, 0x16, 0x50, 0x32, 0xb2, 0x9e, 0xa5, + 0x0d, 0xbd, 0xe2, 0xb5, 0x30, 0x24, 0xc4, 0x7f, 0x83, 0x20, 0x12, 0x10, + 0x35, 0xc1, 0xcd, 0x22, 0x49, 0x39, 0x68, 0xf5, 0xdc, 0xb6, 0xc4, 0x01, + 0x60, 0xa7, 0x66, 0x12, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x80, + 0xe6, 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(ODKGoldenLicenseV18, Both_CdmUseCase_SevenHardTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xe0, 0xac, 0x6c, 0xd3, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xe0, 0xac, 0x6c, 0xd3, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0xcf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x87, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfd, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x73, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x57, 0x32, 0x24, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x65, 0x76, 0x65, 0x6e, 0x48, 0x61, 0x72, 0x64, 0x54, 0x77, 0x6f, + 0x48, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x45, 0x42, 0x33, + 0x35, 0x33, 0x37, 0x41, 0x41, 0x35, 0x31, 0x33, 0x31, 0x44, 0x43, 0x43, + 0x43, 0x31, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, + 0x00, 0x20, 0x64, 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, + 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0x67, 0x27, 0x5d, 0xad, 0xc3, 0x2a, 0xd0, + 0x1c, 0xaf, 0xc4, 0x98, 0x00, 0x78, 0xd8, 0x8e, 0x44, 0x57, 0x56, 0xfa, + 0x43, 0x7a, 0x66, 0x68, 0x85, 0x72, 0xb0, 0xd7, 0x78, 0x9a, 0x64, 0xbb, + 0xd6, 0x72, 0x17, 0x03, 0x45, 0x3e, 0xd4, 0xbd, 0xf1, 0x8e, 0x10, 0xa3, + 0xe6, 0x9c, 0x7f, 0xf9, 0x74, 0x11, 0x2b, 0x0f, 0xe5, 0x43, 0x74, 0x65, + 0x4e, 0x5b, 0x75, 0x06, 0x1b, 0x34, 0x31, 0x4c, 0xf3, 0x1b, 0xd4, 0xf6, + 0xf4, 0x3b, 0x1c, 0x33, 0xdc, 0x12, 0x72, 0xde, 0x23, 0x1b, 0xee, 0x38, + 0x4c, 0x12, 0x10, 0x98, 0xa6, 0x43, 0x34, 0xc4, 0x6f, 0xf5, 0x9d, 0x06, + 0x3a, 0x11, 0x1b, 0x7f, 0xa3, 0x43, 0x15, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0xac, 0x6c, 0xd3, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x64, 0x9b, 0xdf, + 0x37, 0x92, 0x73, 0xc0, 0xe9, 0x42, 0x0f, 0x66, 0x22, 0x8e, 0xaf, 0x52, + 0x8d, 0x4b, 0x51, 0xe8, 0xc9, 0x93, 0xcb, 0x0e, 0x6a, 0x97, 0x09, 0xb6, + 0xd2, 0x66, 0x71, 0x04, 0x6a, 0x12, 0x10, 0xe7, 0x24, 0x8f, 0xd8, 0x17, + 0x35, 0x7f, 0xdd, 0x4c, 0xcb, 0xeb, 0x7d, 0x0b, 0xf5, 0x2b, 0xd8, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xac, 0x6c, + 0xd3, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x87, 0x32, 0xb2, 0x84, 0x23, + 0x9e, 0x58, 0x74, 0x2b, 0x1a, 0xee, 0x70, 0x33, 0x7a, 0xb8, 0x92, 0x59, + 0x83, 0x27, 0xfd, 0x88, 0xd2, 0x27, 0x58, 0xaf, 0x5a, 0xc6, 0x80, 0x0f, + 0xe6, 0xaf, 0x52, 0x12, 0x10, 0x67, 0x5e, 0x28, 0xe7, 0x03, 0x03, 0x02, + 0x25, 0x6c, 0xb3, 0x6b, 0x5d, 0x6d, 0x17, 0xfd, 0xb4, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xac, 0x6c, 0xd3, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x11, 0xbe, 0xe2, 0x5d, 0xbf, 0xaf, 0x99, + 0x15, 0xf0, 0x92, 0x9f, 0x73, 0x14, 0x5a, 0xe0, 0xf4, 0x1d, 0x18, 0xe5, + 0xcb, 0x75, 0x94, 0xa3, 0x1f, 0xc1, 0x6b, 0x29, 0x41, 0x96, 0xac, 0x5b, + 0xfb, 0x12, 0x10, 0xa9, 0x96, 0x6f, 0x3f, 0x71, 0x6d, 0x82, 0x97, 0xe6, + 0x1a, 0x8f, 0xd7, 0x80, 0x8c, 0x1c, 0xed, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xac, 0x6c, 0xd3, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x3f, 0x3e, 0x52, 0x34, 0xbb, 0x73, 0x2f, 0x87, 0x13, + 0xcd, 0x5e, 0xfb, 0x07, 0x0a, 0xd9, 0x59, 0x39, 0x8c, 0x6a, 0x0c, 0x24, + 0x46, 0xeb, 0xf4, 0xce, 0x98, 0x3e, 0x58, 0x80, 0x9e, 0xb2, 0x5e, 0x12, + 0x10, 0x08, 0x0d, 0xdf, 0x40, 0x1f, 0xe2, 0x80, 0x39, 0xf6, 0x00, 0xee, + 0x13, 0x7e, 0xdc, 0x66, 0x36, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0xac, 0x6c, 0xd3, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0xcb, 0x38, 0x5c, 0xe5, 0x50, 0xae, 0x40, 0xad, 0x0b, 0x43, 0xa8, + 0xda, 0x6a, 0x9c, 0x05, 0xd2, 0x75, 0x3a, 0x4e, 0x36, 0xf2, 0xa8, 0x31, + 0xe1, 0x5d, 0xec, 0xca, 0x78, 0x74, 0x94, 0xcf, 0x90, 0x12, 0x10, 0x36, + 0x0c, 0x71, 0x35, 0xba, 0xaa, 0x72, 0xd4, 0x44, 0x49, 0x59, 0xa4, 0xdc, + 0x93, 0xf6, 0xf7, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x98, 0xe6, + 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(ODKGoldenLicenseV18, Both_CdmUseCase_SevenHardTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x58, 0x89, 0xaa, 0xf3, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x58, 0x89, 0xaa, 0xf3, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x0b, 0xfa, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x45, 0x35, 0x30, 0x45, 0x31, 0x39, + 0x33, 0x46, 0x45, 0x46, 0x43, 0x41, 0x42, 0x37, 0x33, 0x42, 0x31, 0x38, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x89, 0xaa, 0xf3, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x8c, 0x9d, + 0x9b, 0x6a, 0x42, 0x78, 0x1a, 0x23, 0x63, 0x6d, 0x33, 0x03, 0x4b, 0x40, + 0x6f, 0x11, 0xd2, 0xfd, 0x53, 0x71, 0x1b, 0xed, 0x57, 0x6a, 0xb2, 0x90, + 0x6a, 0x95, 0x0a, 0x96, 0xa7, 0xa6, 0x12, 0x10, 0xcf, 0x6c, 0xff, 0xe6, + 0xee, 0xfb, 0x2b, 0xbf, 0x00, 0xce, 0x19, 0x9b, 0xcb, 0x4f, 0x5d, 0x68, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x89, + 0xaa, 0xf3, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xee, 0xbb, 0x14, 0x48, + 0xe5, 0xbf, 0x02, 0xba, 0xe7, 0x04, 0xfe, 0xd9, 0xb8, 0x27, 0xc1, 0xd0, + 0x2a, 0x2f, 0x3e, 0x3a, 0x0b, 0x63, 0x93, 0xf4, 0xb5, 0x5c, 0x76, 0x10, + 0xe9, 0xd5, 0xb6, 0xbb, 0x12, 0x10, 0x75, 0x8f, 0xbf, 0x03, 0xf6, 0x48, + 0xd1, 0x17, 0x4c, 0x77, 0xdc, 0x38, 0xca, 0x24, 0x8d, 0x88, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x89, 0xaa, 0xf3, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xed, 0xd6, 0xe0, 0x57, 0xb1, 0xf3, + 0xd1, 0x78, 0x2f, 0x70, 0x0e, 0x13, 0xff, 0xc6, 0x8c, 0x46, 0x01, 0x87, + 0xfd, 0x50, 0x10, 0x21, 0x69, 0x54, 0x21, 0x5e, 0x32, 0x22, 0x79, 0x16, + 0x97, 0xe0, 0x12, 0x10, 0x33, 0x86, 0x55, 0xf6, 0xde, 0x28, 0x2a, 0x57, + 0x7d, 0x1b, 0x23, 0x5f, 0xf8, 0xe8, 0x6a, 0x57, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x58, 0x89, 0xaa, 0xf3, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x79, 0x9c, 0xa1, 0xcb, 0xc1, 0x90, 0x92, 0xff, + 0xe7, 0x2e, 0x3f, 0x5e, 0x00, 0x0f, 0x94, 0x43, 0xb7, 0xe8, 0x08, 0x7a, + 0xd4, 0xaa, 0xcf, 0xb8, 0xe4, 0x3a, 0x55, 0x55, 0xa2, 0xe1, 0x62, 0x7a, + 0x12, 0x10, 0x50, 0x1f, 0xa9, 0xad, 0xbe, 0x02, 0xc9, 0x45, 0xae, 0xa8, + 0x4d, 0x14, 0x89, 0x65, 0x24, 0x5e, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x89, 0xaa, 0xf3, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xb4, 0xce, 0x8c, 0x83, 0xda, 0xb6, 0x2f, 0x70, 0x2c, 0x26, + 0xe4, 0xfa, 0x53, 0x18, 0xe6, 0xa9, 0x6e, 0x62, 0x67, 0x99, 0xf2, 0x96, + 0xfa, 0xcf, 0x05, 0xd4, 0x04, 0x33, 0x87, 0x79, 0x1e, 0x46, 0x12, 0x10, + 0xa3, 0x73, 0x28, 0x41, 0x77, 0xa6, 0x5c, 0xc2, 0xde, 0xe5, 0xb2, 0xbb, + 0x2a, 0xb7, 0x1a, 0xa7, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xb0, + 0xe6, 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(ODKGoldenLicenseV18, Both_CdmUseCase_SevenHardTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x43, 0xea, 0x2d, 0x91, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x43, 0xea, 0x2d, 0x91, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0xcf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x87, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfd, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x73, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x57, 0x32, 0x24, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x65, 0x76, 0x65, 0x6e, 0x48, 0x61, 0x72, 0x64, 0x54, 0x77, 0x6f, + 0x53, 0x6f, 0x66, 0x74, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x37, 0x37, 0x33, + 0x45, 0x44, 0x34, 0x33, 0x42, 0x30, 0x45, 0x42, 0x46, 0x38, 0x44, 0x39, + 0x39, 0x31, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, + 0x00, 0x20, 0x64, 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, + 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x00, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0x52, 0x1e, 0x3c, 0x1d, 0x11, 0x35, 0xda, + 0xe5, 0x50, 0xa9, 0x90, 0xa6, 0x61, 0xbb, 0x49, 0xaf, 0x97, 0xbb, 0x14, + 0xf0, 0x5e, 0xbc, 0x34, 0xe4, 0x28, 0x30, 0xa8, 0x5d, 0x7b, 0x5e, 0x86, + 0x7f, 0xff, 0x45, 0x27, 0xd0, 0x71, 0x47, 0x3a, 0xb4, 0xbd, 0xa1, 0xed, + 0x35, 0xee, 0xe9, 0x51, 0x35, 0xb9, 0x50, 0xd3, 0x12, 0xef, 0xa6, 0x2d, + 0xe5, 0xb9, 0x28, 0xea, 0xb4, 0xd5, 0xa1, 0xc7, 0xd0, 0x88, 0xcc, 0x69, + 0x15, 0x54, 0xff, 0x82, 0x0e, 0x49, 0x28, 0x05, 0x3f, 0x16, 0x8c, 0xbb, + 0x1c, 0x12, 0x10, 0x42, 0x07, 0x9e, 0xe0, 0xa1, 0x15, 0x2e, 0xc2, 0x61, + 0x15, 0x61, 0xa5, 0x5d, 0x14, 0xd3, 0x96, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x43, + 0xea, 0x2d, 0x91, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x88, 0x73, 0xab, + 0x7b, 0x78, 0x40, 0x6c, 0xdb, 0x91, 0x1f, 0xab, 0x1e, 0xcd, 0x82, 0xe5, + 0x35, 0xd4, 0x4d, 0x73, 0x00, 0x7a, 0x23, 0x4c, 0x94, 0x81, 0x91, 0xcc, + 0xfb, 0x85, 0x0b, 0x91, 0x69, 0x12, 0x10, 0x0f, 0xd6, 0xcd, 0x74, 0xfa, + 0xb1, 0xc6, 0x75, 0xbe, 0xd3, 0x5b, 0xaa, 0x6e, 0xc6, 0x7e, 0xc5, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x43, 0xea, 0x2d, + 0x91, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xb0, 0x90, 0xfb, 0xee, 0x67, + 0x8b, 0xd2, 0x5c, 0xc7, 0xb7, 0x0d, 0x75, 0x18, 0x3e, 0x16, 0xbd, 0xd9, + 0x79, 0x81, 0x78, 0x98, 0xd4, 0x28, 0x1c, 0x5c, 0x02, 0x73, 0x7d, 0x34, + 0x74, 0xe6, 0xc3, 0x12, 0x10, 0x8e, 0xac, 0x28, 0xb7, 0xaf, 0x6c, 0x0c, + 0x86, 0xfa, 0xca, 0x50, 0xa7, 0x8b, 0xbc, 0xa2, 0x52, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x43, 0xea, 0x2d, 0x91, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0xb4, 0x4c, 0xc4, 0x8e, 0x9d, 0xa8, 0xae, + 0x95, 0x15, 0xe9, 0x73, 0x22, 0xfe, 0xa8, 0x94, 0x9a, 0xeb, 0xe6, 0xd3, + 0xaa, 0x84, 0xaf, 0x19, 0x6e, 0x76, 0xa3, 0x72, 0x33, 0x1a, 0x9c, 0xf3, + 0x83, 0x12, 0x10, 0xed, 0x21, 0x55, 0xca, 0x58, 0xfc, 0xcd, 0x0f, 0x53, + 0xc0, 0xac, 0xdc, 0xca, 0x64, 0xc8, 0x7c, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x43, 0xea, 0x2d, 0x91, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0xbd, 0x7c, 0xdf, 0xc3, 0x46, 0x14, 0xb4, 0xbe, 0x35, + 0x91, 0xde, 0x41, 0xee, 0x04, 0x75, 0x16, 0x6b, 0xe6, 0x25, 0x13, 0x51, + 0xd7, 0x05, 0x81, 0xd9, 0xd2, 0x74, 0xa7, 0xc8, 0xad, 0x16, 0xb3, 0x12, + 0x10, 0x27, 0xa4, 0x71, 0x7b, 0xe6, 0xc4, 0x45, 0x30, 0xea, 0x22, 0xdf, + 0x2c, 0x2e, 0x4f, 0x62, 0xe5, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x00, 0x43, 0xea, 0x2d, 0x91, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0x3a, 0xe2, 0xa9, 0x3a, 0xb3, 0x16, 0x7f, 0xdd, 0xa0, 0x0b, 0x5b, + 0x09, 0xf0, 0xd3, 0xa9, 0xd9, 0x46, 0x7a, 0x02, 0xc1, 0xa2, 0xee, 0x9a, + 0x43, 0x87, 0xda, 0xcb, 0x50, 0x71, 0x97, 0x72, 0x80, 0x12, 0x10, 0x3b, + 0xbe, 0x4c, 0xfc, 0x5c, 0x9c, 0xb6, 0x73, 0x6b, 0x3d, 0x65, 0x12, 0xce, + 0x73, 0x9f, 0x35, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xc8, 0xe6, + 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(ODKGoldenLicenseV18, Both_CdmUseCase_SevenSoftTwoHard_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xbd, 0xfa, 0x35, 0x42, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xbd, 0xfa, 0x35, 0x42, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0xa9, 0xff, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x41, 0x41, 0x31, 0x30, 0x36, 0x33, + 0x35, 0x39, 0x39, 0x34, 0x36, 0x43, 0x30, 0x36, 0x39, 0x46, 0x31, 0x43, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0xbd, 0xfa, 0x35, 0x42, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x43, 0x6c, + 0xbb, 0x90, 0x68, 0xa0, 0xb9, 0xb3, 0x0a, 0xc4, 0x8a, 0xb5, 0xa4, 0xe0, + 0xd5, 0x04, 0x10, 0x9e, 0x76, 0xbd, 0xac, 0x3b, 0xbe, 0x8b, 0x0e, 0x74, + 0x3d, 0xfb, 0x2d, 0xcd, 0x71, 0x24, 0x12, 0x10, 0x4e, 0x14, 0xa2, 0x79, + 0xb9, 0xe6, 0x00, 0x76, 0xf6, 0x07, 0x35, 0xa2, 0x17, 0x2f, 0x67, 0x63, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xfa, + 0x35, 0x42, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x35, 0xa1, 0x98, 0x43, + 0x76, 0x9e, 0x28, 0x79, 0x05, 0xcc, 0x81, 0x43, 0x7d, 0x30, 0x96, 0xd9, + 0x2a, 0xba, 0xc5, 0x6d, 0x28, 0x74, 0xb2, 0x28, 0xbd, 0x58, 0x46, 0x43, + 0xe3, 0xd5, 0xec, 0xf4, 0x12, 0x10, 0x52, 0xc9, 0x3d, 0xd0, 0x79, 0x84, + 0x6f, 0x28, 0xb1, 0x37, 0x77, 0x35, 0x6f, 0x56, 0x43, 0x41, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xfa, 0x35, 0x42, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xa3, 0xe0, 0xff, 0x2b, 0xbc, 0x43, + 0xd9, 0x53, 0xbe, 0xa6, 0x02, 0x0c, 0x40, 0x9f, 0x6e, 0x38, 0x0e, 0x91, + 0x2e, 0xac, 0x29, 0x22, 0x4a, 0xe2, 0x45, 0x6c, 0x3a, 0x7d, 0x13, 0x49, + 0xb3, 0x78, 0x12, 0x10, 0x0e, 0xf1, 0x6c, 0x28, 0xe2, 0x60, 0xbb, 0x78, + 0xc2, 0x39, 0x41, 0x81, 0x2a, 0xab, 0x02, 0x59, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xfa, 0x35, 0x42, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xd5, 0x7e, 0x38, 0x92, 0x1e, 0xe3, 0x47, 0x56, + 0x59, 0x9d, 0x91, 0xeb, 0x37, 0x43, 0x92, 0x04, 0xe7, 0x47, 0xa2, 0x3a, + 0x2e, 0x3c, 0x10, 0x1e, 0x73, 0xfb, 0x98, 0xd8, 0xe2, 0x73, 0xbe, 0x1e, + 0x12, 0x10, 0x7a, 0x8e, 0x64, 0xd8, 0x95, 0xf0, 0xe1, 0x63, 0xb8, 0xd8, + 0xfc, 0x27, 0x21, 0x19, 0x40, 0xda, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0xbd, 0xfa, 0x35, 0x42, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x7d, 0x36, 0x11, 0xef, 0x63, 0x68, 0xfb, 0x01, 0xa6, 0xcc, + 0xec, 0x3c, 0x7d, 0x67, 0x6c, 0x9e, 0x93, 0x0b, 0x4d, 0x92, 0xbc, 0xf9, + 0xb0, 0xd9, 0x4a, 0xda, 0xe0, 0x75, 0x58, 0x30, 0x88, 0x4d, 0x12, 0x10, + 0x19, 0xb0, 0xb1, 0x14, 0xce, 0x54, 0x65, 0x4f, 0xfa, 0x87, 0x70, 0x23, + 0xa7, 0xad, 0x10, 0x26, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xe0, + 0xe6, 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(ODKGoldenLicenseV18, Both_CdmUseCase_SevenSoftTwoHard_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xc2, 0xd9, 0x80, 0xde, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xc2, 0xd9, 0x80, 0xde, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0xcf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x87, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfd, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x73, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x57, 0x32, 0x24, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x65, 0x76, 0x65, 0x6e, 0x53, 0x6f, 0x66, 0x74, 0x54, 0x77, 0x6f, + 0x48, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x44, 0x32, 0x39, + 0x35, 0x45, 0x43, 0x35, 0x33, 0x37, 0x43, 0x38, 0x30, 0x30, 0x33, 0x34, + 0x43, 0x31, 0x45, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, + 0x00, 0x20, 0x64, 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, + 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0x5e, 0xce, 0x69, 0xc0, 0x21, 0x8f, 0x81, + 0xdd, 0xbc, 0xf5, 0xac, 0x66, 0x2c, 0xd1, 0x67, 0x7d, 0x3e, 0xca, 0xd3, + 0xdc, 0x52, 0x7d, 0xf6, 0x4f, 0x21, 0xaa, 0xd8, 0x21, 0x01, 0x9c, 0xf7, + 0x21, 0xd5, 0x81, 0xa0, 0x45, 0x58, 0x9e, 0xcb, 0x40, 0x6a, 0x2a, 0x92, + 0x06, 0xd8, 0xef, 0xb7, 0xf8, 0x6a, 0x63, 0x22, 0x49, 0xcf, 0x74, 0x87, + 0x82, 0xca, 0xe9, 0x9f, 0xaf, 0x7d, 0x15, 0x7e, 0x24, 0x3f, 0x77, 0x0a, + 0xea, 0x5c, 0xc2, 0xd7, 0xfa, 0x80, 0x09, 0xcc, 0xe2, 0x2a, 0xfb, 0x2f, + 0x2d, 0x12, 0x10, 0x13, 0x0a, 0x55, 0x40, 0xa6, 0x36, 0xd5, 0x19, 0x25, + 0x2e, 0xe0, 0x5c, 0x9c, 0x02, 0x8b, 0x0e, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xc2, + 0xd9, 0x80, 0xde, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xdf, 0xda, 0x08, + 0x71, 0xfa, 0x80, 0x50, 0x59, 0x97, 0x11, 0x70, 0x74, 0xdb, 0x6f, 0x7f, + 0x5a, 0xbb, 0xd4, 0x92, 0x59, 0xca, 0xa9, 0x88, 0x35, 0xec, 0x24, 0x87, + 0xbc, 0x9a, 0x8c, 0x0b, 0x1e, 0x12, 0x10, 0x62, 0xd4, 0xfa, 0xfd, 0xf9, + 0x56, 0x49, 0xa3, 0x0f, 0x82, 0x2b, 0x22, 0xf2, 0xb3, 0xc5, 0xe0, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xd9, 0x80, + 0xde, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xd2, 0x1b, 0xeb, 0x5b, 0xd4, + 0x4d, 0xec, 0xd2, 0x13, 0x88, 0xc9, 0x19, 0xfd, 0xd1, 0x1d, 0x0f, 0x01, + 0x4e, 0xcb, 0xcb, 0x23, 0xdc, 0xe2, 0x65, 0x29, 0x4a, 0x53, 0x72, 0xf4, + 0x86, 0x8b, 0x91, 0x12, 0x10, 0xa4, 0x28, 0x55, 0xf5, 0xdb, 0x3a, 0x7a, + 0x79, 0x15, 0x14, 0x36, 0xd4, 0xc0, 0x12, 0xa7, 0x7d, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xd9, 0x80, 0xde, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x71, 0x74, 0xa1, 0xb0, 0x90, 0x81, 0xfb, + 0x38, 0x37, 0xee, 0x76, 0xd3, 0xce, 0xe4, 0xb1, 0xf5, 0xb6, 0xe3, 0xc0, + 0xa5, 0x33, 0xfc, 0x72, 0x6b, 0x7e, 0xb1, 0x70, 0x1e, 0xb5, 0xf6, 0x0a, + 0x3d, 0x12, 0x10, 0x4d, 0x54, 0x9a, 0x85, 0xf6, 0x1e, 0x39, 0x9a, 0x92, + 0x62, 0x07, 0x15, 0xb3, 0x16, 0x3c, 0xa3, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xd9, 0x80, 0xde, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x18, 0x5a, 0x83, 0xdf, 0x56, 0x5b, 0xb1, 0xec, 0x57, + 0x99, 0x21, 0xda, 0xf4, 0x20, 0xad, 0x46, 0x53, 0x81, 0x62, 0x10, 0x66, + 0x92, 0x03, 0xc4, 0x75, 0x10, 0x32, 0xa0, 0xe5, 0x21, 0x68, 0xe9, 0x12, + 0x10, 0x3d, 0xa9, 0x5c, 0xf8, 0xe2, 0x2b, 0x8a, 0xab, 0xfe, 0xff, 0x25, + 0xfe, 0x9a, 0xab, 0x8c, 0x3c, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x00, 0xc2, 0xd9, 0x80, 0xde, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0xe6, 0xb2, 0x40, 0x8d, 0xc9, 0x90, 0x6b, 0x96, 0xb0, 0x37, 0x87, + 0x53, 0x08, 0xef, 0xf3, 0x59, 0x06, 0x34, 0xf3, 0xb8, 0x48, 0x05, 0x19, + 0x26, 0x12, 0x73, 0x46, 0xd0, 0x88, 0xdf, 0xd4, 0x8d, 0x12, 0x10, 0xf0, + 0xcc, 0xf0, 0xd8, 0xf1, 0x62, 0xdb, 0x42, 0x49, 0xaf, 0x3e, 0x1b, 0xe1, + 0xbc, 0x8b, 0x64, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xf8, 0xe6, + 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(ODKGoldenLicenseV18, Both_CdmUseCase_SevenSoftTwoSoft_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x3f, 0x75, 0x72, 0xd7, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x3f, 0x75, 0x72, 0xd7, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x78, 0xfa, 0xba, 0x9a, + 0xe7, 0x55, 0x4d, 0xe1, 0x0a, 0x20, 0x31, 0x41, 0x39, 0x42, 0x31, 0x38, + 0x38, 0x31, 0x44, 0x33, 0x32, 0x42, 0x35, 0x42, 0x42, 0x30, 0x32, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x64, + 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0x75, 0x72, 0xd7, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xd5, 0x47, + 0xa3, 0xf2, 0x91, 0x78, 0xa8, 0xbe, 0xd9, 0xc5, 0x1c, 0x28, 0xb3, 0xf7, + 0x65, 0x41, 0xd5, 0x27, 0x1d, 0x74, 0x40, 0x90, 0x33, 0xfb, 0x74, 0x16, + 0x2b, 0xf6, 0x18, 0xee, 0xee, 0x73, 0x12, 0x10, 0x2f, 0xd1, 0x4e, 0xd4, + 0x4f, 0x59, 0x12, 0xb4, 0x2e, 0xe4, 0x9b, 0xcb, 0xb3, 0x75, 0x70, 0xa7, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x75, + 0x72, 0xd7, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xda, 0x53, 0x3b, 0x6c, + 0x9d, 0xfc, 0xc0, 0x62, 0x64, 0x2e, 0x03, 0xc5, 0xbb, 0xdd, 0xd6, 0xcd, + 0x6c, 0x8e, 0x70, 0x47, 0x4b, 0xec, 0x57, 0x26, 0x43, 0x7b, 0x2c, 0x0c, + 0xda, 0xc5, 0x5b, 0x97, 0x12, 0x10, 0xc5, 0x52, 0xe5, 0x73, 0xac, 0x07, + 0x4f, 0xde, 0x8f, 0x73, 0x68, 0x69, 0x51, 0x00, 0x8a, 0x22, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x75, 0x72, 0xd7, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x1d, 0xd9, 0xbb, 0x09, 0xb1, 0xe3, + 0x5b, 0x85, 0xc9, 0x1a, 0xf6, 0x5f, 0xec, 0x5e, 0x7e, 0xd7, 0xa0, 0xfe, + 0x67, 0x64, 0x87, 0xb1, 0x7e, 0xfb, 0xb3, 0x6c, 0x4a, 0xb1, 0x46, 0x0d, + 0xa8, 0xcc, 0x12, 0x10, 0x1f, 0x9e, 0xea, 0x2a, 0xa7, 0x60, 0x20, 0xb9, + 0x4d, 0x38, 0xca, 0x67, 0x9f, 0x0f, 0xdf, 0x15, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x75, 0x72, 0xd7, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xc9, 0xb8, 0xc6, 0x06, 0x65, 0x33, 0x08, 0xaf, + 0xbf, 0x5a, 0xff, 0x77, 0xf8, 0x5f, 0xa2, 0xff, 0x8a, 0xaf, 0x81, 0x6f, + 0xb5, 0xf7, 0x9d, 0x2e, 0x9a, 0xda, 0x21, 0xf2, 0x30, 0x3c, 0xeb, 0xb5, + 0x12, 0x10, 0xa4, 0x30, 0x98, 0x92, 0xb2, 0x43, 0xe7, 0x37, 0xf4, 0xa2, + 0xd9, 0x50, 0x83, 0x9e, 0x63, 0x0e, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x75, 0x72, 0xd7, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x2e, 0x5b, 0x72, 0xa7, 0x41, 0xff, 0xd6, 0x5a, 0xe8, 0xe9, + 0x4d, 0x22, 0x25, 0x87, 0x50, 0xee, 0x95, 0xdc, 0xf9, 0x9b, 0x03, 0x83, + 0x1d, 0x9d, 0xb0, 0x55, 0xc0, 0xbd, 0x7a, 0x4c, 0x80, 0xd0, 0x12, 0x10, + 0x92, 0x62, 0x33, 0x68, 0x92, 0xd5, 0x1f, 0xda, 0x35, 0x84, 0xfa, 0x31, + 0x5f, 0xdb, 0x20, 0xae, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x90, + 0xe7, 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(ODKGoldenLicenseV18, Both_CdmUseCase_SevenSoftTwoSoft_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x68, 0xb3, 0xd7, 0x92, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x68, 0xb3, 0xd7, 0x92, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0xcf, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x87, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfd, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x73, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x57, 0x32, 0x24, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x53, 0x65, 0x76, 0x65, 0x6e, 0x53, 0x6f, 0x66, 0x74, 0x54, 0x77, 0x6f, + 0x53, 0x6f, 0x66, 0x74, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x43, 0x45, 0x43, + 0x46, 0x35, 0x43, 0x36, 0x44, 0x39, 0x30, 0x43, 0x32, 0x31, 0x38, 0x35, + 0x46, 0x32, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, + 0x00, 0x20, 0x64, 0x28, 0x32, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, + 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0x68, 0xfe, 0x0c, 0x61, 0x12, 0xd1, 0x77, + 0xe4, 0x1c, 0xaf, 0x5d, 0x97, 0x19, 0xcd, 0xb5, 0x6e, 0xe9, 0x22, 0xe4, + 0x23, 0x9a, 0xc5, 0x2a, 0x47, 0xc4, 0x16, 0x2c, 0x0d, 0x0c, 0x39, 0xad, + 0x96, 0xe5, 0x4b, 0x30, 0x9f, 0x62, 0xb8, 0xa4, 0x4b, 0x8c, 0x50, 0xb3, + 0x38, 0x9f, 0x2a, 0xbf, 0x3f, 0x0b, 0x30, 0xcc, 0x76, 0xbe, 0xd5, 0x7f, + 0x4e, 0x22, 0x94, 0x47, 0xc8, 0xab, 0xa6, 0x01, 0xb6, 0xae, 0xde, 0x0a, + 0xfc, 0x2a, 0xfc, 0x13, 0x47, 0x59, 0xc6, 0xbc, 0xa9, 0x9e, 0x98, 0x80, + 0xec, 0x12, 0x10, 0x60, 0x94, 0x62, 0x02, 0x71, 0xc9, 0x06, 0x51, 0xeb, + 0xce, 0x10, 0xc7, 0x6a, 0xe0, 0xbd, 0x2c, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x68, + 0xb3, 0xd7, 0x92, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x82, 0xe9, 0x8d, + 0xdf, 0xf0, 0x4b, 0x17, 0x83, 0x64, 0x16, 0xc6, 0xdf, 0xc6, 0xc9, 0xfc, + 0x9b, 0x3f, 0xff, 0xdf, 0x20, 0x0e, 0xea, 0xba, 0x23, 0x9d, 0x43, 0x81, + 0xbb, 0xbe, 0x70, 0x84, 0x27, 0x12, 0x10, 0xa7, 0x3d, 0x76, 0x35, 0x6f, + 0xf2, 0x4d, 0x92, 0xc8, 0x4a, 0x93, 0x98, 0x40, 0x0d, 0x4b, 0xb5, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x68, 0xb3, 0xd7, + 0x92, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x3c, 0x5b, 0x9b, 0x21, 0x54, + 0x98, 0xf2, 0x2e, 0x8e, 0xdb, 0xa2, 0x43, 0xaa, 0x8b, 0xe3, 0x19, 0xe7, + 0xa7, 0x04, 0xb0, 0x76, 0x48, 0x36, 0xad, 0x18, 0x32, 0x90, 0x83, 0x28, + 0x9a, 0x90, 0xd8, 0x12, 0x10, 0x75, 0xa5, 0xa5, 0xbb, 0x0c, 0xd5, 0xbc, + 0x6a, 0xb0, 0x38, 0xed, 0xc2, 0x08, 0x27, 0x54, 0xe3, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x68, 0xb3, 0xd7, 0x92, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0xca, 0x25, 0x06, 0xd4, 0x8a, 0xd0, 0xae, + 0xe7, 0x56, 0xa1, 0xe4, 0x2c, 0x08, 0xad, 0x30, 0xec, 0x2b, 0xb7, 0x33, + 0xff, 0x1b, 0x25, 0x6c, 0xa1, 0x9f, 0x00, 0xfd, 0xec, 0x77, 0x6b, 0xc8, + 0x1a, 0x12, 0x10, 0xa2, 0x24, 0x3f, 0x95, 0x36, 0x32, 0x2c, 0xf8, 0xeb, + 0xa2, 0x3b, 0x45, 0x33, 0x8c, 0x8b, 0xc5, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x68, 0xb3, 0xd7, 0x92, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x43, 0xbc, 0x0c, 0x2f, 0x5f, 0xae, 0x42, 0x3c, 0x9e, + 0xc3, 0x71, 0x55, 0x59, 0x47, 0xa2, 0x59, 0xb7, 0xf3, 0x2f, 0xe6, 0x05, + 0x2b, 0xb9, 0x4f, 0x11, 0x2e, 0x3e, 0x3f, 0x34, 0xda, 0x28, 0xa9, 0x12, + 0x10, 0xc6, 0xf0, 0x32, 0xd0, 0x8e, 0x0a, 0x5d, 0xc0, 0xfd, 0x34, 0x25, + 0xa2, 0xb0, 0x56, 0xfb, 0x17, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x00, 0x68, 0xb3, 0xd7, 0x92, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0xb7, 0xe3, 0xb9, 0x2b, 0x00, 0x73, 0xc1, 0x82, 0xba, 0xec, 0xb8, + 0xc3, 0x73, 0xa7, 0xbc, 0x00, 0x4a, 0x31, 0xab, 0x6b, 0x44, 0x62, 0xc9, + 0xd7, 0x95, 0x12, 0xb2, 0xd9, 0x68, 0xd3, 0xdb, 0x10, 0x12, 0x10, 0x2e, + 0xac, 0x1c, 0x95, 0x86, 0x02, 0x05, 0xec, 0xf5, 0xa1, 0xc6, 0x47, 0xd3, + 0x09, 0x17, 0x22, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xa8, 0xe7, + 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(ODKGoldenLicenseV18, Both_CdmUseCase_LicenseWithRenewal_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x0c, 0x6a, 0x70, 0xec, 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, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x0c, 0x6a, 0x70, 0xec, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xaa, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x58, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x84, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xfa, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x82, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x70, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x4e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x39, 0x36, 0x37, 0x33, + 0x45, 0x32, 0x43, 0x31, 0x37, 0x46, 0x32, 0x41, 0x41, 0x44, 0x42, 0x32, + 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0xb4, 0x01, 0x28, 0x00, 0x30, 0x00, 0x38, 0x0a, 0x42, 0x00, 0x48, 0x0f, + 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, + 0x20, 0x01, 0x1a, 0x50, 0x6d, 0xef, 0xff, 0x94, 0x3d, 0xce, 0xf7, 0xeb, + 0x9e, 0x99, 0x37, 0x3e, 0x0a, 0x33, 0xf5, 0x5b, 0x22, 0xcf, 0xe0, 0x75, + 0xfc, 0xda, 0x96, 0xd5, 0x4e, 0x22, 0x6f, 0x0f, 0x59, 0x72, 0xad, 0x38, + 0xea, 0x32, 0x66, 0xa4, 0x36, 0x42, 0x70, 0x58, 0x1b, 0xa2, 0xb4, 0x77, + 0x9e, 0xe2, 0x5e, 0x97, 0xa4, 0x9d, 0xcf, 0xc5, 0x72, 0x61, 0xbe, 0xf9, + 0x43, 0xb9, 0x24, 0x68, 0x31, 0x38, 0x8d, 0x55, 0x17, 0xa0, 0x13, 0xce, + 0x41, 0xab, 0x8a, 0xdd, 0xf2, 0x0d, 0xd9, 0x61, 0x58, 0x03, 0x90, 0xea, + 0x12, 0x10, 0xa3, 0x5a, 0xbc, 0xca, 0x8a, 0x41, 0x40, 0xdb, 0x77, 0xbc, + 0x54, 0xb4, 0xe6, 0x0f, 0x6e, 0xd9, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x0c, 0x6a, + 0x70, 0xec, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xae, 0x95, 0x75, 0xaa, + 0xe8, 0x44, 0xd8, 0x7b, 0x50, 0xce, 0x53, 0x02, 0xb8, 0xc2, 0x72, 0xb9, + 0xd5, 0xc9, 0xb9, 0x1d, 0x51, 0x9d, 0xa9, 0x15, 0xc0, 0xf1, 0x20, 0xfc, + 0x74, 0xf5, 0xe8, 0x14, 0x12, 0x10, 0xda, 0x8b, 0x62, 0x3e, 0x69, 0x54, + 0x7e, 0xf0, 0x33, 0x20, 0x2d, 0xdd, 0x7c, 0x34, 0x27, 0x4f, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x0c, 0x6a, 0x70, 0xec, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xb5, 0x10, 0xbb, 0x3a, 0xf3, 0xad, + 0xf6, 0xe6, 0x7f, 0xfd, 0xa8, 0x92, 0x4d, 0x84, 0xe7, 0x91, 0x34, 0x39, + 0x19, 0x4e, 0x28, 0xc1, 0x49, 0x83, 0x9a, 0xe1, 0x5d, 0x8b, 0x70, 0x22, + 0x26, 0x4e, 0x12, 0x10, 0x69, 0x75, 0x1d, 0x55, 0x68, 0xa2, 0x75, 0x38, + 0x50, 0x4e, 0xa5, 0x43, 0x26, 0x91, 0x82, 0x43, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x0c, 0x6a, 0x70, 0xec, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x3c, 0xc9, 0x9b, 0x1f, 0x43, 0x19, 0x1a, 0x31, + 0xbb, 0x01, 0xde, 0x65, 0x6e, 0x85, 0xfe, 0x6f, 0x0c, 0x12, 0x93, 0x14, + 0xbb, 0x63, 0x53, 0x0b, 0xaa, 0x96, 0x9a, 0x91, 0xfc, 0x75, 0x13, 0xda, + 0x12, 0x10, 0xf2, 0x26, 0x92, 0x82, 0xbe, 0x77, 0xc9, 0x64, 0x52, 0x7a, + 0x04, 0x90, 0xbb, 0xb3, 0x53, 0xb5, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x19, 0x0c, 0x6a, 0x70, 0xec, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x30, 0x45, 0xd5, 0xb3, 0x99, 0x59, 0x4f, 0xab, 0x1f, 0xa5, + 0xa6, 0x8e, 0xab, 0x64, 0x55, 0x87, 0x58, 0xbe, 0xc6, 0x2b, 0x0d, 0xc7, + 0x40, 0xaf, 0xc9, 0x77, 0xb8, 0x3f, 0x79, 0x74, 0x96, 0x5c, 0x12, 0x10, + 0x8c, 0x53, 0xb4, 0x34, 0x31, 0x45, 0x3d, 0x82, 0x8c, 0xf3, 0x32, 0xc0, + 0xe2, 0xad, 0x1a, 0xff, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x19, 0x0c, 0x6a, 0x70, 0xec, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x2f, 0x3e, 0xc1, 0x5d, 0x94, 0xe6, 0x4b, 0xbe, 0x57, 0xc6, 0xb6, 0xa6, + 0xbd, 0x6a, 0x78, 0x94, 0xb8, 0x94, 0xe3, 0x7f, 0x8b, 0x23, 0x46, 0xb0, + 0x3b, 0x28, 0x10, 0xb5, 0x64, 0x1c, 0x1b, 0x6c, 0x12, 0x10, 0x94, 0x09, + 0xfb, 0x98, 0x64, 0x06, 0x1a, 0xdf, 0xcd, 0x72, 0xae, 0x2c, 0xbd, 0x44, + 0x82, 0x6f, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xc0, 0xe7, 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(ODKGoldenLicenseV18, Both_CdmUseCase_LicenseWithRenewal_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x90, 0x7f, 0xd2, 0x4a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x90, 0x7f, 0xd2, 0x4a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0xd2, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x26, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x48, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbe, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xac, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x22, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xaa, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x76, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x59, 0x32, 0x26, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x52, + 0x65, 0x6e, 0x65, 0x77, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x43, + 0x41, 0x35, 0x45, 0x46, 0x41, 0x31, 0x44, 0x35, 0x33, 0x37, 0x41, 0x41, + 0x46, 0x34, 0x44, 0x32, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, + 0x01, 0x18, 0x01, 0x20, 0xb4, 0x01, 0x28, 0x00, 0x30, 0x00, 0x38, 0x0a, + 0x42, 0x00, 0x48, 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, + 0x78, 0x00, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xf7, 0x41, 0x5c, 0x07, + 0x70, 0xa9, 0xae, 0xff, 0x5f, 0x94, 0xcb, 0x02, 0xc1, 0xf5, 0xb9, 0x28, + 0xbd, 0x85, 0x9f, 0x70, 0x31, 0xfb, 0xa7, 0x83, 0x2f, 0x98, 0xda, 0x3d, + 0xba, 0x56, 0xfe, 0xcb, 0x91, 0x5b, 0x10, 0x8e, 0xdc, 0x54, 0xb0, 0x57, + 0xee, 0x43, 0x13, 0xbf, 0xab, 0x36, 0xc0, 0x71, 0xe3, 0x3b, 0xc3, 0x53, + 0xe3, 0xfa, 0xab, 0xef, 0x9e, 0xd8, 0xf8, 0xc0, 0x06, 0xdd, 0x5d, 0x0f, + 0x18, 0xc3, 0x42, 0x6b, 0xc0, 0x38, 0x5c, 0x9a, 0x33, 0xd6, 0xc6, 0x10, + 0x64, 0xc3, 0x9b, 0x18, 0x12, 0x10, 0x5f, 0xf3, 0x4b, 0x13, 0xef, 0xda, + 0x3c, 0xa0, 0x33, 0xf1, 0x84, 0xfa, 0x0e, 0x84, 0xeb, 0x6d, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x19, 0x90, 0x7f, 0xd2, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0xf1, 0x1f, 0x0e, 0x77, 0xdc, 0x5e, 0xcf, 0x90, 0xb9, 0x0c, 0x83, 0x24, + 0x3a, 0x45, 0x30, 0xa0, 0x6f, 0x28, 0xd6, 0x5d, 0x8e, 0x7d, 0xa2, 0xdf, + 0x06, 0x11, 0x01, 0x03, 0x29, 0x8d, 0x71, 0x27, 0x12, 0x10, 0x1b, 0x6e, + 0x88, 0xf0, 0xed, 0xe5, 0x26, 0xc4, 0x0a, 0xa9, 0x58, 0xa4, 0x19, 0xa5, + 0x63, 0x4d, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, + 0x90, 0x7f, 0xd2, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x8c, 0xb3, + 0x69, 0x30, 0x19, 0x30, 0x96, 0xdf, 0x98, 0xab, 0xd3, 0xf2, 0x75, 0xbd, + 0xd4, 0x6d, 0x3d, 0xf2, 0x31, 0x13, 0x4e, 0xd5, 0xbd, 0xb1, 0xac, 0xf3, + 0xc2, 0xd5, 0x82, 0x52, 0xfd, 0xbe, 0x12, 0x10, 0x94, 0x67, 0x49, 0x7f, + 0x6e, 0xd8, 0x51, 0x96, 0x70, 0xb1, 0x88, 0xb0, 0x74, 0xe8, 0xa4, 0xbc, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x90, 0x7f, + 0xd2, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x27, 0x6a, 0x20, 0x08, + 0x26, 0x8a, 0xed, 0xad, 0xf9, 0x2b, 0xae, 0xd7, 0x29, 0x78, 0x65, 0x01, + 0x91, 0xd8, 0x53, 0x69, 0xc7, 0x6d, 0x2b, 0xaa, 0xaa, 0xc7, 0xc7, 0x04, + 0xbf, 0x82, 0x5e, 0xda, 0x12, 0x10, 0xd2, 0x27, 0xe2, 0x0f, 0x36, 0x36, + 0x95, 0x91, 0x6e, 0xd9, 0x51, 0x7d, 0xf2, 0xb4, 0x01, 0xb6, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x90, 0x7f, 0xd2, 0x4a, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x18, 0x7a, 0x0b, 0x3f, 0x15, 0x41, + 0x9b, 0x06, 0xa8, 0xca, 0x83, 0x02, 0x62, 0x1e, 0x95, 0x25, 0x65, 0x40, + 0xe7, 0xca, 0x19, 0x70, 0x52, 0x89, 0xfc, 0xdf, 0x98, 0x50, 0xd8, 0x7b, + 0x71, 0x68, 0x12, 0x10, 0x37, 0xdd, 0xd1, 0xc1, 0xc9, 0x60, 0xb8, 0xe5, + 0xcc, 0x07, 0xc7, 0x2c, 0xeb, 0x0d, 0xe5, 0x89, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x90, 0x7f, 0xd2, 0x4a, 0xa0, 0x00, + 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xbd, 0xb0, 0xbe, 0x82, 0x4f, 0x3f, 0x05, 0x65, + 0x48, 0xee, 0x9a, 0x2c, 0xa3, 0x9d, 0xe0, 0x9a, 0x69, 0xb7, 0x3f, 0xe1, + 0x1a, 0xc9, 0xfe, 0x3c, 0x6f, 0xd5, 0x2b, 0x17, 0x54, 0xcb, 0xd2, 0x94, + 0x12, 0x10, 0x77, 0x0e, 0x54, 0x27, 0x4b, 0xd6, 0x20, 0x17, 0xb2, 0xae, + 0xe7, 0x1e, 0x03, 0xcc, 0xea, 0x55, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, + 0x20, 0xb3, 0xe8, 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(ODKGoldenLicenseV18, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x05, 0xd3, 0xe8, 0xe8, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x05, 0xd3, 0xe8, 0xe8, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xaa, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x58, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x96, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x84, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xfa, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x82, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x70, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x4e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x34, 0x42, 0x44, 0x43, 0x35, + 0x37, 0x34, 0x39, 0x37, 0x34, 0x45, 0x39, 0x36, 0x31, 0x35, 0x36, 0x32, + 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x00, 0x28, 0xb4, 0x01, 0x30, 0x00, 0x38, 0x0a, 0x42, 0x00, 0x48, 0x0f, + 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, + 0x20, 0x01, 0x1a, 0x50, 0xfd, 0x36, 0xa7, 0x75, 0xab, 0xd5, 0x44, 0xf4, + 0x09, 0xfc, 0x08, 0x7a, 0xe6, 0xf9, 0xcc, 0x03, 0x13, 0x3d, 0xf2, 0x04, + 0x45, 0xb5, 0xbe, 0xac, 0x94, 0x6c, 0xcb, 0x53, 0xe4, 0x12, 0xf7, 0x14, + 0xb9, 0x88, 0x31, 0x94, 0x9b, 0x28, 0xc8, 0xe9, 0x37, 0x42, 0xe0, 0x55, + 0x45, 0xc0, 0x44, 0x7f, 0x7f, 0x4d, 0x84, 0x62, 0xbf, 0x0a, 0x5b, 0x1b, + 0x6c, 0x99, 0xb3, 0x21, 0x7d, 0x85, 0x75, 0x15, 0x65, 0x76, 0x86, 0x7c, + 0x54, 0xca, 0x3a, 0xdd, 0x80, 0xaa, 0x68, 0x12, 0xc5, 0x32, 0x93, 0xcd, + 0x12, 0x10, 0xcd, 0xf6, 0xfc, 0xfa, 0x31, 0x8f, 0x67, 0x91, 0x14, 0xc2, + 0x98, 0x67, 0x35, 0xa2, 0x20, 0xa0, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x05, 0xd3, + 0xe8, 0xe8, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x72, 0xab, 0xf2, 0xf4, + 0xe0, 0x16, 0x30, 0x3a, 0xbf, 0x03, 0x3d, 0xa6, 0x3a, 0x88, 0x63, 0xc9, + 0xef, 0xda, 0x15, 0xc3, 0xdc, 0x45, 0x30, 0xde, 0x54, 0x56, 0x26, 0x08, + 0xde, 0xaa, 0x4b, 0xbd, 0x12, 0x10, 0x32, 0x3d, 0x48, 0x43, 0xc2, 0xcc, + 0x9c, 0x7c, 0x31, 0x20, 0xe4, 0xb8, 0xc1, 0xb7, 0x08, 0xbc, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x05, 0xd3, 0xe8, 0xe8, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x50, 0xa5, 0x46, 0xbd, 0xe0, 0xdb, + 0x52, 0x81, 0xa6, 0xb9, 0xb9, 0x32, 0x54, 0xe9, 0x65, 0x0c, 0x4d, 0x2e, + 0xbf, 0x2a, 0xe8, 0x13, 0x15, 0xa6, 0x3e, 0x30, 0xa1, 0x59, 0xd8, 0x5c, + 0x88, 0xff, 0x12, 0x10, 0x87, 0x57, 0x61, 0x95, 0xff, 0xc5, 0xff, 0x42, + 0xd8, 0xe8, 0xb9, 0xe8, 0x14, 0x06, 0x39, 0x59, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x05, 0xd3, 0xe8, 0xe8, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x5a, 0x85, 0xa7, 0x6a, 0x4f, 0x56, 0x2f, 0x89, + 0x46, 0x29, 0x24, 0xfd, 0x7b, 0xc1, 0x2c, 0xe8, 0x31, 0x5b, 0x41, 0xbd, + 0x07, 0x9e, 0x88, 0xf2, 0xfc, 0x5f, 0x5a, 0x88, 0x77, 0x0c, 0x3e, 0x05, + 0x12, 0x10, 0x3a, 0x22, 0x79, 0x11, 0xea, 0x97, 0x0f, 0xdf, 0xa0, 0x78, + 0x0c, 0x44, 0x7b, 0xf7, 0x98, 0x5d, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x19, 0x05, 0xd3, 0xe8, 0xe8, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x5f, 0x19, 0x3f, 0x95, 0x73, 0x12, 0x95, 0x31, 0x9f, 0x26, + 0x1b, 0x99, 0xac, 0x2f, 0x8c, 0xff, 0xba, 0x41, 0x61, 0xf7, 0x8a, 0xab, + 0xa6, 0x98, 0x57, 0xd8, 0x3a, 0xeb, 0x70, 0x5e, 0xfc, 0x98, 0x12, 0x10, + 0x31, 0x1b, 0x09, 0x47, 0xed, 0xd5, 0x43, 0x16, 0x7c, 0x83, 0x00, 0xa4, + 0x08, 0xfc, 0xa4, 0xd3, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x19, 0x05, 0xd3, 0xe8, 0xe8, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x23, 0x66, 0x4c, 0x9c, 0xf2, 0x01, 0xa2, 0xd3, 0xaf, 0x57, 0x78, 0x4c, + 0xee, 0x31, 0xf8, 0x6a, 0xd9, 0xf8, 0x73, 0x97, 0xda, 0x61, 0xa0, 0x50, + 0xa0, 0x8d, 0xca, 0x51, 0xc2, 0x95, 0x98, 0xcd, 0x12, 0x10, 0x1e, 0xe5, + 0x64, 0x2c, 0xf0, 0x43, 0x34, 0x46, 0xe4, 0x03, 0x88, 0x3b, 0xca, 0xcb, + 0x62, 0x20, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xa6, 0xe9, 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(ODKGoldenLicenseV18, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x61, 0xa5, 0xde, 0x06, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x61, 0xa5, 0xde, 0x06, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xdb, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2f, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x51, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x3f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x1d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xc7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xb5, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x93, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x3d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x2b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x09, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xb3, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xa1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x7f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x29, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x17, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x62, 0x32, 0x2f, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x52, + 0x65, 0x6e, 0x65, 0x77, 0x61, 0x6c, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x62, + 0x61, 0x63, 0x6b, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, + 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x34, 0x46, 0x30, 0x35, + 0x42, 0x30, 0x42, 0x31, 0x32, 0x42, 0x32, 0x33, 0x39, 0x32, 0x33, 0x37, + 0x32, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x1d, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, + 0x20, 0x00, 0x28, 0xb4, 0x01, 0x30, 0x00, 0x38, 0x0a, 0x42, 0x00, 0x48, + 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, + 0x66, 0x20, 0x01, 0x1a, 0x50, 0xfe, 0xf1, 0xfc, 0xf9, 0x6a, 0xbe, 0xbe, + 0xd2, 0xc4, 0x28, 0x0b, 0x35, 0x5b, 0x2b, 0x52, 0xe4, 0x9f, 0x24, 0x8a, + 0xd9, 0x02, 0xd1, 0x6f, 0xc3, 0xa6, 0x48, 0x94, 0x5d, 0x87, 0x57, 0xbc, + 0x48, 0x86, 0xf4, 0x16, 0xa7, 0xee, 0xd9, 0x2e, 0x1c, 0xb8, 0xb8, 0x15, + 0xc9, 0xdf, 0x13, 0x19, 0x13, 0x48, 0xb0, 0x03, 0xdc, 0xc4, 0xc9, 0x45, + 0x45, 0xbb, 0x0d, 0x87, 0xda, 0xa8, 0x23, 0x40, 0xcc, 0x49, 0x14, 0x44, + 0xd7, 0x7a, 0x98, 0x73, 0x10, 0x37, 0x9e, 0x1c, 0xeb, 0x3d, 0x06, 0x89, + 0x65, 0x12, 0x10, 0x55, 0x50, 0x69, 0xf5, 0x3a, 0xd9, 0xc6, 0x7e, 0xbf, + 0xe7, 0x16, 0xea, 0x62, 0xf0, 0x44, 0x93, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x61, + 0xa5, 0xde, 0x06, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x60, 0xb6, 0x80, + 0xd1, 0xc8, 0x62, 0x11, 0x9e, 0x57, 0x94, 0xf0, 0xb1, 0xd5, 0x48, 0x2f, + 0xe6, 0x9f, 0xaf, 0xb4, 0x12, 0xb7, 0xd9, 0x66, 0x4e, 0x7d, 0x61, 0xb4, + 0x3c, 0x76, 0xf7, 0x7e, 0x6e, 0x12, 0x10, 0x7c, 0xda, 0x3f, 0xef, 0x08, + 0xf1, 0xd7, 0x70, 0x28, 0x2f, 0x23, 0x09, 0xa4, 0x60, 0xc6, 0x75, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x61, 0xa5, 0xde, + 0x06, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x39, 0x7e, 0x04, 0xe1, 0xd6, + 0x52, 0xd0, 0x4a, 0x3b, 0x49, 0x43, 0xc6, 0xbf, 0x70, 0x8b, 0xed, 0xb5, + 0x94, 0x79, 0x67, 0xa0, 0x49, 0x35, 0x6c, 0x5e, 0xe3, 0x77, 0x49, 0xde, + 0xd2, 0x3e, 0xdd, 0x12, 0x10, 0x52, 0xad, 0xc6, 0x5e, 0x20, 0x9e, 0x12, + 0xbd, 0x3d, 0x6f, 0x7e, 0xba, 0x24, 0x6f, 0x4e, 0x72, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x19, 0x61, 0xa5, 0xde, 0x06, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0xd2, 0x45, 0x8b, 0x97, 0x7b, 0xcd, 0xac, + 0x67, 0x11, 0x8f, 0x78, 0xca, 0xdf, 0x77, 0xbb, 0x42, 0x90, 0xb1, 0x56, + 0x14, 0xda, 0x61, 0xc0, 0x30, 0x3c, 0x05, 0xc5, 0xb0, 0xbb, 0xd3, 0x8f, + 0x2e, 0x12, 0x10, 0x6a, 0x03, 0x4c, 0x60, 0x44, 0x47, 0xfb, 0x23, 0xb2, + 0xf2, 0xae, 0x28, 0xb9, 0x11, 0x68, 0xd5, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x19, 0x61, 0xa5, 0xde, 0x06, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x00, 0xdb, 0x10, 0x5b, 0x15, 0x6e, 0x51, 0xca, 0x1e, + 0xb6, 0x2e, 0x33, 0x19, 0x79, 0x14, 0xa8, 0xf8, 0x34, 0xbb, 0x59, 0x03, + 0x41, 0x56, 0x43, 0xcb, 0x84, 0xf3, 0x39, 0x7d, 0x1c, 0xb8, 0x5c, 0x12, + 0x10, 0x93, 0x65, 0x95, 0xd4, 0x54, 0x19, 0x8c, 0xcd, 0xe4, 0x66, 0x16, + 0x10, 0xd3, 0xb8, 0x09, 0xe4, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x19, 0x61, 0xa5, 0xde, 0x06, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0x13, 0xb8, 0x60, 0xc7, 0xcd, 0x84, 0xd0, 0x1e, 0x23, 0x05, 0x9c, + 0xb6, 0xdc, 0x69, 0x30, 0x6f, 0xd9, 0x34, 0xa0, 0xa5, 0x09, 0xc5, 0x69, + 0x7a, 0xf5, 0x8d, 0x81, 0xc9, 0x93, 0xe0, 0xb9, 0x4a, 0x12, 0x10, 0x01, + 0x98, 0xc8, 0xf7, 0xfc, 0x66, 0xb4, 0xf3, 0xc0, 0x3e, 0xa7, 0x29, 0x88, + 0x48, 0x0f, 0xf9, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x99, 0xea, + 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(ODKGoldenLicenseV18, Both_CdmUseCase_LimitedDurationLicense_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x1d, 0x71, 0xab, 0x3b, 0x00, 0x00, 0x00, 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, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x1d, 0x71, 0xab, 0x3b, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xa9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x57, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xeb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xd7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x81, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x4d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe5, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x42, 0x44, 0x46, 0x30, 0x45, + 0x34, 0x42, 0x39, 0x30, 0x34, 0x32, 0x41, 0x42, 0x38, 0x30, 0x41, 0x32, + 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x0f, 0x28, 0x3c, 0x30, 0x00, 0x38, 0x0f, 0x42, 0x00, 0x48, 0x05, 0x50, + 0x00, 0x58, 0x01, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x20, + 0x01, 0x1a, 0x50, 0xa1, 0x7b, 0x9a, 0x06, 0x24, 0x4e, 0x5e, 0x63, 0x05, + 0xab, 0x1e, 0xf8, 0xd2, 0x18, 0xe3, 0x0a, 0xec, 0xe5, 0xef, 0xb2, 0x3a, + 0xe8, 0x1a, 0x1a, 0x8f, 0xe9, 0x2a, 0x17, 0x2c, 0x32, 0xdb, 0x59, 0xca, + 0xa9, 0x05, 0x23, 0x20, 0x9c, 0xa1, 0x5b, 0xa3, 0x72, 0xed, 0x04, 0xde, + 0xd5, 0x17, 0xd4, 0x78, 0x52, 0x73, 0x1e, 0x7d, 0x42, 0xcb, 0x62, 0x6d, + 0xa4, 0x99, 0xc0, 0x66, 0x71, 0x87, 0x2a, 0xed, 0xfc, 0x4e, 0xff, 0x15, + 0x23, 0x13, 0x98, 0xaa, 0x29, 0x20, 0x54, 0x44, 0x9e, 0xbb, 0x34, 0x12, + 0x10, 0x83, 0xa9, 0x0f, 0x5c, 0xb9, 0x63, 0x19, 0x2c, 0x21, 0xdf, 0xb2, + 0x7f, 0x43, 0xa8, 0x5d, 0xbb, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0x1d, 0x71, 0xab, + 0x3b, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x2d, 0x6e, 0x41, 0xea, 0x05, + 0xc4, 0xd5, 0xea, 0x7e, 0xa3, 0xb6, 0x29, 0x0f, 0x27, 0x21, 0x31, 0xae, + 0xbc, 0x7f, 0x48, 0x71, 0xd2, 0xce, 0xc6, 0xc3, 0xe0, 0x1a, 0xb0, 0xdf, + 0x13, 0xa0, 0x3d, 0x12, 0x10, 0x7b, 0x87, 0x16, 0x1e, 0x9c, 0xcd, 0x51, + 0xae, 0x23, 0x96, 0x7a, 0x8b, 0x7e, 0xe5, 0xe6, 0x60, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0x1d, 0x71, 0xab, 0x3b, 0xa0, + 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0xc5, 0x78, 0x21, 0x56, 0xe3, 0xd4, 0xcb, + 0x40, 0x6d, 0xc0, 0xc9, 0x90, 0xae, 0xe2, 0x8a, 0x58, 0x6f, 0x21, 0x68, + 0x7e, 0x5d, 0x1b, 0xed, 0x03, 0xd2, 0xb7, 0xb9, 0x5b, 0x26, 0x6d, 0xbc, + 0x3e, 0x12, 0x10, 0x97, 0x67, 0x9f, 0x8a, 0x5d, 0xf5, 0xe6, 0x3c, 0xdc, + 0x6c, 0xf0, 0xac, 0x86, 0xfc, 0xeb, 0x20, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x14, 0x1d, 0x71, 0xab, 0x3b, 0xa0, 0x00, 0x00, + 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x27, 0x7b, 0x6a, 0x8e, 0xdc, 0xee, 0xbf, 0x5e, 0x9a, + 0x34, 0x96, 0xbf, 0x85, 0xc0, 0x50, 0xce, 0x0f, 0x3a, 0xf7, 0x5b, 0xc1, + 0x02, 0xc5, 0x18, 0xcd, 0xc3, 0xe0, 0x3d, 0x66, 0x80, 0x88, 0xe7, 0x12, + 0x10, 0x4f, 0xa4, 0xe2, 0x7c, 0x38, 0x76, 0xa6, 0x2f, 0xe9, 0xd0, 0x04, + 0x02, 0x51, 0x25, 0x52, 0xfd, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x14, 0x1d, 0x71, 0xab, 0x3b, 0xa0, 0x00, 0x00, 0x08, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0x4b, 0x4e, 0xdc, 0x72, 0xb5, 0x45, 0x2c, 0x8b, 0x2d, 0xf8, 0x10, + 0x28, 0x2d, 0xef, 0x43, 0xf9, 0x81, 0x37, 0xb4, 0x05, 0x3a, 0x83, 0x0b, + 0x2d, 0xa6, 0x9c, 0x8d, 0x80, 0x05, 0x37, 0xa3, 0x6f, 0x12, 0x10, 0x15, + 0x45, 0x60, 0xaf, 0xb9, 0x42, 0x5d, 0xd5, 0xb2, 0x64, 0x76, 0x26, 0x24, + 0xdb, 0x06, 0x59, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x14, 0x1d, 0x71, 0xab, 0x3b, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xbd, + 0x16, 0x1e, 0x17, 0x8b, 0x0c, 0xb9, 0x59, 0x10, 0x63, 0x5b, 0xcb, 0x40, + 0x98, 0xba, 0xe4, 0x98, 0xce, 0x1f, 0xd4, 0x7c, 0x13, 0x87, 0x43, 0x05, + 0x07, 0xf8, 0xf4, 0xa8, 0x9a, 0x3f, 0xa6, 0x12, 0x10, 0x34, 0xa4, 0x3b, + 0x05, 0x69, 0x18, 0x16, 0x22, 0x4f, 0x05, 0xbc, 0xc8, 0x4e, 0x18, 0x43, + 0xe1, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x8c, 0xeb, 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(ODKGoldenLicenseV18, Both_CdmUseCase_LimitedDurationLicense_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xd4, 0x57, 0xcc, 0x27, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xd4, 0x57, 0xcc, 0x27, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xd5, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2a, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x4b, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x39, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x17, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xaf, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x8d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x37, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x25, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xad, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x9b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x79, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x11, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xef, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x5d, 0x32, 0x2a, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x63, + 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, + 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x0a, 0x20, 0x39, 0x35, 0x31, 0x38, 0x34, 0x35, 0x33, 0x39, 0x36, + 0x34, 0x31, 0x31, 0x46, 0x31, 0x45, 0x38, 0x32, 0x45, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x0f, 0x28, 0x3c, 0x30, + 0x00, 0x38, 0x0f, 0x42, 0x00, 0x48, 0x05, 0x50, 0x00, 0x58, 0x01, 0x60, + 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xdc, + 0x72, 0x77, 0xc9, 0x58, 0xc5, 0xf9, 0x02, 0x40, 0xec, 0xe6, 0x7a, 0x7a, + 0x1c, 0xef, 0x40, 0x6a, 0x5c, 0x05, 0xf9, 0xa7, 0x64, 0x0e, 0xa2, 0xa4, + 0x3c, 0xab, 0x16, 0xbe, 0xd0, 0x0a, 0xf2, 0x93, 0x23, 0x76, 0x6e, 0xe5, + 0xe3, 0x29, 0x2a, 0x9e, 0x90, 0x52, 0x63, 0xcf, 0x80, 0x05, 0x91, 0x9f, + 0x04, 0x99, 0x26, 0x59, 0x77, 0x17, 0xba, 0x6e, 0xec, 0x49, 0x76, 0xa7, + 0xe8, 0xea, 0x7d, 0x25, 0x20, 0xbc, 0xcb, 0x8b, 0x2e, 0xdb, 0x42, 0x18, + 0x61, 0xc6, 0xb4, 0x79, 0x56, 0xcd, 0x36, 0x12, 0x10, 0x0b, 0x0c, 0xca, + 0xf6, 0x53, 0x4c, 0x0d, 0xf7, 0xde, 0x66, 0x75, 0x6c, 0xa3, 0xb1, 0xc5, + 0x34, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x14, 0xd4, 0x57, 0xcc, 0x27, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x9b, 0xcc, 0xa8, 0xe2, 0x9e, 0x5e, 0x24, 0xfb, 0x66, + 0x5e, 0xd5, 0xc1, 0x75, 0x9a, 0xf9, 0x6b, 0x64, 0x1f, 0xed, 0xdf, 0x9b, + 0x09, 0x73, 0x0c, 0xfa, 0xbe, 0x21, 0xf2, 0x37, 0x85, 0x59, 0x87, 0x12, + 0x10, 0x99, 0xaa, 0xfb, 0x08, 0xc6, 0x23, 0x58, 0x1a, 0xf1, 0x98, 0x30, + 0x0f, 0x72, 0xae, 0x1b, 0xe6, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x14, 0xd4, 0x57, 0xcc, 0x27, 0xa0, 0x00, 0x40, 0x00, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0x52, 0x2c, 0x88, 0xf6, 0x1f, 0xe8, 0xa7, 0xf2, 0x79, 0x21, 0x49, + 0x55, 0x55, 0x17, 0x27, 0x30, 0x51, 0x3c, 0x4d, 0xe5, 0xe7, 0x48, 0x19, + 0xc8, 0xa0, 0x2a, 0x2c, 0xec, 0xff, 0xc6, 0x8f, 0x7d, 0x12, 0x10, 0xae, + 0xfc, 0x48, 0x7c, 0x84, 0xbf, 0x33, 0xc8, 0xe2, 0xc0, 0x0e, 0x2e, 0x38, + 0x3d, 0x4a, 0xb7, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x14, 0xd4, 0x57, 0xcc, 0x27, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x54, + 0xd9, 0x6b, 0x58, 0x99, 0xb5, 0x8c, 0x59, 0x8a, 0xd3, 0xbc, 0x6c, 0x1c, + 0x50, 0xbd, 0xea, 0x5e, 0xa5, 0xc7, 0x8f, 0x38, 0x75, 0xfb, 0x3d, 0x78, + 0x63, 0x51, 0x4e, 0xf2, 0x7c, 0x04, 0xe3, 0x12, 0x10, 0x15, 0x04, 0xe4, + 0xce, 0x52, 0x63, 0x7c, 0x45, 0x91, 0xcd, 0xdf, 0xa2, 0xbf, 0x19, 0xd3, + 0xe5, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xd4, + 0x57, 0xcc, 0x27, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x9e, 0xe9, 0xba, + 0x83, 0x56, 0xea, 0x25, 0x0a, 0xb3, 0xe8, 0xe1, 0x19, 0x7e, 0xa6, 0x02, + 0xaa, 0x97, 0x19, 0xfa, 0x79, 0xfc, 0x0f, 0x12, 0x16, 0xbb, 0xab, 0x89, + 0xfd, 0x73, 0x55, 0xcf, 0x78, 0x12, 0x10, 0xb9, 0xa3, 0x65, 0xe7, 0x0d, + 0x41, 0xd8, 0xb5, 0xf6, 0xde, 0xfc, 0x66, 0xe2, 0x38, 0xb6, 0x77, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xd4, 0x57, 0xcc, + 0x27, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x3a, 0x7c, 0x35, 0x84, 0x7b, + 0x89, 0x05, 0xf2, 0x07, 0xfd, 0xe6, 0x2d, 0xfa, 0x47, 0x9e, 0xa0, 0x65, + 0x06, 0xa8, 0x0f, 0xe7, 0x9c, 0x02, 0x4a, 0x58, 0x3a, 0xb6, 0x4c, 0x61, + 0xf2, 0xc6, 0xd1, 0x12, 0x10, 0x13, 0x44, 0x08, 0xf4, 0xf9, 0x4d, 0x99, + 0x18, 0x65, 0xff, 0x40, 0x95, 0xb8, 0xa1, 0x66, 0x0b, 0x0a, 0x10, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, + 0x3d, 0x3d, 0x3d, 0x20, 0xad, 0xeb, 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(ODKGoldenLicenseV18, Both_CdmUseCase_RenewOnLicenseLoad_Case1S_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xfe, 0xe4, 0xb3, 0x02, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xfe, 0xe4, 0xb3, 0x02, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xac, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x5a, 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, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x22, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xee, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x98, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xfc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xda, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x84, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x50, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xfa, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x43, 0x44, 0x43, 0x32, 0x45, + 0x35, 0x39, 0x32, 0x32, 0x34, 0x43, 0x46, 0x45, 0x37, 0x32, 0x44, 0x33, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x14, 0x28, 0x32, 0x30, 0x00, 0x38, 0x0f, 0x42, 0x00, 0x48, 0x05, 0x50, + 0x00, 0x58, 0x01, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x90, 0x01, 0x02, + 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0x64, 0xbf, 0xd5, 0x47, 0x73, 0x1a, + 0xca, 0xe6, 0x4e, 0xc8, 0x27, 0x4a, 0x85, 0xfd, 0x10, 0xb5, 0xbf, 0xf2, + 0x89, 0x7d, 0x67, 0x4c, 0xfd, 0x83, 0x2b, 0xe9, 0x9e, 0x5f, 0xf7, 0x2d, + 0xf9, 0x84, 0xd9, 0xb2, 0xa8, 0xc7, 0xdf, 0x4c, 0x53, 0xdd, 0x92, 0x96, + 0x90, 0xee, 0x80, 0xbf, 0x5b, 0xf0, 0x01, 0x87, 0x92, 0x47, 0x6e, 0x1e, + 0x0e, 0xa5, 0xf7, 0x3e, 0x5b, 0x23, 0x6d, 0x51, 0x0b, 0x95, 0xd7, 0x88, + 0xa5, 0x18, 0xa1, 0x0e, 0x27, 0xbf, 0xa3, 0xc1, 0xd1, 0xfe, 0xa8, 0xbe, + 0x5f, 0x63, 0x12, 0x10, 0xb0, 0xe8, 0x54, 0x73, 0x75, 0x49, 0xe4, 0x1b, + 0x57, 0xc4, 0xbe, 0x7b, 0x70, 0xb4, 0x1f, 0xc6, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, + 0xfe, 0xe4, 0xb3, 0x02, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xf6, 0x29, + 0x8e, 0x12, 0x81, 0xcb, 0x6e, 0x10, 0x67, 0xc9, 0xdc, 0xf5, 0xce, 0x65, + 0x39, 0x97, 0x68, 0xe1, 0x14, 0x7c, 0x0f, 0xc7, 0x70, 0x77, 0x3d, 0x77, + 0xbc, 0x1e, 0x55, 0x0f, 0x8b, 0x30, 0x12, 0x10, 0xd0, 0x30, 0xbc, 0xbf, + 0xca, 0x72, 0xf3, 0x33, 0x6f, 0xeb, 0x65, 0x5b, 0x4f, 0x29, 0xe3, 0x79, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xfe, 0xe4, + 0xb3, 0x02, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xe5, 0xfc, 0x1c, 0x6e, + 0xd6, 0x40, 0x9d, 0x92, 0xf6, 0xc2, 0x5a, 0x3f, 0x8d, 0x02, 0x90, 0x29, + 0x8b, 0x52, 0x7b, 0xf0, 0xb4, 0x26, 0xb9, 0x57, 0x18, 0x7c, 0x91, 0x29, + 0xa4, 0xbf, 0x0e, 0xe0, 0x12, 0x10, 0xc5, 0x44, 0x84, 0xf2, 0x91, 0x41, + 0xb9, 0xd5, 0xf7, 0x33, 0x99, 0x3a, 0x2c, 0x01, 0x97, 0x51, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xfe, 0xe4, 0xb3, 0x02, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x7c, 0x02, 0x54, 0xf1, 0x58, 0xa4, + 0x87, 0x4b, 0x5b, 0x5b, 0x4c, 0x7d, 0x2a, 0x37, 0xcd, 0x56, 0x75, 0x28, + 0x22, 0x1f, 0x46, 0x8e, 0xb2, 0x78, 0x74, 0x85, 0x77, 0x9a, 0x80, 0x57, + 0xd8, 0xa0, 0x12, 0x10, 0x56, 0x88, 0x6b, 0xe9, 0x49, 0xf1, 0x60, 0xb2, + 0x41, 0xa4, 0x93, 0x08, 0x39, 0x47, 0xdc, 0xea, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0xfe, 0xe4, 0xb3, 0x02, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xb4, 0x8c, 0x7f, 0x27, 0x46, 0x7a, 0xa9, 0x2d, + 0xff, 0xcd, 0xb1, 0xa4, 0xd6, 0x0f, 0xcc, 0xbb, 0x05, 0x5c, 0xf3, 0x1f, + 0x89, 0xdf, 0x75, 0xee, 0xaf, 0xa8, 0x5a, 0x63, 0xd2, 0xf7, 0x24, 0xbe, + 0x12, 0x10, 0xbc, 0xe2, 0xe8, 0xbd, 0x43, 0x35, 0xaa, 0x37, 0xdf, 0x08, + 0x79, 0x76, 0x68, 0xc1, 0x5c, 0xff, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x14, 0xfe, 0xe4, 0xb3, 0x02, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xd3, 0x21, 0xe6, 0x68, 0x67, 0x33, 0x42, 0xfa, 0x69, 0x83, + 0x0e, 0x72, 0x9a, 0xe9, 0xbd, 0xa3, 0xbf, 0x65, 0x89, 0x14, 0x4a, 0x42, + 0x40, 0x69, 0x97, 0xbc, 0xdd, 0x85, 0xca, 0xab, 0x7c, 0x43, 0x12, 0x10, + 0xf7, 0x87, 0xfc, 0xd1, 0x23, 0xc3, 0x78, 0xb0, 0x64, 0x2b, 0x9b, 0x21, + 0xfd, 0x8b, 0x0c, 0x5d, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xce, + 0xeb, 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(ODKGoldenLicenseV18, Both_CdmUseCase_RenewOnLicenseLoad_Case1S_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x89, 0x1b, 0x93, 0x4a, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x89, 0x1b, 0x93, 0x4a, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0xd4, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x26, 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, 0x32, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x4a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x38, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xc0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xae, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x8c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x36, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xac, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x9a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x78, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x22, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x10, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xee, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x59, 0x32, 0x26, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x52, 0x65, 0x6e, 0x65, 0x77, 0x4f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, + 0x73, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x33, + 0x39, 0x36, 0x31, 0x44, 0x41, 0x33, 0x32, 0x39, 0x31, 0x38, 0x43, 0x45, + 0x38, 0x39, 0x45, 0x33, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, + 0x01, 0x18, 0x01, 0x20, 0x14, 0x28, 0x32, 0x30, 0x00, 0x38, 0x0f, 0x42, + 0x00, 0x48, 0x05, 0x50, 0x00, 0x58, 0x01, 0x60, 0x00, 0x70, 0x00, 0x78, + 0x01, 0x90, 0x01, 0x02, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xde, 0xdf, + 0x6d, 0x7e, 0x92, 0x6d, 0x88, 0xc2, 0x7b, 0x1f, 0x19, 0xd4, 0xce, 0xc4, + 0x29, 0x26, 0x3a, 0x5f, 0x08, 0x73, 0x4d, 0x53, 0xab, 0x19, 0x78, 0x94, + 0xd5, 0x0e, 0xa9, 0x39, 0x9d, 0x49, 0x2e, 0x1d, 0xd2, 0x35, 0x99, 0x29, + 0x45, 0xb6, 0x71, 0x62, 0x7f, 0x84, 0xef, 0x38, 0x8a, 0x4b, 0x6f, 0x95, + 0xdf, 0x77, 0x29, 0x13, 0x6c, 0x59, 0xbf, 0xcb, 0x68, 0xee, 0x86, 0x02, + 0xab, 0x5f, 0x3b, 0xd2, 0x59, 0x0f, 0x0c, 0xc9, 0xa5, 0x08, 0xaa, 0xa7, + 0xea, 0xbf, 0x04, 0xe0, 0x74, 0x10, 0x12, 0x10, 0x0f, 0x43, 0xab, 0xfd, + 0x5a, 0x22, 0x2e, 0x0c, 0x20, 0xfe, 0x1f, 0xd7, 0x26, 0xb2, 0x4b, 0x8b, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x14, 0x89, 0x1b, 0x93, 0x4a, 0xa0, 0x00, 0x40, 0x00, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0xd6, 0xad, 0x65, 0x99, 0xda, 0xab, 0xc5, 0x20, 0x9d, 0x2f, + 0xc5, 0x50, 0xbd, 0x87, 0xcd, 0x8e, 0xbf, 0xa8, 0x2c, 0x72, 0x26, 0x99, + 0xa5, 0xe5, 0xdc, 0x9f, 0x53, 0x24, 0x3a, 0x9b, 0x25, 0x00, 0x12, 0x10, + 0xf4, 0x86, 0x40, 0xc9, 0xf8, 0x07, 0x49, 0x65, 0x9d, 0x86, 0x32, 0xba, + 0x4a, 0xf6, 0x14, 0xca, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x14, 0x89, 0x1b, 0x93, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x54, 0x91, 0xb8, 0xdb, 0x8d, 0x4f, 0xbe, 0xb4, 0x1d, 0x6d, 0x2f, 0x80, + 0xdb, 0xcf, 0x08, 0xe9, 0xe3, 0x71, 0x0e, 0x81, 0x7c, 0x29, 0x2f, 0x1d, + 0xff, 0xc0, 0x10, 0x97, 0x01, 0x5a, 0x24, 0xb3, 0x12, 0x10, 0x9d, 0x99, + 0xf6, 0x9a, 0x51, 0x94, 0xe0, 0x53, 0xb3, 0xfd, 0x48, 0x3a, 0x68, 0xef, + 0xb0, 0x89, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, + 0x89, 0x1b, 0x93, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x24, 0xd2, + 0x67, 0x90, 0xb6, 0x45, 0xf4, 0x00, 0x13, 0xf3, 0xf8, 0x1a, 0x18, 0x7e, + 0x72, 0x99, 0x42, 0xe6, 0x90, 0xa8, 0x34, 0x05, 0xa0, 0x82, 0xa1, 0x65, + 0x21, 0x60, 0x00, 0xc7, 0x08, 0x12, 0x12, 0x10, 0xac, 0x8b, 0x07, 0x6c, + 0x81, 0x40, 0xb2, 0xf6, 0xa4, 0xe4, 0xb5, 0xef, 0xb6, 0xe8, 0x1c, 0xfe, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0x89, 0x1b, + 0x93, 0x4a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x52, 0x7b, 0x3f, 0xfb, + 0x2f, 0x4f, 0xd4, 0x1a, 0x99, 0x16, 0x57, 0xdf, 0xc6, 0x9b, 0x7a, 0xb0, + 0xb0, 0x0f, 0x3a, 0x3e, 0x58, 0xed, 0x7f, 0x36, 0x24, 0x0c, 0x31, 0xee, + 0x4d, 0xba, 0x14, 0x2f, 0x12, 0x10, 0xf7, 0x91, 0xce, 0x0e, 0xca, 0x85, + 0x09, 0xc3, 0xb6, 0x8e, 0x55, 0xba, 0x57, 0x78, 0x06, 0xd5, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x14, 0x89, 0x1b, 0x93, 0x4a, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x7e, 0xd6, 0x01, 0xe7, 0x8e, 0x9c, + 0x69, 0x62, 0x48, 0x7d, 0x87, 0x36, 0x52, 0x00, 0xb1, 0xba, 0x17, 0x17, + 0x18, 0x2f, 0xbc, 0x41, 0xed, 0x49, 0x89, 0xc8, 0xd8, 0x86, 0x7d, 0xc1, + 0x40, 0x17, 0x12, 0x10, 0xdc, 0xa2, 0x65, 0x56, 0x19, 0xec, 0x28, 0x1a, + 0x52, 0xc0, 0xee, 0xff, 0x8e, 0xd7, 0x27, 0x71, 0x0a, 0x10, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, + 0x3d, 0x3d, 0x20, 0xf9, 0xeb, 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(ODKGoldenLicenseV18, Both_CdmUseCase_Heartbeat_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x65, 0x6d, 0xbf, 0xb7, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x65, 0x6d, 0xbf, 0xb7, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xa9, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x57, 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, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xeb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x95, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xf9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xd7, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x81, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x6f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x4d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0xf7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xe5, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xc3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x31, 0x28, 0x00, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x33, 0x37, 0x34, 0x42, + 0x32, 0x38, 0x39, 0x36, 0x46, 0x31, 0x33, 0x34, 0x46, 0x33, 0x36, 0x33, + 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x01, 0x20, + 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x1e, 0x42, 0x00, 0x48, 0x0a, 0x50, + 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x20, + 0x01, 0x1a, 0x50, 0x3c, 0x24, 0xe5, 0xa4, 0x72, 0x7b, 0x14, 0xd1, 0x6d, + 0x16, 0x30, 0x6e, 0x1c, 0xf9, 0xe2, 0xe8, 0xad, 0x7b, 0x37, 0x8e, 0xce, + 0x2c, 0x9c, 0x02, 0xf4, 0x93, 0xb3, 0xa1, 0x51, 0x26, 0x24, 0x25, 0x8a, + 0x84, 0x5f, 0xe8, 0xbb, 0x68, 0x75, 0x80, 0xaf, 0x9c, 0x7e, 0x39, 0xc4, + 0x6e, 0xe0, 0xb0, 0xd5, 0x4c, 0x0d, 0x89, 0xb8, 0x83, 0x67, 0x72, 0x4c, + 0x4c, 0x7c, 0x83, 0x3c, 0x67, 0x0c, 0x18, 0xf9, 0x6d, 0xb9, 0xe2, 0x31, + 0x36, 0x23, 0x75, 0x5b, 0x95, 0xd5, 0xbc, 0x87, 0x63, 0x2d, 0x5f, 0x12, + 0x10, 0x07, 0xf9, 0x13, 0x26, 0x2e, 0x8e, 0xcd, 0x99, 0xcf, 0x51, 0xc7, + 0x23, 0x9d, 0x93, 0x7e, 0x17, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x65, 0x6d, 0xbf, + 0xb7, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x08, 0x32, 0xa2, 0xe4, 0x52, + 0xe8, 0xb6, 0xe9, 0x9b, 0x35, 0x12, 0x27, 0x34, 0x61, 0xb4, 0x65, 0xa2, + 0xa0, 0x36, 0x8a, 0xe5, 0x4e, 0x87, 0xb9, 0x63, 0x88, 0x46, 0x52, 0x24, + 0x0d, 0x99, 0x81, 0x12, 0x10, 0xcd, 0xdd, 0x7d, 0x3f, 0x55, 0x1b, 0x55, + 0x4a, 0xde, 0x62, 0x11, 0x22, 0xa7, 0x6f, 0x7f, 0xf4, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x65, 0x6d, 0xbf, 0xb7, 0xa0, + 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x2c, 0x20, 0xca, 0x90, 0xe5, 0x74, 0xb4, + 0x51, 0x9e, 0x76, 0xb2, 0xb9, 0x9c, 0x90, 0x8c, 0xa1, 0xc7, 0x95, 0x2d, + 0xa5, 0xc4, 0x4e, 0x6f, 0x60, 0xd2, 0xe1, 0xdd, 0x48, 0x6a, 0x7c, 0xfb, + 0x7f, 0x12, 0x10, 0xbb, 0x62, 0x59, 0x12, 0x20, 0x34, 0x33, 0xbb, 0x54, + 0xc9, 0xcb, 0xeb, 0xc5, 0xd2, 0xaa, 0x81, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x28, 0x65, 0x6d, 0xbf, 0xb7, 0xa0, 0x00, 0x00, + 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0x63, 0x14, 0xef, 0x69, 0xdf, 0x79, 0x12, 0x54, 0x65, + 0xb2, 0x16, 0xb7, 0xe3, 0x11, 0xc0, 0x76, 0x55, 0x74, 0x46, 0x69, 0x74, + 0x43, 0x88, 0xb5, 0x05, 0x58, 0x97, 0x49, 0x31, 0x54, 0x49, 0xe9, 0x12, + 0x10, 0x4f, 0x97, 0xeb, 0x53, 0xed, 0x6c, 0xe7, 0x0c, 0x14, 0xcd, 0x90, + 0xaa, 0x7a, 0xc3, 0x37, 0xfc, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, + 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, + 0x00, 0x00, 0x28, 0x65, 0x6d, 0xbf, 0xb7, 0xa0, 0x00, 0x00, 0x08, 0x3a, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, + 0x20, 0xdb, 0x37, 0x77, 0xed, 0x7a, 0xc2, 0x1e, 0x60, 0xf2, 0x82, 0xe2, + 0x7b, 0x56, 0x03, 0xb8, 0x21, 0xdd, 0xeb, 0x01, 0xf3, 0xe1, 0xa7, 0xaf, + 0x7a, 0xf5, 0x38, 0x8e, 0x1d, 0x01, 0x9d, 0x1b, 0xe4, 0x12, 0x10, 0x89, + 0x97, 0xdb, 0x38, 0x9a, 0xc9, 0x12, 0x79, 0x60, 0x37, 0x5e, 0x1a, 0x29, + 0xf9, 0x16, 0x34, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x28, 0x65, 0x6d, 0xbf, 0xb7, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x52, + 0x32, 0xcf, 0x3c, 0xae, 0x98, 0x40, 0xef, 0x7f, 0xc2, 0x5b, 0x6b, 0x5f, + 0x4a, 0x2b, 0x57, 0x03, 0xfa, 0x1c, 0x1a, 0xd3, 0x9c, 0x03, 0x96, 0xf7, + 0x0a, 0x09, 0x7e, 0x88, 0xa7, 0xd5, 0x4d, 0x12, 0x10, 0xa4, 0xa0, 0x78, + 0xe7, 0x65, 0x31, 0x98, 0xbd, 0x72, 0xf4, 0xa5, 0xec, 0xc4, 0x5f, 0x15, + 0xa1, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xd0, 0xed, 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(ODKGoldenLicenseV18, Both_CdmUseCase_Heartbeat_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0xff, 0x39, 0xcd, 0x87, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0xff, 0x39, 0xcd, 0x87, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0xc8, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1d, 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, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xb4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x2a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xf6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa0, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x16, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x50, 0x32, 0x1d, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x63, 0x61, + 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, + 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x0a, 0x20, 0x31, 0x45, 0x43, 0x38, 0x42, 0x30, 0x30, 0x33, 0x42, 0x32, + 0x42, 0x32, 0x34, 0x30, 0x34, 0x37, 0x33, 0x45, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, + 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, + 0x38, 0x1e, 0x42, 0x00, 0x48, 0x0a, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x00, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0xbc, 0x1c, + 0x7d, 0xe8, 0x97, 0x48, 0x11, 0x56, 0x47, 0xa2, 0x80, 0xe5, 0x76, 0x69, + 0x27, 0x5e, 0x06, 0x21, 0x13, 0x66, 0xcb, 0x76, 0xb6, 0xc5, 0xbf, 0xf8, + 0xce, 0x25, 0x66, 0x31, 0x42, 0x70, 0x98, 0xad, 0xe4, 0xce, 0x4b, 0x4b, + 0x61, 0x74, 0x66, 0x50, 0x32, 0x59, 0xbb, 0x7f, 0x4a, 0xa1, 0x66, 0x3a, + 0x88, 0xd7, 0xb5, 0x35, 0xde, 0xa1, 0xb6, 0xb1, 0xe8, 0xbe, 0x05, 0xfe, + 0xcd, 0x7c, 0xe2, 0x96, 0xdc, 0xc2, 0xdf, 0x91, 0xb2, 0x90, 0x4d, 0xbb, + 0x81, 0xcb, 0x01, 0xaa, 0x42, 0xd3, 0x12, 0x10, 0x46, 0x77, 0x79, 0x61, + 0x62, 0x62, 0xed, 0xaa, 0x46, 0x5a, 0x67, 0xf2, 0x19, 0xba, 0xee, 0x9e, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x28, 0xff, 0x39, 0xcd, 0x87, 0xa0, 0x00, 0x40, 0x00, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x48, 0xff, 0x8e, 0x66, 0x20, 0xd1, 0xbc, 0x5b, 0x76, 0x04, + 0x2f, 0x09, 0x9b, 0xc5, 0x06, 0x7f, 0x4e, 0xb7, 0x26, 0x9f, 0x7c, 0xbc, + 0x18, 0x59, 0xc8, 0xe4, 0x80, 0xae, 0xef, 0xac, 0xe9, 0xa2, 0x12, 0x10, + 0x4c, 0x2e, 0x98, 0xba, 0xcc, 0xac, 0x5d, 0x8d, 0x39, 0x02, 0x1a, 0xcb, + 0x26, 0xea, 0x2d, 0x9a, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x28, 0xff, 0x39, 0xcd, 0x87, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x93, 0x8a, 0x54, 0xea, 0xa0, 0xf6, 0x46, 0xa0, 0x30, 0x43, 0x0b, 0xab, + 0x83, 0xae, 0x5c, 0xff, 0xcb, 0xef, 0x9e, 0x6c, 0xc1, 0x60, 0x77, 0xdb, + 0xb0, 0x52, 0x41, 0x0e, 0x8f, 0x5e, 0x71, 0x61, 0x12, 0x10, 0xd9, 0x43, + 0xf4, 0xe0, 0x79, 0xb5, 0xfa, 0xaa, 0xc1, 0x1c, 0x4f, 0x06, 0xcb, 0xa7, + 0x6d, 0xf0, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, + 0xff, 0x39, 0xcd, 0x87, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xcc, 0xc8, + 0xf0, 0xc2, 0x89, 0xb6, 0x55, 0xa7, 0xc8, 0x8b, 0xfc, 0x1a, 0x77, 0x31, + 0xd6, 0x2f, 0x0b, 0x9b, 0x6f, 0x80, 0x30, 0x82, 0x44, 0x90, 0x87, 0x81, + 0x4a, 0x3e, 0x08, 0xbf, 0x66, 0x0c, 0x12, 0x10, 0xba, 0xb6, 0x61, 0xb5, + 0x67, 0xaa, 0x5a, 0xfb, 0x54, 0xa9, 0xf7, 0x2d, 0x0a, 0xf5, 0x7e, 0x53, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0xff, 0x39, + 0xcd, 0x87, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x9b, 0xdc, 0x8d, 0x37, + 0xc5, 0x6e, 0x42, 0xe1, 0xb9, 0xd2, 0xf4, 0xa2, 0x3d, 0x35, 0xc8, 0xc9, + 0xd3, 0x98, 0xd7, 0xf4, 0x48, 0x99, 0x37, 0x29, 0x82, 0x1c, 0xd0, 0x09, + 0xf1, 0x3d, 0x6b, 0x2c, 0x12, 0x10, 0x7c, 0xdd, 0xf1, 0xf4, 0x4c, 0x0f, + 0xda, 0xf2, 0x11, 0xde, 0x1c, 0x63, 0x67, 0xf7, 0x64, 0xe3, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0xff, 0x39, 0xcd, 0x87, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xb6, 0x8c, 0xc4, 0xe3, 0x81, 0x2d, + 0x12, 0x8b, 0x4e, 0x34, 0xb0, 0xd1, 0x98, 0xfe, 0x3d, 0xac, 0xb9, 0x23, + 0x55, 0x2c, 0xd2, 0x92, 0x6f, 0xb8, 0x43, 0x29, 0x9e, 0xbc, 0x65, 0xf6, + 0x1c, 0xa7, 0x12, 0x10, 0x93, 0x46, 0x6d, 0x6f, 0xc4, 0x67, 0xaa, 0xa2, + 0x67, 0x00, 0x1d, 0x31, 0x4e, 0xce, 0xca, 0x56, 0x0a, 0x10, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, + 0x3d, 0x3d, 0x20, 0xaa, 0xee, 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(ODKGoldenLicenseV18, Both_CdmUseCase_UnlimitedStreaming_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x1a, 0xb9, 0xef, 0x9e, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x1a, 0xb9, 0xef, 0x9e, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0xf2, 0xb9, 0x77, 0xd5, + 0x84, 0xc8, 0x31, 0xbf, 0x0a, 0x20, 0x39, 0x41, 0x32, 0x39, 0x30, 0x42, + 0x35, 0x37, 0x43, 0x44, 0x32, 0x34, 0x34, 0x43, 0x38, 0x30, 0x34, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x1a, 0xb9, 0xef, 0x9e, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xe4, 0xe3, + 0x94, 0xff, 0x8b, 0x7b, 0xe0, 0x33, 0xbb, 0x8d, 0xe4, 0x12, 0xda, 0xa6, + 0xff, 0xb1, 0x0c, 0x12, 0x52, 0xb6, 0x18, 0x75, 0xca, 0x42, 0xc0, 0x79, + 0xa9, 0x1e, 0xce, 0x50, 0xe4, 0xdc, 0x12, 0x10, 0x19, 0x7a, 0x19, 0xaf, + 0x7a, 0x9d, 0x7a, 0x42, 0xcd, 0x63, 0x28, 0xdb, 0x60, 0x9b, 0xd7, 0xbb, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x1a, 0xb9, + 0xef, 0x9e, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x0a, 0xca, 0xc3, 0x4a, + 0xef, 0xc3, 0x1f, 0x88, 0xdb, 0x98, 0x0a, 0xe6, 0xfe, 0xdc, 0xd4, 0x1a, + 0xfe, 0x75, 0x70, 0x52, 0x40, 0x14, 0x8c, 0xc4, 0xfd, 0x31, 0x4e, 0x70, + 0x72, 0x0f, 0x3a, 0x16, 0x12, 0x10, 0x38, 0xa3, 0xf3, 0x06, 0x12, 0x23, + 0x3c, 0x90, 0xe6, 0x97, 0xce, 0xe5, 0x30, 0xf2, 0xf8, 0x74, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x1a, 0xb9, 0xef, 0x9e, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x3b, 0x0e, 0xfc, 0x2d, 0x2c, 0x09, + 0xee, 0x4e, 0x26, 0xac, 0x63, 0xa2, 0x78, 0x8f, 0x07, 0xa8, 0x1e, 0xf1, + 0xeb, 0x6b, 0xc5, 0x50, 0x4f, 0xca, 0xcb, 0x73, 0xe8, 0x6a, 0xec, 0x04, + 0x0c, 0x3f, 0x12, 0x10, 0xc6, 0x14, 0xa3, 0xcf, 0xd5, 0xb7, 0x6d, 0xc7, + 0x39, 0x53, 0x3f, 0xf8, 0xf9, 0xc2, 0x8e, 0x44, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x1a, 0xb9, 0xef, 0x9e, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x99, 0xb7, 0x72, 0x61, 0x4a, 0x47, 0xae, 0x57, + 0x5f, 0xf6, 0xfb, 0xd2, 0x86, 0x19, 0x56, 0x65, 0x3d, 0x79, 0x6c, 0x88, + 0x9d, 0xa2, 0x06, 0xf8, 0x50, 0x21, 0xda, 0x1a, 0xdc, 0xc6, 0xac, 0xd2, + 0x12, 0x10, 0x80, 0x2c, 0xbb, 0x2f, 0x10, 0x99, 0xbf, 0xc2, 0x10, 0xfa, + 0x04, 0x32, 0xc4, 0xb8, 0xe7, 0x77, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x1a, 0xb9, 0xef, 0x9e, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x19, 0x97, 0xf8, 0x93, 0x7a, 0xb2, 0x45, 0xde, 0x2d, 0x9e, + 0xc5, 0x3d, 0xae, 0xf6, 0xf9, 0xf0, 0xd1, 0x42, 0xa5, 0x51, 0x59, 0xbb, + 0x00, 0x9c, 0xa8, 0xd4, 0xe4, 0x32, 0x63, 0x39, 0x17, 0x87, 0x12, 0x10, + 0x3a, 0xef, 0x60, 0x77, 0x8d, 0x75, 0xa4, 0x72, 0x6c, 0x75, 0xaa, 0x72, + 0x77, 0xde, 0x02, 0xc6, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0x84, + 0xef, 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(ODKGoldenLicenseV18, Both_CdmUseCase_UnlimitedStreaming_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x8d, 0x57, 0x68, 0x72, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x8d, 0x57, 0x68, 0x72, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0xd1, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x26, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x47, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x35, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x13, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xbd, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xab, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x89, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x21, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa9, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x97, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x75, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0d, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xeb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x59, 0x32, 0x26, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x55, 0x6e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x46, + 0x37, 0x33, 0x44, 0x33, 0x42, 0x32, 0x32, 0x42, 0x42, 0x41, 0x37, 0x41, + 0x34, 0x45, 0x31, 0x34, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, + 0x01, 0x18, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x42, + 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x01, 0x78, + 0x01, 0x1a, 0x66, 0x20, 0x01, 0x1a, 0x50, 0x5d, 0x0d, 0x4a, 0x1f, 0x5f, + 0x83, 0x6c, 0xf4, 0x8f, 0x56, 0x85, 0x6f, 0x7c, 0xa1, 0x37, 0xb5, 0x26, + 0x29, 0xa0, 0x22, 0x46, 0x0b, 0xf3, 0x4e, 0xea, 0xc5, 0x71, 0x7e, 0x20, + 0x08, 0x95, 0xcb, 0x7c, 0xb1, 0x63, 0x4f, 0x5c, 0x4f, 0xd7, 0xde, 0x13, + 0x12, 0x72, 0x46, 0x30, 0x27, 0x9e, 0xad, 0x5a, 0x25, 0x8a, 0xe5, 0x64, + 0x2e, 0x48, 0xfc, 0x52, 0x95, 0x62, 0xb2, 0x4e, 0xd8, 0x6d, 0x14, 0xd4, + 0x9b, 0xd4, 0x98, 0x97, 0x68, 0x21, 0xe2, 0x0a, 0xe3, 0xcc, 0x27, 0xeb, + 0xfe, 0x47, 0x3e, 0x12, 0x10, 0x8b, 0x98, 0x83, 0x17, 0x2c, 0x86, 0x55, + 0x18, 0xbc, 0x7c, 0x65, 0x50, 0x7e, 0xb1, 0xaa, 0x53, 0x1a, 0x74, 0x62, + 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, + 0x00, 0x8d, 0x57, 0x68, 0x72, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, + 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xed, + 0x6c, 0xeb, 0xc4, 0x44, 0xc9, 0xa2, 0x37, 0x35, 0xfc, 0xa0, 0x15, 0x5b, + 0x22, 0xd3, 0xdd, 0xb7, 0x60, 0x8f, 0x7d, 0x37, 0xfb, 0xe9, 0x46, 0x3f, + 0x54, 0x81, 0x0d, 0x19, 0xc8, 0x66, 0x1e, 0x12, 0x10, 0x96, 0xbf, 0x5c, + 0xf6, 0xe9, 0x97, 0xa9, 0x50, 0x5c, 0x66, 0x0d, 0xe7, 0x82, 0x4a, 0xed, + 0x32, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, + 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8d, + 0x57, 0x68, 0x72, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, + 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x47, 0x20, 0xd3, + 0x75, 0xd1, 0xab, 0xb1, 0x83, 0x40, 0x9a, 0xbe, 0x30, 0xcf, 0xed, 0x5e, + 0x38, 0x41, 0x1d, 0x1f, 0x24, 0x56, 0xfb, 0x68, 0x2b, 0x5c, 0x6f, 0xe4, + 0x4a, 0xba, 0x9f, 0x83, 0xd3, 0x12, 0x10, 0x23, 0xe6, 0xff, 0x76, 0x47, + 0xca, 0xb8, 0xdf, 0x87, 0x5e, 0xd6, 0xf8, 0x0e, 0x7e, 0x1b, 0x54, 0x0a, + 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, + 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x57, 0x68, + 0x72, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, + 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x54, 0x82, 0xa0, 0x1f, 0x11, + 0x1a, 0x3a, 0x97, 0xbb, 0xb8, 0xd0, 0x5f, 0x8a, 0x1c, 0x46, 0x3f, 0xdf, + 0xeb, 0x1f, 0xa7, 0x6f, 0x76, 0x1e, 0xe4, 0x38, 0x1b, 0x2d, 0x0e, 0x16, + 0x18, 0x28, 0x2e, 0x12, 0x10, 0xc4, 0x4d, 0x7f, 0xe8, 0x06, 0x7c, 0xa7, + 0x9d, 0x8d, 0x57, 0x8e, 0x79, 0x36, 0x99, 0xd1, 0xee, 0x0a, 0x10, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, + 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x57, 0x68, 0x72, 0xa0, + 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, + 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, + 0x01, 0x20, 0x02, 0x1a, 0x20, 0x0b, 0xc5, 0x6f, 0x96, 0xd3, 0x5c, 0xeb, + 0x9f, 0xce, 0xe2, 0x5e, 0xcc, 0x18, 0x4b, 0x16, 0x93, 0x30, 0x4c, 0x54, + 0x93, 0xf7, 0xc2, 0x44, 0x6a, 0x55, 0x7d, 0xa9, 0x8f, 0xb4, 0x87, 0xe6, + 0xef, 0x12, 0x10, 0xfc, 0x24, 0x24, 0x57, 0xcd, 0xd5, 0x88, 0xbc, 0x8b, + 0x2b, 0x68, 0x39, 0x11, 0x07, 0xec, 0x05, 0x0a, 0x10, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x33, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x57, 0x68, 0x72, 0xa0, 0x00, 0x40, + 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, + 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, + 0x02, 0x1a, 0x20, 0xb7, 0xc4, 0xda, 0xb3, 0x69, 0xa9, 0xb8, 0x00, 0xce, + 0xf1, 0xae, 0x14, 0x78, 0xe3, 0xcd, 0x53, 0x04, 0x6a, 0x53, 0x3a, 0x21, + 0xb4, 0xf8, 0x93, 0xa5, 0x01, 0x90, 0x3f, 0x96, 0xf7, 0x03, 0x3f, 0x12, + 0x10, 0x94, 0x6b, 0xeb, 0xf2, 0xd4, 0x31, 0xf2, 0x53, 0x7e, 0x87, 0xff, + 0x92, 0x32, 0x98, 0x14, 0xba, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, + 0x92, 0xef, 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(ODKGoldenLicenseV18, Both_CdmUseCase_LicenseDuration_Case1_0) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x10, 0x13, 0x2c, 0xd0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x10, 0x13, 0x2c, 0xd0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x6e, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xe4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x8e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x7c, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x5a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x30, 0x28, 0x00, 0x20, 0x01, 0x12, 0x08, 0x45, 0xbd, 0x77, 0xd5, + 0x84, 0xc8, 0x31, 0xbf, 0x0a, 0x20, 0x37, 0x37, 0x33, 0x46, 0x46, 0x38, + 0x38, 0x37, 0x45, 0x43, 0x41, 0x41, 0x41, 0x46, 0x35, 0x44, 0x34, 0x34, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x28, + 0x28, 0x28, 0x30, 0x28, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x74, 0x62, 0x00, + 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, + 0x10, 0x13, 0x2c, 0xd0, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x76, 0x44, + 0x2f, 0xe8, 0xe6, 0xc6, 0x69, 0xd7, 0xe6, 0x58, 0x52, 0xa2, 0x55, 0x21, + 0xff, 0x35, 0x18, 0x6e, 0xf4, 0xd1, 0xcf, 0xf7, 0xa6, 0x3f, 0x28, 0x1b, + 0x9c, 0xb9, 0x7c, 0xd5, 0x55, 0xf3, 0x12, 0x10, 0x84, 0x64, 0x82, 0xfd, + 0x48, 0xb2, 0x95, 0x64, 0x40, 0xfb, 0xdb, 0x52, 0xf0, 0x65, 0xeb, 0x4c, + 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x10, 0x13, + 0x2c, 0xd0, 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xca, 0x46, 0xaa, 0xa0, + 0x09, 0x72, 0x53, 0x17, 0x0d, 0x87, 0x93, 0xef, 0x04, 0x54, 0x58, 0x2f, + 0x23, 0xfc, 0x5b, 0xa2, 0x3b, 0xf4, 0x92, 0x85, 0x20, 0x7c, 0x70, 0x89, + 0x74, 0x8b, 0xa7, 0xdf, 0x12, 0x10, 0x89, 0xe6, 0x26, 0xe0, 0xea, 0x66, + 0xc9, 0xfe, 0xe5, 0x00, 0x49, 0x97, 0xb1, 0x44, 0x5f, 0xd0, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x10, 0x13, 0x2c, 0xd0, + 0xa0, 0x00, 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x49, 0x88, 0xb9, 0x28, 0x94, 0xb7, + 0x79, 0x98, 0x26, 0xcb, 0x73, 0xa7, 0x46, 0x7a, 0xad, 0xff, 0x67, 0x6f, + 0xd6, 0x6d, 0xb1, 0xa4, 0xbf, 0x77, 0x00, 0x47, 0x41, 0x5b, 0x46, 0xb8, + 0xd7, 0x8c, 0x12, 0x10, 0x6e, 0x4c, 0x66, 0x7f, 0xf8, 0x13, 0x1a, 0xe7, + 0x39, 0x37, 0x0a, 0x10, 0xbf, 0x2e, 0x3f, 0x60, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x32, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x10, 0x13, 0x2c, 0xd0, 0xa0, 0x00, + 0x00, 0x08, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0xd4, 0x6e, 0xdd, 0x52, 0x3a, 0xef, 0x82, 0x79, + 0xb0, 0xc2, 0x65, 0x82, 0x1a, 0x95, 0x42, 0x7a, 0xaf, 0x08, 0x20, 0xeb, + 0x6b, 0x8d, 0xc8, 0x66, 0x76, 0x82, 0xee, 0x21, 0x20, 0x98, 0x94, 0xd1, + 0x12, 0x10, 0x1f, 0xd3, 0x15, 0x4c, 0xaa, 0xd4, 0xa4, 0xea, 0x38, 0x26, + 0xaf, 0x2b, 0x83, 0x8d, 0xb9, 0x41, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x28, 0x10, 0x13, 0x2c, 0xd0, 0xa0, 0x00, 0x00, 0x08, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x02, 0xb7, 0xe2, 0x66, 0x85, 0x9c, 0x89, 0xc5, 0x1a, 0xc2, + 0x64, 0xd1, 0xad, 0x54, 0xe1, 0x8c, 0xc6, 0x58, 0xa2, 0xef, 0x16, 0x6c, + 0xba, 0x07, 0x53, 0x3a, 0xf4, 0xf0, 0x91, 0xdb, 0x98, 0xfa, 0x12, 0x10, + 0x66, 0x4e, 0xc3, 0xd9, 0x5b, 0xd1, 0xae, 0x03, 0x7c, 0x7d, 0x02, 0x3d, + 0x46, 0x63, 0x5b, 0x8a, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xa0, + 0xef, 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(ODKGoldenLicenseV18, Both_CdmUseCase_LicenseDuration_Case1_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x02, 0x00, 0x12, + 0x6c, 0x30, 0xc9, 0x6a, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x02, 0x00, 0x00, 0x01, 0x39, 0x00, 0x02, 0x00, 0x12, + 0x6c, 0x30, 0xc9, 0x6a, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0xce, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x23, 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, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x44, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x32, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, + 0xba, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xa8, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x1e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xfc, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0xa6, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x94, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, + 0x72, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, + 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x0a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0xe8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, + 0x10, + }; + core_response_ = + std::string(reinterpret_cast(core_response_raw), + sizeof(core_response_raw)); + const uint8_t serialized_license_raw[] = { + 0x0a, 0x56, 0x32, 0x23, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, + 0x69, 0x73, 0x74, 0x28, 0x00, 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x46, 0x33, 0x30, 0x42, + 0x34, 0x32, 0x34, 0x45, 0x37, 0x32, 0x45, 0x39, 0x44, 0x42, 0x31, 0x34, + 0x34, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, 0x10, 0x01, 0x18, 0x00, + 0x20, 0x28, 0x28, 0x28, 0x30, 0x28, 0x38, 0x00, 0x42, 0x00, 0x48, 0x00, + 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x1a, 0x66, + 0x20, 0x01, 0x1a, 0x50, 0x88, 0x49, 0x61, 0x40, 0xdb, 0x33, 0x95, 0x3c, + 0x00, 0x45, 0xe8, 0x2a, 0x7f, 0x4f, 0x19, 0xf5, 0xa9, 0x95, 0x0c, 0x87, + 0x9a, 0x3a, 0x07, 0xac, 0x9b, 0x2d, 0xc1, 0xe7, 0x33, 0x3f, 0x02, 0xcd, + 0xab, 0xa8, 0x28, 0x59, 0x4a, 0x87, 0xe8, 0x34, 0x2e, 0x59, 0xb5, 0xbf, + 0x0d, 0x5a, 0xea, 0x48, 0x92, 0xb5, 0x6a, 0x4d, 0x9f, 0x3b, 0x05, 0x77, + 0x1e, 0xf0, 0xc6, 0x86, 0x7f, 0xf6, 0xda, 0x86, 0x63, 0xa1, 0x83, 0xcb, + 0xa8, 0x42, 0xa6, 0x8f, 0x1d, 0x51, 0x7e, 0x30, 0x3d, 0x8e, 0x9d, 0xd3, + 0x12, 0x10, 0xa8, 0x5d, 0x94, 0xdf, 0x84, 0xa9, 0x21, 0xfe, 0x34, 0xf5, + 0x1c, 0x46, 0x91, 0x3f, 0x5a, 0xd3, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, + 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x6c, 0x30, + 0xc9, 0x6a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, + 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0xcd, 0xf2, 0x1a, 0x88, + 0x12, 0x76, 0x9c, 0xe3, 0xa4, 0xd2, 0x4e, 0xb4, 0x47, 0x7e, 0x5f, 0xbd, + 0x3d, 0xf3, 0xb6, 0x8b, 0x08, 0x2a, 0x08, 0xd2, 0x8c, 0x48, 0xc1, 0x2a, + 0x7d, 0xea, 0x7c, 0x1d, 0x12, 0x10, 0xcc, 0x3a, 0x0a, 0x97, 0x77, 0x32, + 0x0a, 0x3e, 0xba, 0x4e, 0x4b, 0x49, 0x0c, 0x31, 0x20, 0xbf, 0x0a, 0x10, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, + 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x6c, 0x30, 0xc9, 0x6a, + 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, + 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, 0x4f, 0xab, 0x30, 0xee, 0xcb, 0xd8, + 0x98, 0x92, 0x98, 0x9e, 0x68, 0xc6, 0xec, 0x62, 0x10, 0xbd, 0x77, 0x1b, + 0xdd, 0x76, 0xf9, 0x3d, 0x54, 0xbd, 0x4d, 0xdf, 0xc1, 0x2c, 0x1b, 0x99, + 0xc4, 0xbc, 0x12, 0x10, 0x9e, 0xc1, 0x2c, 0xe9, 0x27, 0x28, 0x8e, 0x10, + 0xc3, 0x10, 0x4a, 0x29, 0x0c, 0xd4, 0xe0, 0xf3, 0x0a, 0x10, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x31, 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, + 0x31, 0x38, 0x00, 0x00, 0x00, 0x28, 0x6c, 0x30, 0xc9, 0x6a, 0xa0, 0x00, + 0x40, 0x00, 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, + 0x32, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, + 0x20, 0x02, 0x1a, 0x20, 0x12, 0x21, 0x5b, 0x6b, 0x76, 0xe1, 0xb1, 0x54, + 0xee, 0x90, 0xb5, 0x9e, 0x07, 0x52, 0x83, 0x90, 0x6e, 0x59, 0xed, 0x1b, + 0x7c, 0xda, 0xa5, 0x54, 0xd7, 0xed, 0x8b, 0x2a, 0x1d, 0x71, 0xeb, 0x11, + 0x12, 0x10, 0xd2, 0x5b, 0xd0, 0x80, 0x0e, 0x79, 0x33, 0xc2, 0xfb, 0xf6, + 0x5c, 0xc8, 0xbf, 0x70, 0x4b, 0xfb, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, + 0x1a, 0x74, 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, + 0x00, 0x00, 0x00, 0x28, 0x6c, 0x30, 0xc9, 0x6a, 0xa0, 0x00, 0x40, 0x00, + 0x3a, 0x08, 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, + 0x1a, 0x20, 0x12, 0xfc, 0x46, 0xad, 0xa8, 0x4a, 0xa6, 0x32, 0x3f, 0xbd, + 0x56, 0x2c, 0xc5, 0xd7, 0x9e, 0x4b, 0xd1, 0x58, 0x5d, 0xdb, 0x11, 0x4c, + 0x98, 0xde, 0x7e, 0xfa, 0x76, 0x53, 0xfd, 0x26, 0x16, 0x3d, 0x12, 0x10, + 0x70, 0x32, 0x63, 0x16, 0x9d, 0xf9, 0xe6, 0xbd, 0x98, 0x15, 0x4d, 0xa5, + 0x64, 0x37, 0x80, 0xdf, 0x0a, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x1a, 0x74, + 0x62, 0x00, 0x42, 0x12, 0x0a, 0x10, 0x6b, 0x63, 0x31, 0x38, 0x00, 0x00, + 0x00, 0x28, 0x6c, 0x30, 0xc9, 0x6a, 0xa0, 0x00, 0x40, 0x00, 0x3a, 0x08, + 0x08, 0x00, 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x32, 0x08, 0x08, 0x00, + 0x10, 0x2a, 0x18, 0x00, 0x20, 0x00, 0x28, 0x01, 0x20, 0x02, 0x1a, 0x20, + 0x73, 0x93, 0xe0, 0xf1, 0x39, 0xcb, 0x32, 0xc1, 0xb7, 0x33, 0x0f, 0x1f, + 0x98, 0xd2, 0x7c, 0x88, 0xc0, 0x8c, 0xcb, 0x5e, 0x9f, 0x75, 0xe7, 0xb7, + 0x6b, 0x0c, 0x30, 0x8b, 0x7a, 0xb0, 0x90, 0xff, 0x12, 0x10, 0x31, 0x6b, + 0xc7, 0xf8, 0x79, 0xa1, 0x32, 0xbd, 0x66, 0x86, 0x11, 0x42, 0x8c, 0xcc, + 0x8d, 0x21, 0x0a, 0x10, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x3d, 0x3d, 0x20, 0xc6, 0xef, 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(ODKGoldenRenewalV18, Both_CdmUseCase_LicenseWithRenewal_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x0c, 0x6a, 0x70, 0xec, 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, 0x12, + 0x0c, 0x6a, 0x70, 0xec, 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, 0x31, 0x28, 0x01, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x39, 0x36, + 0x37, 0x33, 0x45, 0x32, 0x43, 0x31, 0x37, 0x46, 0x32, 0x41, 0x41, + 0x44, 0x42, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x00, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, + 0x0a, 0x42, 0x00, 0x48, 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x01, 0x20, 0xd7, 0xe7, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_LicenseWithRenewal_Case1_0_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x0c, 0x6a, 0x70, 0xec, 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, 0x12, + 0x0c, 0x6a, 0x70, 0xec, 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, 0x31, 0x28, 0x04, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x39, 0x36, + 0x37, 0x33, 0x45, 0x32, 0x43, 0x31, 0x37, 0x46, 0x32, 0x41, 0x41, + 0x44, 0x42, 0x32, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x00, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, + 0x0a, 0x42, 0x00, 0x48, 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x01, 0x20, 0x9c, 0xe8, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, + Both_CdmUseCase_LicenseWithRenewalPlayback_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x05, 0xd3, 0xe8, 0xe8, 0x00, 0x00, 0x00, 0x2c, + 0x00, 0x00, 0x00, 0x00, 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, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x02, 0x00, 0x12, + 0x05, 0xd3, 0xe8, 0xe8, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x24, 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, 0x31, 0x28, 0x02, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x34, 0x42, 0x44, + 0x43, 0x35, 0x37, 0x34, 0x39, 0x37, 0x34, 0x45, 0x39, 0x36, 0x31, + 0x35, 0x36, 0x32, 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x00, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, + 0x0a, 0x42, 0x00, 0x48, 0x0f, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x01, 0x20, 0xd4, 0xe9, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 25; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_LimitedDurationLicense_Case1_0_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x1d, 0x71, 0xab, 0x3b, 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, 0x12, + 0x1d, 0x71, 0xab, 0x3b, 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, 0x31, 0x28, 0x01, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x42, 0x44, 0x46, 0x30, 0x45, + 0x34, 0x42, 0x39, 0x30, 0x34, 0x32, 0x41, 0x42, 0x38, 0x30, 0x41, 0x32, + 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x80, 0xe7, 0x84, 0x0f, 0x42, 0x00, + 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, + 0x20, 0x9d, 0xeb, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_LimitedDurationLicense_Case1_1_3) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0xd4, 0x57, 0xcc, 0x27, 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, 0x12, + 0xd4, 0x57, 0xcc, 0x27, 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, 0x5d, 0x32, 0x2a, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x63, + 0x61, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x01, + 0x20, 0x02, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x0a, 0x20, 0x39, 0x35, 0x31, 0x38, 0x34, 0x35, 0x33, 0x39, 0x36, + 0x34, 0x31, 0x31, 0x46, 0x31, 0x45, 0x38, 0x32, 0x45, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, + 0x1f, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, + 0x00, 0x38, 0x80, 0xe7, 0x84, 0x0f, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, + 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, 0x20, 0xbe, 0xeb, 0x92, + 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_RenewOnLicenseLoad_Case1L_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x84, 0x57, 0x13, 0x9e, 0x00, 0x00, 0x00, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + }; + 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, 0x12, + 0x84, 0x57, 0x13, 0x9e, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 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, 0x31, 0x28, 0x01, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x34, 0x31, 0x35, 0x34, 0x39, + 0x42, 0x42, 0x46, 0x44, 0x36, 0x45, 0x36, 0x38, 0x42, 0x32, 0x37, 0x33, + 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, 0x00, 0x18, 0x00, 0x20, + 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x80, 0xe7, 0x84, 0x0f, 0x42, 0x00, + 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x01, + 0x20, 0x85, 0xed, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_RenewOnLicenseLoad_Case1L_1_2) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0xb8, 0xfc, 0x76, 0x3a, 0x00, 0x00, 0x00, 0x3e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + }; + 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, 0x12, + 0xb8, 0xfc, 0x76, 0x3a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 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, 0x59, 0x32, 0x26, 0x70, 0x73, 0x74, 0x5f, 0x43, 0x44, 0x4d, 0x5f, + 0x52, 0x65, 0x6e, 0x65, 0x77, 0x4f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, + 0x73, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x28, 0x01, 0x20, 0x02, 0x12, 0x09, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x30, + 0x45, 0x42, 0x34, 0x39, 0x44, 0x34, 0x37, 0x39, 0x32, 0x32, 0x37, 0x32, + 0x33, 0x31, 0x45, 0x33, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1f, 0x08, 0x01, 0x10, + 0x00, 0x18, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x80, 0xe7, + 0x84, 0x0f, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x01, 0x20, 0xb0, 0xed, 0x92, 0xa2, 0x06, + }; + renewal_ = std::string(reinterpret_cast(renewal_raw), + sizeof(renewal_raw)); + renewal_duration_seconds_ = 31536000; + RunTest(); +} + +TEST_F(ODKGoldenRenewalV18, Both_CdmUseCase_Heartbeat_Case1_0_1) { + const uint8_t core_request_raw[] = { + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x02, + 0x00, 0x12, 0x65, 0x6d, 0xbf, 0xb7, 0x00, 0x00, 0x00, 0x40, + 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, 0x12, + 0x65, 0x6d, 0xbf, 0xb7, 0x00, 0x00, 0x00, 0x40, 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, 0x31, 0x28, 0x03, 0x20, 0x01, 0x12, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x0a, 0x20, 0x38, 0x33, 0x37, + 0x34, 0x42, 0x32, 0x38, 0x39, 0x36, 0x46, 0x31, 0x33, 0x34, 0x46, + 0x33, 0x36, 0x33, 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x12, 0x1c, 0x08, 0x01, + 0x10, 0x00, 0x18, 0x01, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, + 0x1e, 0x42, 0x00, 0x48, 0x0a, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, + 0x70, 0x00, 0x78, 0x00, 0x20, 0x86, 0xee, 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 a244d25..71073fc 100644 --- a/oemcrypto/odk/test/odk_test.cpp +++ b/oemcrypto/odk/test/odk_test.cpp @@ -4,16 +4,22 @@ #include "odk.h" +#include #include #include +#include #include +#include #include "OEMCryptoCENCCommon.h" #include "core_message_deserialize.h" #include "core_message_features.h" #include "core_message_serialize.h" +#include "core_message_serialize_proto.h" #include "core_message_types.h" #include "gtest/gtest.h" +#include "odk_overflow.h" +#include "odk_structs.h" #include "odk_structs_priv.h" #include "odk_test_helper.h" @@ -21,11 +27,16 @@ namespace wvodk_test { namespace { +using oemcrypto_core_message::ODK_CommonRequest; using oemcrypto_core_message::ODK_LicenseRequest; +using oemcrypto_core_message::ODK_MessageCounter; +using oemcrypto_core_message::ODK_Provisioning40Request; using oemcrypto_core_message::ODK_ProvisioningRequest; using oemcrypto_core_message::ODK_RenewalRequest; +using oemcrypto_core_message::deserialize::CoreCommonRequestFromMessage; using oemcrypto_core_message::deserialize::CoreLicenseRequestFromMessage; +using oemcrypto_core_message::deserialize::CoreProvisioning40RequestFromMessage; using oemcrypto_core_message::deserialize::CoreProvisioningRequestFromMessage; using oemcrypto_core_message::deserialize::CoreRenewalRequestFromMessage; using oemcrypto_core_message::deserialize:: @@ -34,7 +45,10 @@ using oemcrypto_core_message::deserialize:: using oemcrypto_core_message::features::CoreMessageFeatures; using oemcrypto_core_message::serialize::CreateCoreLicenseResponse; +using oemcrypto_core_message::serialize::CreateCoreProvisioning40Response; using oemcrypto_core_message::serialize::CreateCoreProvisioningResponse; +using oemcrypto_core_message::serialize:: + CreateCoreProvisioningResponseFromProto; using oemcrypto_core_message::serialize::CreateCoreRenewalResponse; constexpr uint32_t kExtraPayloadSize = 128u; @@ -59,6 +73,40 @@ void PrintTo(const VersionParameters& p, std::ostream* os) { << p.response_minor_version; } +void SetDefaultSerializedProvisioningResponse(std::string* serialized_message) { + // Create a dummy provisioning response + video_widevine::ProvisioningResponse provisioning_response; + provisioning_response.set_device_certificate("device_certificate"); + provisioning_response.set_device_rsa_key("device_rsa_key"); + provisioning_response.set_device_rsa_key_iv("device_rsa_key_iv"); + if (!provisioning_response.SerializeToString(serialized_message)) { + FAIL(); + } +} + +bool CheckCounterInfoIsEqual(ODK_MessageCounterInfo* a, ODK_MessageCounter* b) { + if (!a || !b) return false; + + EXPECT_EQ(a->master_generation_number, b->master_generation_number); + EXPECT_EQ(a->provisioning_count, b->provisioning_count); + EXPECT_EQ(a->license_count, b->license_count); + EXPECT_EQ(a->decrypt_count, b->decrypt_count); + EXPECT_EQ(a->major_version, b->major_version); + EXPECT_EQ(a->minor_version, b->minor_version); + EXPECT_EQ(a->patch_version, b->patch_version); + for (size_t i = 0; i < sizeof(a->soc_vendor); i++) { + EXPECT_EQ(a->soc_vendor[i], b->soc_vendor[i]); + } + for (size_t i = 0; i < sizeof(a->chipset_model); i++) { + EXPECT_EQ(a->chipset_model[i], b->chipset_model[i]); + } + for (size_t i = 0; i < sizeof(a->extra); i++) { + EXPECT_EQ(a->extra[i], b->extra[i]); + } + + return true; +} + template void ValidateRequest(uint32_t message_type, const std::vector& extra_fields, @@ -241,13 +289,19 @@ TEST(OdkTest, NullRequestTest) { memset(&nonce_values, 0, sizeof(nonce_values)); ODK_ClockValues clock_values; memset(&clock_values, 0, sizeof(clock_values)); + ODK_MessageCounterInfo counter_info; + memset(&counter_info, 0, sizeof(counter_info)); // Assert that nullptr does not cause a core dump. - EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreLicenseRequest( - nullptr, 0uL, nullptr, &nonce_values)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, + ODK_PrepareCoreLicenseRequest(nullptr, 0uL, nullptr, &nonce_values, + &counter_info)); EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreLicenseRequest(nullptr, 0uL, &core_message_length, - nullptr)); + nullptr, &counter_info)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, + ODK_PrepareCoreLicenseRequest(nullptr, 0uL, &core_message_length, + &nonce_values, nullptr)); EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreRenewalRequest(nullptr, 0uL, nullptr, &nonce_values, @@ -261,18 +315,49 @@ TEST(OdkTest, NullRequestTest) { EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreProvisioningRequest( - nullptr, 0uL, &core_message_length, nullptr, nullptr, 0uL)); + nullptr, 0uL, &core_message_length, nullptr, &counter_info)); EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreProvisioningRequest(nullptr, 0uL, nullptr, - &nonce_values, nullptr, 0uL)); + &nonce_values, &counter_info)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, + ODK_PrepareCoreProvisioningRequest( + nullptr, 0uL, &core_message_length, &nonce_values, nullptr)); + + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreProvisioning40Request( + nullptr, 0uL, &core_message_length, + nullptr, nullptr, 0uL, &counter_info)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreProvisioning40Request( + nullptr, 0uL, nullptr, &nonce_values, + nullptr, 0uL, &counter_info)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreProvisioning40Request( + nullptr, 0uL, &core_message_length, + &nonce_values, nullptr, 0uL, nullptr)); // Null device id in provisioning request is ok - uint8_t message[ODK_PROVISIONING_REQUEST_SIZE] = {0}; - core_message_length = ODK_PROVISIONING_REQUEST_SIZE; - EXPECT_EQ(OEMCrypto_SUCCESS, - ODK_PrepareCoreProvisioningRequest( - message, ODK_PROVISIONING_REQUEST_SIZE, &core_message_length, - &nonce_values, nullptr, 0uL)); + if (nonce_values.api_major_version > 17) { + uint8_t message[ODK_PROVISIONING_REQUEST_SIZE] = {0}; + core_message_length = ODK_PROVISIONING_REQUEST_SIZE; + EXPECT_EQ(OEMCrypto_SUCCESS, + ODK_PrepareCoreProvisioningRequest( + message, ODK_PROVISIONING_REQUEST_SIZE, &core_message_length, + &nonce_values, &counter_info)); + } else { + uint8_t message[ODK_PROVISIONING_REQUEST_SIZE_V17] = {0}; + core_message_length = ODK_PROVISIONING_REQUEST_SIZE_V17; + EXPECT_EQ(OEMCrypto_SUCCESS, + ODK_PrepareCoreProvisioningRequest( + message, ODK_PROVISIONING_REQUEST_SIZE_V17, + &core_message_length, &nonce_values, &counter_info)); + } + + // Null device info in provisioning 4.0 request is ok + uint8_t message_prov4[ODK_PROVISIONING40_REQUEST_SIZE] = {0}; + core_message_length = ODK_PROVISIONING40_REQUEST_SIZE; + EXPECT_EQ( + OEMCrypto_SUCCESS, + ODK_PrepareCoreProvisioning40Request( + message_prov4, ODK_PROVISIONING40_REQUEST_SIZE, &core_message_length, + &nonce_values, nullptr, 0uL, &counter_info)); EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreRenewedProvisioningRequest( @@ -316,26 +401,26 @@ TEST(OdkTest, NullResponseTest) { memset(&clock_values, 0, sizeof(clock_values)); // Assert that nullptr does not cause a core dump. - EXPECT_EQ( - ODK_ERROR_CORE_MESSAGE, - ODK_ParseLicense(message, message_size, core_message_length, true, true, - &timer_limits, &clock_values, &nonce_values, nullptr)); - EXPECT_EQ( - ODK_ERROR_CORE_MESSAGE, - ODK_ParseLicense(message, message_size, core_message_length, true, true, - &timer_limits, &clock_values, nullptr, &parsed_license)); - EXPECT_EQ( - ODK_ERROR_CORE_MESSAGE, - ODK_ParseLicense(message, message_size, core_message_length, true, true, - &timer_limits, nullptr, &nonce_values, &parsed_license)); - EXPECT_EQ( - ODK_ERROR_CORE_MESSAGE, - ODK_ParseLicense(message, message_size, core_message_length, true, true, - nullptr, &clock_values, &nonce_values, &parsed_license)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, + ODK_ParseLicense(message, message_size, core_message_length, true, + true, 0, &timer_limits, &clock_values, + &nonce_values, nullptr, nullptr)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, + ODK_ParseLicense(message, message_size, core_message_length, true, + true, 0, &timer_limits, &clock_values, nullptr, + &parsed_license, nullptr)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, + ODK_ParseLicense(message, message_size, core_message_length, true, + true, 0, &timer_limits, nullptr, &nonce_values, + &parsed_license, nullptr)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, + ODK_ParseLicense(message, message_size, core_message_length, true, + true, 0, nullptr, &clock_values, &nonce_values, + &parsed_license, nullptr)); EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_ParseLicense(nullptr, message_size, core_message_length, true, - true, &timer_limits, &clock_values, &nonce_values, - &parsed_license)); + true, 0, &timer_limits, &clock_values, + &nonce_values, &parsed_license, nullptr)); constexpr uint64_t system_time = 0; uint64_t timer_value = 0; @@ -373,6 +458,13 @@ TEST(OdkTest, NullResponseTest) { ODK_ParseProvisioning(nullptr, message_size, core_message_length, &nonce_values, device_id, ODK_DEVICE_ID_LEN_MAX, &parsed_response)); + + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, + ODK_ParseProvisioning40(message, message_size, core_message_length, + nullptr)); + EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, + ODK_ParseProvisioning40(nullptr, message_size, core_message_length, + &nonce_values)); } TEST(OdkTest, PrepareCoreLicenseRequest) { @@ -380,9 +472,12 @@ TEST(OdkTest, PrepareCoreLicenseRequest) { size_t core_message_length = sizeof(license_message); ODK_NonceValues nonce_values; memset(&nonce_values, 0, sizeof(nonce_values)); - EXPECT_EQ(OEMCrypto_SUCCESS, ODK_PrepareCoreLicenseRequest( - license_message, sizeof(license_message), - &core_message_length, &nonce_values)); + ODK_MessageCounterInfo counter_info; + memset(&counter_info, 0, sizeof(counter_info)); + EXPECT_EQ(OEMCrypto_SUCCESS, + ODK_PrepareCoreLicenseRequest( + license_message, sizeof(license_message), &core_message_length, + &nonce_values, &counter_info)); } TEST(OdkTest, PrepareCoreLicenseRequestSize) { @@ -390,18 +485,20 @@ TEST(OdkTest, PrepareCoreLicenseRequestSize) { size_t core_message_length = sizeof(license_message); ODK_NonceValues nonce_values; memset(&nonce_values, 0, sizeof(nonce_values)); + ODK_MessageCounterInfo counter_info; + memset(&counter_info, 0, sizeof(counter_info)); // message length smaller than core message length size_t core_message_length_invalid = core_message_length + 1; EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, ODK_PrepareCoreLicenseRequest( license_message, sizeof(license_message), - &core_message_length_invalid, &nonce_values)); + &core_message_length_invalid, &nonce_values, &counter_info)); // message length larger than core message length uint8_t license_message_large[ODK_LICENSE_REQUEST_SIZE * 2] = {0}; EXPECT_EQ(OEMCrypto_SUCCESS, - ODK_PrepareCoreLicenseRequest(license_message_large, - sizeof(license_message_large), - &core_message_length, &nonce_values)); + ODK_PrepareCoreLicenseRequest( + license_message_large, sizeof(license_message_large), + &core_message_length, &nonce_values, &counter_info)); } TEST(OdkTest, PrepareCoreRenewalRequest) { @@ -446,12 +543,27 @@ TEST(OdkTest, PrepareCoreProvisioningRequest) { size_t core_message_length = sizeof(provisioning_message); ODK_NonceValues nonce_values; memset(&nonce_values, 0, sizeof(nonce_values)); - uint8_t device_id[ODK_DEVICE_ID_LEN_MAX] = {0}; - EXPECT_EQ( - OEMCrypto_SUCCESS, - ODK_PrepareCoreProvisioningRequest( - provisioning_message, sizeof(provisioning_message), - &core_message_length, &nonce_values, device_id, sizeof(device_id))); + ODK_MessageCounterInfo counter_info; + memset(&counter_info, 0, sizeof(counter_info)); + EXPECT_EQ(OEMCrypto_SUCCESS, + ODK_PrepareCoreProvisioningRequest( + provisioning_message, sizeof(provisioning_message), + &core_message_length, &nonce_values, &counter_info)); +} + +TEST(OdkTest, PrepareCoreProvisioning40Request) { + uint8_t provisioning_message[ODK_PROVISIONING40_REQUEST_SIZE] = {0}; + size_t core_message_length = sizeof(provisioning_message); + ODK_NonceValues nonce_values; + memset(&nonce_values, 0, sizeof(nonce_values)); + ODK_MessageCounterInfo counter_info; + memset(&counter_info, 0, sizeof(counter_info)); + uint8_t device_info[ODK_DEVICE_INFO_LEN_MAX] = {0}; + EXPECT_EQ(OEMCrypto_SUCCESS, + ODK_PrepareCoreProvisioning40Request( + provisioning_message, sizeof(provisioning_message), + &core_message_length, &nonce_values, device_info, + sizeof(device_info), &counter_info)); } TEST(OdkTest, PrepareCoreRenewedProvisioningRequest) { @@ -469,17 +581,19 @@ TEST(OdkTest, PrepareCoreRenewedProvisioningRequest) { OEMCrypto_RenewalACert, renewal_data, sizeof(renewal_data))); } -TEST(OdkTest, PrepareCoreProvisioningRequestDeviceId) { - uint8_t provisioning_message[ODK_PROVISIONING_REQUEST_SIZE] = {0}; +TEST(OdkTest, PrepareCoreProvisioning40RequestDeviceInfo) { + uint8_t provisioning_message[ODK_PROVISIONING40_REQUEST_SIZE] = {0}; size_t core_message_length = sizeof(provisioning_message); ODK_NonceValues nonce_values; memset(&nonce_values, 0, sizeof(nonce_values)); - uint8_t device_id_invalid[ODK_DEVICE_ID_LEN_MAX + 1] = {0}; + ODK_MessageCounterInfo counter_info; + memset(&counter_info, 0, sizeof(counter_info)); + uint8_t device_info_invalid[ODK_DEVICE_INFO_LEN_MAX + 1] = {0}; EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, - ODK_PrepareCoreProvisioningRequest( + ODK_PrepareCoreProvisioning40Request( provisioning_message, sizeof(provisioning_message), - &core_message_length, &nonce_values, device_id_invalid, - sizeof(device_id_invalid))); + &core_message_length, &nonce_values, device_info_invalid, + sizeof(device_info_invalid), &counter_info)); } TEST(OdkTest, PrepareCoreRenewedProvisioningRequestDeviceId) { @@ -514,13 +628,36 @@ TEST(OdkTest, PrepareCoreRenewedProvisioningRequestRenewalDataInvalid) { // Serialize and de-serialize license request TEST(OdkTest, LicenseRequestRoundtrip) { - std::vector empty; + ODK_MessageCounterInfo counter_info; + counter_info.master_generation_number = 0x12345678abcdffff; + counter_info.provisioning_count = 12; + counter_info.license_count = 50; + counter_info.decrypt_count = 340; + counter_info.major_version = ODK_MAJOR_VERSION; + counter_info.minor_version = ODK_MINOR_VERSION; + counter_info.patch_version = 4; + memset(counter_info.soc_vendor, 0xff, sizeof(counter_info.soc_vendor)); + memset(counter_info.chipset_model, 0xdd, sizeof(counter_info.chipset_model)); + memset(counter_info.extra, 0xee, sizeof(counter_info.extra)); + std::vector extra_fields = { + {ODK_MESSAGECOUNTER, &counter_info, "counter_info"}, + }; auto odk_prepare_func = [&](uint8_t* const buf, size_t* size, ODK_NonceValues* nonce_values) { - return ODK_PrepareCoreLicenseRequest(buf, SIZE_MAX, size, nonce_values); + return ODK_PrepareCoreLicenseRequest(buf, SIZE_MAX, size, nonce_values, + &counter_info); }; - auto kdo_parse_func = CoreLicenseRequestFromMessage; - ValidateRequest(ODK_License_Request_Type, empty, + auto kdo_parse_func = [&](const std::string& oemcrypto_core_message, + ODK_LicenseRequest* core_license_request) { + bool ok = CoreLicenseRequestFromMessage(oemcrypto_core_message, + core_license_request); + if (!ok) return false; + + ok = CheckCounterInfoIsEqual(&counter_info, + &core_license_request->counter_info); + return ok; + }; + ValidateRequest(ODK_License_Request_Type, extra_fields, odk_prepare_func, kdo_parse_func); } @@ -550,23 +687,38 @@ TEST(OdkTest, RenewalRequestRoundtrip) { } TEST(OdkTest, ProvisionRequestRoundtrip) { - uint32_t device_id_length = ODK_DEVICE_ID_LEN_MAX / 2; - uint8_t device_id[ODK_DEVICE_ID_LEN_MAX] = {0}; - memset(device_id, 0xff, device_id_length); + ODK_MessageCounterInfo counter_info; + counter_info.master_generation_number = 0x12345678abcdffff; + counter_info.provisioning_count = 12; + counter_info.license_count = 50; + counter_info.decrypt_count = 340; + counter_info.major_version = ODK_MAJOR_VERSION; + counter_info.minor_version = ODK_MINOR_VERSION; + counter_info.patch_version = 4; + memset(counter_info.soc_vendor, 0xff, sizeof(counter_info.soc_vendor)); + memset(counter_info.chipset_model, 0xdd, sizeof(counter_info.chipset_model)); + memset(counter_info.extra, 0xee, sizeof(counter_info.extra)); + // Fake device_id_length for older servers, since we removed device id from + // the v18 request + uint32_t fake_device_id_length = 64; std::vector extra_fields = { - {ODK_UINT32, &device_id_length, "device_id_length"}, - {ODK_DEVICEID, device_id, "device_id"}, + {ODK_UINT32, &(fake_device_id_length), "fake_device_id_length"}, + {ODK_MESSAGECOUNTER, &counter_info, "counter_info"}, }; + auto odk_prepare_func = [&](uint8_t* const buf, size_t* size, const ODK_NonceValues* nonce_values) { return ODK_PrepareCoreProvisioningRequest(buf, SIZE_MAX, size, nonce_values, - device_id, device_id_length); + &counter_info); }; auto kdo_parse_func = [&](const std::string& oemcrypto_core_message, ODK_ProvisioningRequest* core_provisioning_request) { bool ok = CoreProvisioningRequestFromMessage(oemcrypto_core_message, core_provisioning_request); + if (!ok) return false; + ok = CheckCounterInfoIsEqual(&counter_info, + &core_provisioning_request->counter_info); return ok; }; ValidateRequest(ODK_Provisioning_Request_Type, @@ -574,6 +726,47 @@ TEST(OdkTest, ProvisionRequestRoundtrip) { kdo_parse_func); } +TEST(OdkTest, ProvisionRequest40Roundtrip) { + uint32_t device_info_length = ODK_DEVICE_INFO_LEN_MAX / 2; + uint8_t device_info[ODK_DEVICE_INFO_LEN_MAX] = {0}; + memset(device_info, 0xaa, device_info_length); + ODK_MessageCounterInfo counter_info; + counter_info.master_generation_number = 0x12345678abcdffff; + counter_info.provisioning_count = 12; + counter_info.license_count = 50; + counter_info.decrypt_count = 340; + counter_info.major_version = ODK_MAJOR_VERSION; + counter_info.minor_version = ODK_MINOR_VERSION; + counter_info.patch_version = 4; + memset(counter_info.soc_vendor, 0xff, sizeof(counter_info.soc_vendor)); + memset(counter_info.chipset_model, 0xdd, sizeof(counter_info.chipset_model)); + memset(counter_info.extra, 0xee, sizeof(counter_info.extra)); + std::vector extra_fields = { + {ODK_UINT32, &device_info_length, "device_info_length"}, + {ODK_DEVICEINFO, device_info, "device_info"}, + {ODK_MESSAGECOUNTER, &counter_info, "counter_info"}, + }; + auto odk_prepare_func = [&](uint8_t* const buf, size_t* size, + const ODK_NonceValues* nonce_values) { + return ODK_PrepareCoreProvisioning40Request( + buf, SIZE_MAX, size, nonce_values, device_info, device_info_length, + &counter_info); + }; + auto kdo_parse_func = + [&](const std::string& oemcrypto_core_message, + ODK_Provisioning40Request* core_provisioning_request) { + bool ok = CoreProvisioning40RequestFromMessage( + oemcrypto_core_message, core_provisioning_request); + if (!ok) return false; + ok = CheckCounterInfoIsEqual(&counter_info, + &core_provisioning_request->counter_info); + return ok; + }; + ValidateRequest(ODK_Provisioning40_Request_Type, + extra_fields, odk_prepare_func, + kdo_parse_func); +} + TEST(OdkTest, RenewedProvisionRequestRoundtrip) { uint32_t device_id_length = ODK_DEVICE_ID_LEN_MAX / 2; uint8_t device_id[ODK_DEVICE_ID_LEN_MAX] = {0}; @@ -618,9 +811,9 @@ TEST(OdkTest, ParseLicenseErrorNonce) { params.core_message.nonce_values.nonce = 0; OEMCryptoResult err = ODK_ParseLicense( buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, - params.usage_entry_present, &(params.timer_limits), + params.usage_entry_present, 0, &(params.timer_limits), &(params.clock_values), &(params.core_message.nonce_values), - &(params.parsed_license)); + &(params.parsed_license), nullptr); EXPECT_EQ(OEMCrypto_ERROR_INVALID_NONCE, err); delete[] buf; } @@ -635,9 +828,9 @@ TEST(OdkTest, ParseLicenseErrorUsageEntry) { params.usage_entry_present = false; OEMCryptoResult err = ODK_ParseLicense( buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, - params.usage_entry_present, &(params.timer_limits), + params.usage_entry_present, 0, &(params.timer_limits), &(params.clock_values), &(params.core_message.nonce_values), - &(params.parsed_license)); + &(params.parsed_license), nullptr); EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, err); delete[] buf; } @@ -653,9 +846,9 @@ TEST(OdkTest, ParseLicenseNullSubstring) { &buf_size); OEMCryptoResult result = ODK_ParseLicense( buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, - params.usage_entry_present, &(params.timer_limits), + params.usage_entry_present, 0, &(params.timer_limits), &(params.clock_values), &(params.core_message.nonce_values), - &(params.parsed_license)); + &(params.parsed_license), nullptr); EXPECT_EQ(OEMCrypto_SUCCESS, result); delete[] buf; } @@ -671,9 +864,9 @@ TEST(OdkTest, ParseLicenseErrorSubstringOffset) { &buf_size); OEMCryptoResult err = ODK_ParseLicense( buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, - params.usage_entry_present, &(params.timer_limits), + params.usage_entry_present, 0, &(params.timer_limits), &(params.clock_values), &(params.core_message.nonce_values), - &(params.parsed_license)); + &(params.parsed_license), nullptr); EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, err); delete[] buf; @@ -687,9 +880,9 @@ TEST(OdkTest, ParseLicenseErrorSubstringOffset) { &buf_size); err = ODK_ParseLicense( buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, - params.usage_entry_present, &(params.timer_limits), + params.usage_entry_present, 0, &(params.timer_limits), &(params.clock_values), &(params.core_message.nonce_values), - &(params.parsed_license)); + &(params.parsed_license), nullptr); EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, err); delete[] buf; } @@ -701,7 +894,10 @@ TEST(OdkTest, ParseRenewalErrorTimer) { uint32_t buf_size = 0; ODK_BuildMessageBuffer(&(params.core_message), params.extra_fields, &buf, &buf_size); - params.clock_values.time_of_renewal_request = 0; + // Set the time for the last renewal request, as seen in clock_values, to be + // after the time in the request. + // TODO: b/290249855 - This is reversed. It should be +5. + params.clock_values.time_of_renewal_request = params.playback_clock - 5; OEMCryptoResult err = ODK_ParseRenewal( buf, buf_size, buf_size, &(params.core_message.nonce_values), params.system_time, &(params.timer_limits), &(params.clock_values), @@ -710,20 +906,50 @@ TEST(OdkTest, ParseRenewalErrorTimer) { delete[] buf; } -TEST(OdkTest, ParsePrivisioningErrorDeviceId) { - ODK_ProvisioningResponseParams params; - ODK_SetDefaultProvisioningResponseParams(¶ms); - uint8_t* buf = nullptr; - uint32_t buf_size = 0; - ODK_BuildMessageBuffer(&(params.core_message), params.extra_fields, &buf, - &buf_size); - // temporarily mess up with device_id - params.device_id[0] = 0; - OEMCryptoResult err = ODK_ParseProvisioning( - buf, buf_size + 16, buf_size, &(params.core_message.nonce_values), - params.device_id, params.device_id_length, &(params.parsed_provisioning)); - EXPECT_EQ(ODK_ERROR_CORE_MESSAGE, err); - delete[] buf; +TEST(OdkTest, ProvisionResponseFromProto) { + std::string serialized_provisioning_resp; + EXPECT_NO_FATAL_FAILURE( + SetDefaultSerializedProvisioningResponse(&serialized_provisioning_resp)); + ODK_ProvisioningRequest core_request = { + .api_minor_version = ODK_MINOR_VERSION, + .api_major_version = ODK_MAJOR_VERSION, + .nonce = 0xdeadbeef, + .session_id = 0xcafebabe, + }; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + std::string oemcrypto_core_message; + EXPECT_TRUE(CreateCoreProvisioningResponseFromProto( + features, serialized_provisioning_resp, core_request, + OEMCrypto_RSA_Private_Key, &oemcrypto_core_message)); +} + +// Verify de-serialize common request. +TEST(OdkTest, ParseCoreCommonRequestFromMessage) { + std::string serialized_provisioning_resp; + EXPECT_NO_FATAL_FAILURE( + SetDefaultSerializedProvisioningResponse(&serialized_provisioning_resp)); + ODK_ProvisioningRequest core_request = { + .api_minor_version = ODK_MINOR_VERSION, + .api_major_version = ODK_MAJOR_VERSION, + .nonce = 0xdeadbeef, + .session_id = 0xcafebabe, + }; + const CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + std::string oemcrypto_core_message; + EXPECT_TRUE(CreateCoreProvisioningResponseFromProto( + features, serialized_provisioning_resp, core_request, + OEMCrypto_RSA_Private_Key, &oemcrypto_core_message)); + ODK_CommonRequest odk_common_request; + ASSERT_TRUE(CoreCommonRequestFromMessage(oemcrypto_core_message, + &odk_common_request)); + EXPECT_EQ(odk_common_request.message_type, 6u); + EXPECT_EQ(odk_common_request.message_length, 48u); + EXPECT_EQ(odk_common_request.api_minor_version, ODK_MINOR_VERSION); + EXPECT_EQ(odk_common_request.api_major_version, ODK_MAJOR_VERSION); + EXPECT_EQ(odk_common_request.nonce, 0xdeadbeef); + EXPECT_EQ(odk_common_request.session_id, 0xcafebabe); } class OdkVersionTest : public ::testing::Test, @@ -735,8 +961,12 @@ class OdkVersionTest : public ::testing::Test, GetParam().response_major_version; params->core_message.nonce_values.api_minor_version = GetParam().response_minor_version; - features_ = - CoreMessageFeatures::DefaultFeatures(GetParam().maximum_major_version); + if (GetParam().maximum_major_version > 0) { + features_ = CoreMessageFeatures::DefaultFeatures( + GetParam().maximum_major_version); + } else { + features_ = CoreMessageFeatures::kDefaultFeatures; + } } CoreMessageFeatures features_; }; @@ -756,17 +986,36 @@ TEST_P(OdkVersionTest, LicenseResponseRoundtrip) { auto odk_parse_func = [&](const uint8_t* buf, size_t size) { return ODK_ParseLicense( buf, size + kExtraPayloadSize, size, params.initial_license_load, - params.usage_entry_present, &(params.timer_limits), + params.usage_entry_present, 0, &(params.timer_limits), &(params.clock_values), &(params.core_message.nonce_values), - &(params.parsed_license)); + &(params.parsed_license), nullptr); }; + + ODK_Packing_ParsedLicense parsed_license; + parsed_license.enc_mac_keys_iv = params.parsed_license.enc_mac_keys_iv; + parsed_license.enc_mac_keys = params.parsed_license.enc_mac_keys; + parsed_license.pst = params.parsed_license.pst; + parsed_license.srm_restriction_data = + params.parsed_license.srm_restriction_data; + parsed_license.license_type = params.parsed_license.license_type; + parsed_license.nonce_required = params.parsed_license.nonce_required; + parsed_license.timer_limits = params.parsed_license.timer_limits; + parsed_license.watermarking = params.parsed_license.watermarking; + parsed_license.dtcp2_required = params.parsed_license.dtcp2_required; + parsed_license.renewal_delay_base = params.parsed_license.renewal_delay_base; + parsed_license.key_array_length = params.parsed_license.key_array_length; + std::vector key_array; + for (size_t i = 0; i < params.parsed_license.key_array_length; i++) { + key_array.push_back(params.parsed_license.key_array[i]); + } + parsed_license.key_array = key_array.data(); const std::string request_hash_string( reinterpret_cast(request_hash_read), sizeof(request_hash_read)); auto kdo_prepare_func = [&](const ODK_LicenseRequest& core_request, std::string* oemcrypto_core_message) { - return CreateCoreLicenseResponse(features_, params.parsed_license, - core_request, request_hash_string, + return CreateCoreLicenseResponse(features_, parsed_license, core_request, + request_hash_string, oemcrypto_core_message); }; ValidateResponse(GetParam(), &(params.core_message), @@ -774,6 +1023,84 @@ TEST_P(OdkVersionTest, LicenseResponseRoundtrip) { kdo_prepare_func); } +// Serialize and de-serialize license response with more keys than +// ODK_MAX_NUM_KEYS. +TEST_P(OdkVersionTest, LicenseResponseRoundtripMoreThanMaxKeys) { + ODK_LicenseResponseParams params; + ODK_SetDefaultLicenseResponseParams(¶ms, + GetParam().response_major_version); + SetRequestVersion(¶ms); + // For v17, we do not use the hash to verify the request. However, the server + // needs to be backwards compatible, so it still needs to pass the hash into + // CreateCoreLiceseseResponse below. Save a copy of params.request_hash as it + // will be zero out during the test + uint8_t request_hash_read[ODK_SHA256_HASH_SIZE]; + memcpy(request_hash_read, params.request_hash, sizeof(request_hash_read)); + uint8_t* buf = nullptr; + uint32_t buf_size = 0; + ODK_BuildMessageBuffer(&(params.core_message), params.extra_fields, &buf, + &buf_size); + + uint8_t* zero = new uint8_t[buf_size]{}; + size_t bytes_read = 0; + // zero-out input + EXPECT_EQ(OEMCrypto_SUCCESS, + ODK_IterFields(ODK_READ, zero, buf_size, &bytes_read, + params.extra_fields)); + + // Parse buf with odk + const OEMCryptoResult parse_result = ODK_ParseLicense( + buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, + params.usage_entry_present, 0, &(params.timer_limits), + &(params.clock_values), &(params.core_message.nonce_values), + &(params.parsed_license), nullptr); + EXPECT_EQ(OEMCrypto_SUCCESS, parse_result); + + size_t size_out = 0; + if (parse_result != OEMCrypto_SUCCESS) { + ODK_IterFields(ODK_FieldMode::ODK_DUMP, buf, buf_size, &size_out, + params.extra_fields); + } + + ODK_Packing_ParsedLicense parsed_license; + parsed_license.enc_mac_keys_iv = params.parsed_license.enc_mac_keys_iv; + parsed_license.enc_mac_keys = params.parsed_license.enc_mac_keys; + parsed_license.pst = params.parsed_license.pst; + parsed_license.srm_restriction_data = + params.parsed_license.srm_restriction_data; + parsed_license.license_type = params.parsed_license.license_type; + parsed_license.nonce_required = params.parsed_license.nonce_required; + parsed_license.timer_limits = params.parsed_license.timer_limits; + parsed_license.watermarking = params.parsed_license.watermarking; + parsed_license.dtcp2_required = params.parsed_license.dtcp2_required; + parsed_license.renewal_delay_base = params.parsed_license.renewal_delay_base; + parsed_license.key_array_length = ODK_MAX_NUM_KEYS + 1; + std::vector key_array; + for (size_t i = 0; i < ODK_MAX_NUM_KEYS + 1; i++) { + OEMCrypto_KeyObject key = {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}; + key_array.push_back(key); + } + parsed_license.key_array = key_array.data(); + const std::string request_hash_string( + reinterpret_cast(request_hash_read), + sizeof(request_hash_read)); + + // serialize odk output to oemcrypto_core_message + std::string oemcrypto_core_message; + ODK_LicenseRequest core_request = {}; + core_request.api_major_version = GetParam().request_major_version; + core_request.api_minor_version = GetParam().request_minor_version; + core_request.nonce = params.core_message.nonce_values.nonce; + core_request.session_id = params.core_message.nonce_values.session_id; + bool result = + CreateCoreLicenseResponse(features_, parsed_license, core_request, + request_hash_string, &oemcrypto_core_message); + EXPECT_FALSE(result); + + delete[] buf; + delete[] zero; +} + TEST_P(OdkVersionTest, RenewalResponseRoundtrip) { ODK_RenewalResponseParams params; ODK_SetDefaultRenewalResponseParams(¶ms); @@ -806,7 +1133,8 @@ TEST_P(OdkVersionTest, RenewalResponseRoundtrip) { TEST_P(OdkVersionTest, ProvisionResponseRoundtrip) { ODK_ProvisioningResponseParams params; - ODK_SetDefaultProvisioningResponseParams(¶ms); + ODK_SetDefaultProvisioningResponseParams(¶ms, + GetParam().response_major_version); SetRequestVersion(¶ms); // save a copy of params.device_id as it will be zero out during the test const uint32_t device_id_length = params.device_id_length; @@ -821,8 +1149,12 @@ TEST_P(OdkVersionTest, ProvisionResponseRoundtrip) { }; auto kdo_prepare_func = [&](ODK_ProvisioningRequest& core_request, std::string* oemcrypto_core_message) { + // use device_id for V17 and V16 core_request.device_id.assign(reinterpret_cast(device_id), device_id_length); + // use counter info for V18 + memcpy(&core_request.counter_info, ¶ms.counter_info, + sizeof(params.counter_info)); return CreateCoreProvisioningResponse(features_, params.parsed_provisioning, core_request, oemcrypto_core_message); }; @@ -831,12 +1163,30 @@ TEST_P(OdkVersionTest, ProvisionResponseRoundtrip) { kdo_prepare_func); } +TEST_P(OdkVersionTest, Provision40ResponseRoundtrip) { + ODK_Provisioning40ResponseParams params; + ODK_SetDefaultProvisioning40ResponseParams(¶ms); + SetRequestVersion(¶ms); + + auto odk_parse_func = [&](const uint8_t* buf, size_t size) { + OEMCryptoResult err = ODK_ParseProvisioning40( + buf, size + 16, size, &(params.core_message.nonce_values)); + return err; + }; + auto kdo_prepare_func = [&](ODK_Provisioning40Request& core_request, + std::string* oemcrypto_core_message) { + return CreateCoreProvisioning40Response(features_, core_request, + oemcrypto_core_message); + }; + ValidateResponse( + GetParam(), &(params.core_message), params.extra_fields, odk_parse_func, + kdo_prepare_func); +} + // If the minor version is positive, we can test an older minor version. const uint16_t kOldMinor = ODK_MINOR_VERSION > 0 ? ODK_MINOR_VERSION - 1 : 0; // Similarly, if this isn't the first major version, we can test an older major // version. -// TODO(b/163416999): Remove it in the future. This will be unecessarily -// complicated after we upgrade to version 17. const uint16_t kOldMajor = ODK_MAJOR_VERSION > ODK_FIRST_VERSION ? ODK_MAJOR_VERSION - 1 : ODK_FIRST_VERSION; @@ -862,16 +1212,26 @@ std::vector TestCases() { {ODK_MAJOR_VERSION, kOldMajor, kOldMajorMinor, kOldMajor, kOldMajorMinor}, // If the server is restricted to v16, then the response can be at // most 16.5 + // These tests cases must be updated whenever we roll the minor version + // number. {16, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 16, 5}, + {17, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 17, 2}, + {18, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 18, 3}, // Here are some known good versions. Make extra sure they work. - {16, 16, 3, 16, 3}, - {16, 16, 4, 16, 4}, - {16, 16, 5, 16, 5}, - {17, 16, 3, 16, 3}, - {17, 16, 4, 16, 4}, - {17, 16, 5, 16, 5}, - {17, 17, 0, 17, 0}, - {17, 17, 1, 17, 1}, + {ODK_MAJOR_VERSION, 16, 3, 16, 3}, + {ODK_MAJOR_VERSION, 16, 4, 16, 4}, + {ODK_MAJOR_VERSION, 16, 5, 16, 5}, + {ODK_MAJOR_VERSION, 17, 1, 17, 1}, + {ODK_MAJOR_VERSION, 17, 2, 17, 2}, + {ODK_MAJOR_VERSION, 18, 1, 18, 1}, + {ODK_MAJOR_VERSION, 18, 2, 18, 2}, + {ODK_MAJOR_VERSION, 18, 3, 18, 3}, + {0, 16, 3, 16, 3}, + {0, 16, 4, 16, 4}, + {0, 16, 5, 16, 5}, + {0, 17, 1, 17, 1}, + {0, 17, 2, 17, 2}, + {0, 18, 3, 18, 3}, // Change to 19 when the default version is updated. }; return test_cases; } @@ -887,13 +1247,20 @@ TEST(OdkSizeTest, LicenseRequest) { uint16_t api_major_version = 0; uint32_t nonce = 0; uint32_t session_id = 0; + ODK_MessageCounterInfo counter_info; + memset(&counter_info, 0, sizeof(counter_info)); ODK_NonceValues nonce_values{api_minor_version, api_major_version, nonce, session_id}; EXPECT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, ODK_PrepareCoreLicenseRequest(message, message_length, - &core_message_length, &nonce_values)); + &core_message_length, &nonce_values, + &counter_info)); // the core_message_length should be appropriately set - EXPECT_EQ(ODK_LICENSE_REQUEST_SIZE, core_message_length); + if (nonce_values.api_major_version > 17) { + EXPECT_EQ(ODK_LICENSE_REQUEST_SIZE, core_message_length); + } else { + EXPECT_EQ(ODK_LICENSE_REQUEST_SIZE_V17, core_message_length); + } } TEST(OdkSizeTest, RenewalRequest) { @@ -948,15 +1315,20 @@ TEST(OdkSizeTest, ProvisioningRequest) { uint16_t api_major_version = 0; uint32_t nonce = 0; uint32_t session_id = 0; - uint32_t device_id_length = 0; + ODK_MessageCounterInfo counter_info; + memset(&counter_info, 0, sizeof(counter_info)); ODK_NonceValues nonce_values{api_minor_version, api_major_version, nonce, session_id}; EXPECT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, - ODK_PrepareCoreProvisioningRequest( - message, message_length, &core_message_length, &nonce_values, - nullptr, device_id_length)); + ODK_PrepareCoreProvisioningRequest(message, message_length, + &core_message_length, + &nonce_values, &counter_info)); // the core_message_length should be appropriately set - EXPECT_EQ(ODK_PROVISIONING_REQUEST_SIZE, core_message_length); + if (nonce_values.api_major_version > 17) { + EXPECT_EQ(ODK_PROVISIONING_REQUEST_SIZE, core_message_length); + } else { + EXPECT_EQ(ODK_PROVISIONING_REQUEST_SIZE_V17, core_message_length); + } } // Verify the version string contains the right version numbers. @@ -970,6 +1342,37 @@ TEST(OdkTest, CheckReleaseVersion) { << "Version mismatch in odk_structs.h"; } +TEST(OdkOverflowTest, SubtractU64) { + uint64_t result = 0; + EXPECT_FALSE(odk_sub_overflow_u64(10, 5, &result)); + EXPECT_EQ(result, static_cast(10 - 5)); + EXPECT_TRUE(odk_sub_overflow_u64(5, 10, &result)); +} + +TEST(OdkOverflowTest, AddU64) { + uint64_t result = 0; + EXPECT_FALSE(odk_add_overflow_u64(2, 2, &result)); + EXPECT_EQ(result, static_cast(2 + 2)); + EXPECT_TRUE(odk_add_overflow_u64(0xffffffffffffffff, 1, &result)); + EXPECT_TRUE(odk_add_overflow_u64(1, 0xffffffffffffffff, &result)); +} + +TEST(OdkOverflowTest, AddUX) { + size_t result = 0; + EXPECT_FALSE(odk_add_overflow_ux(2, 2, &result)); + EXPECT_EQ(result, static_cast(2 + 2)); + EXPECT_TRUE(odk_add_overflow_ux(SIZE_MAX, 1, &result)); + EXPECT_TRUE(odk_add_overflow_ux(1, SIZE_MAX, &result)); +} + +TEST(OdkOverflowTest, MultiplyUX) { + size_t result = 0; + EXPECT_FALSE(odk_mul_overflow_ux(2, 7, &result)); + EXPECT_EQ(result, static_cast(2 * 7)); + EXPECT_TRUE(odk_mul_overflow_ux(SIZE_MAX >> 1, 4, &result)); + EXPECT_TRUE(odk_mul_overflow_ux(4, SIZE_MAX >> 1, &result)); +} + } // namespace } // namespace wvodk_test diff --git a/oemcrypto/odk/test/odk_test.gypi b/oemcrypto/odk/test/odk_test.gypi index 0cb8a00..1b5c5e7 100644 --- a/oemcrypto/odk/test/odk_test.gypi +++ b/oemcrypto/odk/test/odk_test.gypi @@ -4,6 +4,9 @@ { 'sources': [ + 'odk_golden_v16.cpp', + 'odk_golden_v17.cpp', + 'odk_golden_v18.cpp', 'odk_test.cpp', 'odk_test_helper.cpp', 'odk_test_helper.h', diff --git a/oemcrypto/odk/test/odk_test_helper.cpp b/oemcrypto/odk/test/odk_test_helper.cpp index dab9afa..db9b2f2 100644 --- a/oemcrypto/odk/test/odk_test_helper.cpp +++ b/oemcrypto/odk/test/odk_test_helper.cpp @@ -8,7 +8,10 @@ #include #include #include +#include +#include #include +#include #include #include @@ -75,6 +78,7 @@ void ODK_SetDefaultLicenseResponseParams(ODK_LicenseResponseParams* params, .length = 3, .data = {0, 0, 0}, }}, + .renewal_delay_base = OEMCrypto_License_Start, .key_array_length = 3, .key_array = { @@ -203,6 +207,11 @@ void ODK_SetDefaultLicenseResponseParams(ODK_LicenseResponseParams* params, ".cmi_descriptor_data"}); } } + if (odk_major_version >= 18) { + params->extra_fields.push_back( + {ODK_UINT32, &(params->parsed_license.renewal_delay_base), + ".renewal_delay_base"}); + } params->extra_fields.push_back({ODK_UINT32, &(params->parsed_license.key_array_length), ".key_array_length"}); @@ -288,7 +297,7 @@ void ODK_SetDefaultRenewalResponseParams(ODK_RenewalResponseParams* params) { } void ODK_SetDefaultProvisioningResponseParams( - ODK_ProvisioningResponseParams* params) { + ODK_ProvisioningResponseParams* params, uint32_t odk_major_version) { ODK_SetDefaultCoreFields(&(params->core_message), ODK_Provisioning_Response_Type); params->device_id_length = ODK_DEVICE_ID_LEN_MAX / 2; @@ -301,17 +310,34 @@ void ODK_SetDefaultProvisioningResponseParams( .enc_private_key_iv = {.offset = 2, .length = 3}, .encrypted_message_key = {.offset = 4, .length = 5}, }; - params->extra_fields = { - {ODK_UINT32, &(params->device_id_length), "device_id_length"}, - {ODK_DEVICEID, params->device_id, "device_id"}, - {ODK_UINT32, &(params->parsed_provisioning).key_type, "key_type"}, + + params->extra_fields = {}; + // V17 uses device_id + if (odk_major_version <= 17) { + params->extra_fields.push_back( + {ODK_UINT32, &(params->device_id_length), "device_id_length"}); + params->extra_fields.push_back( + {ODK_DEVICEID, params->device_id, "device_id"}); + } + + params->extra_fields.push_back( + {ODK_UINT32, &(params->parsed_provisioning).key_type, "key_type"}); + params->extra_fields.push_back( {ODK_SUBSTRING, &(params->parsed_provisioning).enc_private_key, - "enc_private_key"}, + "enc_private_key"}); + params->extra_fields.push_back( {ODK_SUBSTRING, &(params->parsed_provisioning).enc_private_key_iv, - "enc_private_key_iv"}, + "enc_private_key_iv"}); + params->extra_fields.push_back( {ODK_SUBSTRING, &(params->parsed_provisioning).encrypted_message_key, - "encrypted_message_key"}, - }; + "encrypted_message_key"}); +} + +void ODK_SetDefaultProvisioning40ResponseParams( + ODK_Provisioning40ResponseParams* params) { + ODK_SetDefaultCoreFields(&(params->core_message), + ODK_Provisioning_Response_Type); + params->extra_fields = {}; } size_t ODK_FieldLength(ODK_FieldType type) { @@ -330,6 +356,10 @@ size_t ODK_FieldLength(ODK_FieldType type) { return sizeof(uint32_t) + sizeof(uint32_t); case ODK_DEVICEID: return ODK_DEVICE_ID_LEN_MAX; + case ODK_MESSAGECOUNTER: + return ODK_MESSAGECOUNTERINFO_SIZE; + case ODK_DEVICEINFO: + return ODK_DEVICE_INFO_LEN_MAX; case ODK_RENEWALDATA: return ODK_KEYBOX_RENEWAL_DATA_SIZE; case ODK_HASH: @@ -343,6 +373,9 @@ size_t ODK_AllocSize(ODK_FieldType type) { if (type == ODK_SUBSTRING) { return sizeof(OEMCrypto_Substring); } + if (type == ODK_MESSAGECOUNTER) { + return sizeof(ODK_MessageCounterInfo); + } return ODK_FieldLength(type); } @@ -388,6 +421,7 @@ OEMCryptoResult ODK_WriteSingleField(uint8_t* buf, const ODK_Field* field) { break; } case ODK_DEVICEID: + case ODK_DEVICEINFO: case ODK_RENEWALDATA: case ODK_HASH: { const size_t field_len = ODK_FieldLength(field->type); @@ -396,6 +430,27 @@ OEMCryptoResult ODK_WriteSingleField(uint8_t* buf, const ODK_Field* field) { break; } + case ODK_MESSAGECOUNTER: { + // Size required in field->value, which may get padding from the compiler. + const size_t src_len = ODK_AllocSize(field->type); + // Size taken up in serialized message buffer, which is tightly packed. + const size_t dest_len = ODK_FieldLength(field->type); + const uint8_t* const write_src = static_cast(field->value); + + // Copy data from field to buf, fixing endian-ness + ODK_MessageCounterInfo info; + memcpy(&info, write_src, src_len); + info.master_generation_number = + oemcrypto_htobe64(info.master_generation_number); + info.provisioning_count = oemcrypto_htobe32(info.provisioning_count); + info.license_count = oemcrypto_htobe32(info.license_count); + info.decrypt_count = oemcrypto_htobe32(info.decrypt_count); + info.major_version = oemcrypto_htobe16(info.major_version); + info.minor_version = oemcrypto_htobe16(info.minor_version); + info.patch_version = oemcrypto_htobe16(info.patch_version); + memcpy(buf, &info, dest_len); + break; + } default: return ODK_ERROR_CORE_MESSAGE; } @@ -448,6 +503,7 @@ OEMCryptoResult ODK_ReadSingleField(const uint8_t* buf, break; } case ODK_DEVICEID: + case ODK_DEVICEINFO: case ODK_RENEWALDATA: case ODK_HASH: { const size_t field_len = ODK_FieldLength(field->type); @@ -455,6 +511,55 @@ OEMCryptoResult ODK_ReadSingleField(const uint8_t* buf, memcpy(id, buf, field_len); break; } + case ODK_MESSAGECOUNTER: { + // Size required in field->value, which may get padding from the compiler. + const size_t dest_len = ODK_AllocSize(field->type); + // Size taken up in serialized message buffer, which is tightly packed. + const size_t src_len = ODK_FieldLength(field->type); + uint8_t* const read_dest = static_cast(field->value); + + // Copy data from buf to field, fixing endian-ness + uint8_t temp_buf[sizeof(ODK_MessageCounterInfo)] = {0}; + memcpy(temp_buf, buf, src_len); + + size_t index = 0; + ODK_MessageCounterInfo info; + uint64_t* u64 = reinterpret_cast(&temp_buf[index]); + info.master_generation_number = oemcrypto_be64toh(*u64); + index += sizeof(uint64_t); + + uint32_t* u32 = reinterpret_cast(&temp_buf[index]); + info.provisioning_count = oemcrypto_be32toh(*u32); + index += sizeof(uint32_t); + + u32 = reinterpret_cast(&temp_buf[index]); + info.license_count = oemcrypto_be32toh(*u32); + index += sizeof(uint32_t); + + u32 = reinterpret_cast(&temp_buf[index]); + info.decrypt_count = oemcrypto_be32toh(*u32); + index += sizeof(uint32_t); + + uint16_t* u16 = reinterpret_cast(&temp_buf[index]); + info.major_version = oemcrypto_be16toh(*u16); + index += sizeof(uint16_t); + + u16 = reinterpret_cast(&temp_buf[index]); + info.minor_version = oemcrypto_be16toh(*u16); + index += sizeof(uint16_t); + + u16 = reinterpret_cast(&temp_buf[index]); + info.patch_version = oemcrypto_be16toh(*u16); + index += sizeof(uint16_t); + + memcpy(info.soc_vendor, &temp_buf[index], sizeof(info.soc_vendor)); + index += sizeof(info.soc_vendor); + memcpy(info.chipset_model, &temp_buf[index], sizeof(info.chipset_model)); + index += sizeof(info.chipset_model); + memcpy(info.extra, &temp_buf[index], sizeof(info.extra)); + memcpy(read_dest, &info, dest_len); + break; + } default: return ODK_ERROR_CORE_MESSAGE; } @@ -508,6 +613,8 @@ OEMCryptoResult ODK_DumpSingleField(const uint8_t* buf, break; } case ODK_DEVICEID: + case ODK_MESSAGECOUNTER: + case ODK_DEVICEINFO: case ODK_RENEWALDATA: case ODK_HASH: { const size_t field_len = ODK_FieldLength(field->type); diff --git a/oemcrypto/odk/test/odk_test_helper.h b/oemcrypto/odk/test/odk_test_helper.h index f825af1..b004233 100644 --- a/oemcrypto/odk/test/odk_test_helper.h +++ b/oemcrypto/odk/test/odk_test_helper.h @@ -21,6 +21,8 @@ enum ODK_FieldType { ODK_UINT64, ODK_SUBSTRING, ODK_DEVICEID, + ODK_DEVICEINFO, + ODK_MESSAGECOUNTER, ODK_RENEWALDATA, ODK_HASH, // The "stressable" types are the ones we can put in a stress test that packs @@ -71,10 +73,17 @@ struct ODK_ProvisioningResponseParams { ODK_CoreMessage core_message; uint8_t device_id[ODK_DEVICE_ID_LEN_MAX]; uint32_t device_id_length; + uint32_t padding_u32; + ODK_MessageCounterInfo counter_info; ODK_ParsedProvisioning parsed_provisioning; std::vector extra_fields; }; +struct ODK_Provisioning40ResponseParams { + ODK_CoreMessage core_message; + std::vector extra_fields; +}; + // Default values in core_message for testing void ODK_SetDefaultCoreFields(ODK_CoreMessage* core_message, ODK_MessageType message_type); @@ -82,7 +91,9 @@ void ODK_SetDefaultLicenseResponseParams(ODK_LicenseResponseParams* params, uint32_t odk_major_version); void ODK_SetDefaultRenewalResponseParams(ODK_RenewalResponseParams* params); void ODK_SetDefaultProvisioningResponseParams( - ODK_ProvisioningResponseParams* params); + ODK_ProvisioningResponseParams* params, uint32_t odk_major_version); +void ODK_SetDefaultProvisioning40ResponseParams( + ODK_Provisioning40ResponseParams* params); size_t ODK_FieldLength(ODK_FieldType type); size_t ODK_AllocSize(ODK_FieldType type); @@ -92,8 +103,8 @@ OEMCryptoResult ODK_WriteSingleField(uint8_t* buf, const ODK_Field* field); // Load buf to ODK_Field OEMCryptoResult ODK_ReadSingleField(const uint8_t* buf, const ODK_Field* field); OEMCryptoResult ODK_DumpSingleField(const uint8_t* buf, const ODK_Field* field); -OEMCryptoResult ODK_IterFields(ODK_FieldMode mode, uint8_t* buf, - const size_t size_in, size_t* size_out, +OEMCryptoResult ODK_IterFields(ODK_FieldMode mode, uint8_t* buf, size_t size_in, + size_t* size_out, const std::vector& fields); void ODK_ExpectEqualBuf(const void* s1, const void* s2, size_t n, const std::vector& fields); diff --git a/oemcrypto/odk/test/odk_timer_test.cpp b/oemcrypto/odk/test/odk_timer_test.cpp index 8413960..b595d98 100644 --- a/oemcrypto/odk/test/odk_timer_test.cpp +++ b/oemcrypto/odk/test/odk_timer_test.cpp @@ -6,7 +6,9 @@ #include "OEMCryptoCENCCommon.h" #include "gtest/gtest.h" #include "odk.h" +#include "odk_structs.h" #include "odk_structs_priv.h" +#include "odk_test_helper.h" namespace { @@ -23,6 +25,99 @@ constexpr uint64_t kRentalClockStart = 1000u; // renewal is not loaded. constexpr uint64_t kGracePeriod = 5u; +constexpr uint32_t kExtraPayloadSize = 128u; + +constexpr uint32_t kSystemTime = 20u; + +namespace wvodk_test { + +TEST(OdkTimerBasicTest, ParseLicenseTimerSet) { + // playback timer is successfully started + ::wvodk_test::ODK_LicenseResponseParams params; + ODK_SetDefaultLicenseResponseParams(¶ms, ODK_MAJOR_VERSION); + params.parsed_license.renewal_delay_base = OEMCrypto_License_Load; + params.parsed_license.timer_limits.soft_enforce_rental_duration = false; + params.parsed_license.timer_limits.soft_enforce_playback_duration = false; + params.parsed_license.timer_limits.earliest_playback_start_seconds = 10; + params.parsed_license.timer_limits.total_playback_duration_seconds = 0; + params.parsed_license.timer_limits.rental_duration_seconds = 10; + params.parsed_license.timer_limits.initial_renewal_duration_seconds = 0; + OEMCryptoResult result = + ODK_InitializeClockValues(¶ms.clock_values, kSystemTime); + EXPECT_EQ(OEMCrypto_SUCCESS, result); + params.clock_values.time_of_license_request_signed = 5; + params.clock_values.status = kActive; + + uint8_t* buf = nullptr; + uint32_t buf_size = 0; + ODK_BuildMessageBuffer(&(params.core_message), params.extra_fields, &buf, + &buf_size); + + result = ODK_ParseLicense( + buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, + params.usage_entry_present, kSystemTime, &(params.timer_limits), + &(params.clock_values), &(params.core_message.nonce_values), + &(params.parsed_license), nullptr); + EXPECT_EQ(ODK_SET_TIMER, result); + delete[] buf; +} + +TEST(OdkTimerBasicTest, ParseLicenseTimerDisabled) { + // playback timer is successfully started + ::wvodk_test::ODK_LicenseResponseParams params; + ODK_SetDefaultLicenseResponseParams(¶ms, ODK_MAJOR_VERSION); + params.parsed_license.renewal_delay_base = OEMCrypto_License_Load; + params.parsed_license.timer_limits.soft_enforce_rental_duration = true; + params.parsed_license.timer_limits.earliest_playback_start_seconds = 3; + params.parsed_license.timer_limits.total_playback_duration_seconds = 0; + params.parsed_license.timer_limits.initial_renewal_duration_seconds = 0; + params.clock_values.time_of_first_decrypt = 10; + params.clock_values.time_of_license_request_signed = 5; + params.clock_values.status = kActive; + + uint8_t* buf = nullptr; + uint32_t buf_size = 0; + ODK_BuildMessageBuffer(&(params.core_message), params.extra_fields, &buf, + &buf_size); + + OEMCryptoResult result = ODK_ParseLicense( + buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, + params.usage_entry_present, kSystemTime, &(params.timer_limits), + &(params.clock_values), &(params.core_message.nonce_values), + &(params.parsed_license), nullptr); + EXPECT_EQ(ODK_DISABLE_TIMER, result); + delete[] buf; +} + +TEST(OdkTimerBasicTest, ParseRenewalTimerExpired) { + // playback timer is successfully started + ::wvodk_test::ODK_LicenseResponseParams params; + ODK_SetDefaultLicenseResponseParams(¶ms, ODK_MAJOR_VERSION); + + params.parsed_license.renewal_delay_base = OEMCrypto_License_Load; + params.parsed_license.timer_limits.rental_duration_seconds = 5; + params.parsed_license.timer_limits.earliest_playback_start_seconds = 3; + OEMCryptoResult result = + ODK_InitializeClockValues(¶ms.clock_values, kSystemTime); + EXPECT_EQ(OEMCrypto_SUCCESS, result); + params.clock_values.time_of_license_request_signed = 5; + + uint8_t* buf = nullptr; + uint32_t buf_size = 0; + ODK_BuildMessageBuffer(&(params.core_message), params.extra_fields, &buf, + &buf_size); + + result = ODK_ParseLicense( + buf, buf_size + kExtraPayloadSize, buf_size, params.initial_license_load, + params.usage_entry_present, kSystemTime, &(params.timer_limits), + &(params.clock_values), &(params.core_message.nonce_values), + &(params.parsed_license), nullptr); + EXPECT_EQ(ODK_TIMER_EXPIRED, result); + delete[] buf; +} + +} // namespace wvodk_test + TEST(OdkTimerBasicTest, NullTest) { // Assert that nullptr does not cause a core dump. ODK_InitializeClockValues(nullptr, 0u);