diff --git a/CHANGELOG.md b/CHANGELOG.md index c553551..72cdac1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,61 @@ [TOC] +## [Version 18.3][v18.3] + +Version 18.3 includes a major feature (Cast with Provisioning 4.0) and various +minor changes. Version 18.2 was an internal version bump for the ODK that +included changes used by the provisioning server. Since we keep the ODK and OPK +version numbers in sync, the OPK version effectively skipped 18.2. + +## Cast with Provisioning 4.0 + +The OPK now supports devices that wish to act as cast receivers while using +Provisioning 4.0. Previously, only devices using Provisioning 2.0 or devices +with factory provisioned certs could do this. These changes span the OPK, CDM, +and provisioning server code. + +The OPK changes are included in this release. The CDM changes are part of +Android U. The provisioning server changes are live on Widevine staging servers, +and will be pushed to production by August 2023. + +## OP-TEE port changes + +- Added CSR and DeviceInformation implementations for Provisioning 4.0. +- Bugfix: REE->TEE message shared memory was sized based on the incoming request +length, yet the response could be larger than the request and crash the TA if it +did not fit in the nearest page boundary. Fixed by setting the shared memory +size to the maximum allowed and passing in the request size as a separate +TEE_Param. + +## Other changes + +- Updated BoringSSL dependency to +https://boringssl.googlesource.com/boringssl/+/e1b8685770d0e82e5a4a3c5d24ad1602e05f2e83 +- Removed WTPI_MaxBufferSizeForDecrypt() and WTPI_ApplyCGMS() from +wtpi_config_interface.h. These functions are not called by any of the OPK code. +- Updated the documentation for WTPI_GetDeviceKey() to be clearer. +- Added new optional fields to OEMCrypto_BuildInformation() output. +- Removed v15 functions OEMCrypto_LoadKeys() and OEMCrypto_RefreshKeys(), which +were replaced by OEMCrypto_LoadLicense() and OEMCrypto_LoadRenewal() in v16. +- Three new optional fields have been added to OEMCrypto_BuildInformation() +output JSON: `git_commit` and `build_timestamp`, and `ree` information. +- OEMCrypto_GenerateCertificateKeyPair() documentation has been improved to be +clearer. +- New function OEMCrypto_FactoryInstallBCCSignature() added to OEMCrypto API. +Not implemented in OPK. +- OPK can be used with license servers that send more than `MAX_NUM_KEYS` in the +license response. The client-side value of `MAX_NUM_KEYS` must be changed in +`odk/include/odk_target.h` to match the server's value. This is only intended +for closed network systems. + +## Known issues + +- CdmOtaKeyboxTest.BasicTest may fail due to server issues +- The ODK renewal clock is not correctly checked for all circumstances. This +will be changed in v19 since the existing implementation is already in +production devices. + ## [Version 18.1][v18.1] OEMCrypto V18.0 consisted of header files only. This release includes tests and diff --git a/linux/src/file_store.cpp b/linux/src/file_store.cpp index 66d163f..8164409 100644 --- a/linux/src/file_store.cpp +++ b/linux/src/file_store.cpp @@ -176,6 +176,22 @@ bool FileSystem::Exists(const std::string& path) { return res; } +bool FileSystem::Exists(const std::string& path, int* errno_value) { + struct stat buf; + int error = 0; + int res = stat(path.c_str(), &buf) == 0; + if (!res) { + error = errno; + if (error == ENOENT) { + LOGI("stat failed: ENOENT"); + } else { + LOGE("stat failed: %d, %s", error, strerror(error)); + } + } + if (errno_value != nullptr) *errno_value = error; + return res; +} + bool FileSystem::Remove(const std::string& path) { if (IsDirectory(path)) { // Handle directory deletion diff --git a/linux/src/log.cpp b/linux/src/log.cpp index 14d0d8d..1e688c6 100644 --- a/linux/src/log.cpp +++ b/linux/src/log.cpp @@ -25,7 +25,7 @@ void InitLogging() { // set by jenkins (http://go/wvbuild), so that we have more details when the // build breaks. const char* verbose_env = getenv("VERBOSE_LOG"); - if (verbose_env && !strncmp(verbose_env, "yes", 3)) { + if (verbose_env && strncmp(verbose_env, "yes", 3) == 0) { g_cutoff = CDM_LOG_VERBOSE; } } diff --git a/oemcrypto/include/OEMCryptoCENC.h b/oemcrypto/include/OEMCryptoCENC.h index 87eb1f6..99e0f61 100644 --- a/oemcrypto/include/OEMCryptoCENC.h +++ b/oemcrypto/include/OEMCryptoCENC.h @@ -3,7 +3,7 @@ // License Agreement. /** - * @mainpage OEMCrypto API v18.1 + * @mainpage OEMCrypto API v18.3 * * OEMCrypto is the low level library implemented by the OEM to provide key and * content protection, usually in a separate secure memory or process space. The @@ -712,6 +712,7 @@ typedef enum OEMCrypto_SignatureHashAlgorithm { #define OEMCrypto_GetSignatureHashAlgorithm _oecc139 #define OEMCrypto_EnterTestMode _oecc140 #define OEMCrypto_GetDeviceSignedCsrPayload _oecc141 +#define OEMCrypto_FactoryInstallBCCSignature _oecc142 // clang-format on /// @addtogroup initcontrol @@ -2996,6 +2997,41 @@ OEMCryptoResult OEMCrypto_WrapKeyboxOrOEMCert( OEMCryptoResult OEMCrypto_InstallKeyboxOrOEMCert(const uint8_t* keybox_or_cert, size_t keybox_or_cert_length); +/** + * Install a factory generated signature for the BCC. This is for devices that + * use Provisioning 4.0, with the signing option in the factory. With the + * signing option, the BCC is extracted from the device in the factory. Instead + * of being uploaded to the Widevine server, the BCC is signed by a certificate + * that the manufacturer shares with Widevine. The signature is then installed + * on the device is a secure location. The signature must not be erased during + * factory reset. + * + * This signature should be returned as `addition_signature` in a call to the + * function `OEMCrypto_GetBootCertificateChain()`. + * + * Devices that do not support Provisioning 4.0, or only support Provisioning + * 4.0 Option 1 should return OEMCrypto_ERROR_NOT_IMPLEMENTED. + * + * + * @param[in] signature: pointer to data as input + * @param[in] signature_length: length of the data in bytes + * + * @retval OEMCrypto_SUCCESS success + * @retval OEMCrypto_ERROR_INSUFFICIENT_RESOURCES + * @retval OEMCrypto_ERROR_NOT_IMPLEMENTED + * @retval OEMCrypto_ERROR_SYSTEM_INVALIDATED + * + * @threading + * This is an "Initialization and Termination Function" and will not be + * called simultaneously with any other function, as if the CDM holds a write + * lock on the OEMCrypto system. + * + * @version + * This method is new in API version 18.3. + */ +OEMCryptoResult OEMCrypto_FactoryInstallBCCSignature(const uint8_t* signature, + size_t signature_length); + /** * This function is for OEMCrypto to tell the layer above what provisioning * method it uses: keybox or OEM certificate. @@ -3314,6 +3350,22 @@ uint32_t OEMCrypto_MinorAPIVersion(void); * While not required, the following top level fields are recommended: * - "implementer" [string]: Name of company or entity that provides OEMCrypto. * Important if not SOC vendor. + * - "git_commit" [string]: Git commit hash of the code repository that + * produced the TA build. Useful for implementers to distinguish the state of + * different TA builds. + * - "build_timestamp" [string]: ISO 8601 formatted timestamp of the time the + * TA was compiled, eg "YYYY-MM-DDTHH:MM:SS" + * + * While not required, another optional top level struct can be added to the + * build information string to provide information about liboemcrypto.so: + * - "ree" { + * - "liboemcrypto_ver" [string]: liboemcrypto.so version in string format + * eg "2.15.0+tag". Note that this is separate from the "ta_ver" field + * above, since this section is specific to the liboemcrypto.so binary. + * - "git_commit" [string]: git hash of code that compiled liboemcrypto.so + * - "build_timestamp" [string]: ISO 8601 timestamp for when + * liboemcrypto.so was built + * } * * The JSON string can contain other values, structs, arrays, etc in addition to * the above, if desired. @@ -4812,11 +4864,71 @@ OEMCryptoResult OEMCrypto_GetBootCertificateChain( * key is supposed to be certified by the server. The private key is wrapped * with the encryption key so it can be stored in the file system. * - * If an OEM private key is unavailable, the request is assumed for OEM + * The |public_key_signature| output is formatted differently depending + * on whether or not an OEM private key has been loaded. + * + * If an OEM private key is unavailable, the request is assumed to be for OEM * certificate provisioning. In this case, the public key is signed by the - * device private key. If an OEM private key is available, the request is - * assumed for DRM certificate provisioning and the public key is signed by the - * OEM private key. + * device private key. The format of |public_key_signature| in this case is a + * COSE_Sign1 CBOR array. The format is described in RFC 8152 Section 4.2 and + * 4.4, as well as Android IRemotelyProvisionedComponent.aidl (under + * "SignedData") + * + * ~~~ + * |public_key_signature|: COSE_Sign1 CBOR array + * [ + * protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / + * AlgorithmES384 }, + * unprotected: {}, + * payload: bstr .cbor Data / nil, + * signature: bstr ; PureEd25519(priv_key, Sig_structure) / + * ; ECDSA(priv_key, Sig_structure) + * ] + * ~~~ + * + * Notes: + * 1. The payload field in the COSE_Sign1 struct is the public key generated + * by OEMCrypto_GenerateCertificateKeyPair + * 2. The signature field in the COSE_Sign1 struct is the concatenation of the + * (R,S) values from the EC/Ed signature. If either R or S is smaller than + * the key size, it is left-padded with 0 to match the key size as + * described in RFC 8152. This signature is not DER encoded. + * 3. The signature is generated by calling the selected EC signing function + * (PureEd25519 or one of the supported ECDSA algorithms) on + * `Sig_structure`, which is a CBOR array described below. The payload + * field in Sig_structure is the same as the payload in the above + * COSE_Sign1 CBOR array. + * + * ~~~ + * Sig_structure: CBOR array + * [ + * context: "Signature1", + * protected: bstr .cbor { 1 : AlgorithmEdDSA / AlgorithmES256 / + * AlgorithmES384 }, + * external_aad: bstr .size 0, + * payload: bstr .cbor Data / nil, + * ] + * ~~~ + * + * If an OEM private key is available, the request is assumed to be for DRM + * certificate provisioning and the public key is signed by the OEM private key. + * If the OEM private key is an RSA key, then |public_key_signature| is the raw + * output of the RSA sign operation with RSASSA-PSS padding. If the OEM private + * key is an ECC key, then |public_key_signature| is the ASN.1 DER-encoded (R,S) + * signature as specified in RFC 3279 2.2.3. + * + * After this function completes successfully, the session will hold a private + * key and will be ready for a call to + * OEMCrypto_PrepAndSignProvisioningRequest(). In particular, when this + * function is used to generate a DRM Certificate key pair, the session will be + * ready to sign a provisioning request with the DRM Cert private key. When this + * function is used to generate an OEM Certificate key pair, the session will be + * ready to sign a provisioning request with the OEM Cert private key. + * + * The public key shall be an ASN.1 DER-encoded SubjectPublicKeyInfo as + * specified in RFC 5280. Widevine recommends ECC keys for Provisioning 4.0, but + * an RSA key may also be used. If the key is an RSA key, then the encoding + * should use "rsaEncryption" (OID 1.2.840.113549.1.1.1), and not RSASSA-PSS. * * @param[in] session: session id. * @param[out] public_key: pointer to the buffer that receives the public key @@ -4825,11 +4937,8 @@ OEMCryptoResult OEMCrypto_GetBootCertificateChain( * @param[in,out] public_key_length: on input, size of the caller's public_key * buffer. On output, the number of bytes written into the buffer. * @param[out] public_key_signature: pointer to the buffer that receives the - * signature of the public key. - * If an OEM private key is unavailable: it is signed by the device private - * key. The signature must be in COSE_SIGN1 format as specified in RFC 8152. - * If an OEM private key is available: it is signed by the OEM private key. - * The signature must be raw signature bytes. + * signature of the public key. The format depends on whether an OEM private + * key has been loaded. * @param[in,out] public_key_signature_length: on input, size of the caller's * public_key_signature buffer. On output, the number of bytes written into * the buffer. diff --git a/oemcrypto/odk/Android.bp b/oemcrypto/odk/Android.bp index 92646bc..544c838 100644 --- a/oemcrypto/odk/Android.bp +++ b/oemcrypto/odk/Android.bp @@ -38,6 +38,7 @@ cc_library_static { proprietary: true, owner: "widevine", + min_sdk_version: "UpsideDownCake", } // ---------------------------------------------------------------- diff --git a/oemcrypto/odk/include/OEMCryptoCENCCommon.h b/oemcrypto/odk/include/OEMCryptoCENCCommon.h index 97989aa..a4e5438 100644 --- a/oemcrypto/odk/include/OEMCryptoCENCCommon.h +++ b/oemcrypto/odk/include/OEMCryptoCENCCommon.h @@ -156,8 +156,8 @@ typedef enum OEMCrypto_TimerDelayBase { } OEMCrypto_TimerDelayBase; /** - * 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 + * 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 { @@ -223,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. @@ -240,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_features.h b/oemcrypto/odk/include/core_message_features.h index 6e210d6..1365dd8 100644 --- a/oemcrypto/odk/include/core_message_features.h +++ b/oemcrypto/odk/include/core_message_features.h @@ -26,9 +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 17.2. - uint32_t maximum_major_version = 17; - uint32_t maximum_minor_version = 2; + // 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 765d292..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); diff --git a/oemcrypto/odk/include/odk_structs.h b/oemcrypto/odk/include/odk_structs.h index 8a2b8ee..1debc12 100644 --- a/oemcrypto/odk/include/odk_structs.h +++ b/oemcrypto/odk/include/odk_structs.h @@ -16,10 +16,10 @@ extern "C" { /* The version of this library. */ #define ODK_MAJOR_VERSION 18 -#define ODK_MINOR_VERSION 1 +#define ODK_MINOR_VERSION 3 /* ODK Version string. Date changed automatically on each release. */ -#define ODK_RELEASE_DATE "ODK v18.1 2023-02-25" +#define ODK_RELEASE_DATE "ODK v18.3 2023-07-07" /* The lowest version number for an ODK message. */ #define ODK_FIRST_VERSION 16 @@ -97,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 @@ -246,6 +247,46 @@ typedef struct { 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 5c8054f..30e68c4 100644 --- a/oemcrypto/odk/src/core_message_deserialize.cpp +++ b/oemcrypto/odk/src/core_message_deserialize.cpp @@ -162,44 +162,26 @@ bool CoreRenewalRequestFromMessage(const std::string& oemcrypto_core_message, bool CoreProvisioningRequestFromMessage( const std::string& oemcrypto_core_message, ODK_ProvisioningRequest* core_provisioning_request) { - // We can't tell if V18 format or older. Need to partially parse in order - // to get the nonce values, which will tell us. + // 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) { - // Proceed with V18 types - const auto unpacker = Unpack_ODK_PreparedProvisioningRequest; + // 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)) { - // check for edge case: initial v18 message which is 4 bytes smaller and - // has 0's in the message counter struct - const uint8_t* buf = - reinterpret_cast(oemcrypto_core_message.c_str()); - const size_t buf_length = oemcrypto_core_message.size(); + return false; + } - if (!(buf_length + 4 == ODK_PROVISIONING_REQUEST_SIZE)) { - return false; - } - - // Expected zero padding. Size is the new ODK Provisioning Request (core - // message + const uint32_t + the rest) without the core message and const - // uint32_t. - uint8_t zeros[ODK_PROVISIONING_REQUEST_SIZE - 4 - ODK_CORE_MESSAGE_SIZE] = - {0}; - - // Compare zeros against the old Provisioning Request (core message + the - // rest). - if (memcmp(zeros, buf + ODK_CORE_MESSAGE_SIZE, sizeof(zeros)) != 0) { - return false; - } - - memset(&prepared_provision.counter_info, 0, - sizeof(prepared_provision.counter_info)); - } else if (!CopyCounterInfo(&core_provisioning_request->counter_info, - &prepared_provision.counter_info)) { + if (!CopyCounterInfo(&core_provisioning_request->counter_info, + &prepared_provision.counter_info)) { return false; } } else { @@ -219,7 +201,7 @@ bool CoreProvisioningRequestFromMessage( 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)) { + ODK_DEVICE_ID_LEN_MAX - device_id_length) != 0) { return false; } core_provisioning_request->device_id.assign( @@ -251,7 +233,7 @@ bool CoreProvisioning40RequestFromMessage( } uint8_t zero[ODK_DEVICE_INFO_LEN_MAX] = {}; if (memcmp(zero, device_info + device_info_length, - ODK_DEVICE_INFO_LEN_MAX - device_info_length)) { + ODK_DEVICE_INFO_LEN_MAX - device_info_length) != 0) { return false; } core_provisioning_request->device_info.assign( @@ -276,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( diff --git a/oemcrypto/odk/src/core_message_features.cpp b/oemcrypto/odk/src/core_message_features.cpp index b8bcb9e..b8cae56 100644 --- a/oemcrypto/odk/src/core_message_features.cpp +++ b/oemcrypto/odk/src/core_message_features.cpp @@ -28,7 +28,7 @@ CoreMessageFeatures CoreMessageFeatures::DefaultFeatures( features.maximum_minor_version = 2; // 17.2 break; case 18: - features.maximum_minor_version = 1; // 18.0 + 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 8f28a3f..5edd352 100644 --- a/oemcrypto/odk/src/core_message_serialize.cpp +++ b/oemcrypto/odk/src/core_message_serialize.cpp @@ -25,14 +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, ODK_CoreMessage* response_header, - const S& core_request, T& response) { + const S& core_request) { // Bad major version. if ((features.maximum_major_version > ODK_MAJOR_VERSION) || (features.maximum_major_version == ODK_MAJOR_VERSION && @@ -68,11 +67,10 @@ 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, +template +bool CreateResponse(ODK_MessageType message_type, std::string* oemcrypto_core_message, ODK_CoreMessage* response_header, T& response, const P& packer) { @@ -118,118 +116,25 @@ 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)}; + ODK_Packing_LicenseResponse license_response{ + {}, const_cast(&parsed_lic), {}}; if (!CreateResponseHeader(features, ODK_License_Response_Type, - &license_response.core_message, core_request, - license_response)) { - return false; - } - if (ODK_MAX_NUM_KEYS < license_response.parsed_license->key_array_length) { + &license_response.core_message, core_request)) { return false; } if (license_response.core_message.nonce_values.api_major_version == 16) { - ODK_LicenseResponseV16 license_response_v16; - license_response_v16.request.core_message = license_response.core_message; - 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 (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.request.core_message, - license_response_v16, Pack_ODK_LicenseResponseV16); - } else if (license_response.core_message.nonce_values.api_major_version == - 17) { - ODK_LicenseResponseV17 license_response_v17; - ODK_ParsedLicenseV17* dest = &license_response_v17.parsed_license; - ODK_ParsedLicense src = *license_response.parsed_license; - license_response_v17.request.core_message = license_response.core_message; - dest->enc_mac_keys_iv = src.enc_mac_keys_iv; - dest->enc_mac_keys = src.enc_mac_keys; - dest->pst = src.pst; - dest->srm_restriction_data = src.srm_restriction_data; - dest->license_type = src.license_type; - dest->nonce_required = src.nonce_required; - dest->timer_limits = src.timer_limits; - dest->watermarking = src.watermarking; - dest->dtcp2_required.dtcp2_required = src.dtcp2_required.dtcp2_required; - dest->dtcp2_required.cmi_descriptor_0.id = - src.dtcp2_required.cmi_descriptor_0.id; - dest->dtcp2_required.cmi_descriptor_0.extension = - src.dtcp2_required.cmi_descriptor_0.extension; - dest->dtcp2_required.cmi_descriptor_0.length = - src.dtcp2_required.cmi_descriptor_0.length; - dest->dtcp2_required.cmi_descriptor_0.data = - src.dtcp2_required.cmi_descriptor_0.data; - dest->dtcp2_required.cmi_descriptor_1.id = - src.dtcp2_required.cmi_descriptor_1.id; - dest->dtcp2_required.cmi_descriptor_1.extension = - src.dtcp2_required.cmi_descriptor_1.extension; - dest->dtcp2_required.cmi_descriptor_1.length = - src.dtcp2_required.cmi_descriptor_1.length; - dest->dtcp2_required.cmi_descriptor_1.data[0] = - src.dtcp2_required.cmi_descriptor_1.data[0]; - dest->dtcp2_required.cmi_descriptor_1.data[1] = - src.dtcp2_required.cmi_descriptor_1.data[1]; - dest->dtcp2_required.cmi_descriptor_1.data[2] = - src.dtcp2_required.cmi_descriptor_1.data[2]; - dest->dtcp2_required.cmi_descriptor_2.id = - src.dtcp2_required.cmi_descriptor_2.id; - dest->dtcp2_required.cmi_descriptor_2.extension = - src.dtcp2_required.cmi_descriptor_2.extension; - dest->dtcp2_required.cmi_descriptor_2.length = - src.dtcp2_required.cmi_descriptor_2.length; - dest->dtcp2_required.cmi_descriptor_2.data[0] = - src.dtcp2_required.cmi_descriptor_2.data[0]; - dest->dtcp2_required.cmi_descriptor_2.data[1] = - src.dtcp2_required.cmi_descriptor_2.data[1]; - dest->dtcp2_required.cmi_descriptor_2.data[2] = - src.dtcp2_required.cmi_descriptor_2.data[2]; - dest->key_array_length = src.key_array_length; - uint32_t i; - for (i = 0; i < dest->key_array_length && i < src.key_array_length; i++) { - dest->key_array[i] = src.key_array[i]; - } - if (core_request_sha256.size() != sizeof(license_response_v17.request_hash)) - return false; - memcpy(license_response_v17.request_hash, core_request_sha256.data(), - sizeof(license_response_v17.request_hash)); - return CreateResponse(ODK_License_Response_Type, core_request, - oemcrypto_core_message, - &license_response_v17.request.core_message, - license_response_v17, Pack_ODK_LicenseResponseV17); + 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.core_message, - license_response, Pack_ODK_LicenseResponse); + return CreateResponse(ODK_License_Response_Type, oemcrypto_core_message, + &license_response.core_message, license_response, + Pack_ODK_LicenseResponse); } bool CreateCoreRenewalResponse(const CoreMessageFeatures& features, @@ -241,11 +146,10 @@ bool CreateCoreRenewalResponse(const CoreMessageFeatures& features, renewal_response.renewal_duration_seconds = renewal_duration_seconds; if (!CreateResponseHeader(features, ODK_Renewal_Response_Type, &renewal_response.request.core_message, - core_request, renewal_response)) { + core_request)) { return false; } - return CreateResponse(ODK_Renewal_Response_Type, core_request, - oemcrypto_core_message, + return CreateResponse(ODK_Renewal_Response_Type, oemcrypto_core_message, &renewal_response.request.core_message, renewal_response, Pack_ODK_RenewalResponse); } @@ -257,8 +161,7 @@ bool CreateCoreProvisioningResponse(const CoreMessageFeatures& features, ODK_ProvisioningResponse prov_response{ {}, const_cast(&parsed_prov)}; if (!CreateResponseHeader(features, ODK_Provisioning_Response_Type, - &prov_response.core_message, core_request, - prov_response)) { + &prov_response.core_message, core_request)) { return false; } @@ -269,15 +172,15 @@ bool CreateCoreProvisioningResponse(const CoreMessageFeatures& features, } 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, core_request, + 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, core_request, - oemcrypto_core_message, &prov_response.core_message, - prov_response, Pack_ODK_ProvisioningResponse); + return CreateResponse(ODK_Provisioning_Response_Type, oemcrypto_core_message, + &prov_response.core_message, prov_response, + Pack_ODK_ProvisioningResponse); } bool CreateCoreProvisioning40Response( @@ -286,13 +189,12 @@ bool CreateCoreProvisioning40Response( std::string* oemcrypto_core_message) { ODK_Provisioning40Response prov_response = {}; if (!CreateResponseHeader(features, ODK_Provisioning_Response_Type, - &prov_response.core_message, 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.core_message, - prov_response, Pack_ODK_Provisioning40Response); + return CreateResponse(ODK_Provisioning_Response_Type, oemcrypto_core_message, + &prov_response.core_message, prov_response, + Pack_ODK_Provisioning40Response); } } // namespace serialize diff --git a/oemcrypto/odk/src/core_message_serialize_proto.cpp b/oemcrypto/odk/src/core_message_serialize_proto.cpp index 78b20fb..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,6 +171,9 @@ 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); } diff --git a/oemcrypto/odk/src/odk.c b/oemcrypto/odk/src/odk.c index db6f510..3ade4a7 100644 --- a/oemcrypto/odk/src/odk.c +++ b/oemcrypto/odk/src/odk.c @@ -9,6 +9,7 @@ #include #include +#include "odk_message.h" #include "odk_overflow.h" #include "odk_serialize.h" #include "odk_structs.h" @@ -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,23 @@ static OEMCryptoResult ODK_PrepareRequest( break; } case ODK_Provisioning_Request_Type: { - core_message->message_length = ODK_PROVISIONING_REQUEST_SIZE; - if (sizeof(ODK_PreparedProvisioningRequest) > - prepared_request_buffer_length) { - return ODK_ERROR_CORE_MESSAGE; + 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); } - Pack_ODK_PreparedProvisioningRequest( - &msg, (ODK_PreparedProvisioningRequest*)prepared_request_buffer); break; } case ODK_Provisioning40_Request_Type: { @@ -186,12 +208,19 @@ OEMCryptoResult ODK_PrepareCoreLicenseRequest( counter_info == NULL) { return ODK_ERROR_CORE_MESSAGE; } - 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)); + 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, @@ -250,14 +279,22 @@ OEMCryptoResult ODK_PrepareCoreProvisioningRequest( counter_info == NULL) { return ODK_ERROR_CORE_MESSAGE; } - ODK_PreparedProvisioningRequest provisioning_request = {0}; - memcpy(&provisioning_request.counter_info, counter_info, - sizeof(ODK_MessageCounterInfo)); + 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)); + 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( @@ -342,132 +379,12 @@ OEMCryptoResult ODK_ParseLicense( 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; - 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.core_message = license_response_v16.request.core_message; - parsed_license->renewal_delay_base = 0; - } else if (nonce_values->api_major_version == 17) { - ODK_LicenseResponseV17 license_response_v17 = {0}; - Unpack_ODK_LicenseResponseV17(&msg, &license_response_v17); - - if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK || - ODK_Message_GetOffset(&msg) != core_message_length) { - return ODK_ERROR_CORE_MESSAGE; - } - - ODK_ParsedLicenseV17 src = license_response_v17.parsed_license; - - // Need to manually set parsed_license fields to - // license_response_v17.parsed_license field values since - // license_response_v17 is no longer a pointer so parsed_license doesn't get - // updated during the unpacking. - parsed_license->enc_mac_keys_iv = src.enc_mac_keys_iv; - parsed_license->enc_mac_keys = src.enc_mac_keys; - parsed_license->pst = src.pst; - parsed_license->srm_restriction_data = src.srm_restriction_data; - parsed_license->license_type = src.license_type; - parsed_license->nonce_required = src.nonce_required; - parsed_license->timer_limits = src.timer_limits; - parsed_license->watermarking = src.watermarking; - parsed_license->dtcp2_required.dtcp2_required = - src.dtcp2_required.dtcp2_required; - parsed_license->dtcp2_required.cmi_descriptor_0.id = - src.dtcp2_required.cmi_descriptor_0.id; - parsed_license->dtcp2_required.cmi_descriptor_0.extension = - src.dtcp2_required.cmi_descriptor_0.extension; - parsed_license->dtcp2_required.cmi_descriptor_0.length = - src.dtcp2_required.cmi_descriptor_0.length; - parsed_license->dtcp2_required.cmi_descriptor_0.data = - src.dtcp2_required.cmi_descriptor_0.data; - parsed_license->dtcp2_required.cmi_descriptor_1.id = - src.dtcp2_required.cmi_descriptor_1.id; - parsed_license->dtcp2_required.cmi_descriptor_1.extension = - src.dtcp2_required.cmi_descriptor_1.extension; - parsed_license->dtcp2_required.cmi_descriptor_1.length = - src.dtcp2_required.cmi_descriptor_1.length; - parsed_license->dtcp2_required.cmi_descriptor_1.data[0] = - src.dtcp2_required.cmi_descriptor_1.data[0]; - parsed_license->dtcp2_required.cmi_descriptor_1.data[1] = - src.dtcp2_required.cmi_descriptor_1.data[1]; - parsed_license->dtcp2_required.cmi_descriptor_1.data[2] = - src.dtcp2_required.cmi_descriptor_1.data[2]; - parsed_license->dtcp2_required.cmi_descriptor_2.id = - src.dtcp2_required.cmi_descriptor_2.id; - parsed_license->dtcp2_required.cmi_descriptor_2.extension = - src.dtcp2_required.cmi_descriptor_2.extension; - parsed_license->dtcp2_required.cmi_descriptor_2.length = - src.dtcp2_required.cmi_descriptor_2.length; - parsed_license->dtcp2_required.cmi_descriptor_2.data[0] = - src.dtcp2_required.cmi_descriptor_2.data[0]; - parsed_license->dtcp2_required.cmi_descriptor_2.data[1] = - src.dtcp2_required.cmi_descriptor_2.data[1]; - parsed_license->dtcp2_required.cmi_descriptor_2.data[2] = - src.dtcp2_required.cmi_descriptor_2.data[2]; - parsed_license->key_array_length = src.key_array_length; - uint32_t i; - for (i = 0; i < parsed_license->key_array_length; i++) { - parsed_license->key_array[i] = src.key_array[i]; - } - // Set fields not used in V17 to default values. - parsed_license->renewal_delay_base = 0; - license_response.core_message = license_response_v17.request.core_message; - } 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 @@ -494,6 +411,12 @@ OEMCryptoResult ODK_ParseLicense( nonce_values->nonce = license_response.core_message.nonce_values.nonce; 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); @@ -548,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; @@ -603,14 +530,6 @@ OEMCryptoResult ODK_ParseProvisioning( 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; - } } else { // v18 ODK_ProvisioningResponse provisioning_response = {0}; 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_serialize.c b/oemcrypto/odk/src/odk_serialize.c index 3d45035..eec0266 100644 --- a/oemcrypto/odk/src/odk_serialize.c +++ b/oemcrypto/odk/src/odk_serialize.c @@ -47,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); @@ -60,89 +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_enum(msg, obj->renewal_delay_base); - 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_ParsedLicenseV17(ODK_Message* msg, - ODK_ParsedLicenseV17 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->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]); - } -} - -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++) { @@ -229,22 +172,14 @@ void Pack_ODK_PreparedRenewedProvisioningRequest( /* @@ kdo serialize */ void Pack_ODK_LicenseResponse(ODK_Message* msg, - ODK_LicenseResponse const* obj) { + ODK_Packing_LicenseResponse const* obj) { Pack_ODK_CoreMessage(msg, &obj->core_message); - Pack_ODK_ParsedLicense(msg, (const ODK_ParsedLicense*)obj->parsed_license); -} - -void Pack_ODK_LicenseResponseV17(ODK_Message* msg, - ODK_LicenseResponseV17 const* obj) { - Pack_ODK_PreparedLicenseRequestV17(msg, &obj->request); - Pack_ODK_ParsedLicenseV17(msg, &obj->parsed_license); -} - -void Pack_ODK_LicenseResponseV16(ODK_Message* msg, - ODK_LicenseResponseV16 const* obj) { - Pack_ODK_PreparedLicenseRequestV17(msg, &obj->request); - Pack_ODK_ParsedLicenseV16(msg, &obj->parsed_license); - PackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + 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, @@ -307,7 +242,8 @@ 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); @@ -315,123 +251,31 @@ static void Unpack_ODK_ParsedLicense(ODK_Message* msg, ODK_ParsedLicense* obj) { 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_OEMCrypto_TimerDelayBase(msg, &obj->renewal_delay_base); - 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_ParsedLicenseV17(ODK_Message* msg, - ODK_ParsedLicenseV17* 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); - 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; - } - 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; - } - 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); - Unpack_OEMCrypto_LicenseType(msg, &obj->license_type); - Unpack_bool(msg, &obj->nonce_required); - Unpack_ODK_TimerLimits(msg, &obj->timer_limits); Unpack_uint32_t(msg, &obj->key_array_length); if (obj->key_array_length > ODK_MAX_NUM_KEYS) { ODK_Message_SetStatus(msg, MESSAGE_STATUS_OVERFLOW_ERROR); @@ -494,6 +338,12 @@ void Unpack_ODK_PreparedProvisioningRequest( 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); @@ -527,20 +377,11 @@ void Unpack_ODK_PreparedCommonRequest(ODK_Message* msg, void Unpack_ODK_LicenseResponse(ODK_Message* msg, ODK_LicenseResponse* obj) { Unpack_ODK_CoreMessage(msg, &obj->core_message); - Unpack_ODK_ParsedLicense(msg, obj->parsed_license); -} - -void Unpack_ODK_LicenseResponseV17(ODK_Message* msg, - ODK_LicenseResponseV17* obj) { - Unpack_ODK_PreparedLicenseRequestV17(msg, &obj->request); - Unpack_ODK_ParsedLicenseV17(msg, &obj->parsed_license); -} - -void Unpack_ODK_LicenseResponseV16(ODK_Message* msg, - ODK_LicenseResponseV16* obj) { - Unpack_ODK_PreparedLicenseRequestV17(msg, &obj->request); - Unpack_ODK_ParsedLicenseV16(msg, &obj->parsed_license); - UnpackArray(msg, &obj->request_hash[0], sizeof(obj->request_hash)); + 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) { diff --git a/oemcrypto/odk/src/odk_serialize.h b/oemcrypto/odk/src/odk_serialize.h index db9e2f6..1ec74b6 100644 --- a/oemcrypto/odk/src/odk_serialize.h +++ b/oemcrypto/odk/src/odk_serialize.h @@ -34,10 +34,6 @@ void Pack_ODK_PreparedRenewedProvisioningRequest( /* 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_LicenseResponseV17(ODK_Message* msg, - ODK_LicenseResponseV17* 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); @@ -47,11 +43,8 @@ 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_LicenseResponseV17(ODK_Message* msg, - const ODK_LicenseResponseV17* 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); @@ -69,6 +62,8 @@ 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( diff --git a/oemcrypto/odk/src/odk_structs_priv.h b/oemcrypto/odk/src/odk_structs_priv.h index b20cc72..5306a4b 100644 --- a/oemcrypto/odk/src/odk_structs_priv.h +++ b/oemcrypto/odk/src/odk_structs_priv.h @@ -85,48 +85,17 @@ typedef struct { ODK_CoreMessage core_message; } 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 { - 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; - uint32_t key_array_length; - OEMCrypto_KeyObject key_array[ODK_MAX_NUM_KEYS]; -} ODK_ParsedLicenseV17; - typedef struct { ODK_CoreMessage core_message; ODK_ParsedLicense* parsed_license; + uint8_t request_hash[ODK_SHA256_HASH_SIZE]; } ODK_LicenseResponse; typedef struct { - ODK_PreparedLicenseRequestV17 request; - ODK_ParsedLicenseV17 parsed_license; + ODK_CoreMessage core_message; + ODK_Packing_ParsedLicense* parsed_license; uint8_t request_hash[ODK_SHA256_HASH_SIZE]; -} ODK_LicenseResponseV17; - -typedef struct { - ODK_PreparedLicenseRequestV17 request; - ODK_ParsedLicenseV16 parsed_license; - uint8_t request_hash[ODK_SHA256_HASH_SIZE]; -} ODK_LicenseResponseV16; +} ODK_Packing_LicenseResponse; typedef struct { ODK_PreparedRenewalRequest request; @@ -154,8 +123,10 @@ typedef struct { // ../test/odk_test.cpp for validations of each of the defined request sizes. #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 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 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/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 ad20cb7..04905f1 100644 --- a/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp +++ b/oemcrypto/odk/test/fuzzing/odk_fuzz_helper.cpp @@ -4,8 +4,11 @@ #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 { @@ -41,7 +44,8 @@ OEMCryptoResult odk_serialize_LicenseRequest( const ODK_LicenseRequest& core_license_request UNUSED, const ODK_NonceValues* nonce_values) { // TODO(mattfedd): hook up counters to fuzzer - const ODK_MessageCounterInfo counter_info = {0}; + 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); } @@ -58,10 +62,11 @@ 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) { // TODO(mattfedd): hook up counters to fuzzer - const ODK_MessageCounterInfo counter_info = {0}; + 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); } @@ -123,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); } @@ -155,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 2ed15d4..db476ad 100644 --- a/oemcrypto/odk/test/odk_core_message_test.cpp +++ b/oemcrypto/odk/test/odk_core_message_test.cpp @@ -2,11 +2,15 @@ // 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" @@ -18,6 +22,9 @@ 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 = @@ -69,40 +76,121 @@ TEST(CoreMessageTest, ParseCoreCommonRequestFromMessage) { EXPECT_EQ(odk_common_request.session_id, 1); } -// 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. -TEST(CoreMessageTest, ProvisionRequestRoundtrip_V18_Initial) { - std::vector should_pass = { - // Pulled from ODKTest provision round trip, extra 4 bytes removed - "000000050000005e00000012deadbeefcafebabe000000000000000000000000" - "000000000000000000000000000000000000000000000000000000000000000000000000" - "00000000000000000000000000000000000000000000", - // Same thing but v17 in nonce. Almost like testing on the v17 server (but - // not quite since the v17 parsing code has been slightly changed anyway) - "000000050000005e00000011deadbeefcafebabe000000000000000000000000" - "000000000000000000000000000000000000000000000000000000000000000000000000" - "00000000000000000000000000000000000000000000", - }; +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; +}; - ODK_ProvisioningRequest request; - for (auto& tc : should_pass) { - ASSERT_TRUE(CoreProvisioningRequestFromMessage(absl::HexStringToBytes(tc), - &request)); - } - - // Fail cases have non-zero values after the bytes interpreted as length - std::vector should_fail = { - // Change a 0 to a 1 in the message counter - "000000050000005e00000012deadbeefcafebabe000000000000000100000000" - "000000000000000000000000000000000000000000000000000000000000000000000000" - "00000000000000000000000000000000000000000000", - }; - - for (auto& tc : should_fail) { - ASSERT_FALSE(CoreProvisioningRequestFromMessage(absl::HexStringToBytes(tc), - &request)); - } +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 6cd9319..71073fc 100644 --- a/oemcrypto/odk/test/odk_test.cpp +++ b/oemcrypto/odk/test/odk_test.cpp @@ -4,6 +4,7 @@ #include "odk.h" +#include #include #include #include @@ -17,6 +18,7 @@ #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" @@ -332,12 +334,21 @@ TEST(OdkTest, NullRequestTest) { &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, &counter_info)); + 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}; @@ -883,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), @@ -976,13 +990,32 @@ TEST_P(OdkVersionTest, LicenseResponseRoundtrip) { &(params.clock_values), &(params.core_message.nonce_values), &(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), @@ -990,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); @@ -1105,20 +1216,22 @@ std::vector TestCases() { // 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, 1}, + {18, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 18, 3}, // Here are some known good versions. Make extra sure they work. {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, 0, 18, 0}, + {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, 0, 17, 2}, // Change to 18 when the default version is updated. + {0, 18, 3, 18, 3}, // Change to 19 when the default version is updated. }; return test_cases; } @@ -1143,7 +1256,11 @@ TEST(OdkSizeTest, LicenseRequest) { &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) { @@ -1207,7 +1324,11 @@ TEST(OdkSizeTest, ProvisioningRequest) { &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. @@ -1221,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/opk/build/ree-sources.mk b/oemcrypto/opk/build/ree-sources.mk index a589520..307dc46 100644 --- a/oemcrypto/opk/build/ree-sources.mk +++ b/oemcrypto/opk/build/ree-sources.mk @@ -211,7 +211,9 @@ oemcrypto_unittests_sources += \ $(oemcrypto_unittests_dir)/oemcrypto_corpus_generator_helper.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_session_tests_helper.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_basic_test.cpp \ + $(oemcrypto_unittests_dir)/oemcrypto_cast_test.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_decrypt_test.cpp \ + $(oemcrypto_unittests_dir)/oemcrypto_generic_crypto_test.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_license_test.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_provisioning_test.cpp \ $(oemcrypto_unittests_dir)/oemcrypto_usage_table_test.cpp \ diff --git a/oemcrypto/opk/build/tee-sources.mk b/oemcrypto/opk/build/tee-sources.mk index 38123d8..9f96daf 100644 --- a/oemcrypto/opk/build/tee-sources.mk +++ b/oemcrypto/opk/build/tee-sources.mk @@ -109,6 +109,7 @@ wtpi_serialization_tee_includes += \ serialization_tee_sources += \ $(serialization_dir)/tee/GEN_dispatcher.c \ $(serialization_dir)/tee/GEN_tee_serializer.c \ + $(serialization_dir)/tee/special_case_request_handlers.c \ $(serialization_dir)/tee/tee_special_cases.c \ $(serialization_dir)/tee/tee_os_type.c \ $(serialization_dir)/tee/tee_version.c \ diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto.c index afa83c2..79b5125 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto.c @@ -88,13 +88,14 @@ static OEMCryptoResult FreeContentAndEntitlementKeys( "OEMCrypto is not yet initialized"); ABORT_IF_NULL(session); OEMCryptoResult result = OEMCrypto_SUCCESS; - OEMCryptoResult free_key_result = result; for (size_t i = 0; i < session->num_content_keys; i++) { - free_key_result = OPKI_FreeKeyFromTable(&session->content_keys[i]); + OEMCryptoResult free_key_result = + OPKI_FreeKeyFromTable(&session->content_keys[i]); if (result == OEMCrypto_SUCCESS) result = free_key_result; } for (size_t i = 0; i < session->num_entitlement_keys; i++) { - free_key_result = OPKI_FreeKeyFromTable(&session->entitlement_keys[i]); + OEMCryptoResult free_key_result = + OPKI_FreeKeyFromTable(&session->entitlement_keys[i]); if (result == OEMCrypto_SUCCESS) result = free_key_result; } session->num_content_keys = 0; @@ -108,9 +109,9 @@ static OEMCryptoResult FreeEntitledContentKeys( "OEMCrypto is not yet initialized"); ABORT_IF_NULL(session); OEMCryptoResult result = OEMCrypto_SUCCESS; - OEMCryptoResult free_key_result = result; for (size_t i = 0; i < session->num_entitled_content_keys; i++) { - free_key_result = OPKI_FreeKeyFromTable(&session->entitled_content_keys[i]); + OEMCryptoResult free_key_result = + OPKI_FreeKeyFromTable(&session->entitled_content_keys[i]); if (result == OEMCrypto_SUCCESS) result = free_key_result; session->entitlement_keys[i] = (EntitlementKeyInfo){0}; } @@ -182,6 +183,7 @@ cleanup:; // TODO(b/225216277): When result is not OEMCrypto_ERROR_NOT_IMPLEMENTED // above, uncomment this check // if (result == OEMCrypto_SUCCESS) + // NOLINTNEXTLINE result = free_key_result; free_key_result = FreeMacAndEncryptionKeys(session_context); // TODO(b/225216277): When result is not OEMCrypto_ERROR_NOT_IMPLEMENTED @@ -280,7 +282,7 @@ static OEMCryptoResult RewrapDeviceDRMKeyCommon(OEMCryptoSession* session, return result; } -static OEMCryptoResult RewrapDeviceDRMKeyKeybox( +static OEMCryptoResult RewrapDeviceDRMKey( OEMCryptoSession* session_context, const uint8_t* message, size_t message_length, const uint8_t* signature, size_t signature_length, const uint8_t* enc_drm_key, size_t enc_drm_key_length, @@ -288,8 +290,17 @@ static OEMCryptoResult RewrapDeviceDRMKeyKeybox( uint8_t* wrapped_drm_key, size_t wrapped_drm_key_length) { ABORT_IF(g_opk_system_state != SYSTEM_INITIALIZED, "OEMCrypto is not yet initialized"); - ABORT_IF(WTPI_GetProvisioningMethod() != OEMCrypto_Keybox, - "This function is only valid on Provisioning 2.0 devices"); + const bool is_prov_2 = (WTPI_GetProvisioningMethod() == OEMCrypto_Keybox); + const bool is_prov_4 = + (WTPI_GetProvisioningMethod() == OEMCrypto_BootCertificateChain); + const bool supports_cast = + ((WTPI_SupportedCertificates() & OEMCrypto_Supports_RSA_CAST) != 0); + + // this function is for Prov 2 devices, or Prov 4 with cast + const bool can_continue = is_prov_2 || (is_prov_4 && supports_cast); + ABORT_IF(!can_continue, + "This function is only valid on Provisioning 2.0 devices, or " + "Provisioning 4.0 devices that support Cast"); ABORT_IF_NULL(session_context); ABORT_IF_NULL(message); @@ -458,7 +469,6 @@ OEMCryptoResult OEMCrypto_Initialize(void) { // provisioned with a keybox. In that case, we log the error and continue. // A production system will fail later on when it tries to validate the // keybox. - result = OEMCrypto_SUCCESS; } OPKI_InitializeSessionTable(); @@ -648,7 +658,7 @@ OEMCryptoResult OEMCrypto_GenerateDerivedKeys(OEMCrypto_SESSION session, LOGE("Failed to derive mac and encryption keys from keybox with result: %u", result); } -cleanup : { +cleanup: { OEMCryptoResult free_key_result = WTPI_K1_FreeKeyHandle(keybox_key); if (result == OEMCrypto_SUCCESS) result = free_key_result; if (result != OEMCrypto_SUCCESS) { @@ -1226,7 +1236,7 @@ static OEMCryptoResult LoadKeysNoSignature( } if (crypto_memcmp(message + srm_restriction_data.offset, kSrmVerification, - sizeof(kSrmVerification))) { + sizeof(kSrmVerification)) != 0) { LOGE("SRM verification failed"); return OEMCrypto_ERROR_INVALID_CONTEXT; } @@ -1465,100 +1475,6 @@ OEMCryptoResult OEMCrypto_LoadLicense(OEMCrypto_SESSION session, return OPKI_SetStatePostCall(session_context, API_LOADLICENSE); } -OEMCryptoResult OEMCrypto_LoadKeys( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const uint8_t* signature, size_t signature_length, - OEMCrypto_Substring enc_mac_keys_iv, OEMCrypto_Substring enc_mac_keys, - size_t key_array_length, const OEMCrypto_KeyObject* key_array, - OEMCrypto_Substring pst, OEMCrypto_Substring srm_restriction_data, - OEMCrypto_LicenseType license_type) { - if (g_opk_system_state != SYSTEM_INITIALIZED) { - LOGE("OEMCrypto is not yet initialized"); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - if (OPKI_GetSessionType(session) != SESSION_TYPE_OEMCRYPTO) { - LOGE("Unexpected session type."); - return OEMCrypto_ERROR_INVALID_SESSION; - } - OEMCryptoSession* session_context = NULL; - OEMCryptoResult result = OPKI_GetSession(session, &session_context); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to get session with result: %u, session = %u", result, - session); - return result; - } - ABORT_IF(session_context == NULL, - "OPKI_GetSession() provided invalid output."); - result = OPKI_CheckStatePreCall(session_context, API_LOADKEYS); - if (result != OEMCrypto_SUCCESS) return result; - - RETURN_INVALID_CONTEXT_IF_NULL(message); - RETURN_INVALID_CONTEXT_IF_ZERO(message_length); - RETURN_INVALID_CONTEXT_IF_NULL(signature); - if (signature_length != SHA256_DIGEST_LENGTH) { - LOGE("signature_length is not the length of a SHA256 digest"); - return OEMCrypto_ERROR_SIGNATURE_FAILURE; - } - RETURN_INVALID_CONTEXT_IF_NULL(key_array); - RETURN_INVALID_CONTEXT_IF_ZERO(key_array_length); - - if (license_type != OEMCrypto_ContentLicense && - license_type != OEMCrypto_EntitlementLicense) { - LOGE("Invalid license type: %u", license_type); - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - /* Check state before we check signature. State is change in - * LoadKeysNoSignature. */ - if (session_context->response_loaded) { - return OEMCrypto_ERROR_LICENSE_RELOAD; - } - - result = OPKI_VerifySignatureWithMacKeyServer(session_context, message, - message_length, signature); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to verify signature with server mac key, error: %u", result); - return result; - } - - result = LoadKeysNoSignature( - session_context, message, message_length, enc_mac_keys_iv, enc_mac_keys, - key_array_length, key_array, pst, srm_restriction_data, license_type); - if (result != OEMCrypto_SUCCESS) return result; - - /* Update clock values using the duration for the loaded key. */ - SymmetricKey* key = NULL; - const int kIndex = 0; - switch (session_context->license_type) { - case OEMCrypto_ContentLicense: - if (session_context->num_content_keys == 0) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - key = session_context->content_keys[kIndex]; - break; - case OEMCrypto_EntitlementLicense: - if (session_context->num_entitlement_keys == 0) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - key = session_context->entitlement_keys[kIndex]; - break; - default: - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - const uint32_t duration = key ? key->key_control_block.duration : 0; - uint64_t now; - result = WTPI_GetTrustedTime(&now); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to get trusted time with result: %u", result); - return result; - } - result = ODK_InitializeV15Values( - &session_context->timer_limits, &session_context->clock_values, - &session_context->nonce_values, duration, now); - if (result != OEMCrypto_SUCCESS) return result; - return OPKI_SetStatePostCall(session_context, API_LOADKEYS); -} - OEMCryptoResult OEMCrypto_LoadEntitledContentKeys( OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, size_t key_array_length, @@ -1611,7 +1527,6 @@ OEMCryptoResult OEMCrypto_LoadEntitledContentKeys( } } - result = OEMCrypto_SUCCESS; for (size_t i = 0; i < key_array_length; i++) { const OEMCrypto_EntitledContentKeyObject key_object = key_array[i]; SymmetricKey* entitlement_key = OPKI_FindKeyFromTable( @@ -1769,87 +1684,6 @@ OEMCryptoResult OEMCrypto_LoadRenewal(OEMCrypto_SESSION session, return result; } -OEMCryptoResult OEMCrypto_RefreshKeys( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const uint8_t* signature, size_t signature_length, size_t key_array_length, - const OEMCrypto_KeyRefreshObject* key_array) { - if (g_opk_system_state != SYSTEM_INITIALIZED) { - LOGE("OEMCrypto is not yet initialized"); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - if (OPKI_GetSessionType(session) != SESSION_TYPE_OEMCRYPTO) { - LOGE("Unexpected session type."); - return OEMCrypto_ERROR_INVALID_SESSION; - } - OEMCryptoSession* session_context = NULL; - OEMCryptoResult result = OPKI_GetSession(session, &session_context); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to get session with result: %u, session = %u", result, - session); - return result; - } - ABORT_IF(session_context == NULL, - "OPKI_GetSession() provided invalid output."); - result = OPKI_CheckStatePreCall(session_context, API_REFRESHKEYS); - if (result != OEMCrypto_SUCCESS) return result; - - RETURN_INVALID_CONTEXT_IF_NULL(message); - RETURN_INVALID_CONTEXT_IF_ZERO(message_length); - RETURN_INVALID_CONTEXT_IF_NULL(signature); - if (signature_length != SHA256_DIGEST_LENGTH) { - LOGE("signature_length is not the length of a SHA256 digest"); - return OEMCrypto_ERROR_SIGNATURE_FAILURE; - } - RETURN_INVALID_CONTEXT_IF_NULL(key_array); - RETURN_INVALID_CONTEXT_IF_ZERO(key_array_length); - - /* We only use the first key object to update the entire license. Since we - * know num_keys > 0 after the last if statement, we can assume index is not - * out of bounds. */ - static const size_t kIndex = 0; - if (!IsSubstrInRange(message_length, key_array[kIndex].key_id, true) || - !IsSubstrInRange(message_length, key_array[kIndex].key_control, false) || - !IsSubstrInRange(message_length, key_array[kIndex].key_control_iv, - true) || - key_array[kIndex].key_id.length > KEY_ID_MAX_SIZE || - key_array[kIndex].key_control.length < KEY_CONTROL_SIZE || - (key_array[kIndex].key_control_iv.length != 0 && - key_array[kIndex].key_control_iv.length != KEY_IV_SIZE)) { - LOGE("Invalid substring range for key: %zu", kIndex); - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - if (!session_context->refresh_valid) { - LOGE("Invalid key refresh"); - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - result = OPKI_VerifySignatureWithMacKeyServer(session_context, message, - message_length, signature); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to verify signature with server mac key, error: %u", result); - return result; - } - - result = OEMCrypto_SUCCESS; - const uint8_t* key_id = NULL; - const uint8_t* key_control_iv = NULL; - if (key_array[kIndex].key_id.length != 0) { - key_id = message + key_array[kIndex].key_id.offset; - } - if (key_array[kIndex].key_control_iv.length != 0) { - key_control_iv = message + key_array[kIndex].key_control_iv.offset; - } - result = OPKI_RefreshKey( - session_context, key_id, key_array[kIndex].key_id.length, - message + key_array[kIndex].key_control.offset, key_control_iv); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to refresh key with result: %u", result); - return result; - } - return OPKI_SetStatePostCall(session_context, API_REFRESHKEYS); -} - OEMCryptoResult OEMCrypto_QueryKeyControl(OEMCrypto_SESSION session, const uint8_t* content_key_id, size_t content_key_id_length, @@ -2144,10 +1978,10 @@ OEMCryptoResult OEMCrypto_CopyBuffer( LOGE("OEMCrypto is not yet initialized"); return OEMCrypto_ERROR_UNKNOWN_FAILURE; } + if (data_length == 0) return OEMCrypto_SUCCESS; /* We don't need to check the session, CopyBuffer should be allowed for all session states since it doesn't access any state data. */ RETURN_INVALID_CONTEXT_IF_NULL(data_addr); - RETURN_INVALID_CONTEXT_IF_ZERO(data_length); RETURN_INVALID_CONTEXT_IF_NULL(dest_buffer_desc); OEMCryptoResult result; @@ -2499,8 +2333,24 @@ OEMCryptoResult OEMCrypto_WrapKeyboxOrOEMCert( OEMCryptoResult OEMCrypto_InstallKeyboxOrOEMCert(const uint8_t* keybox, size_t length) { +// This API is only allowed in factory mode. +#ifdef FACTORY_BUILD_ONLY // TODO(b/225216277): We currently only support keyboxes. return WTPI_UnwrapValidateAndInstallKeybox(keybox, length); +#else + return OEMCrypto_ERROR_NOT_IMPLEMENTED; +#endif +} + +OEMCryptoResult OEMCrypto_FactoryInstallBCCSignature(const uint8_t* signature, + size_t signature_length) { +// This API is only allowed in factory mode. +#ifdef FACTORY_BUILD_ONLY + // TODO: add implementation. + return OEMCrypto_ERROR_NOT_IMPLEMENTED; +#else + return OEMCrypto_ERROR_NOT_IMPLEMENTED; +#endif } OEMCrypto_ProvisioningMethod OEMCrypto_GetProvisioningMethod(void) { @@ -2694,8 +2544,6 @@ OEMCryptoResult OEMCrypto_BuildInformation(char* buffer, XSTR(OPK_CONFIG_CAN_DISABLE_ANALOG_DISPLAY)"\"," "\"OPK_CONFIG_MAX_HDCP_CAPABILITY\":\"" XSTR(OPK_CONFIG_MAX_HDCP_CAPABILITY)"\"," - "\"OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT\":\"" - XSTR(OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT)"\"," "\"OPK_CONFIG_MAX_OUTPUT_SIZE_FOR_DECRYPT\":\"" XSTR(OPK_CONFIG_MAX_OUTPUT_SIZE_FOR_DECRYPT)"\"," "\"OPK_CONFIG_MAX_BUFFER_SIZE_FOR_GENERIC_CRYPTO\":\"" @@ -3052,6 +2900,10 @@ OEMCryptoResult OEMCrypto_LoadProvisioning( LOGE("Encrypted private key length is too large to handle."); return OEMCrypto_ERROR_INVALID_CONTEXT; } + if (parsed_response.enc_private_key.length == 0) { + LOGE("Encrypted private key length is zero."); + return OEMCrypto_ERROR_INVALID_CONTEXT; + } if (parsed_response.enc_private_key_iv.length != KEY_IV_SIZE) { LOGE("Encrypted private key iv has invalid length: %zu", parsed_response.enc_private_key_iv.length); @@ -3077,8 +2929,11 @@ OEMCryptoResult OEMCrypto_LoadProvisioning( const uint8_t* message_body = message + core_message_length; const OEMCrypto_ProvisioningMethod provisioning_method = WTPI_GetProvisioningMethod(); - if (provisioning_method == OEMCrypto_Keybox) { - result = RewrapDeviceDRMKeyKeybox( + + // RewrapDeviceDRMKey only intended for Prov 4 with cast, or Prov 2. + if (provisioning_method == OEMCrypto_Keybox || + provisioning_method == OEMCrypto_BootCertificateChain) { + result = RewrapDeviceDRMKey( session_context, message, message_length, signature, signature_length, message_body + parsed_response.enc_private_key.offset, parsed_response.enc_private_key.length, @@ -3862,11 +3717,73 @@ OEMCryptoResult OEMCrypto_ReassociateEntitledKeySession( OEMCryptoSession* entitlement_session_context = NULL; /* entitlement_session must be present to be associated to. */ result = OPKI_GetSession(entitlement_session, &entitlement_session_context); - if (result != OEMCrypto_SUCCESS || entitlement_session_context == NULL) { + if (result != OEMCrypto_SUCCESS) { LOGE("Failed to get session with result: %u, session = %u", result, entitlement_session); return result; } + /* Validations to be done before re-associating an entitled key session to a + * new entitlement session: + * 1. at least one entitled key is supposed to have its entitlement key found + * in the new session + * 2. for any entitled key, if its entitlement key is found in the new + * session, then the key control block should remain unchanged in the new + * session, compared to the one in the existing entitlement session */ + bool key_found = false; + for (uint32_t i = 0; i < key_session_context->num_entitled_content_keys; + i++) { + /* Gets the entitlement key info that the current entitled key associates + * with. */ + const EntitlementKeyInfo* key_info = + &key_session_context->entitlement_keys[i]; + /* Finds the entitlement key in the new entitlement session. It is ok if an + * entitled key doesn't have an entitlement key in the new entitlement + * session. The entitled key will be ignored in this case. */ + for (uint32_t k = 0; k < entitlement_session_context->num_entitlement_keys; + k++) { + const SymmetricKey* entitlement_key = + entitlement_session_context->entitlement_keys[k]; + if (key_info->entitlement_key_id_size == entitlement_key->key_id_size && + memcmp(key_info->entitlement_key_id, entitlement_key->key_id, + key_info->entitlement_key_id_size) == 0) { + /* Found at least one entitlement key in new session. */ + key_found = true; + /* Get the existing entitlement session to which the key session is + * currently associated. */ + OEMCryptoSession* old_entitlement_session_context = NULL; + result = OPKI_GetSession(key_session_context->entitlement_session_id, + &old_entitlement_session_context); + if (result != OEMCrypto_SUCCESS) { + LOGE("Failed to get session with result: %u, session = %u", result, + key_session_context->entitlement_session_id); + return result; + } + SymmetricKey* old_entitlement_key = NULL; + result = OPKI_GetEntitlementKey( + old_entitlement_session_context, key_info->entitlement_key_id, + key_info->entitlement_key_id_size, &old_entitlement_key); + if (result != OEMCrypto_SUCCESS) { + LOGE("Failed to get session entitlement key with result: %u", result); + return result; + } + /* Make sure the key control block is not changed. */ + const KeyControlBlock* control_block = + &entitlement_key->key_control_block; + const KeyControlBlock* old_control_block = + &old_entitlement_key->key_control_block; + if (control_block->control_bits != old_control_block->control_bits || + control_block->duration != old_control_block->duration) { + return OEMCrypto_ERROR_INVALID_SESSION; + } + break; + } + } // loop entitlement keys + } // loop entitled keys + if (!key_found) { + LOGE("Failed to find entitlement keys in session = %u", + entitlement_session); + return OEMCrypto_ERROR_INVALID_SESSION; + } key_session_context->entitlement_session_id = entitlement_session; return OEMCrypto_SUCCESS; } diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_api_macros.h b/oemcrypto/opk/oemcrypto_ta/oemcrypto_api_macros.h index 02a74e1..f178463 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_api_macros.h +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_api_macros.h @@ -34,7 +34,7 @@ // version bumps to v17.1, the first released OPK implementation would be // v17.1.0 #define API_MAJOR_VERSION 18 -#define API_MINOR_VERSION 1 +#define API_MINOR_VERSION 3 #define OPK_PATCH_VERSION 0 #endif /* OEMCRYPTO_TA_OEMCRYPTO_API_MACROS_H_ */ diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_key_control_block.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_key_control_block.c index ae83ae4..d70952e 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_key_control_block.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_key_control_block.c @@ -31,21 +31,18 @@ OEMCryptoResult OPKI_ParseKeyControlBlock(const uint8_t* kcb, key_control_block.control_bits = extract_field_from_KCB(kcb, 3); const char* verification = key_control_block.verification; - if (memcmp(verification, "kc18", 4) && /* add in version 18 api */ - memcmp(verification, "kc17", 4) && /* add in version 17 api */ - memcmp(verification, "kc16", 4) && /* add in version 16 api */ - memcmp(verification, "kc15", 4) && /* add in version 15 api */ - memcmp(verification, "kc14", 4) && /* add in version 14 api */ - memcmp(verification, "kc13", 4) && /* add in version 13 api */ - memcmp(verification, "kc12", 4) && /* add in version 12 api */ - memcmp(verification, "kc11", 4) && /* add in version 11 api */ - memcmp(verification, "kc10", 4) && /* add in version 10 api */ - memcmp(verification, "kc09", 4) && /* add in version 9 api */ - memcmp(verification, "kctl", 4)) { /* original verification */ - key_control_block.valid = false; - } else { - key_control_block.valid = true; - } + key_control_block.valid = + memcmp(verification, "kc18", 4) == 0 || /* add in version 18 api */ + memcmp(verification, "kc17", 4) == 0 || /* add in version 17 api */ + memcmp(verification, "kc16", 4) == 0 || /* add in version 16 api */ + memcmp(verification, "kc15", 4) == 0 || /* add in version 15 api */ + memcmp(verification, "kc14", 4) == 0 || /* add in version 14 api */ + memcmp(verification, "kc13", 4) == 0 || /* add in version 13 api */ + memcmp(verification, "kc12", 4) == 0 || /* add in version 12 api */ + memcmp(verification, "kc11", 4) == 0 || /* add in version 11 api */ + memcmp(verification, "kc10", 4) == 0 || /* add in version 10 api */ + memcmp(verification, "kc09", 4) == 0 || /* add in version 9 api */ + memcmp(verification, "kctl", 4) == 0; /* original verification */ *out = key_control_block; return OEMCrypto_SUCCESS; } diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_output.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_output.c index cdedc97..c4e7f77 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_output.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_output.c @@ -52,7 +52,6 @@ OEMCryptoResult OPK_ParseDestBufferDesc( OEMCryptoResult OPK_CheckOutputBounds(const OPK_OutputBuffer* output_buffer, size_t offset, size_t size) { ABORT_IF_NULL(output_buffer); - ABORT_IF_ZERO(size); ABORT_IF(!OPK_IsOutputBufferValid(output_buffer), "Invalid output buffer."); const size_t max_allowed = WTPI_MaxOutputSizeForDecrypt(); diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.c index 251ed2e..27d2511 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.c @@ -60,4 +60,14 @@ bool OPK_SubOverflowUX(size_t a, size_t b, size_t* c) { return true; } +bool OPK_AddOverflowUintptr(uintptr_t a, uintptr_t b, uintptr_t* c) { + if (UINTPTR_MAX - a >= b) { + if (c) { + *c = a + b; + } + return false; + } + return true; +} + #endif diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.h b/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.h index ab0b98c..2912678 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.h +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_overflow.h @@ -48,6 +48,12 @@ NO_IGNORE_RESULT static inline bool OPK_SubOverflowUX(size_t a, size_t b, return __builtin_sub_overflow(a, b, c); } +NO_IGNORE_RESULT static inline bool OPK_AddOverflowUintptr(uintptr_t a, + uintptr_t b, + uintptr_t* c) { + return __builtin_add_overflow(a, b, c); +} + #else /* The builtins are not available, so use our implementations. */ @@ -56,6 +62,8 @@ NO_IGNORE_RESULT bool OPK_SubOverflowU32(uint32_t a, uint32_t b, uint32_t* c); NO_IGNORE_RESULT bool OPK_SubOverflowU64(uint64_t a, uint64_t b, uint64_t* c); NO_IGNORE_RESULT bool OPK_AddOverflowUX(size_t a, size_t b, size_t* c); NO_IGNORE_RESULT bool OPK_SubOverflowUX(size_t a, size_t b, size_t* c); +NO_IGNORE_RESULT bool OPK_AddOverflowUintptr(uintptr_t a, uintptr_t b, + uintptr_t* c); #endif /* __has_builtin(__builtin_add_overflow) || COMPATIBLE_WITH_GCC(5) */ diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_session.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_session.c index 36828a4..32bcb0c 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_session.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_session.c @@ -156,6 +156,7 @@ OEMCryptoResult OPKI_CheckStatePreCall(OEMCryptoSession* session, case (SESSION_OPENED): case (SESSION_INSTALL_OEM_PRIVATE_KEY): case (SESSION_PREPARING_REQUEST): + case (SESSION_LOAD_DRM_RSA_KEY): case (SESSION_LOAD_OEM_RSA_KEY): return OEMCrypto_SUCCESS; default: @@ -174,6 +175,7 @@ OEMCryptoResult OPKI_CheckStatePreCall(OEMCryptoSession* session, } case API_LOADPROVISIONING: switch (session->state) { + case (SESSION_LOAD_DRM_RSA_KEY): case (SESSION_WAIT_FOR_PROVISIONING): return OEMCrypto_SUCCESS; default: @@ -192,6 +194,8 @@ OEMCryptoResult OPKI_CheckStatePreCall(OEMCryptoSession* session, case (SESSION_OPENED): case (SESSION_PREPARING_REQUEST): case (SESSION_USAGE_ENTRY_LOADED): + // Prov 4 OEM private key installed at beginning of session + case (SESSION_INSTALL_OEM_PRIVATE_KEY): // Provisioning 4 skips LoadProvisioning case (SESSION_WAIT_FOR_PROVISIONING): // This can happen when using testing the CDM with a pre-provisioned @@ -319,6 +323,9 @@ OEMCryptoResult OPKI_CheckStatePreCall(OEMCryptoSession* session, case API_MOVEENTRY: switch (session->state) { case (SESSION_USAGE_ENTRY_LOADED): + case (SESSION_OPENED): + case (SESSION_WAIT_FOR_LICENSE): + case (SESSION_LOAD_DRM_RSA_KEY): return OEMCrypto_SUCCESS; default: goto err; @@ -1159,8 +1166,7 @@ OEMCryptoResult OPKI_EnforceOutputRestrictions(KeyControlBlock control) { const uint8_t required_hdcp = (control.control_bits & CONTROL_HDCP_VERSION_MASK) >> CONTROL_HDCP_VERSION_SHIFT; - if (!IsHdcpLevelSufficient(required_hdcp, capability) || - capability == HDCP_NONE) { + if (!IsHdcpLevelSufficient(required_hdcp, capability)) { return OEMCrypto_ERROR_INSUFFICIENT_HDCP; } } @@ -1333,12 +1339,14 @@ NO_IGNORE_RESULT static OEMCryptoResult ComputeDecryptHash( return result; } } - result = WTPI_Crc32Cont_OutputBuffer( - output_buffer, current_offset, subsample_length, - decrypt_hash->current_hash, &decrypt_hash->current_hash); - if (result != OEMCrypto_SUCCESS) { - LOGE("Failed to compute CRC32 with result: %u", result); - return result; + if (subsample_length > 0) { + result = WTPI_Crc32Cont_OutputBuffer( + output_buffer, current_offset, subsample_length, + decrypt_hash->current_hash, &decrypt_hash->current_hash); + if (result != OEMCrypto_SUCCESS) { + LOGE("Failed to compute CRC32 with result: %u", result); + return result; + } } if (OEMCrypto_LastSubsample & subsample->subsample_flags) { if (decrypt_hash->current_hash != decrypt_hash->given_hash) { diff --git a/oemcrypto/opk/oemcrypto_ta/oemcrypto_usage_table.c b/oemcrypto/opk/oemcrypto_ta/oemcrypto_usage_table.c index 075cce5..676843c 100644 --- a/oemcrypto/opk/oemcrypto_ta/oemcrypto_usage_table.c +++ b/oemcrypto/opk/oemcrypto_ta/oemcrypto_usage_table.c @@ -156,7 +156,7 @@ NO_IGNORE_RESULT static OEMCryptoResult EncryptAndSignHeader( .buffer_size = sizeof(signed_header.buffer), .buffer = {0}, }; - uint8_t temp_buffer[PADDED_HEADER_BUFFER_SIZE]; + uint8_t temp_buffer[PADDED_HEADER_BUFFER_SIZE] = {0}; OEMCryptoResult result = OPKI_PackUsageHeader(temp_buffer, sizeof(temp_buffer), &header); if (result != OEMCrypto_SUCCESS) return result; @@ -312,7 +312,7 @@ NO_IGNORE_RESULT static OEMCryptoResult EncryptAndSignEntry( .buffer_size = sizeof(signed_entry.buffer), .buffer = {0}, }; - uint8_t temp_buffer[PADDED_ENTRY_BUFFER_SIZE]; + uint8_t temp_buffer[PADDED_ENTRY_BUFFER_SIZE] = {0}; OEMCryptoResult result = OPKI_PackUsageEntry(temp_buffer, sizeof(temp_buffer), entry); if (result != OEMCrypto_SUCCESS) return result; @@ -922,7 +922,7 @@ OEMCryptoResult OPKI_VerfiyUsageEntryPST(OEMCrypto_SESSION session_id, return OEMCrypto_ERROR_UNKNOWN_FAILURE; } if (entry->data.pst_length != pst_length || - crypto_memcmp(entry->data.pst, pst, pst_length)) { + crypto_memcmp(entry->data.pst, pst, pst_length) != 0) { return OEMCrypto_ERROR_WRONG_PST; } return OEMCrypto_SUCCESS; @@ -994,9 +994,9 @@ OEMCryptoResult OPKI_VerifyUsageEntryMacKeys( return result; } if (crypto_memcmp(entry->data.mac_key_server, wrapped_server_mac, - WRAPPED_MAC_KEY_SIZE) || + WRAPPED_MAC_KEY_SIZE) != 0 || crypto_memcmp(entry->data.mac_key_client, wrapped_client_mac, - WRAPPED_MAC_KEY_SIZE)) { + WRAPPED_MAC_KEY_SIZE) != 0) { return OEMCrypto_ERROR_WRONG_PST; } return OEMCrypto_SUCCESS; @@ -1066,7 +1066,7 @@ OEMCryptoResult OPKI_ReportUsage(OEMCrypto_SESSION session_id, pst_length != entry->data.pst_length) { return OEMCrypto_ERROR_WRONG_PST; } - if (crypto_memcmp(entry->data.pst, pst, pst_length)) { + if (crypto_memcmp(entry->data.pst, pst, pst_length) != 0) { return OEMCrypto_ERROR_WRONG_PST; } diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_config_interface.h b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_config_interface.h index 7a1d416..af02c0d 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_config_interface.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_config_interface.h @@ -104,20 +104,6 @@ OEMCryptoResult WTPI_GetCurrentSRMVersion(uint32_t* srm_version); */ bool WTPI_IsAntiRollbackHWPresent(void); -/** - * Returns whether or not the device was able to apply the CGMS protection for - * the device. The |cgms_field| correlates to those under the Key Control Block - * description in the OEMCrypto doc. If the cgms_field is invalid, return - * OEMCrypto_ERROR_UNKNOWN_FAILURE. Even if this function is not called, the - * device should attempt best effort for CGMS. - * - * @param[in] cgms_field: CGMS control bits. - * - * @retval OEMCrypto_SUCCESS - * @retval OEMCrypto_ERROR_UNKNOWN_FAILURE - */ -OEMCryptoResult WTPI_ApplyCGMS(uint8_t cgms_field); - /** * Returns whether CGMS is enabled for analog output for this device. */ @@ -150,12 +136,6 @@ bool WTPI_CanDisableAnalogDisplay(void); */ bool WTPI_DisableAnalogDisplay(void); -/** - * Returns the max buffer size/max subsample size in bytes allowed for - * DecryptCENC. If there is no restriction, returns 0. - */ -size_t WTPI_MaxBufferSizeForDecrypt(void); - /** * Returns the max output size in bytes allowed for DecryptCENC and CopyBuffer. * If there is no restriction, returns 0. diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_device_key_access_interface.h b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_device_key_access_interface.h index 54bddae..d1ad420 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_device_key_access_interface.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi/wtpi_device_key_access_interface.h @@ -29,6 +29,20 @@ extern "C" { */ /** Returns the device unique key. + * + * The device key is a secret array of bytes that is unique per individual + * device (not just device family) and persistent across reboots. It must + * never leave the device. It is used to encrypt and decrypt the usage table + * and the DRM key. + * + * In case of a security flaw that exposes the device key, the device key + * should be renewed or regenerated as part of the security fix. + * + * For Provisioning 2, the device key is a 128-bit AES key that is part of the + * keybox. + * + * For Provisioning 4, the device key should be derived from a unique device + * secret. * * @return The device unique key. * */ diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/config/default.h b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/config/default.h index 8128b40..f4ef821 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/config/default.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/config/default.h @@ -140,17 +140,6 @@ # define OPK_CONFIG_MAX_HDCP_CAPABILITY HDCP_NO_DIGITAL_OUTPUT #endif -/** - * Maximum buffer size for DecryptCENC input in bytes. - * - * 0 means no limit. - * - * Type is size_t - */ -#ifndef OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT -# define OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT 0 -#endif - /** * Maximum output size in bytes allowed for DecryptCENC. * diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/cose_util.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/cose_util.c index 57f3fc5..59de36e 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/cose_util.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/cose_util.c @@ -244,7 +244,7 @@ static DiceResult EncodeCoseSign1(const uint8_t* protected_attributes, // Payload. CborWriteBstr(payload_size, payload, &out); // Signature. - CborWriteBstr(/*num_elements=*/signature_size, signature, &out); + CborWriteBstr(/*data_size=*/signature_size, signature, &out); if (CborOutOverflowed(&out)) { return kDiceResultBufferTooSmall; } @@ -321,7 +321,7 @@ OEMCryptoResult DiceCoseSignAndEncodeSign1(const uint8_t* payload, #endif // CSR is defined in: -// https://source.corp.google.com/android/hardware/interfaces/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl +// https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl #define CSR_PAYLOAD_MAX_LENGTH 2048 // The max length of a string field in device CBOR map @@ -332,22 +332,22 @@ OEMCryptoResult DiceCoseSignAndEncodeSign1(const uint8_t* payload, // Device info is defined in: // https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl typedef struct { - // TSTR fields with DEVICE_TSTR_MAX_LENGTH need an extra space for null - // termination + // TSTR fields with DEVICE_TSTR_MAX_LENGTH or DEVICE_TSTR_SHORT_MAX_LENGTH + // need an extra space for null termination char brand[DEVICE_TSTR_MAX_LENGTH + 1]; char manufacturer[DEVICE_TSTR_MAX_LENGTH + 1]; char product[DEVICE_TSTR_MAX_LENGTH + 1]; char model[DEVICE_TSTR_MAX_LENGTH + 1]; char device[DEVICE_TSTR_MAX_LENGTH + 1]; - char vb_state[DEVICE_TSTR_SHORT_MAX_LENGTH]; - char bootloader_state[DEVICE_TSTR_SHORT_MAX_LENGTH]; + char vb_state[DEVICE_TSTR_SHORT_MAX_LENGTH + 1]; + char bootloader_state[DEVICE_TSTR_SHORT_MAX_LENGTH + 1]; uint8_t vbmeta_digest[64]; size_t vbmeta_digest_size; char os_version[DEVICE_TSTR_MAX_LENGTH + 1]; uint64_t system_patch_level; uint64_t boot_patch_level; uint64_t vendor_patch_level; - char security_level[DEVICE_TSTR_SHORT_MAX_LENGTH]; + char security_level[DEVICE_TSTR_SHORT_MAX_LENGTH + 1]; int64_t fused; } DeviceInfo; @@ -474,8 +474,7 @@ static OEMCryptoResult DecodeAndWriteDeviceInfo( const size_t kNumPairs = 14; OEMCryptoResult result = OEMCrypto_SUCCESS; - DeviceInfo deviceInfo; - memset(&deviceInfo, 0, sizeof(deviceInfo)); + DeviceInfo deviceInfo = {0}; for (size_t i = 0; i < item_count; ++i) { const char* raw_key; size_t key_size = 0; @@ -549,61 +548,69 @@ static OEMCryptoResult DecodeAndWriteDeviceInfo( // Write the decoded device info map. CborWriteMap(kNumPairs, cbor_csr_out); - // Write key-values in canonical order: - // boot_patch_level - // bootloader_state - // brand - // device - // fused - // manufacturer - // model - // os_version - // product - // security_level - // system_patch_level - // vb_state - // vbmeta_digest - // vendor_patch_level + // Write key-values in canonical order, which is required when the device info + // map is validated by the server. Current CBOR C library doesn't provide + // canonicalize(). Pairs are manually added to the map following CBOR map + // canonicalization rules below: + // 1. If two keys have different lengths, the shorter one sorts earlier. + // 2. If two keys have the same length, the one with the lower value in + // (byte-wise) lexical order sorts earlier. + // + // brand: 5 + // fused: 5 + // model: 5 + // device: 6 + // product: 7 + // vb_state: 8 + // os_version: 10 + // manufacturer: 12 + // vbmeta_digest: 13 + // security_level: 14 + // boot_patch_level: 16 + // bootloader_state: 16 + // system_patch_level: 18 + // vendor_patch_level: 18 + + CborWriteTstr(kBrand, cbor_csr_out); + CborWriteTstr(deviceInfo.brand, cbor_csr_out); + + CborWriteTstr(kFused, cbor_csr_out); + CborWriteInt(deviceInfo.fused, cbor_csr_out); + + CborWriteTstr(kModel, cbor_csr_out); + CborWriteTstr(deviceInfo.model, cbor_csr_out); + + CborWriteTstr(kDevice, cbor_csr_out); + CborWriteTstr(deviceInfo.device, cbor_csr_out); + + CborWriteTstr(kProduct, cbor_csr_out); + CborWriteTstr(deviceInfo.product, cbor_csr_out); + + CborWriteTstr(kVbState, cbor_csr_out); + CborWriteTstr(deviceInfo.vb_state, cbor_csr_out); + + CborWriteTstr(kOsVersion, cbor_csr_out); + CborWriteTstr(deviceInfo.os_version, cbor_csr_out); + + CborWriteTstr(kManufacturer, cbor_csr_out); + CborWriteTstr(deviceInfo.manufacturer, cbor_csr_out); + + CborWriteTstr(kVbmetaDigest, cbor_csr_out); + CborWriteBstr(deviceInfo.vbmeta_digest_size, deviceInfo.vbmeta_digest, + cbor_csr_out); + + CborWriteTstr(kSecurityLevel, cbor_csr_out); + CborWriteTstr(deviceInfo.security_level, cbor_csr_out); + CborWriteTstr(kBootPatchLevel, cbor_csr_out); CborWriteUint(deviceInfo.boot_patch_level, cbor_csr_out); CborWriteTstr(kBootloaderState, cbor_csr_out); CborWriteTstr(deviceInfo.bootloader_state, cbor_csr_out); - CborWriteTstr(kBrand, cbor_csr_out); - CborWriteTstr(deviceInfo.brand, cbor_csr_out); - - CborWriteTstr(kDevice, cbor_csr_out); - CborWriteTstr(deviceInfo.device, cbor_csr_out); - - CborWriteTstr(kFused, cbor_csr_out); - CborWriteInt(deviceInfo.fused, cbor_csr_out); - - CborWriteTstr(kManufacturer, cbor_csr_out); - CborWriteTstr(deviceInfo.manufacturer, cbor_csr_out); - - CborWriteTstr(kModel, cbor_csr_out); - CborWriteTstr(deviceInfo.model, cbor_csr_out); - - CborWriteTstr(kOsVersion, cbor_csr_out); - CborWriteTstr(deviceInfo.os_version, cbor_csr_out); - - CborWriteTstr(kProduct, cbor_csr_out); - CborWriteTstr(deviceInfo.product, cbor_csr_out); - - CborWriteTstr(kSecurityLevel, cbor_csr_out); - CborWriteTstr(deviceInfo.security_level, cbor_csr_out); - CborWriteTstr(kSystemPatchLevel, cbor_csr_out); CborWriteUint(deviceInfo.system_patch_level, cbor_csr_out); - CborWriteTstr(kVbState, cbor_csr_out); - CborWriteTstr(deviceInfo.vb_state, cbor_csr_out); - - CborWriteTstr(kVbmetaDigest, cbor_csr_out); - CborWriteBstr(deviceInfo.vbmeta_digest_size, deviceInfo.vbmeta_digest, - cbor_csr_out); - CborWriteTstr(kVendorPatchLevel, cbor_csr_out); CborWriteUint(deviceInfo.vendor_patch_level, cbor_csr_out); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/crypto_util.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/crypto_util.c index fd4b67e..882b9fc 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/crypto_util.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/crypto_util.c @@ -123,7 +123,7 @@ bool OPKI_DeriveKeyWithCMAC(const uint8_t* key, KeySize key_size, CMAC_CTX* cmac_ctx = CMAC_CTX_new(); if (!cmac_ctx) return false; - for (uint8_t index = 0; index < out_key_size; index += KEY_SIZE_128) { + for (int index = 0; index < (int)out_key_size; index += KEY_SIZE_128) { if (!CMAC_Init(cmac_ctx, key, key_size, cipher, 0)) { CMAC_CTX_free(cmac_ctx); return false; diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/rsa_util.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/rsa_util.c index ba70d8d..f0e56ea 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/rsa_util.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/rsa_util.c @@ -4,6 +4,7 @@ #include "rsa_util.h" +#include "oemcrypto_compiler_attributes.h" #include "oemcrypto_key_types.h" #include "openssl/bio.h" #include "openssl/err.h" @@ -14,7 +15,7 @@ #include "wtpi_logging_interface.h" void dump_ssl_error(void) { - int count = 0; + UNUSED int count = 0; unsigned long err; while ((err = ERR_get_error())) { count++; diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_config.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_config.c index ce7b0dc..43397e9 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_config.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_config.c @@ -47,11 +47,6 @@ bool WTPI_IsAntiRollbackHWPresent(void) { return OPK_CONFIG_HW_ANTIROLLBACK_SUPPORTED; } -OEMCryptoResult WTPI_ApplyCGMS(uint8_t cgms_field) { - (void)cgms_field; - return OEMCrypto_ERROR_UNKNOWN_FAILURE; -} - bool WTPI_IsCGMS_AActive(void) { return false; } bool WTPI_SupportsCGMS_A(void) { return OPK_CONFIG_SUPPORTS_CGMSA; } @@ -66,10 +61,6 @@ bool WTPI_CanDisableAnalogDisplay(void) { bool WTPI_DisableAnalogDisplay(void) { return false; } -size_t WTPI_MaxBufferSizeForDecrypt(void) { - return OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT; -} - size_t WTPI_MaxOutputSizeForDecrypt(void) { return OPK_CONFIG_MAX_OUTPUT_SIZE_FOR_DECRYPT; } diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_hw.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_hw.c index 6f6555e..909d5c0 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_hw.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_hw.c @@ -10,6 +10,7 @@ #include "OEMCryptoCENCCommon.h" #include "key_mapping_interface.h" +#include "oemcrypto_check_macros.h" #include "oemcrypto_compiler_attributes.h" #include "oemcrypto_object_table.h" #include "oemcrypto_overflow.h" @@ -132,6 +133,10 @@ static OEMCryptoResult VerifyAndDecryptKey( static bool IsKeyValid(uint32_t index) { WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, index); + if (key == NULL) { + LOGE("Key at index %u is null", index); + return false; + } switch (key->key_type) { case CONTENT_KEY: // We cheat a little here. We also call generic crypto keys "content @@ -163,6 +168,7 @@ static OEMCryptoResult GetKeyType(WTPI_K1_SymmetricKey_Handle key_handle, } WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); + ABORT_IF_NULL(key); *type = key->key_type; return OEMCrypto_SUCCESS; } @@ -177,6 +183,7 @@ OEMCryptoResult WTPI_K1_GetKeySize(WTPI_K1_SymmetricKey_Handle key_handle, } WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); + ABORT_IF_NULL(key); *size = key->key_size; return OEMCrypto_SUCCESS; } @@ -203,6 +210,7 @@ WTPI_K2_SymmetricKey_Handle KM_LookupKeyHandle( WTPI_K2_SymmetricKey_Handle k2_key_handle = NULL; uint32_t k1_index = k1_key_handle->index; WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, k1_index); + ABORT_IF_NULL(key); if (key->is_loaded) { uint32_t k2_index = key->index_loaded; k2_key_handle = gHandlePairTable[k2_index].k2_key_handle; @@ -236,6 +244,7 @@ OEMCryptoResult KM_PairKeyHandle(WTPI_K1_SymmetricKey_Handle k1_key_handle, if (result != OEMCrypto_SUCCESS) return result; WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, k1_key_handle->index); + ABORT_IF_NULL(key); key->is_loaded = true; key->index_loaded = k2_index; gHandlePairTable[k2_index].k2_key_handle = k2_key_handle; @@ -250,6 +259,7 @@ static void UnpairKeyHandle(uint32_t k2_index) { if (IsKeyHandleValid(k1_key_handle)) { WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, k1_key_handle->index); + ABORT_IF_NULL(key); key->is_loaded = false; key->index_loaded = MAX_NUMBER_OF_LAYER2_KEY_TABLE_ENTRIES; } diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_openssl.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_openssl.c index 313dda1..61b86ea 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_openssl.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_crypto_and_key_management_layer1_openssl.c @@ -11,6 +11,8 @@ #include "OEMCryptoCENCCommon.h" #include "crypto_util.h" #include "device_key_util.h" +#include "odk_util.h" +#include "oemcrypto_check_macros.h" #include "oemcrypto_compiler_attributes.h" #include "oemcrypto_object_table.h" #include "oemcrypto_overflow.h" @@ -109,6 +111,7 @@ static OEMCryptoResult GetKeyType(WTPI_K1_SymmetricKey_Handle key_handle, } WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); + ABORT_IF_NULL(key); *type = key->key_type; return OEMCrypto_SUCCESS; } @@ -159,7 +162,7 @@ static OEMCryptoResult VerifyAndDecryptKey( ABORT_IF(out_key == NULL, "Parameters are NULL or 0"); WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); - if (key == NULL) return OEMCrypto_ERROR_UNKNOWN_FAILURE; + ABORT_IF_NULL(key); ABORT_IF(out_size < (size_t)(key->key_size), "Invalid output buffer size"); const uint8_t* wrapped_data = (const uint8_t*)(&key->key_data); @@ -176,13 +179,13 @@ static OEMCryptoResult VerifyAndDecryptKey( const uint8_t* wrapped_key_data = (const uint8_t*)(&wrapped->wrapped_key_data); size_t wrapped_key_data_length = sizeof(wrapped->wrapped_key_data); - uint8_t computed_signature[SHA256_DIGEST_LENGTH]; + uint8_t computed_signature[SHA256_DIGEST_LENGTH] = {0}; if (!OPKI_HMAC_SHA256(wrapped_key_data, wrapped_key_data_length, signing_key, sizeof(signing_key), computed_signature)) { return OEMCrypto_ERROR_UNKNOWN_FAILURE; } - if (memcmp(wrapped->signature, computed_signature, SHA256_DIGEST_LENGTH) != - 0) { + if (crypto_memcmp(wrapped->signature, computed_signature, + SHA256_DIGEST_LENGTH) != 0) { return OEMCrypto_ERROR_SIGNATURE_FAILURE; } @@ -224,6 +227,7 @@ OEMCryptoResult WTPI_K1_GetKeySize(WTPI_K1_SymmetricKey_Handle key_handle, } WTPI_K1_SymmetricKey* key = OPKI_GetFromObjectTable(&key_table, key_handle->index); + ABORT_IF_NULL(key); *size = key->key_size; return OEMCrypto_SUCCESS; } @@ -365,11 +369,11 @@ OEMCryptoResult WTPI_C1_HMAC_SHA256_Verify( if (!IsKeyHandleValid(key_handle)) { return OEMCrypto_ERROR_INVALID_CONTEXT; } - uint8_t computed_signature[SHA256_DIGEST_LENGTH]; + uint8_t computed_signature[SHA256_DIGEST_LENGTH] = {0}; OEMCryptoResult result = WTPI_C1_HMAC_SHA256( key_handle, message, message_length, computed_signature); if (result != OEMCrypto_SUCCESS) return result; - if (memcmp(signature, computed_signature, SHA256_DIGEST_LENGTH) != 0) { + if (crypto_memcmp(signature, computed_signature, SHA256_DIGEST_LENGTH) != 0) { return OEMCrypto_ERROR_SIGNATURE_FAILURE; } return OEMCrypto_SUCCESS; @@ -466,7 +470,6 @@ OEMCryptoResult WTPI_K1_AESDecryptAndCreateKeyHandle( (size_t)decryption_key_size, key)) { return OEMCrypto_ERROR_UNKNOWN_FAILURE; } - if (result != OEMCrypto_SUCCESS) return result; return WTPI_K1_CreateKeyHandle(key, enc_key_length, key_type, out_key_handle); } diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_decrypt_sample.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_decrypt_sample.c index 1ce44a9..62b1143 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_decrypt_sample.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_decrypt_sample.c @@ -27,8 +27,9 @@ NO_IGNORE_RESULT static OEMCryptoResult DecryptToOutputBuffer_CBC( const OEMCrypto_CENCEncryptPatternDesc* pattern, const uint8_t* cipher_data, size_t cipher_data_length, const OPK_OutputBuffer* output_buffer, size_t output_offset) { + if (cipher_data_length == 0) return OEMCrypto_SUCCESS; if (key_handle == NULL || initial_iv == NULL || pattern == NULL || - cipher_data == NULL || cipher_data_length == 0 || output_buffer == NULL) { + cipher_data == NULL || output_buffer == NULL) { return OEMCrypto_ERROR_INVALID_CONTEXT; } OEMCryptoResult result = @@ -94,9 +95,10 @@ NO_IGNORE_RESULT static OEMCryptoResult DecryptToOutputBuffer_CTR( WTPI_K1_SymmetricKey_Handle key_handle, const uint8_t* initial_iv, size_t block_offset, const uint8_t* cipher_data, size_t cipher_data_length, const OPK_OutputBuffer* output_buffer, size_t output_offset) { + if (cipher_data_length == 0) return OEMCrypto_SUCCESS; if (key_handle == NULL || initial_iv == NULL || block_offset >= AES_BLOCK_SIZE || cipher_data == NULL || - cipher_data_length == 0 || output_buffer == NULL) { + output_buffer == NULL) { return OEMCrypto_ERROR_INVALID_CONTEXT; } OEMCryptoResult result = @@ -231,6 +233,7 @@ OEMCryptoResult WTPI_DecryptSample( subsample->num_bytes_encrypted, &subsample_length)) { return OEMCrypto_ERROR_INVALID_CONTEXT; } + if (subsample_length == 0) continue; size_t current_offset; if (OPK_AddOverflowUX(starting_output_offset, offset, ¤t_offset)) { diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_root_of_trust_layer1.c b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_root_of_trust_layer1.c index 59d8482..e13b87e 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_root_of_trust_layer1.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_reference/wtpi_root_of_trust_layer1.c @@ -123,6 +123,10 @@ OEMCryptoResult WTPI_UnwrapValidateAndInstallKeybox(const uint8_t* input, result = OEMCrypto_ERROR_SHORT_BUFFER; goto cleanup; } + if (input == NULL) { + result = OEMCrypto_ERROR_INVALID_CONTEXT; + goto cleanup; + } // First, try the buffer as if is a clear keybox. memcpy(&gKeybox, input, output_length); result = WTPI_ValidateKeybox(); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/common/GEN_common_serializer.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/common/GEN_common_serializer.c index da397a0..675a491 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/common/GEN_common_serializer.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/common/GEN_common_serializer.c @@ -11,7 +11,6 @@ #include -#include "GEN_common_serializer.h" #include "bump_allocator.h" #include "common_special_cases.h" #include "log_macros.h" diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_oemcrypto_tee_test_api.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_oemcrypto_tee_test_api.c index f2109aa..b9c259f 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_oemcrypto_tee_test_api.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_oemcrypto_tee_test_api.c @@ -2011,38 +2011,6 @@ cleanup_and_return: return result; } -OEMCryptoResult WTPI_ApplyCGMS(uint8_t cgms_field) { - pthread_mutex_lock(&api_lock); - OEMCryptoResult result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - ODK_Message request = ODK_Message_Create(NULL, 0); - ODK_Message response = ODK_Message_Create(NULL, 0); - - API_Initialize(); - request = OPK_Pack_ApplyCGMS_Request(cgms_field); - if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { - if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { - api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; - } else { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - goto cleanup_and_return; - } - response = API_Transact(&request); - OPK_Unpack_ApplyCGMS_Response(&response, &result); - - if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } -cleanup_and_return: - TOS_Transport_ReleaseMessage(&request); - TOS_Transport_ReleaseMessage(&response); - - API_Terminate(); - result = API_CheckResult(result); - pthread_mutex_unlock(&api_lock); - return result; -} - bool WTPI_IsCGMS_AActive(void) { pthread_mutex_lock(&api_lock); bool result = false; @@ -2229,37 +2197,6 @@ cleanup_and_return: return result; } -size_t WTPI_MaxBufferSizeForDecrypt(void) { - pthread_mutex_lock(&api_lock); - size_t result = 0; - ODK_Message request = ODK_Message_Create(NULL, 0); - ODK_Message response = ODK_Message_Create(NULL, 0); - - API_Initialize(); - request = OPK_Pack_MaxBufferSizeForDecrypt_Request(); - if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { - if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { - api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; - } else { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - goto cleanup_and_return; - } - response = API_Transact(&request); - OPK_Unpack_MaxBufferSizeForDecrypt_Response(&response, &result); - - if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } -cleanup_and_return: - TOS_Transport_ReleaseMessage(&request); - TOS_Transport_ReleaseMessage(&response); - - API_Terminate(); - pthread_mutex_unlock(&api_lock); - return result; -} - size_t WTPI_MaxOutputSizeForDecrypt(void) { pthread_mutex_lock(&api_lock); size_t result = 0; diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.c index a8fa099..140fa7a 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.c @@ -1949,36 +1949,8 @@ void OPK_Unpack_IsAntiRollbackHWPresent_Response(ODK_Message* msg, OPK_SharedBuffer_FinalizeUnpacking(); } -ODK_Message OPK_Pack_ApplyCGMS_Request(uint8_t cgms_field) { - uint32_t api_value = 10058; /* from _tee10058 */ - ODK_Message msg = TOS_Transport_GetRequest(); - OPK_Pack_uint32_t(&msg, &api_value); - uint64_t timestamp = time(0); - OPK_Pack_uint64_t(&msg, ×tamp); - OPK_Pack_uint8_t(&msg, &cgms_field); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - -void OPK_Unpack_ApplyCGMS_Response(ODK_Message* msg, OEMCryptoResult* result) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10058) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - OPK_Unpack_uint32_t(msg, result); - if (!Is_Valid_OEMCryptoResult(*result)) { - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_INVALID_ENUM_VALUE); - } - OPK_UnpackEOM(msg); - - if (SuccessResult(*result)) { - OPK_SharedBuffer_FinalizeUnpacking(); - } -} - ODK_Message OPK_Pack_IsCGMS_AActive_Request(void) { - uint32_t api_value = 10059; /* from _tee10059 */ + uint32_t api_value = 10058; /* from _tee10058 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -1991,7 +1963,7 @@ ODK_Message OPK_Pack_IsCGMS_AActive_Request(void) { void OPK_Unpack_IsCGMS_AActive_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10059) + if (api_value != 10058) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -1999,7 +1971,7 @@ void OPK_Unpack_IsCGMS_AActive_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_SupportsCGMS_A_Request(void) { - uint32_t api_value = 10060; /* from _tee10060 */ + uint32_t api_value = 10059; /* from _tee10059 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2012,7 +1984,7 @@ ODK_Message OPK_Pack_SupportsCGMS_A_Request(void) { void OPK_Unpack_SupportsCGMS_A_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10060) + if (api_value != 10059) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2020,7 +1992,7 @@ void OPK_Unpack_SupportsCGMS_A_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_HasAnalogDisplay_Request(void) { - uint32_t api_value = 10061; /* from _tee10061 */ + uint32_t api_value = 10060; /* from _tee10060 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2033,7 +2005,7 @@ ODK_Message OPK_Pack_HasAnalogDisplay_Request(void) { void OPK_Unpack_HasAnalogDisplay_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10061) + if (api_value != 10060) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2041,7 +2013,7 @@ void OPK_Unpack_HasAnalogDisplay_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_IsAnalogDisplayActive_Request(void) { - uint32_t api_value = 10062; /* from _tee10062 */ + uint32_t api_value = 10061; /* from _tee10061 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2054,7 +2026,7 @@ ODK_Message OPK_Pack_IsAnalogDisplayActive_Request(void) { void OPK_Unpack_IsAnalogDisplayActive_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10062) + if (api_value != 10061) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2062,7 +2034,7 @@ void OPK_Unpack_IsAnalogDisplayActive_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_CanDisableAnalogDisplay_Request(void) { - uint32_t api_value = 10063; /* from _tee10063 */ + uint32_t api_value = 10062; /* from _tee10062 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2076,7 +2048,7 @@ void OPK_Unpack_CanDisableAnalogDisplay_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10063) + if (api_value != 10062) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2084,7 +2056,7 @@ void OPK_Unpack_CanDisableAnalogDisplay_Response(ODK_Message* msg, } ODK_Message OPK_Pack_DisableAnalogDisplay_Request(void) { - uint32_t api_value = 10064; /* from _tee10064 */ + uint32_t api_value = 10063; /* from _tee10063 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2097,37 +2069,15 @@ ODK_Message OPK_Pack_DisableAnalogDisplay_Request(void) { void OPK_Unpack_DisableAnalogDisplay_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10064) + if (api_value != 10063) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); OPK_SharedBuffer_FinalizeUnpacking(); } -ODK_Message OPK_Pack_MaxBufferSizeForDecrypt_Request(void) { - uint32_t api_value = 10065; /* from _tee10065 */ - ODK_Message msg = TOS_Transport_GetRequest(); - OPK_Pack_uint32_t(&msg, &api_value); - uint64_t timestamp = time(0); - OPK_Pack_uint64_t(&msg, ×tamp); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - -void OPK_Unpack_MaxBufferSizeForDecrypt_Response(ODK_Message* msg, - size_t* result) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10065) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - OPK_Unpack_size_t(msg, result); - OPK_UnpackEOM(msg); - OPK_SharedBuffer_FinalizeUnpacking(); -} - ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Request(void) { - uint32_t api_value = 10066; /* from _tee10066 */ + uint32_t api_value = 10064; /* from _tee10064 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2141,7 +2091,7 @@ void OPK_Unpack_MaxOutputSizeForDecrypt_Response(ODK_Message* msg, size_t* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10066) + if (api_value != 10064) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_size_t(msg, result); OPK_UnpackEOM(msg); @@ -2149,7 +2099,7 @@ void OPK_Unpack_MaxOutputSizeForDecrypt_Response(ODK_Message* msg, } ODK_Message OPK_Pack_IsClosedPlatform_Request(void) { - uint32_t api_value = 10067; /* from _tee10067 */ + uint32_t api_value = 10065; /* from _tee10065 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2162,7 +2112,7 @@ ODK_Message OPK_Pack_IsClosedPlatform_Request(void) { void OPK_Unpack_IsClosedPlatform_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10067) + if (api_value != 10065) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2170,7 +2120,7 @@ void OPK_Unpack_IsClosedPlatform_Response(ODK_Message* msg, bool* result) { } ODK_Message OPK_Pack_CurrentHDCPCapability_Request(void) { - uint32_t api_value = 10068; /* from _tee10068 */ + uint32_t api_value = 10066; /* from _tee10066 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2184,7 +2134,7 @@ void OPK_Unpack_CurrentHDCPCapability_Response( ODK_Message* msg, OEMCrypto_HDCP_Capability* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10068) + if (api_value != 10066) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_OEMCrypto_HDCP_Capability(msg, result); OPK_UnpackEOM(msg); @@ -2192,7 +2142,7 @@ void OPK_Unpack_CurrentHDCPCapability_Response( } ODK_Message OPK_Pack_MaxHDCPCapability_Request(void) { - uint32_t api_value = 10069; /* from _tee10069 */ + uint32_t api_value = 10067; /* from _tee10067 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2206,7 +2156,7 @@ void OPK_Unpack_MaxHDCPCapability_Response(ODK_Message* msg, OEMCrypto_HDCP_Capability* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10069) + if (api_value != 10067) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_OEMCrypto_HDCP_Capability(msg, result); OPK_UnpackEOM(msg); @@ -2214,7 +2164,7 @@ void OPK_Unpack_MaxHDCPCapability_Response(ODK_Message* msg, } ODK_Message OPK_Pack_MaxBufferSizeForGenericCrypto_Request(void) { - uint32_t api_value = 10070; /* from _tee10070 */ + uint32_t api_value = 10068; /* from _tee10068 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2228,7 +2178,7 @@ void OPK_Unpack_MaxBufferSizeForGenericCrypto_Response(ODK_Message* msg, size_t* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10070) + if (api_value != 10068) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_size_t(msg, result); OPK_UnpackEOM(msg); @@ -2236,7 +2186,7 @@ void OPK_Unpack_MaxBufferSizeForGenericCrypto_Response(ODK_Message* msg, } ODK_Message OPK_Pack_MaxSampleSize_Request(void) { - uint32_t api_value = 10071; /* from _tee10071 */ + uint32_t api_value = 10069; /* from _tee10069 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2249,7 +2199,7 @@ ODK_Message OPK_Pack_MaxSampleSize_Request(void) { void OPK_Unpack_MaxSampleSize_Response(ODK_Message* msg, size_t* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10071) + if (api_value != 10069) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_size_t(msg, result); OPK_UnpackEOM(msg); @@ -2257,7 +2207,7 @@ void OPK_Unpack_MaxSampleSize_Response(ODK_Message* msg, size_t* result) { } ODK_Message OPK_Pack_SupportedCertificates_Request(void) { - uint32_t api_value = 10072; /* from _tee10072 */ + uint32_t api_value = 10070; /* from _tee10070 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2271,7 +2221,7 @@ void OPK_Unpack_SupportedCertificates_Response(ODK_Message* msg, uint32_t* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10072) + if (api_value != 10070) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_uint32_t(msg, result); OPK_UnpackEOM(msg); @@ -2279,7 +2229,7 @@ void OPK_Unpack_SupportedCertificates_Response(ODK_Message* msg, } ODK_Message OPK_Pack_ContentDecryptBypassesTA_Request(void) { - uint32_t api_value = 10073; /* from _tee10073 */ + uint32_t api_value = 10071; /* from _tee10071 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2293,7 +2243,7 @@ void OPK_Unpack_ContentDecryptBypassesTA_Response(ODK_Message* msg, bool* result) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10073) + if (api_value != 10071) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_bool(msg, result); OPK_UnpackEOM(msg); @@ -2302,7 +2252,7 @@ void OPK_Unpack_ContentDecryptBypassesTA_Response(ODK_Message* msg, ODK_Message OPK_Pack_GetEncryptAndSignSize_Request( uint32_t context, size_t in_length, const size_t* wrapped_length) { - uint32_t api_value = 10074; /* from _tee10074 */ + uint32_t api_value = 10072; /* from _tee10072 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2320,7 +2270,7 @@ void OPK_Unpack_GetEncryptAndSignSize_Response(ODK_Message* msg, size_t** wrapped_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10074) + if (api_value != 10072) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_uint32_t(msg, result); if (!Is_Valid_OEMCryptoResult(*result)) { @@ -2339,7 +2289,7 @@ ODK_Message OPK_Pack_EncryptAndSign_Request(uint32_t context, size_t data_length, const uint8_t* out, const size_t* out_length) { - uint32_t api_value = 10075; /* from _tee10075 */ + uint32_t api_value = 10073; /* from _tee10073 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2359,7 +2309,7 @@ void OPK_Unpack_EncryptAndSign_Response(ODK_Message* msg, size_t** out_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10075) + if (api_value != 10073) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_UnpackNullable_size_t(msg, out_length); OPK_Unpack_uint32_t(msg, result); @@ -2385,7 +2335,7 @@ ODK_Message OPK_Pack_VerifyAndDecrypt_Request(uint32_t context, size_t wrapped_length, const uint8_t* out, const size_t* out_length) { - uint32_t api_value = 10076; /* from _tee10076 */ + uint32_t api_value = 10074; /* from _tee10074 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2406,7 +2356,7 @@ void OPK_Unpack_VerifyAndDecrypt_Response(ODK_Message* msg, uint8_t** out, size_t** out_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10076) + if (api_value != 10074) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_UnpackNullable_size_t(msg, out_length); OPK_Unpack_uint32_t(msg, result); @@ -2430,7 +2380,7 @@ void OPK_Unpack_VerifyAndDecrypt_Response(ODK_Message* msg, ODK_Message OPK_Pack_VerifyAndDecryptUsageData_Legacy_Request( const uint8_t* wrapped, size_t wrapped_length, const uint8_t* signature, const uint8_t* iv, const uint8_t* out) { - uint32_t api_value = 10077; /* from _tee10077 */ + uint32_t api_value = 10075; /* from _tee10075 */ ODK_Message msg = TOS_Transport_GetRequest(); OPK_Pack_uint32_t(&msg, &api_value); uint64_t timestamp = time(0); @@ -2450,7 +2400,7 @@ void OPK_Unpack_VerifyAndDecryptUsageData_Legacy_Response( ODK_Message* msg, OEMCryptoResult* result, uint8_t** out) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10077) + if (api_value != 10075) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); OPK_Unpack_uint32_t(msg, result); if (!Is_Valid_OEMCryptoResult(*result)) { diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.h b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.h index d72732b..33def3b 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/ree/GEN_ree_serializer.h @@ -308,8 +308,6 @@ void OPK_Unpack_GetCurrentSRMVersion_Response(ODK_Message* msg, ODK_Message OPK_Pack_IsAntiRollbackHWPresent_Request(void); void OPK_Unpack_IsAntiRollbackHWPresent_Response(ODK_Message* msg, bool* result); -ODK_Message OPK_Pack_ApplyCGMS_Request(uint8_t cgms_field); -void OPK_Unpack_ApplyCGMS_Response(ODK_Message* msg, OEMCryptoResult* result); ODK_Message OPK_Pack_IsCGMS_AActive_Request(void); void OPK_Unpack_IsCGMS_AActive_Response(ODK_Message* msg, bool* result); ODK_Message OPK_Pack_SupportsCGMS_A_Request(void); @@ -323,9 +321,6 @@ void OPK_Unpack_CanDisableAnalogDisplay_Response(ODK_Message* msg, bool* result); ODK_Message OPK_Pack_DisableAnalogDisplay_Request(void); void OPK_Unpack_DisableAnalogDisplay_Response(ODK_Message* msg, bool* result); -ODK_Message OPK_Pack_MaxBufferSizeForDecrypt_Request(void); -void OPK_Unpack_MaxBufferSizeForDecrypt_Response(ODK_Message* msg, - size_t* result); ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Request(void); void OPK_Unpack_MaxOutputSizeForDecrypt_Response(ODK_Message* msg, size_t* result); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_dispatcher.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_dispatcher.c index 31c5391..98a254a 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_dispatcher.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_dispatcher.c @@ -1159,20 +1159,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_IsAntiRollbackHWPresent_Response(result); break; } - case 10058: /* WTPI_ApplyCGMS */ - { - uint8_t cgms_field; - OPK_Init_uint8_t((uint8_t*)&cgms_field); - OPK_Unpack_ApplyCGMS_Request(request, &cgms_field); - if (!ODK_Message_IsValid(request)) goto handle_invalid_request; - OEMCryptoResult result; - OPK_Init_uint32_t((uint32_t*)&result); - LOGD("ApplyCGMS"); - result = WTPI_ApplyCGMS(cgms_field); - *response = OPK_Pack_ApplyCGMS_Response(result); - break; - } - case 10059: /* WTPI_IsCGMS_AActive */ + case 10058: /* WTPI_IsCGMS_AActive */ { OPK_Unpack_IsCGMS_AActive_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1183,7 +1170,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_IsCGMS_AActive_Response(result); break; } - case 10060: /* WTPI_SupportsCGMS_A */ + case 10059: /* WTPI_SupportsCGMS_A */ { OPK_Unpack_SupportsCGMS_A_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1194,7 +1181,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_SupportsCGMS_A_Response(result); break; } - case 10061: /* WTPI_HasAnalogDisplay */ + case 10060: /* WTPI_HasAnalogDisplay */ { OPK_Unpack_HasAnalogDisplay_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1205,7 +1192,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_HasAnalogDisplay_Response(result); break; } - case 10062: /* WTPI_IsAnalogDisplayActive */ + case 10061: /* WTPI_IsAnalogDisplayActive */ { OPK_Unpack_IsAnalogDisplayActive_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1216,7 +1203,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_IsAnalogDisplayActive_Response(result); break; } - case 10063: /* WTPI_CanDisableAnalogDisplay */ + case 10062: /* WTPI_CanDisableAnalogDisplay */ { OPK_Unpack_CanDisableAnalogDisplay_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1227,7 +1214,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_CanDisableAnalogDisplay_Response(result); break; } - case 10064: /* WTPI_DisableAnalogDisplay */ + case 10063: /* WTPI_DisableAnalogDisplay */ { OPK_Unpack_DisableAnalogDisplay_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1238,18 +1225,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_DisableAnalogDisplay_Response(result); break; } - case 10065: /* WTPI_MaxBufferSizeForDecrypt */ - { - OPK_Unpack_MaxBufferSizeForDecrypt_Request(request); - if (!ODK_Message_IsValid(request)) goto handle_invalid_request; - size_t result; - OPK_Init_size_t((size_t*)&result); - LOGD("MaxBufferSizeForDecrypt"); - result = WTPI_MaxBufferSizeForDecrypt(); - *response = OPK_Pack_MaxBufferSizeForDecrypt_Response(result); - break; - } - case 10066: /* WTPI_MaxOutputSizeForDecrypt */ + case 10064: /* WTPI_MaxOutputSizeForDecrypt */ { OPK_Unpack_MaxOutputSizeForDecrypt_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1260,7 +1236,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_MaxOutputSizeForDecrypt_Response(result); break; } - case 10067: /* WTPI_IsClosedPlatform */ + case 10065: /* WTPI_IsClosedPlatform */ { OPK_Unpack_IsClosedPlatform_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1271,7 +1247,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_IsClosedPlatform_Response(result); break; } - case 10068: /* WTPI_CurrentHDCPCapability */ + case 10066: /* WTPI_CurrentHDCPCapability */ { OPK_Unpack_CurrentHDCPCapability_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1282,7 +1258,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_CurrentHDCPCapability_Response(result); break; } - case 10069: /* WTPI_MaxHDCPCapability */ + case 10067: /* WTPI_MaxHDCPCapability */ { OPK_Unpack_MaxHDCPCapability_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1293,7 +1269,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_MaxHDCPCapability_Response(result); break; } - case 10070: /* WTPI_MaxBufferSizeForGenericCrypto */ + case 10068: /* WTPI_MaxBufferSizeForGenericCrypto */ { OPK_Unpack_MaxBufferSizeForGenericCrypto_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1304,7 +1280,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_MaxBufferSizeForGenericCrypto_Response(result); break; } - case 10071: /* WTPI_MaxSampleSize */ + case 10069: /* WTPI_MaxSampleSize */ { OPK_Unpack_MaxSampleSize_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1315,7 +1291,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_MaxSampleSize_Response(result); break; } - case 10072: /* WTPI_SupportedCertificates */ + case 10070: /* WTPI_SupportedCertificates */ { OPK_Unpack_SupportedCertificates_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1326,7 +1302,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_SupportedCertificates_Response(result); break; } - case 10073: /* WTPI_ContentDecryptBypassesTA */ + case 10071: /* WTPI_ContentDecryptBypassesTA */ { OPK_Unpack_ContentDecryptBypassesTA_Request(request); if (!ODK_Message_IsValid(request)) goto handle_invalid_request; @@ -1337,7 +1313,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_ContentDecryptBypassesTA_Response(result); break; } - case 10074: /* WTPI_GetEncryptAndSignSize */ + case 10072: /* WTPI_GetEncryptAndSignSize */ { uint32_t context; OPK_Init_uint32_t((uint32_t*)&context); @@ -1356,7 +1332,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, OPK_Pack_GetEncryptAndSignSize_Response(result, wrapped_length); break; } - case 10075: /* WTPI_EncryptAndSign */ + case 10073: /* WTPI_EncryptAndSign */ { size_t data_length; OPK_Init_size_t((size_t*)&data_length); @@ -1378,7 +1354,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_EncryptAndSign_Response(result, out, out_length); break; } - case 10076: /* WTPI_VerifyAndDecrypt */ + case 10074: /* WTPI_VerifyAndDecrypt */ { size_t wrapped_length; OPK_Init_size_t((size_t*)&wrapped_length); @@ -1401,7 +1377,7 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_VerifyAndDecrypt_Response(result, out, out_length); break; } - case 10077: /* WTPI_VerifyAndDecryptUsageData_Legacy */ + case 10075: /* WTPI_VerifyAndDecryptUsageData_Legacy */ { size_t wrapped_length; OPK_Init_size_t((size_t*)&wrapped_length); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.c b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.c index 84c9954..de44ab9 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.c +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.c @@ -1625,32 +1625,10 @@ ODK_Message OPK_Pack_IsAntiRollbackHWPresent_Response(bool result) { return msg; } -void OPK_Unpack_ApplyCGMS_Request(ODK_Message* msg, uint8_t* cgms_field) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10058) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - uint64_t timestamp; - OPK_Unpack_uint64_t(msg, ×tamp); - OPK_Unpack_uint8_t(msg, cgms_field); - OPK_UnpackEOM(msg); - OPK_SharedBuffer_FinalizeUnpacking(); -} - -ODK_Message OPK_Pack_ApplyCGMS_Response(OEMCryptoResult result) { - uint32_t api_value = 10058; /* from _tee10058 */ - ODK_Message msg = TOS_Transport_GetResponse(); - OPK_Pack_uint32_t(&msg, &api_value); - OPK_Pack_uint32_t(&msg, &result); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - void OPK_Unpack_IsCGMS_AActive_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10059) + if (api_value != 10058) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1659,7 +1637,7 @@ void OPK_Unpack_IsCGMS_AActive_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_IsCGMS_AActive_Response(bool result) { - uint32_t api_value = 10059; /* from _tee10059 */ + uint32_t api_value = 10058; /* from _tee10058 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1671,7 +1649,7 @@ ODK_Message OPK_Pack_IsCGMS_AActive_Response(bool result) { void OPK_Unpack_SupportsCGMS_A_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10060) + if (api_value != 10059) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1680,7 +1658,7 @@ void OPK_Unpack_SupportsCGMS_A_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_SupportsCGMS_A_Response(bool result) { - uint32_t api_value = 10060; /* from _tee10060 */ + uint32_t api_value = 10059; /* from _tee10059 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1692,7 +1670,7 @@ ODK_Message OPK_Pack_SupportsCGMS_A_Response(bool result) { void OPK_Unpack_HasAnalogDisplay_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10061) + if (api_value != 10060) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1701,7 +1679,7 @@ void OPK_Unpack_HasAnalogDisplay_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_HasAnalogDisplay_Response(bool result) { - uint32_t api_value = 10061; /* from _tee10061 */ + uint32_t api_value = 10060; /* from _tee10060 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1713,7 +1691,7 @@ ODK_Message OPK_Pack_HasAnalogDisplay_Response(bool result) { void OPK_Unpack_IsAnalogDisplayActive_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10062) + if (api_value != 10061) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1722,7 +1700,7 @@ void OPK_Unpack_IsAnalogDisplayActive_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_IsAnalogDisplayActive_Response(bool result) { - uint32_t api_value = 10062; /* from _tee10062 */ + uint32_t api_value = 10061; /* from _tee10061 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1734,7 +1712,7 @@ ODK_Message OPK_Pack_IsAnalogDisplayActive_Response(bool result) { void OPK_Unpack_CanDisableAnalogDisplay_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10063) + if (api_value != 10062) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1743,7 +1721,7 @@ void OPK_Unpack_CanDisableAnalogDisplay_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_CanDisableAnalogDisplay_Response(bool result) { - uint32_t api_value = 10063; /* from _tee10063 */ + uint32_t api_value = 10062; /* from _tee10062 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1755,7 +1733,7 @@ ODK_Message OPK_Pack_CanDisableAnalogDisplay_Response(bool result) { void OPK_Unpack_DisableAnalogDisplay_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10064) + if (api_value != 10063) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1764,7 +1742,7 @@ void OPK_Unpack_DisableAnalogDisplay_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_DisableAnalogDisplay_Response(bool result) { - uint32_t api_value = 10064; /* from _tee10064 */ + uint32_t api_value = 10063; /* from _tee10063 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1773,31 +1751,10 @@ ODK_Message OPK_Pack_DisableAnalogDisplay_Response(bool result) { return msg; } -void OPK_Unpack_MaxBufferSizeForDecrypt_Request(ODK_Message* msg) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10065) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - uint64_t timestamp; - OPK_Unpack_uint64_t(msg, ×tamp); - OPK_UnpackEOM(msg); - OPK_SharedBuffer_FinalizeUnpacking(); -} - -ODK_Message OPK_Pack_MaxBufferSizeForDecrypt_Response(size_t result) { - uint32_t api_value = 10065; /* from _tee10065 */ - ODK_Message msg = TOS_Transport_GetResponse(); - OPK_Pack_uint32_t(&msg, &api_value); - OPK_Pack_size_t(&msg, &result); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - void OPK_Unpack_MaxOutputSizeForDecrypt_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10066) + if (api_value != 10064) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1806,7 +1763,7 @@ void OPK_Unpack_MaxOutputSizeForDecrypt_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Response(size_t result) { - uint32_t api_value = 10066; /* from _tee10066 */ + uint32_t api_value = 10064; /* from _tee10064 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_size_t(&msg, &result); @@ -1818,7 +1775,7 @@ ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Response(size_t result) { void OPK_Unpack_IsClosedPlatform_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10067) + if (api_value != 10065) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1827,7 +1784,7 @@ void OPK_Unpack_IsClosedPlatform_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_IsClosedPlatform_Response(bool result) { - uint32_t api_value = 10067; /* from _tee10067 */ + uint32_t api_value = 10065; /* from _tee10065 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1839,7 +1796,7 @@ ODK_Message OPK_Pack_IsClosedPlatform_Response(bool result) { void OPK_Unpack_CurrentHDCPCapability_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10068) + if (api_value != 10066) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1849,7 +1806,7 @@ void OPK_Unpack_CurrentHDCPCapability_Request(ODK_Message* msg) { ODK_Message OPK_Pack_CurrentHDCPCapability_Response( OEMCrypto_HDCP_Capability result) { - uint32_t api_value = 10068; /* from _tee10068 */ + uint32_t api_value = 10066; /* from _tee10066 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_OEMCrypto_HDCP_Capability(&msg, &result); @@ -1861,7 +1818,7 @@ ODK_Message OPK_Pack_CurrentHDCPCapability_Response( void OPK_Unpack_MaxHDCPCapability_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10069) + if (api_value != 10067) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1871,7 +1828,7 @@ void OPK_Unpack_MaxHDCPCapability_Request(ODK_Message* msg) { ODK_Message OPK_Pack_MaxHDCPCapability_Response( OEMCrypto_HDCP_Capability result) { - uint32_t api_value = 10069; /* from _tee10069 */ + uint32_t api_value = 10067; /* from _tee10067 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_OEMCrypto_HDCP_Capability(&msg, &result); @@ -1883,7 +1840,7 @@ ODK_Message OPK_Pack_MaxHDCPCapability_Response( void OPK_Unpack_MaxBufferSizeForGenericCrypto_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10070) + if (api_value != 10068) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1892,7 +1849,7 @@ void OPK_Unpack_MaxBufferSizeForGenericCrypto_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_MaxBufferSizeForGenericCrypto_Response(size_t result) { - uint32_t api_value = 10070; /* from _tee10070 */ + uint32_t api_value = 10068; /* from _tee10068 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_size_t(&msg, &result); @@ -1904,7 +1861,7 @@ ODK_Message OPK_Pack_MaxBufferSizeForGenericCrypto_Response(size_t result) { void OPK_Unpack_MaxSampleSize_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10071) + if (api_value != 10069) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1913,7 +1870,7 @@ void OPK_Unpack_MaxSampleSize_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_MaxSampleSize_Response(size_t result) { - uint32_t api_value = 10071; /* from _tee10071 */ + uint32_t api_value = 10069; /* from _tee10069 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_size_t(&msg, &result); @@ -1925,7 +1882,7 @@ ODK_Message OPK_Pack_MaxSampleSize_Response(size_t result) { void OPK_Unpack_SupportedCertificates_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10072) + if (api_value != 10070) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1934,7 +1891,7 @@ void OPK_Unpack_SupportedCertificates_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_SupportedCertificates_Response(uint32_t result) { - uint32_t api_value = 10072; /* from _tee10072 */ + uint32_t api_value = 10070; /* from _tee10070 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_uint32_t(&msg, &result); @@ -1946,7 +1903,7 @@ ODK_Message OPK_Pack_SupportedCertificates_Response(uint32_t result) { void OPK_Unpack_ContentDecryptBypassesTA_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10073) + if (api_value != 10071) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1955,7 +1912,7 @@ void OPK_Unpack_ContentDecryptBypassesTA_Request(ODK_Message* msg) { } ODK_Message OPK_Pack_ContentDecryptBypassesTA_Response(bool result) { - uint32_t api_value = 10073; /* from _tee10073 */ + uint32_t api_value = 10071; /* from _tee10071 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_bool(&msg, &result); @@ -1970,7 +1927,7 @@ void OPK_Unpack_GetEncryptAndSignSize_Request(ODK_Message* msg, size_t** wrapped_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10074) + if (api_value != 10072) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -1983,7 +1940,7 @@ void OPK_Unpack_GetEncryptAndSignSize_Request(ODK_Message* msg, ODK_Message OPK_Pack_GetEncryptAndSignSize_Response( OEMCryptoResult result, const size_t* wrapped_length) { - uint32_t api_value = 10074; /* from _tee10074 */ + uint32_t api_value = 10072; /* from _tee10072 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_uint32_t(&msg, &result); @@ -1998,7 +1955,7 @@ void OPK_Unpack_EncryptAndSign_Request(ODK_Message* msg, uint32_t* context, uint8_t** out, size_t** out_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10075) + if (api_value != 10073) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -2015,7 +1972,7 @@ void OPK_Unpack_EncryptAndSign_Request(ODK_Message* msg, uint32_t* context, ODK_Message OPK_Pack_EncryptAndSign_Response(OEMCryptoResult result, const uint8_t* out, const size_t* out_length) { - uint32_t api_value = 10075; /* from _tee10075 */ + uint32_t api_value = 10073; /* from _tee10073 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_PackNullable_size_t(&msg, out_length); @@ -2034,7 +1991,7 @@ void OPK_Unpack_VerifyAndDecrypt_Request(ODK_Message* msg, uint32_t* context, size_t** out_length) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10076) + if (api_value != 10074) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -2051,7 +2008,7 @@ void OPK_Unpack_VerifyAndDecrypt_Request(ODK_Message* msg, uint32_t* context, ODK_Message OPK_Pack_VerifyAndDecrypt_Response(OEMCryptoResult result, const uint8_t* out, const size_t* out_length) { - uint32_t api_value = 10076; /* from _tee10076 */ + uint32_t api_value = 10074; /* from _tee10074 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_PackNullable_size_t(&msg, out_length); @@ -2069,7 +2026,7 @@ void OPK_Unpack_VerifyAndDecryptUsageData_Legacy_Request( uint8_t** signature, uint8_t** iv, uint8_t** out) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 10077) + if (api_value != 10075) ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); uint64_t timestamp; OPK_Unpack_uint64_t(msg, ×tamp); @@ -2084,7 +2041,7 @@ void OPK_Unpack_VerifyAndDecryptUsageData_Legacy_Request( ODK_Message OPK_Pack_VerifyAndDecryptUsageData_Legacy_Response( OEMCryptoResult result, const uint8_t* out) { - uint32_t api_value = 10077; /* from _tee10077 */ + uint32_t api_value = 10075; /* from _tee10075 */ ODK_Message msg = TOS_Transport_GetResponse(); OPK_Pack_uint32_t(&msg, &api_value); OPK_Pack_uint32_t(&msg, &result); diff --git a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.h b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.h index cc54e97..ac7c4f7 100644 --- a/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.h +++ b/oemcrypto/opk/oemcrypto_ta/wtpi_test/tee/GEN_tee_serializer.h @@ -278,8 +278,6 @@ ODK_Message OPK_Pack_GetCurrentSRMVersion_Response(OEMCryptoResult result, const uint32_t* srm_version); void OPK_Unpack_IsAntiRollbackHWPresent_Request(ODK_Message* msg); ODK_Message OPK_Pack_IsAntiRollbackHWPresent_Response(bool result); -void OPK_Unpack_ApplyCGMS_Request(ODK_Message* msg, uint8_t* cgms_field); -ODK_Message OPK_Pack_ApplyCGMS_Response(OEMCryptoResult result); void OPK_Unpack_IsCGMS_AActive_Request(ODK_Message* msg); ODK_Message OPK_Pack_IsCGMS_AActive_Response(bool result); void OPK_Unpack_SupportsCGMS_A_Request(ODK_Message* msg); @@ -292,8 +290,6 @@ void OPK_Unpack_CanDisableAnalogDisplay_Request(ODK_Message* msg); ODK_Message OPK_Pack_CanDisableAnalogDisplay_Response(bool result); void OPK_Unpack_DisableAnalogDisplay_Request(ODK_Message* msg); ODK_Message OPK_Pack_DisableAnalogDisplay_Response(bool result); -void OPK_Unpack_MaxBufferSizeForDecrypt_Request(ODK_Message* msg); -ODK_Message OPK_Pack_MaxBufferSizeForDecrypt_Response(size_t result); void OPK_Unpack_MaxOutputSizeForDecrypt_Request(ODK_Message* msg); ODK_Message OPK_Pack_MaxOutputSizeForDecrypt_Response(size_t result); void OPK_Unpack_IsClosedPlatform_Request(ODK_Message* msg); diff --git a/oemcrypto/opk/ports/linux/Makefile b/oemcrypto/opk/ports/linux/Makefile index 2d10340..4c16424 100644 --- a/oemcrypto/opk/ports/linux/Makefile +++ b/oemcrypto/opk/ports/linux/Makefile @@ -55,12 +55,11 @@ oemcrypto_unittests: liboemcrypto wtpi_unittests: +$(MAKE) -C host/wtpi_unittests -.PHONY: clean -clean: - +$(MAKE) -C ta/oemcrypto_ta clean - +$(MAKE) -C ta/wtpi_test_ta clean - +$(MAKE) -C host/liboemcrypto clean - +$(MAKE) -C host/oemcrypto_helloworld clean - +$(MAKE) -C host/oemcrypto_unittests clean - +$(MAKE) -C host/wtpi_unittests clean - +.PHONY: clean clang-tidy +clean clang-tidy: + +$(MAKE) -C ta/oemcrypto_ta $@ + +$(MAKE) -C ta/wtpi_test_ta $@ + +$(MAKE) -C host/liboemcrypto $@ + +$(MAKE) -C host/oemcrypto_helloworld $@ + +$(MAKE) -C host/oemcrypto_unittests $@ + +$(MAKE) -C host/wtpi_unittests $@ diff --git a/oemcrypto/opk/ports/linux/common/posix_resources.h b/oemcrypto/opk/ports/linux/common/posix_resources.h index 80cee64..841d747 100644 --- a/oemcrypto/opk/ports/linux/common/posix_resources.h +++ b/oemcrypto/opk/ports/linux/common/posix_resources.h @@ -2,8 +2,8 @@ // source code may only be used and distributed under the Widevine // License Agreement. -#ifndef POSIX_RESOURCES__H_ -#define POSIX_RESOURCES__H_ +#ifndef POSIX_RESOURCES_H_ +#define POSIX_RESOURCES_H_ #include "posix_services.h" @@ -16,4 +16,4 @@ typedef posix::SharedMemory<2> SerializationBlock; typedef posix::Semaphore<0> RequestSemaphore; typedef posix::Semaphore<1> ResponseSemaphore; -#endif // POSIX_RESOURCES__H_ +#endif // POSIX_RESOURCES_H_ diff --git a/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile b/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile index b32f676..972b630 100644 --- a/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile +++ b/oemcrypto/opk/ports/linux/host/wtpi_unittests/Makefile @@ -20,10 +20,10 @@ include $(srcdir)/oemcrypto/opk/build/ree-sources.mk srcs += \ $(OPK_REPO_TOP)/oemcrypto/opk/oemcrypto_ta/wtpi_test/wtpi_test_main.cpp \ - $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_transport.c \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_transport.cpp \ $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_secure_buffers.c \ - $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_logging.c \ - $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_shared_memory.c \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_logging.cpp \ + $(OPK_REPO_TOP)/oemcrypto/opk/ports/linux/common/tos_shared_memory.cpp \ $(wtpi_unittests_sources) \ incs += \ diff --git a/oemcrypto/opk/ports/linux/rules.mk b/oemcrypto/opk/ports/linux/rules.mk index c72afb1..2b1b100 100644 --- a/oemcrypto/opk/ports/linux/rules.mk +++ b/oemcrypto/opk/ports/linux/rules.mk @@ -27,30 +27,47 @@ cmd-echo := echo cmd-echo-silent := true endif -cc := $(CROSS_COMPILE)gcc -cxx := $(CROSS_COMPILE)g++ +cc := $(CROSS_COMPILE)gcc +cxx := $(CROSS_COMPILE)g++ ssrc := $(patsubst %.S, %.o, $(filter %.S, $(srcs))) csrc := $(patsubst %.c, %.o, $(filter %.c, $(srcs))) cppsrc := $(patsubst %.cpp, %.o, $(filter %.cpp, $(srcs))) ccsrc := $(patsubst %.cc, %.o, $(filter %.cc, $(srcs))) -objs = $(sort $(addprefix $(builddir), $(csrc) $(cppsrc) $(ccsrc) $(ssrc))) +objs := $(sort $(addprefix $(builddir), $(csrc) $(cppsrc) $(ccsrc) $(ssrc))) -includes += $(addprefix -I, $(addprefix $(srcdir)/, $(incs)) $(global-incs)) +includes := $(addprefix $(srcdir), $(incs)) $(global-incs) -cflags += -Wall \ +cflags += \ + -Wall \ -Werror \ -fPIC \ - $(includes) \ + $(addprefix -I, $(includes)) -cflags_c += $(cflags) \ +cflags_c += \ + $(cflags) \ -std=c11 \ -D_POSIX_C_SOURCE=200809L \ -fno-inline -cppflags += $(cflags) \ - $(CPPFLAGS) \ +cppflags += \ + $(cflags) \ + $(CPPFLAGS) +# Filter out files and directories in third_party. +filter_out_third_party = \ + $(foreach path,$(1),$(if $(findstring /third_party/,$(path)),,$(path))) + +clang-tidy-srcs := \ + $(sort $(addprefix $(srcdir),$(call filter_out_third_party,$(srcs)))) + +clang-tidy-incs := $(call filter_out_third_party,$(includes)) + +clang-tidy-flags := \ + --header-filter '$(subst $() $(),|,$(strip $(clang-tidy-incs)))' \ + --quiet + +.PHONY: all all: $(builddir)$(output) $(builddir)$(output): $(objs) @@ -82,3 +99,18 @@ $(builddir)%.o: $(srcdir)%.S ${q}mkdir -p $(shell dirname $@) @$(cmd-echo-silent) ' CC $@' ${q}$(cc) $(cflags_c) -c $< -o $@ + +# Define a rule template to run clang-tidy with a single source file. +define clang-tidy-rule +.PHONY: clang-tidy-$(1) +clang-tidy-$(1): + @$(cmd-echo-silent) ' CLANG-TIDY $(1)' + ${q}clang-tidy $(clang-tidy-flags) $(1) -- $(cflags) +endef + +# Generate rules to run clang-tidy with each source file. +$(foreach src,$(clang-tidy-srcs),$(eval $(call clang-tidy-rule,$(src)))) + +# Run clang-tidy with all source files. +.PHONY: clang-tidy +clang-tidy: $(addprefix clang-tidy-,$(clang-tidy-srcs)) diff --git a/oemcrypto/opk/ports/linux/ta/common/opk_config.h b/oemcrypto/opk/ports/linux/ta/common/opk_config.h index 2ca0aa8..7e78d44 100644 --- a/oemcrypto/opk/ports/linux/ta/common/opk_config.h +++ b/oemcrypto/opk/ports/linux/ta/common/opk_config.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _OPK_CONFIG_H_ -#define _OPK_CONFIG_H_ +#ifndef OPK_CONFIG_H_ +#define OPK_CONFIG_H_ #ifndef OPK_CONFIG_SECURITY_LEVEL # define OPK_CONFIG_SECURITY_LEVEL OEMCrypto_Level3 @@ -15,10 +15,6 @@ # define OPK_CONFIG_RESOURCE_RATING_TIER 3 #endif -#ifndef OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT -# define OPK_CONFIG_MAX_BUFFER_SIZE_FOR_DECRYPT 1 * 1024 * 1024 -#endif - #ifndef OPK_CONFIG_MAX_BUFFER_SIZE_FOR_GENERIC_CRYPTO # define OPK_CONFIG_MAX_BUFFER_SIZE_FOR_GENERIC_CRYPTO 500 * 1024 #endif diff --git a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c index 0f950ad..536794b 100644 --- a/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c +++ b/oemcrypto/opk/ports/linux/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer2_hw.c @@ -10,6 +10,7 @@ #include "crypto_util.h" #include "layer2_crypto_key_table.h" +#include "odk_util.h" #include "oemcrypto_compiler_attributes.h" #include "oemcrypto_key_types.h" #include "oemcrypto_math.h" @@ -237,7 +238,7 @@ OEMCryptoResult WTPI_C2_HMAC_SHA256_Verify( OEMCryptoResult result = WTPI_C2_HMAC_SHA256( key_handle, message, message_length, computed_signature); if (result != OEMCrypto_SUCCESS) return result; - if (memcmp(signature, computed_signature, SHA256_DIGEST_LENGTH) != 0) { + if (crypto_memcmp(signature, computed_signature, SHA256_DIGEST_LENGTH) != 0) { return OEMCrypto_ERROR_SIGNATURE_FAILURE; } return OEMCrypto_SUCCESS; diff --git a/oemcrypto/opk/ports/optee/Makefile b/oemcrypto/opk/ports/optee/Makefile index ae19b81..786a9d1 100644 --- a/oemcrypto/opk/ports/optee/Makefile +++ b/oemcrypto/opk/ports/optee/Makefile @@ -36,6 +36,7 @@ TEE_OS := OP-TEE TEE_VERSION := 3.18 DEVICE_FORM_FACTOR := test # overridden later by OP-TEE $(PLATFORM) var. Feel free to replace with own values IMPLEMENTER := your-name-here +OPTEE_PROVISIONING_METHOD := OEMCrypto_Keybox # Default toolchain dir from the optee repositories OPTEE_TOOLCHAIN_DIR ?= $(OPTEE_DIR)/toolchains @@ -119,12 +120,11 @@ oemcrypto_unittests: liboemcrypto wtpi_unittests: +$(MAKE) -C host/wtpi_unittests -.PHONY: clean -clean: - +$(MAKE) -C ta/oemcrypto_ta clean - +$(MAKE) -C ta/wtpi_test_ta clean - +$(MAKE) -C host/liboemcrypto clean - +$(MAKE) -C host/oemcrypto_helloworld clean - +$(MAKE) -C host/oemcrypto_unittests clean - +$(MAKE) -C host/wtpi_unittests clean - +.PHONY: clean clang-tidy +clean clang-tidy: + +$(MAKE) -C ta/oemcrypto_ta $@ + +$(MAKE) -C ta/wtpi_test_ta $@ + +$(MAKE) -C host/liboemcrypto $@ + +$(MAKE) -C host/oemcrypto_helloworld $@ + +$(MAKE) -C host/oemcrypto_unittests $@ + +$(MAKE) -C host/wtpi_unittests $@ diff --git a/oemcrypto/opk/ports/optee/host/common/tos/optee_ree_tos.c b/oemcrypto/opk/ports/optee/host/common/tos/optee_ree_tos.c index b71801e..57dca9a 100644 --- a/oemcrypto/opk/ports/optee/host/common/tos/optee_ree_tos.c +++ b/oemcrypto/opk/ports/optee/host/common/tos/optee_ree_tos.c @@ -140,12 +140,19 @@ OPK_TransportStatus TOS_Transport_SendMessage(ODK_Message* request, op.params[0].memref.size = opk_shared_memory_.size; op.params[1].memref.parent = &transport_shared_memory_; op.params[1].memref.offset = 0; - op.params[1].memref.size = ODK_Message_GetSize(request); + op.params[1].memref.size = transport_shared_memory_.size; + + // TEE_Param VALUE types contain two uint32_t fields. We want to store a + // size_t to represent max(request_size, response_size), but we don't ever + // expect it to realistically be larger than the max uint32_t size (4 GB) so + // we intentionally downcast from size_t to uint32_t. + op.params[2].value.a = (uint32_t)(ODK_Message_GetSize(request)); + op.params[2].value.b = 0; op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_WHOLE, /* opk_shared_memory */ TEEC_MEMREF_PARTIAL_INOUT, /* transport_shared_memory */ - TEEC_NONE, TEEC_NONE); + TEEC_VALUE_INPUT, TEEC_NONE); res = TEEC_InvokeCommand(&teec_session_, TA_SEND_REQUEST_CMD, &op, NULL); if (res != TEEC_SUCCESS) { LOGE("SendMessage failed: 0x%08x", res); diff --git a/oemcrypto/opk/ports/optee/host/rules.mk b/oemcrypto/opk/ports/optee/host/rules.mk index 6ae3a69..f6999e4 100644 --- a/oemcrypto/opk/ports/optee/host/rules.mk +++ b/oemcrypto/opk/ports/optee/host/rules.mk @@ -28,29 +28,46 @@ cmd-echo := echo cmd-echo-silent := true endif -cc := $(CROSS_COMPILE)gcc -cxx := $(CROSS_COMPILE)g++ +cc := $(CROSS_COMPILE)gcc +cxx := $(CROSS_COMPILE)g++ ssrc := $(patsubst %.S, %.o, $(filter %.S, $(srcs))) csrc := $(patsubst %.c, %.o, $(filter %.c, $(srcs))) cppsrc := $(patsubst %.cpp, %.o, $(filter %.cpp, $(srcs))) ccsrc := $(patsubst %.cc, %.o, $(filter %.cc, $(srcs))) -objs = $(sort $(addprefix $(builddir), $(csrc) $(cppsrc) $(ccsrc) $(ssrc))) +objs := $(sort $(addprefix $(builddir), $(csrc) $(cppsrc) $(ccsrc) $(ssrc))) -includes += $(addprefix -I, $(addprefix $(srcdir)/, $(incs)) $(global-incs)) +includes := $(addprefix $(srcdir), $(incs)) $(global-incs) -cflags += -Wall \ +cflags += \ + -Wall \ -Werror \ -fPIC \ - $(includes) \ + $(addprefix -I, $(includes)) -cflags_c += $(cflags) \ +cflags_c += \ + $(cflags) \ -std=c11 \ -D_POSIX_C_SOURCE=200809L -cppflags += $(cflags) \ - $(CPPFLAGS) \ +cppflags += \ + $(cflags) \ + $(CPPFLAGS) +# Filter out files and directories in third_party. +filter_out_third_party = \ + $(foreach path,$(1),$(if $(findstring /third_party/,$(path)),,$(path))) + +clang-tidy-srcs := \ + $(sort $(addprefix $(srcdir),$(call filter_out_third_party,$(srcs)))) + +clang-tidy-incs := $(call filter_out_third_party,$(includes)) + +clang-tidy-flags := \ + --header-filter '$(subst $() $(),|,$(strip $(clang-tidy-incs)))' \ + --quiet + +.PHONY: all all: $(builddir)$(output) $(builddir)$(output): $(objs) @@ -82,3 +99,18 @@ $(builddir)%.o: $(srcdir)%.S ${q}mkdir -p $(shell dirname $@) @$(cmd-echo-silent) ' CC $@' ${q}$(cc) $(cflags_c) -c $< -o $@ + +# Define a rule template to run clang-tidy with a single source file. +define clang-tidy-rule +.PHONY: clang-tidy-$(1) +clang-tidy-$(1): + @$(cmd-echo-silent) ' CLANG-TIDY $(1)' + ${q}clang-tidy $(clang-tidy-flags) $(1) -- $(cflags) +endef + +# Generate rules to run clang-tidy with each source file. +$(foreach src,$(clang-tidy-srcs),$(eval $(call clang-tidy-rule,$(src)))) + +# Run clang-tidy with all source files. +.PHONY: clang-tidy +clang-tidy: $(addprefix clang-tidy-,$(clang-tidy-srcs)) diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/asymmetric_key.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/asymmetric_key.h index c2bcb87..8987e5a 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/asymmetric_key.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/asymmetric_key.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _WTPI_OPTEE_ASYMMETRIC_KEY_H_ -#define _WTPI_OPTEE_ASYMMETRIC_KEY_H_ +#ifndef WTPI_OPTEE_ASYMMETRIC_KEY_H_ +#define WTPI_OPTEE_ASYMMETRIC_KEY_H_ #include #include "wtpi_crypto_asymmetric_interface.h" diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h index 926b486..f54c23f 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/crypto_common.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _WTPI_CRYPTO_COMMON_H_ -#define _WTPI_CRYPTO_COMMON_H_ +#ifndef WTPI_CRYPTO_COMMON_H_ +#define WTPI_CRYPTO_COMMON_H_ #include "wtpi_crypto_and_key_management_interface_layer1.h" diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/opk_config.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/opk_config.h index e8e0e5a..1946c9b 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/opk_config.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/opk_config.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _OPK_CONFIG_H_ -#define _OPK_CONFIG_H_ +#ifndef OPK_CONFIG_H_ +#define OPK_CONFIG_H_ #ifndef MAX_NUMBER_OF_SESSIONS # define MAX_NUMBER_OF_SESSIONS 20 diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/sources.mk b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/sources.mk index c50d86c..aeb8fc2 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/sources.mk +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/sources.mk @@ -39,6 +39,7 @@ wtpi_impl_sources += \ $(wtpi_impl_dir)/util/ta_log.c \ $(wtpi_impl_dir)/util/der_parse.c \ $(wtpi_impl_dir)/util/odk_endian.c \ + $(wtpi_impl_dir)/util/device_info.c \ $(wtpi_ref_dir)/cose_util.c \ $(wtpi_impl_dir)/wtpi_abort.c \ $(wtpi_impl_dir)/wtpi_clock_layer2.c \ diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/der_parse.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/der_parse.h index b79aa19..0f42300 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/der_parse.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/der_parse.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _DER_PARSE_H_ -#define _DER_PARSE_H_ +#ifndef DER_PARSE_H_ +#define DER_PARSE_H_ #include "OEMCryptoCENC.h" diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.c new file mode 100644 index 0000000..804e5e5 --- /dev/null +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.c @@ -0,0 +1,55 @@ +#include "device_info.h" + +#include "cose_util.h" + +#include + +#include "dice/cbor_reader.h" +#include "dice/cbor_writer.h" +#include "dice/config.h" +#include "dice/dice.h" +#include "oemcrypto_check_macros.h" +#include "opk_config.h" +#include "wtpi_provisioning_4_interface.h" + +#define MAX_DEVICE_INFO_SIZE 768 + +OEMCryptoResult BuildDeviceInformation(uint8_t* out, size_t* out_length) { + if (out_length == NULL) { + return OEMCrypto_ERROR_INVALID_CONTEXT; + } + size_t max_device_info_size = WTPI_MaxDeviceInfoSize(); + if (out == NULL || *out_length < max_device_info_size) { + *out_length = max_device_info_size; + return OEMCrypto_ERROR_SHORT_BUFFER; + } + *out_length = max_device_info_size; + + // DeviceInfo = { + // "manufacturer" : tstr, + // "model" : tstr, + // "fused": 1 / 0, ; 1 if secure boot is enforced. 0 otherwise. + // } + const char* kMakeLabel = "manufacturer"; + const char* kModelLabel = "model"; + const char* kFusedLabel = "fused"; + bool is_fused = false; + OEMCryptoResult fused_result = WTPI_GetDeviceFusedStatus(&is_fused); + if (fused_result != OEMCrypto_SUCCESS) { + return fused_result; + } + struct CborOut cbor_out; + CborOutInit(out, *out_length, &cbor_out); + CborWriteMap(/*num_pairs=*/3, &cbor_out); + CborWriteTstr(kMakeLabel, &cbor_out); + CborWriteTstr(XSTR(OPK_CONFIG_SOC_VENDOR_NAME), &cbor_out); + CborWriteTstr(kModelLabel, &cbor_out); + CborWriteTstr(XSTR(OPK_CONFIG_SOC_MODEL_NAME), &cbor_out); + CborWriteTstr(kFusedLabel, &cbor_out); + CborWriteInt(is_fused ? 1 : 0, &cbor_out); + if (CborOutOverflowed(&cbor_out)) { + return OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + *out_length = CborOutSize(&cbor_out); + return OEMCrypto_SUCCESS; +} \ No newline at end of file diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.h new file mode 100644 index 0000000..efe2b53 --- /dev/null +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/device_info.h @@ -0,0 +1,20 @@ +/* Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary + source code may only be used and distributed under the Widevine License + Agreement. */ + +#ifndef WTPI_UTIL_DEVICE_INFO_H_ +#define WTPI_UTIL_DEVICE_INFO_H_ + +#include "OEMCryptoCENCCommon.h" + +/* + * Builds a basic device information CBOR struct according to requirements in + * wtpi_provisioning_4_interface.h + * + * If possible, it is preferable to use a separate module (eg Trusty has + * "hwbcc") to provide this information. + */ +OEMCryptoResult BuildDeviceInformation(uint8_t* device_info, + size_t* device_info_length); + +#endif diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/ta_log.h b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/ta_log.h index 796a33c..fddf459 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/ta_log.h +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/util/ta_log.h @@ -4,8 +4,8 @@ * License Agreement. */ -#ifndef _TA_LOG_H_ -#define _TA_LOG_H_ +#ifndef TA_LOG_H_ +#define TA_LOG_H_ #include #include diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_cbor_deviceinfo.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_cbor_deviceinfo.c index 03db811..5087387 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_cbor_deviceinfo.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_cbor_deviceinfo.c @@ -4,17 +4,19 @@ * License Agreement. */ +#include "cose_util.h" +#include "device_info.h" +#include "oemcrypto_check_macros.h" #include "wtpi_provisioning_4_interface.h" #define DEVICE_INFO_MAX_LENGTH 256 +#define HWBCC_MAX_RESP_PAYLOAD_SIZE 1024 size_t WTPI_MaxDeviceInfoSize(void) { return DEVICE_INFO_MAX_LENGTH; } OEMCryptoResult WTPI_GetDeviceInformation(uint8_t* device_info, size_t* device_info_length) { - (void)device_info; - (void)device_info_length; - return OEMCrypto_ERROR_NOT_IMPLEMENTED; + return BuildDeviceInformation(device_info, device_info_length); } OEMCryptoResult WTPI_GetSignedCsrPayload(const uint8_t* challenge, @@ -23,11 +25,33 @@ OEMCryptoResult WTPI_GetSignedCsrPayload(const uint8_t* challenge, size_t encoded_device_info_length, uint8_t* signed_csr_payload, size_t* signed_csr_payload_length) { - (void)challenge; - (void)challenge_length; - (void)encoded_device_info; - (void)encoded_device_info_length; - (void)signed_csr_payload; - (void)signed_csr_payload_length; - return OEMCrypto_ERROR_NOT_IMPLEMENTED; + RETURN_INVALID_CONTEXT_IF_NULL(challenge); + RETURN_INVALID_CONTEXT_IF_ZERO(challenge_length); + RETURN_INVALID_CONTEXT_IF_NULL(encoded_device_info); + RETURN_INVALID_CONTEXT_IF_ZERO(encoded_device_info_length); + RETURN_INVALID_CONTEXT_IF_NULL(signed_csr_payload_length); + + if (signed_csr_payload == NULL || + *signed_csr_payload_length < HWBCC_MAX_RESP_PAYLOAD_SIZE) { + *signed_csr_payload_length = HWBCC_MAX_RESP_PAYLOAD_SIZE; + return OEMCrypto_ERROR_SHORT_BUFFER; + } + *signed_csr_payload_length = HWBCC_MAX_RESP_PAYLOAD_SIZE; + + /* Generate Csr payload to be signed. HWBCC_MAX_RESP_PAYLOAD_SIZE is + * guaranteed to be large enough to hold the Csr payload. */ + uint8_t csr_payload_to_sign[HWBCC_MAX_RESP_PAYLOAD_SIZE]; + size_t csr_payload_to_sign_length = sizeof(csr_payload_to_sign); + OEMCryptoResult result = + GenerateCsrPayload(challenge, challenge_length, encoded_device_info, + encoded_device_info_length, csr_payload_to_sign, + &csr_payload_to_sign_length); + if (result != OEMCrypto_SUCCESS) { + return result; + } + + /* Sign Csr payload. */ + result = WTPI_BccKeyCoseSign1(csr_payload_to_sign, csr_payload_to_sign_length, + signed_csr_payload, signed_csr_payload_length); + return result; } diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer1.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer1.c index 2e5d8b8..eb56257 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer1.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_and_key_management_layer1.c @@ -674,7 +674,7 @@ OEMCryptoResult WTPI_K1_DeriveKeyFromKeyHandle( } uint8_t buffer[KEY_SIZE_256]; - for (uint8_t i = 0; i < out_key_size; i += KEY_SIZE_128) { + for (int i = 0; i < (int)out_key_size; i += KEY_SIZE_128) { TEE_MACInit(op_handle, NULL, 0); TEE_MACUpdate(op_handle, &counter, sizeof(counter)); counter++; diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_asymmetric.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_asymmetric.c index 4e1fa5b..f5cb900 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_asymmetric.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_crypto_asymmetric.c @@ -561,8 +561,6 @@ OEMCryptoResult WTPI_ECCDeriveSessionKey(WTPI_AsymmetricKey_Handle key, key_size_bytes = KEY_SIZE_512; break; default: - alg_type = 0; - key_size_bytes = 0; EMSG("Unsupported curve type %d", key->ecc_curve_type); return OEMCrypto_ERROR_UNKNOWN_FAILURE; } diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_decrypt_sample.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_decrypt_sample.c index fd0f62b..b57ca69 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_decrypt_sample.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_decrypt_sample.c @@ -74,6 +74,7 @@ static OEMCryptoResult WTPI_DecryptToOutputBuffer_CBC( WTPI_K1_SymmetricKey_Handle key, const uint8_t* initial_iv, const OEMCrypto_CENCEncryptPatternDesc* pattern, const uint8_t* in, size_t size, const OPK_OutputBuffer* out, size_t output_offset) { + if (size == 0) return OEMCrypto_SUCCESS; size_t total_size; if (OPK_AddOverflowUX(output_offset, size, &total_size)) { return OEMCrypto_ERROR_INVALID_CONTEXT; @@ -82,7 +83,6 @@ static OEMCryptoResult WTPI_DecryptToOutputBuffer_CBC( RETURN_INVALID_CONTEXT_IF_NULL(initial_iv); RETURN_INVALID_CONTEXT_IF_NULL(pattern); RETURN_INVALID_CONTEXT_IF_NULL(in); - RETURN_INVALID_CONTEXT_IF_ZERO(size); RETURN_INVALID_CONTEXT_IF_NULL(out); RETURN_INVALID_CONTEXT_IF_NULL(key); if (total_size > out->size) { @@ -252,6 +252,7 @@ OEMCryptoResult WTPI_DecryptSample( subsample->num_bytes_encrypted, &subsample_length)) { return OEMCrypto_ERROR_INVALID_CONTEXT; } + if (subsample_length == 0) continue; size_t current_offset; if (OPK_AddOverflowUX(starting_output_offset, offset, ¤t_offset)) { diff --git a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_provisioning_4.c b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_provisioning_4.c index 5904403..6507ba3 100644 --- a/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_provisioning_4.c +++ b/oemcrypto/opk/ports/optee/ta/common/wtpi_impl/wtpi_provisioning_4.c @@ -156,11 +156,7 @@ static OEMCryptoResult Helper_GetDeviceAsymmetricKeyIntoHandle( RETURN_INVALID_CONTEXT_IF_NULL(key_type); RETURN_INVALID_CONTEXT_IF_NULL(private_key_handle); - TEE_Attribute attrs[4]; - WTPI_AsymmetricKey_Handle sess = TEE_HANDLE_NULL; - TEE_Result res = TEE_SUCCESS; - OEMCryptoResult result = OEMCrypto_SUCCESS; - // Get device key + // Get device key const uint8_t* device_key = WTPI_GetDeviceKey(); const KeySize device_key_len = WTPI_GetDeviceKeySize(); if (device_key == NULL || device_key_len == 0) { @@ -175,28 +171,33 @@ static OEMCryptoResult Helper_GetDeviceAsymmetricKeyIntoHandle( return OEMCrypto_ERROR_UNKNOWN_FAILURE; } - result = DeriveEccKey(device_key, device_key_len, TEE_ECC_CURVE_NIST_P256, - sess_key); + OEMCryptoResult result = DeriveEccKey(device_key, device_key_len, + TEE_ECC_CURVE_NIST_P256, sess_key); if (result != OEMCrypto_SUCCESS) { goto cleanup; } - sess = TEE_Malloc(sizeof(tee_asymmetric_key_handle), TEE_MALLOC_FILL_ZERO); + WTPI_AsymmetricKey_Handle sess = + TEE_Malloc(sizeof(tee_asymmetric_key_handle), TEE_MALLOC_FILL_ZERO); if (sess == NULL) { EMSG("Malloc failed, out of memory"); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; + result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + goto cleanup; } sess->max_signature_size = sess_key->max_signature_size; sess->ecc_curve_type = sess_key->ecc_curve_type; - res = TEE_AllocateTransientObject( + TEE_Result tee_result = TEE_AllocateTransientObject( TEE_TYPE_ECDSA_KEYPAIR, sess_key->private_val_len * 8, &sess->key_handle); - if (res != TEE_SUCCESS) { - EMSG("TEE_AllocateTransientObject() failed with result 0x%x", res); + if (tee_result != TEE_SUCCESS) { + EMSG("TEE_AllocateTransientObject() failed with result 0x%x", tee_result); + WTPI_FreeAsymmetricKeyHandle(sess); + result = OEMCrypto_ERROR_UNKNOWN_FAILURE; goto cleanup; } + TEE_Attribute attrs[4]; TEE_InitRefAttribute(&attrs[0], TEE_ATTR_ECC_PRIVATE_VALUE, sess_key->private_val, sess_key->private_val_len); TEE_InitRefAttribute(&attrs[1], TEE_ATTR_ECC_PUBLIC_VALUE_X, @@ -206,30 +207,24 @@ static OEMCryptoResult Helper_GetDeviceAsymmetricKeyIntoHandle( TEE_InitValueAttribute(&attrs[3], TEE_ATTR_ECC_CURVE, sess_key->ecc_curve_type, 0); - res = TEE_PopulateTransientObject(sess->key_handle, - (const TEE_Attribute*)(&attrs), 4); - if (res != TEE_SUCCESS) { - EMSG("TEE_PopulateTransientObject() failed with result 0x%x", res); + tee_result = TEE_PopulateTransientObject(sess->key_handle, attrs, 4); + if (tee_result != TEE_SUCCESS) { + EMSG("TEE_PopulateTransientObject() failed with result 0x%x", tee_result); + WTPI_FreeAsymmetricKeyHandle(sess); + result = OEMCrypto_ERROR_UNKNOWN_FAILURE; goto cleanup; } *key_type = DRM_ECC_PRIVATE_KEY; + *private_key_handle = sess; cleanup: - if (sess_key != TEE_HANDLE_NULL) { - TEE_Free(sess_key->private_val); - TEE_Free(sess_key->public_x); - TEE_Free(sess_key->public_y); - } + TEE_Free(sess_key->private_val); + TEE_Free(sess_key->public_x); + TEE_Free(sess_key->public_y); TEE_Free(sess_key); - if (res != TEE_SUCCESS) { - WTPI_FreeAsymmetricKeyHandle(sess); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - - *private_key_handle = sess; - return OEMCrypto_SUCCESS; + return result; } OEMCryptoResult WTPI_BccKeyCoseSign1(const uint8_t* message, diff --git a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/Makefile b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/Makefile index 4729e6f..41285c9 100644 --- a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/Makefile +++ b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/Makefile @@ -36,3 +36,5 @@ endif .PHONY: build_and_copy build_and_copy: all cp $(O)/$(BINARY).ta $(O_BASE)/ + +include ../rules.mk diff --git a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/oemcrypto_ta.c b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/oemcrypto_ta.c index 1f0818e..8829d65 100644 --- a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/oemcrypto_ta.c +++ b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/oemcrypto_ta.c @@ -83,7 +83,7 @@ void TA_CloseSessionEntryPoint(void __maybe_unused* session_context) { static TEE_Result HandleRequest(uint32_t param_types, TEE_Param params[4]) { uint32_t expected_param_types = TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INOUT, TEE_PARAM_TYPE_MEMREF_INOUT, - TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE); + TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE); if (param_types != expected_param_types) { DMSG("Bad parameters\n"); @@ -98,7 +98,7 @@ static TEE_Result HandleRequest(uint32_t param_types, TEE_Param params[4]) { return TEE_ERROR_BAD_PARAMETERS; } - size_t request_size = params[1].memref.size; + size_t request_size = (size_t)(params[2].value.a); if (request_size > OPK_TRANSPORT_MESSAGE_SIZE) { DMSG("Size too large. Input is %zu, limit is %d\n", request_size, OPK_TRANSPORT_MESSAGE_SIZE); diff --git a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/sub.mk b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/sub.mk index 42c1fac..aacf72b 100644 --- a/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/sub.mk +++ b/oemcrypto/opk/ports/optee/ta/oemcrypto_ta/sub.mk @@ -35,13 +35,13 @@ global-incdirs-y += \ $(wtpi_impl_includes) \ cppflags-y += \ - -DWTPI_BUILD_INFO=\"$(WTPI_BUILD_INFO)\" \ -DOPK_CONFIG_SOC_VENDOR_NAME=$(SOC_VENDOR) \ -DOPK_CONFIG_SOC_MODEL_NAME=$(SOC_MODEL) \ -DOPK_CONFIG_TEE_OS_NAME=$(TEE_OS) \ -DOPK_CONFIG_TEE_OS_VERSION=$(TEE_VERSION) \ -DOPK_CONFIG_DEVICE_FORM_FACTOR=$(DEVICE_FORM_FACTOR) \ -DOPK_CONFIG_IMPLEMENTER_NAME=$(IMPLEMENTER) \ + -DOPK_CONFIG_PROVISIONING_METHOD=$(OPTEE_PROVISIONING_METHOD) \ -Wno-switch-default #-D_DEBUG diff --git a/oemcrypto/opk/ports/optee/ta/rules.mk b/oemcrypto/opk/ports/optee/ta/rules.mk new file mode 100644 index 0000000..b5062c9 --- /dev/null +++ b/oemcrypto/opk/ports/optee/ta/rules.mk @@ -0,0 +1,50 @@ +# +# Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +# source code may only be used and distributed under the Widevine +# License Agreement. +# + +# Filter out files and directories in third_party. +filter_out_third_party = \ + $(foreach path,$(1),$(if $(findstring /third_party/,$(path)),,$(path))) + +# Filter out third-party sources for clang-tidy. +clang-tidy-srcs := \ + $(filter-out user_ta_header.c ta_entry_a32.S,\ + $(call filter_out_third_party,$(srcs))) + +# Generate flags to run clang-tidy with a single source file. + +oname = $(O)/$(patsubst %.c,%.o,$(1)) + +clang-tidy-incs = \ + $(call filter_out_third_party,\ + $(incdirs-$(call oname,$(1))) $(incdirs$(sm))) + +clang-tidy-flags = \ + --header-filter \ + '$(subst $() $(),|,$(strip $(call clang-tidy-incs,$(1))))' \ + --quiet + +clang-tidy-cflags = \ + -m$(ARCH) \ + $(comp-cppflags-$(call oname,$(1))) + +# Define a rule template to run clang-tidy with a single source file. +define clang-tidy-rule +.PHONY: clang-tidy-$(1) +clang-tidy-$(1): + @$(cmd-echo-silent) ' CLANG-TIDY $(1)' + $(q)clang-tidy \ + $(call clang-tidy-flags,$(1)) \ + $(1) \ + -- \ + $(call clang-tidy-cflags,$(1)) +endef + +# Generate rules to run clang-tidy with each source file. +$(foreach src,$(clang-tidy-srcs),$(eval $(call clang-tidy-rule,$(src)))) + +# Run clang-tidy with all source files. +.PHONY: clang-tidy +clang-tidy: $(addprefix clang-tidy-,$(clang-tidy-srcs)) diff --git a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/Makefile b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/Makefile index a25f452..e661ae5 100644 --- a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/Makefile +++ b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/Makefile @@ -36,3 +36,5 @@ endif .PHONY: build_and_copy build_and_copy: all cp $(O)/$(BINARY).ta $(O_BASE)/ + +include ../rules.mk diff --git a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/sub.mk b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/sub.mk index 5a685d8..30c7979 100644 --- a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/sub.mk +++ b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/sub.mk @@ -47,3 +47,6 @@ cppflags-y += \ -DOPK_CONFIG_TEE_OS_VERSION=$(TEE_VERSION) \ -DOPK_CONFIG_DEVICE_FORM_FACTOR=$(DEVICE_FORM_FACTOR) \ -DOPK_CONFIG_IMPLEMENTER_NAME=$(IMPLEMENTER) \ + -DOPK_CONFIG_PROVISIONING_METHOD=$(OPTEE_PROVISIONING_METHOD) \ + -Wno-switch-default \ + diff --git a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/wtpi_test_ta.c b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/wtpi_test_ta.c index 02cdd8f..af07f79 100644 --- a/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/wtpi_test_ta.c +++ b/oemcrypto/opk/ports/optee/ta/wtpi_test_ta/wtpi_test_ta.c @@ -77,7 +77,7 @@ void TA_CloseSessionEntryPoint(void __maybe_unused* session_context) { static TEE_Result HandleRequest(uint32_t param_types, TEE_Param params[4]) { uint32_t expected_param_types = TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INOUT, TEE_PARAM_TYPE_MEMREF_INOUT, - TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE); + TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE); if (param_types != expected_param_types) { DMSG("Bad parameters\n"); @@ -92,7 +92,7 @@ static TEE_Result HandleRequest(uint32_t param_types, TEE_Param params[4]) { return TEE_ERROR_BAD_PARAMETERS; } - size_t request_size = params[1].memref.size; + size_t request_size = (size_t)(params[2].value.a); if (request_size > OPK_TRANSPORT_MESSAGE_SIZE) { DMSG("Size too large. Input is %zu, limit is %d\n", request_size, OPK_TRANSPORT_MESSAGE_SIZE); diff --git a/oemcrypto/opk/ports/trusty/ta/README.md b/oemcrypto/opk/ports/trusty/ta/README.md index 45b4493..729ed76 100644 --- a/oemcrypto/opk/ports/trusty/ta/README.md +++ b/oemcrypto/opk/ports/trusty/ta/README.md @@ -39,8 +39,8 @@ repo sync -c -j32 # Download an Android NDK prebuilt to compile liboemcrypto.so cd $TRUSTY_DIR/prebuilts -mkdir -p ndk && cd ndk -git clone https://android.googlesource.com/toolchain/prebuilts/ndk/r21 r21 +mkdir ndk && cd ndk +git clone https://android.googlesource.com/toolchain/prebuilts/ndk/r25 # Add the OEMCrypto TA path as a user module. The OEMCRYPTO_TA_DIR must expand # to a path that is relative to the Trusty directory diff --git a/oemcrypto/opk/ports/trusty/ta/reference/clang-tidy-inc.mk b/oemcrypto/opk/ports/trusty/ta/reference/clang-tidy-inc.mk new file mode 100644 index 0000000..b4f22cb --- /dev/null +++ b/oemcrypto/opk/ports/trusty/ta/reference/clang-tidy-inc.mk @@ -0,0 +1,61 @@ +# Copyright (C) 2023 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +OPK_TRUSTY_CLANG_TIDY ?= false +ifeq ($(call TOBOOL,$(OPK_TRUSTY_CLANG_TIDY)),true) + +clang-tidy-srcs := $(MODULE_SRCS) + +clang-tidy-incs := $(MODULE_INCLUDES) + +clang-tidy-flags := \ + --header-filter '$(subst $(SPACE),|,$(strip $(clang-tidy-incs)))' \ + --quiet + +clang-tidy-cflags := \ + $(MODULE_CFLAGS) \ + $(addprefix -D,$(MODULE_DEFINES) TRUSTY_USERSPACE) \ + $(addprefix -I,\ + $(MODULE_INCLUDES) \ + $(addsuffix /include,$(MODULE_LIBRARY_DEPS)) \ + external/open-dice/include/dice/config/boringssl_ed25519 \ + $(BUILDDIR)/sdk/sysroot/usr/include) + +# Define a rule template to run clang-tidy with a single source file. +define clang-tidy-rule +.PHONY: clang-tidy-$(1) +clang-tidy-$(1): clang-tidy-flags := $(clang-tidy-flags) +clang-tidy-$(1): clang-tidy-cflags := $(clang-tidy-cflags) +clang-tidy-$(1): + @echo running clang-tidy: $(1) + $(NOECHO)clang-tidy $(clang-tidy-flags) $(1) -- $(clang-tidy-cflags) +endef + +# Generate rules to run clang-tidy with each source file. +$(foreach src,$(clang-tidy-srcs),$(eval $(call clang-tidy-rule,$(src)))) + +# Run clang-tidy with all source files. +.PHONY: clang-tidy +clang-tidy: $(addprefix clang-tidy-,$(clang-tidy-srcs)) + +EXTRA_BUILDDEPS += clang-tidy + +clang-tidy-srcs := +clang-tidy-incs := +clang-tidy-flags := +clang-tidy-cflags := +clang-tidy-rule := + +endif diff --git a/oemcrypto/opk/ports/trusty/ta/reference/include/opk_config.h b/oemcrypto/opk/ports/trusty/ta/reference/include/opk_config.h index cd25c62..4729186 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/include/opk_config.h +++ b/oemcrypto/opk/ports/trusty/ta/reference/include/opk_config.h @@ -5,8 +5,8 @@ * License Agreement. */ -#ifndef _OPK_CONFIG_H_ -#define _OPK_CONFIG_H_ +#ifndef OPK_CONFIG_H_ +#define OPK_CONFIG_H_ #ifndef OPK_CONFIG_RESOURCE_RATING_TIER # define OPK_CONFIG_RESOURCE_RATING_TIER 3 diff --git a/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_crypto_asymmetric.c b/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_crypto_asymmetric.c deleted file mode 100644 index b274cd4..0000000 --- a/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_crypto_asymmetric.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wtpi_crypto_asymmetric_interface.h" - -#include -#include -#include - -#include "OEMCryptoCENCCommon.h" -#include "ecc_util.h" -#include "oemcrypto_check_macros.h" -#include "oemcrypto_compiler_attributes.h" -#include "oemcrypto_key_types.h" -#include "openssl/curve25519.h" -#include "openssl/evp.h" -#include "openssl/hkdf.h" -#include "openssl/rsa.h" -#include "openssl/x509.h" -#include "rsa_util.h" -#include "wtpi_abort_interface.h" -#include "wtpi_device_key_access_interface.h" -#include "wtpi_device_key_interface.h" -#include "wtpi_logging_interface.h" - -typedef struct tee_asymmetric_key_handle { - AsymmetricKeyType key_type; - RSA* rsa_key; - EC_KEY* ecc_key; - // Consider to use EVP_KEY instead of serialized key. - uint8_t ed25519_key[ED25519_PRIVATE_KEY_LEN]; -} tee_asymmetric_key_handle; - -// Returns true as long as one byte of ed25519_key is non-zero. -static bool HasED25519Key(WTPI_AsymmetricKey_Handle key_handle) { - for (size_t i = 0; i < ED25519_PRIVATE_KEY_LEN; ++i) { - if (key_handle->ed25519_key[i] != 0) { - return true; - } - } - return false; -} - -static bool IsAsymmetricKeyHandleValid(WTPI_AsymmetricKey_Handle key_handle) { - if (key_handle == NULL) return false; - switch (key_handle->key_type) { - case DRM_RSA_PRIVATE_KEY: { - if (key_handle->rsa_key == NULL) return false; - if (key_handle->ecc_key != NULL) return false; - if (HasED25519Key(key_handle)) return false; - break; - } - case DRM_ECC_PRIVATE_KEY: { - if (key_handle->ecc_key == NULL) return false; - if (key_handle->rsa_key != NULL) return false; - if (HasED25519Key(key_handle)) return false; - break; - } - case PROV40_ED25519_PRIVATE_KEY: { - if (key_handle->ecc_key != NULL) return false; - if (key_handle->rsa_key != NULL) return false; - if (!HasED25519Key(key_handle)) return false; - break; - } - default: - return false; - } - return true; -} - -static bool IsSupportedAsymmetricKeyType(AsymmetricKeyType key_type) { - return (key_type == DRM_RSA_PRIVATE_KEY || key_type == DRM_ECC_PRIVATE_KEY || - key_type == PROV40_ED25519_PRIVATE_KEY); -} - -static bool CreateAsymmetricRSAKeyHandle(const uint8_t* serialized_bytes, - size_t size, - WTPI_AsymmetricKey_Handle handle) { - if (serialized_bytes == NULL || size == 0 || handle == NULL) { - return false; - } - RSA* rsa = NULL; - if (!DeserializePKCS8PrivateKey(serialized_bytes, size, &rsa)) { - return false; - } - if (!CheckRSAKey(rsa)) { - RSA_free(rsa); - return false; - } - handle->key_type = DRM_RSA_PRIVATE_KEY; - handle->rsa_key = rsa; - return true; -} - -static bool CreateAsymmetricECCKeyHandle(const uint8_t* serialized_bytes, - size_t size, - WTPI_AsymmetricKey_Handle handle) { - EC_KEY* ecc_key = NULL; - if (!DeserializeECCPrivateKey(serialized_bytes, size, &ecc_key)) { - return false; - } - /* DeserializeECCPrivateKey will check the key after deserializing. */ - handle->key_type = DRM_ECC_PRIVATE_KEY; - handle->ecc_key = ecc_key; - return true; -} - -static bool CreateAsymmetricED25519KeyHandle(const uint8_t* serialized_bytes, - size_t size, - WTPI_AsymmetricKey_Handle handle) { - if (serialized_bytes == NULL || size != ED25519_PRIVATE_KEY_LEN) { - return false; - } - handle->key_type = PROV40_ED25519_PRIVATE_KEY; - memcpy(handle->ed25519_key, serialized_bytes, size); - return true; -} - -OEMCryptoResult WTPI_CreateAsymmetricKeyHandle( - const uint8_t* serialized_bytes, size_t size, AsymmetricKeyType key_type, - WTPI_AsymmetricKey_Handle* key_handle) { - if (serialized_bytes == NULL || size == 0 || - !IsSupportedAsymmetricKeyType(key_type) || key_handle == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - WTPI_AsymmetricKey_Handle handle = malloc(sizeof(tee_asymmetric_key_handle)); - if (handle == NULL) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - memset(handle, 0, sizeof(*handle)); - switch (key_type) { - case DRM_RSA_PRIVATE_KEY: { - if (!CreateAsymmetricRSAKeyHandle(serialized_bytes, size, handle)) - goto cleanup; - break; - } - case DRM_ECC_PRIVATE_KEY: { - if (!CreateAsymmetricECCKeyHandle(serialized_bytes, size, handle)) - goto cleanup; - break; - } - case PROV40_ED25519_PRIVATE_KEY: { - if (!CreateAsymmetricED25519KeyHandle(serialized_bytes, size, handle)) - goto cleanup; - break; - } - } - *key_handle = handle; - return OEMCrypto_SUCCESS; -cleanup: - if (handle) { - free(handle); - } - // TODO(b/201581141): Renamed to be more applicable to both RSA and ECC - // keys. - return OEMCrypto_ERROR_INVALID_RSA_KEY; -} - -OEMCryptoResult WTPI_FreeAsymmetricKeyHandle( - WTPI_AsymmetricKey_Handle key_handle) { - if (key_handle == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - switch (key_handle->key_type) { - case DRM_RSA_PRIVATE_KEY: { - RSA_free(key_handle->rsa_key); - key_handle->rsa_key = NULL; - break; - } - case DRM_ECC_PRIVATE_KEY: { - EC_KEY_free(key_handle->ecc_key); - key_handle->ecc_key = NULL; - break; - } - case PROV40_ED25519_PRIVATE_KEY: { - memset(key_handle->ed25519_key, 0, sizeof(key_handle->ed25519_key)); - break; - } - } - free(key_handle); - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_RSASign(WTPI_AsymmetricKey_Handle key_handle, - const uint8_t* message, size_t message_length, - uint8_t* signature, size_t* signature_length, - RSA_Padding_Scheme padding_scheme) { - if (key_handle == NULL || message == NULL || message_length == 0 || - signature_length == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - if (key_handle->key_type != DRM_RSA_PRIVATE_KEY) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - RSA* rsa = key_handle->rsa_key; - const size_t max_signature_size = (size_t)RSA_size(rsa); - if (signature == NULL || *signature_length < max_signature_size) { - *signature_length = max_signature_size; - return OEMCrypto_ERROR_SHORT_BUFFER; - } - - /* This is the standard padding scheme used for license requests. */ - if (padding_scheme == kSign_RSASSA_PSS) { - size_t local_signature_length = *signature_length; - if (!RSASignSSAPSSSHA256(rsa, message, message_length, signature, - &local_signature_length)) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - *signature_length = local_signature_length; - /* This is the alternate padding scheme used by cast receivers only. */ - } else if (padding_scheme == kSign_PKCS1_Block1) { - /* Pad the message with PKCS1 padding, and then encrypt. */ - const int encrypt_res = RSA_private_encrypt( - message_length, message, signature, rsa, RSA_PKCS1_PADDING); - if (encrypt_res <= 0) { - dump_ssl_error(); - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - *signature_length = (size_t)encrypt_res; - } else { /* Bad RSA_Padding_Scheme */ - return OEMCrypto_ERROR_INVALID_RSA_KEY; - } - - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_RSADecrypt(WTPI_AsymmetricKey_Handle key_handle, - const uint8_t* in, size_t in_length, - uint8_t* out, size_t* out_length) { - if (key_handle == NULL || in == NULL || in_length == 0 || out == NULL || - out_length == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - if (key_handle->key_type != DRM_RSA_PRIVATE_KEY) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - RSA* rsa = key_handle->rsa_key; - const size_t max_cleartext_size = (size_t)RSA_size(rsa); - if (*out_length < max_cleartext_size) { - *out_length = max_cleartext_size; - return OEMCrypto_ERROR_SHORT_BUFFER; - } - if (!RSAPrivateDecrypt(rsa, in, in_length, out, out_length)) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_ECCSign(WTPI_AsymmetricKey_Handle key_handle, - const uint8_t* message, size_t message_length, - uint8_t* signature, size_t* signature_length) { - if (key_handle == NULL || message == NULL || message_length == 0 || - signature_length == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - if (key_handle->key_type != DRM_ECC_PRIVATE_KEY) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - EC_KEY* ecc_key = key_handle->ecc_key; - const size_t max_signature_size = ECDSA_size(ecc_key); - if (signature == NULL || *signature_length < max_signature_size) { - *signature_length = max_signature_size; - return OEMCrypto_ERROR_SHORT_BUFFER; - } - if (!ECCSignECDSA(ecc_key, message, message_length, signature, - signature_length)) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_ECCDeriveSessionKey(WTPI_AsymmetricKey_Handle key_handle, - const uint8_t* key_source, - size_t key_source_length, - uint8_t* session_key, - size_t* session_key_length) { - if (key_handle == NULL || key_source == NULL || key_source_length == 0 || - session_key_length == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - if (key_handle->key_type != DRM_ECC_PRIVATE_KEY) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - if (session_key == NULL || *session_key_length < KEY_SIZE_256) { - *session_key_length = KEY_SIZE_256; - return OEMCrypto_ERROR_SHORT_BUFFER; - } - EC_KEY* ecc_key = key_handle->ecc_key; - if (!ECCWidevineECDHSessionKey(ecc_key, key_source, key_source_length, - session_key, session_key_length)) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_GetSignatureSize(WTPI_AsymmetricKey_Handle key_handle, - size_t* key_size) { - if (key_handle == NULL || key_size == NULL) { - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - ABORT_IF(!IsAsymmetricKeyHandleValid(key_handle), "Impossible key handle."); - *key_size = 0; - switch (key_handle->key_type) { - case DRM_RSA_PRIVATE_KEY: - *key_size = RSA_size(key_handle->rsa_key); - break; - case DRM_ECC_PRIVATE_KEY: - *key_size = ECDSA_size(key_handle->ecc_key); - break; - case PROV40_ED25519_PRIVATE_KEY: - *key_size = ED25519_SIGNATURE_LEN; - break; - } - if (*key_size == 0) { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - return OEMCrypto_SUCCESS; -} - -OEMCryptoResult WTPI_GetSignatureHashAlgorithm( - WTPI_AsymmetricKey_Handle key, AsymmetricKeyType key_type, - OEMCrypto_SignatureHashAlgorithm* hash_algorithm) { - RETURN_INVALID_CONTEXT_IF_NULL(key); - RETURN_INVALID_CONTEXT_IF_NULL(hash_algorithm); - ABORT_IF(!IsAsymmetricKeyHandleValid(key), "Impossible key handle."); - if (key_type != key->key_type) { - LOGE("Passed-in key's type does not match passed-in key type."); - return OEMCrypto_ERROR_INVALID_CONTEXT; - } - - switch (key_type) { - case DRM_RSA_PRIVATE_KEY: - *hash_algorithm = OEMCrypto_SHA2_256; - return OEMCrypto_SUCCESS; - - case DRM_ECC_PRIVATE_KEY: - if (GetECCKeyECDSAHashAlgorithm(key->ecc_key, hash_algorithm)) { - return OEMCrypto_SUCCESS; - } else { - return OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - - case PROV40_ED25519_PRIVATE_KEY: - *hash_algorithm = OEMCrypto_SHA2_512; - return OEMCrypto_SUCCESS; - } - return OEMCrypto_ERROR_UNKNOWN_FAILURE; -} - -OEMCryptoResult WTPI_ED25519Sign(WTPI_AsymmetricKey_Handle key, - const uint8_t* message, size_t message_length, - uint8_t* signature, size_t* signature_length) { - return OEMCrypto_ERROR_NOT_IMPLEMENTED; -} diff --git a/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_provisioning_4.c b/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_provisioning_4.c index 122a20c..4e0703e 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_provisioning_4.c +++ b/oemcrypto/opk/ports/trusty/ta/reference/interface_impls/wtpi_provisioning_4.c @@ -53,7 +53,7 @@ OEMCryptoResult WTPI_GetBootCertificateChain(uint8_t* out, size_t* out_length) { size_t signature_size_unused = 0; int result = hwbcc_get_protected_data( /*test_mode=*/false, /*cose_algorithm=*/HWBCC_ALGORITHM_ED25519, - /*key=*/key_unused, /*key_size=*/sizeof(key_unused), + /*data=*/key_unused, /*data_size=*/sizeof(key_unused), /*aad=*/NULL, /*aad_size=*/0, /*cose_sign1=*/signature_unused, /*cose_sign1_buf_size=*/sizeof(signature_unused), /*cose_sign1_size=*/&signature_size_unused, /*bcc=*/out, @@ -146,7 +146,7 @@ OEMCryptoResult WTPI_BccKeyCoseSign1(const uint8_t* message, size_t bcc_size_unused = 0; int result = hwbcc_get_protected_data( /*test_mode=*/false, /*cose_algorithm=*/HWBCC_ALGORITHM_ED25519, - /*key=*/message, /*key_size=*/message_length, /*aad=*/NULL, + /*data=*/message, /*data_size=*/message_length, /*aad=*/NULL, /*aad_size=*/0, /*cose_sign1=*/signature, /*cose_sign1_buf_size=*/*signature_length, /*cose_sign1_size=*/signature_length, /*bcc=*/bcc_unused, diff --git a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/Application.mk b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/Application.mk index 777b2af..8b7f7d6 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/Application.mk +++ b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/Application.mk @@ -1,6 +1,8 @@ +APP_BUILD_SCRIPT := Android.mk APP_PLATFORM := android-19 APP_ABI := arm64-v8a APP_STL := c++_static APP_CFLAGS := -Werror -Wall -Wextra -Wno-unused-function -Wno-unused-label -Wvla APP_CONLYFLAGS += -std=c17 APP_CPPFLAGS += -std=c++17 +APP_CLANG_TIDY_FLAGS := --header-filter shared/include --quiet diff --git a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/build.sh b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/build.sh index 882c383..fb9eca7 100755 --- a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/build.sh +++ b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/build.sh @@ -3,11 +3,18 @@ set -e set -u +SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") + # Build liboemcrypto.so -if [ ! -v ANDROID_NDK_ROOT ]; -then - ANDROID_NDK_ROOT=$(realpath $(dirname "$0")/../../../../../prebuilts/ndk/r21) +if [ ! -v ANDROID_NDK_ROOT ]; then + ANDROID_NDK_ROOT=$(realpath "$SCRIPT_DIR/../../../../../prebuilts/ndk/r25") fi -$ANDROID_NDK_ROOT/ndk-build -C $(dirname "${BASH_SOURCE[0]}") NDK_PROJECT_PATH=out APP_BUILD_SCRIPT=Android.mk NDK_APPLICATION_MK=Application.mk NDK_DEBUG=1 -j`nproc` +"$ANDROID_NDK_ROOT/ndk-build" \ + -C "$SCRIPT_DIR" \ + NDK_PROJECT_PATH=out \ + NDK_APPLICATION_MK=Application.mk \ + NDK_DEBUG=1 \ + "-j$(nproc)" \ + "$@" diff --git a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/liboemcrypto-inc.mk b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/liboemcrypto-inc.mk index c9e2e6c..0b1f6a3 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/liboemcrypto-inc.mk +++ b/oemcrypto/opk/ports/trusty/ta/reference/liboemcrypto/liboemcrypto-inc.mk @@ -24,12 +24,18 @@ endif LIBOEMCRYPTO_SO := $(LIBOEMCRYPTO_OUT_DIR)/lib/arm64-v8a/liboemcrypto.so +.PHONY: $(LIBOEMCRYPTO_SO) $(LIBOEMCRYPTO_SO): LOCAL_DIR := $(GET_LOCAL_DIR) $(LIBOEMCRYPTO_SO): LIBOEMCRYPTO_BUILD_DIR := $(LIBOEMCRYPTO_BUILD_DIR) $(LIBOEMCRYPTO_SO): LIBOEMCRYPTO_OUT_DIR := $(LIBOEMCRYPTO_OUT_DIR) -$(LIBOEMCRYPTO_SO): NDK_ROOT := $(TRUSTY_TOP)/prebuilts/ndk/r21 -$(LIBOEMCRYPTO_SO): .PHONY - $(NOECHO)(cd $(LOCAL_DIR) && $(NDK_ROOT)/ndk-build NDK_PROJECT_PATH=$(LIBOEMCRYPTO_BUILD_DIR) NDK_LIBS_OUT=$(LIBOEMCRYPTO_OUT_DIR)/lib APP_BUILD_SCRIPT=Android.mk NDK_APPLICATION_MK=Application.mk -j`nproc`) +$(LIBOEMCRYPTO_SO): NDK_ROOT := $(TRUSTY_TOP)/prebuilts/ndk/r25 +$(LIBOEMCRYPTO_SO): + $(NOECHO)$(NDK_ROOT)/ndk-build \ + -C $(LOCAL_DIR) \ + NDK_PROJECT_PATH=$(LIBOEMCRYPTO_BUILD_DIR) \ + NDK_LIBS_OUT=$(LIBOEMCRYPTO_OUT_DIR)/lib \ + NDK_APPLICATION_MK=Application.mk \ + -j`nproc` # Ensure liboemcrypto.so is built EXTRA_BUILDDEPS += $(LIBOEMCRYPTO_SO) diff --git a/oemcrypto/opk/ports/trusty/ta/reference/rules.mk b/oemcrypto/opk/ports/trusty/ta/reference/rules.mk index eea7380..443873d 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/rules.mk +++ b/oemcrypto/opk/ports/trusty/ta/reference/rules.mk @@ -85,6 +85,7 @@ MODULE_SRCS += \ $(APP_DIR)/wtpi_reference/wtpi_clock_and_gn_layer1.c \ $(APP_DIR)/wtpi_reference/wtpi_config.c \ $(APP_DIR)/wtpi_reference/wtpi_crc32.c \ + $(APP_DIR)/wtpi_reference/wtpi_crypto_asymmetric.c \ $(APP_DIR)/wtpi_reference/wtpi_crypto_wrap_asymmetric.c \ $(APP_DIR)/wtpi_reference/wtpi_device_renewal_layer1.c \ $(APP_DIR)/wtpi_reference/wtpi_decrypt_sample.c \ @@ -92,7 +93,6 @@ MODULE_SRCS += \ $(APP_DIR)/wtpi_reference/wtpi_logging.c \ $(APP_DIR)/wtpi_reference/wtpi_root_of_trust_layer1.c \ $(REF_IMPL_DIR)/wtpi_clock_layer2.c \ - $(REF_IMPL_DIR)/wtpi_crypto_asymmetric.c \ $(REF_IMPL_DIR)/wtpi_secure_buffer_access.c \ $(REF_IMPL_DIR)/wtpi_initialize_terminate.c \ $(REF_IMPL_DIR)/wtpi_config.c \ @@ -129,6 +129,8 @@ MODULE_SRCS += \ MODULE_INCLUDES += \ $(opk_base_ta_includes) \ +include $(REF_DIR)/clang-tidy-inc.mk + # Before including trusted_app.mk, this is the root build directory LIBOEMCRYPTO_OUT_DIR := $(BUILDDIR) diff --git a/oemcrypto/opk/ports/trusty/ta/reference/secure_buffer.c b/oemcrypto/opk/ports/trusty/ta/reference/secure_buffer.c index 6b80085..c8b805e 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/secure_buffer.c +++ b/oemcrypto/opk/ports/trusty/ta/reference/secure_buffer.c @@ -123,8 +123,8 @@ void cleanup_secure_buffers(void) { } /* Overly cautious clear */ - secure_buffers[num_secure_buffers] = (struct secure_buffer_info){ - .handle = INVALID_IPC_HANDLE, .size = 0, .addr = NULL}; + secure_buffers[i] = (struct secure_buffer_info){ + .handle = INVALID_IPC_HANDLE, .size = 0, .addr = NULL}; } num_secure_buffers = 0; } diff --git a/oemcrypto/opk/ports/trusty/ta/reference/widevine_app.c b/oemcrypto/opk/ports/trusty/ta/reference/widevine_app.c index 201b148..f388136 100644 --- a/oemcrypto/opk/ports/trusty/ta/reference/widevine_app.c +++ b/oemcrypto/opk/ports/trusty/ta/reference/widevine_app.c @@ -138,12 +138,10 @@ static int receive_tagged(handle_t chan, /* Check we have enough space to read the message. */ if (info.len > WV_HEADER_SIZE + *num_bytes) { TLOGE("Buffer too small %d %zu\n", chan, info.len); - rc = -1; goto on_post_get_error; } if (info.num_handles > *num_handles) { TLOGE("Too many handles %d %u\n", chan, info.num_handles); - rc = -1; goto on_post_get_error; } diff --git a/oemcrypto/opk/serialization/common/GEN_common_serializer.c b/oemcrypto/opk/serialization/common/GEN_common_serializer.c index 5aed9c1..67775bf 100644 --- a/oemcrypto/opk/serialization/common/GEN_common_serializer.c +++ b/oemcrypto/opk/serialization/common/GEN_common_serializer.c @@ -11,7 +11,6 @@ #include -#include "GEN_common_serializer.h" #include "bump_allocator.h" #include "common_special_cases.h" #include "log_macros.h" diff --git a/oemcrypto/opk/serialization/common/include/marshaller_base.h b/oemcrypto/opk/serialization/common/include/marshaller_base.h index dbe9440..b3eb9c0 100644 --- a/oemcrypto/opk/serialization/common/include/marshaller_base.h +++ b/oemcrypto/opk/serialization/common/include/marshaller_base.h @@ -19,8 +19,6 @@ extern "C" { #endif -typedef struct _Message Message; - /* * When packing a pointer to size_t, and the pointer is null, pass * this special value of size_t instead diff --git a/oemcrypto/opk/serialization/common/include/opk_serialization_base.h b/oemcrypto/opk/serialization/common/include/opk_serialization_base.h index 09dd4ca..474618a 100644 --- a/oemcrypto/opk/serialization/common/include/opk_serialization_base.h +++ b/oemcrypto/opk/serialization/common/include/opk_serialization_base.h @@ -144,7 +144,7 @@ void OPK_PackEOM(ODK_Message* message); * parameter type */ void OPK_PackSharedBuffer(ODK_Message* message, const uint8_t* address, - const LengthType length, bool map, bool copy_in, + LengthType length, bool map, bool copy_in, bool is_output); /* diff --git a/oemcrypto/opk/serialization/ree/GEN_oemcrypto_api.c b/oemcrypto/opk/serialization/ree/GEN_oemcrypto_api.c index 6af6b1b..324703f 100644 --- a/oemcrypto/opk/serialization/ree/GEN_oemcrypto_api.c +++ b/oemcrypto/opk/serialization/ree/GEN_oemcrypto_api.c @@ -772,41 +772,6 @@ cleanup_and_return: return result; } -OEMCRYPTO_API OEMCryptoResult OEMCrypto_LoadCasECMKeys( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const OEMCrypto_EntitledContentKeyObject* even_key, - const OEMCrypto_EntitledContentKeyObject* odd_key) { - pthread_mutex_lock(&api_lock); - OEMCryptoResult result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - ODK_Message request = ODK_Message_Create(NULL, 0); - ODK_Message response = ODK_Message_Create(NULL, 0); - - API_Initialize(); - request = OPK_Pack_LoadCasECMKeys_Request(session, message, message_length, - even_key, odd_key); - if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { - if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { - api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; - } else { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } - goto cleanup_and_return; - } - response = API_Transact(&request); - OPK_Unpack_LoadCasECMKeys_Response(&response, &result); - - if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { - api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; - } -cleanup_and_return: - TOS_Transport_ReleaseMessage(&request); - TOS_Transport_ReleaseMessage(&response); - - result = API_CheckResult(result); - pthread_mutex_unlock(&api_lock); - return result; -} - OEMCRYPTO_API OEMCryptoResult OEMCrypto_GetOEMKeyToken(OEMCrypto_SESSION key_session, uint8_t* key_token, size_t* key_token_length) { @@ -1194,6 +1159,39 @@ cleanup_and_return: return result; } +OEMCRYPTO_API OEMCryptoResult OEMCrypto_FactoryInstallBCCSignature( + const uint8_t* signature, size_t signature_length) { + pthread_mutex_lock(&api_lock); + OEMCryptoResult result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + ODK_Message request = ODK_Message_Create(NULL, 0); + ODK_Message response = ODK_Message_Create(NULL, 0); + + API_Initialize(); + request = + OPK_Pack_FactoryInstallBCCSignature_Request(signature, signature_length); + if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { + if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { + api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; + } else { + api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + goto cleanup_and_return; + } + response = API_Transact(&request); + OPK_Unpack_FactoryInstallBCCSignature_Response(&response, &result); + + if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { + api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + } +cleanup_and_return: + TOS_Transport_ReleaseMessage(&request); + TOS_Transport_ReleaseMessage(&response); + + result = API_CheckResult(result); + pthread_mutex_unlock(&api_lock); + return result; +} + OEMCRYPTO_API OEMCrypto_ProvisioningMethod OEMCrypto_GetProvisioningMethod(void) { pthread_mutex_lock(&api_lock); diff --git a/oemcrypto/opk/serialization/ree/GEN_ree_serializer.c b/oemcrypto/opk/serialization/ree/GEN_ree_serializer.c index 5c7a6dd..a927db2 100644 --- a/oemcrypto/opk/serialization/ree/GEN_ree_serializer.c +++ b/oemcrypto/opk/serialization/ree/GEN_ree_serializer.c @@ -761,43 +761,6 @@ void OPK_Unpack_ReassociateEntitledKeySession_Response( } } -ODK_Message OPK_Pack_LoadCasECMKeys_Request( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const OEMCrypto_EntitledContentKeyObject* even_key, - const OEMCrypto_EntitledContentKeyObject* odd_key) { - uint32_t api_value = 120; /* from _oecc120 */ - ODK_Message msg = TOS_Transport_GetRequest(); - OPK_Pack_uint32_t(&msg, &api_value); - uint64_t timestamp = time(0); - OPK_Pack_uint64_t(&msg, ×tamp); - OPK_Pack_size_t(&msg, &message_length); - OPK_Pack_uint32_t(&msg, &session); - OPK_PackMemory(&msg, (const uint8_t*)message, - OPK_ToLengthType(message_length)); - OPK_PackNullable_OEMCrypto_EntitledContentKeyObject(&msg, even_key); - OPK_PackNullable_OEMCrypto_EntitledContentKeyObject(&msg, odd_key); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - -void OPK_Unpack_LoadCasECMKeys_Response(ODK_Message* msg, - OEMCryptoResult* result) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 120) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - OPK_Unpack_uint32_t(msg, result); - if (!Is_Valid_OEMCryptoResult(*result)) { - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_INVALID_ENUM_VALUE); - } - OPK_UnpackEOM(msg); - - if (SuccessResult(*result)) { - OPK_SharedBuffer_FinalizeUnpacking(); - } -} - ODK_Message OPK_Pack_GetOEMKeyToken_Request(OEMCrypto_SESSION key_session, const uint8_t* key_token, const size_t* key_token_length) { @@ -1259,6 +1222,38 @@ void OPK_Unpack_InstallKeyboxOrOEMCert_Response(ODK_Message* msg, } } +ODK_Message OPK_Pack_FactoryInstallBCCSignature_Request( + const uint8_t* signature, size_t signature_length) { + uint32_t api_value = 142; /* from _oecc142 */ + ODK_Message msg = TOS_Transport_GetRequest(); + OPK_Pack_uint32_t(&msg, &api_value); + uint64_t timestamp = time(0); + OPK_Pack_uint64_t(&msg, ×tamp); + OPK_Pack_size_t(&msg, &signature_length); + OPK_PackMemory(&msg, (const uint8_t*)signature, + OPK_ToLengthType(signature_length)); + OPK_PackEOM(&msg); + OPK_SharedBuffer_FinalizePacking(); + return msg; +} + +void OPK_Unpack_FactoryInstallBCCSignature_Response(ODK_Message* msg, + OEMCryptoResult* result) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != 142) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + OPK_Unpack_uint32_t(msg, result); + if (!Is_Valid_OEMCryptoResult(*result)) { + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_INVALID_ENUM_VALUE); + } + OPK_UnpackEOM(msg); + + if (SuccessResult(*result)) { + OPK_SharedBuffer_FinalizeUnpacking(); + } +} + ODK_Message OPK_Pack_GetProvisioningMethod_Request(void) { uint32_t api_value = 49; /* from _oecc49 */ ODK_Message msg = TOS_Transport_GetRequest(); diff --git a/oemcrypto/opk/serialization/ree/GEN_ree_serializer.h b/oemcrypto/opk/serialization/ree/GEN_ree_serializer.h index 2535ed9..e76e432 100644 --- a/oemcrypto/opk/serialization/ree/GEN_ree_serializer.h +++ b/oemcrypto/opk/serialization/ree/GEN_ree_serializer.h @@ -114,12 +114,6 @@ ODK_Message OPK_Pack_ReassociateEntitledKeySession_Request( OEMCrypto_SESSION key_session, OEMCrypto_SESSION oec_session); void OPK_Unpack_ReassociateEntitledKeySession_Response(ODK_Message* msg, OEMCryptoResult* result); -ODK_Message OPK_Pack_LoadCasECMKeys_Request( - OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, - const OEMCrypto_EntitledContentKeyObject* even_key, - const OEMCrypto_EntitledContentKeyObject* odd_key); -void OPK_Unpack_LoadCasECMKeys_Response(ODK_Message* msg, - OEMCryptoResult* result); ODK_Message OPK_Pack_GetOEMKeyToken_Request(OEMCrypto_SESSION key_session, const uint8_t* key_token, const size_t* key_token_length); @@ -192,6 +186,10 @@ ODK_Message OPK_Pack_InstallKeyboxOrOEMCert_Request( const uint8_t* keybox_or_cert, size_t keybox_or_cert_length); void OPK_Unpack_InstallKeyboxOrOEMCert_Response(ODK_Message* msg, OEMCryptoResult* result); +ODK_Message OPK_Pack_FactoryInstallBCCSignature_Request( + const uint8_t* signature, size_t signature_length); +void OPK_Unpack_FactoryInstallBCCSignature_Response(ODK_Message* msg, + OEMCryptoResult* result); ODK_Message OPK_Pack_GetProvisioningMethod_Request(void); void OPK_Unpack_GetProvisioningMethod_Response( ODK_Message* msg, OEMCrypto_ProvisioningMethod* result); diff --git a/oemcrypto/opk/serialization/ree/ree_special_cases.c b/oemcrypto/opk/serialization/ree/ree_special_cases.c index fc7d976..be3133b 100644 --- a/oemcrypto/opk/serialization/ree/ree_special_cases.c +++ b/oemcrypto/opk/serialization/ree/ree_special_cases.c @@ -76,3 +76,40 @@ void OPK_Pack_RewrapDeviceRSAKey_Request( } OEMCryptoResult OPK_PreHook_OEMCrypto_Initialize(void) { return 0; } + +ODK_Message OPK_Pack_LoadCasECMKeys_Request( + OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, + const OEMCrypto_EntitledContentKeyObject* even_key, + const OEMCrypto_EntitledContentKeyObject* odd_key) { + uint32_t api_value = 120; /* from _oecc120 */ + ODK_Message msg = TOS_Transport_GetRequest(); + OPK_Pack_uint32_t(&msg, &api_value); + uint64_t timestamp = time(0); + OPK_Pack_uint64_t(&msg, ×tamp); + OPK_Pack_size_t(&msg, &message_length); + OPK_Pack_uint32_t(&msg, &session); + OPK_PackMemory(&msg, (const uint8_t*)message, + OPK_ToLengthType(message_length)); + OPK_PackNullable_OEMCrypto_EntitledContentKeyObject(&msg, even_key); + OPK_PackNullable_OEMCrypto_EntitledContentKeyObject(&msg, odd_key); + OPK_PackEOM(&msg); + OPK_SharedBuffer_FinalizePacking(); + return msg; +} + +void OPK_Unpack_LoadCasECMKeys_Response(ODK_Message* msg, + OEMCryptoResult* result) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != 120) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + OPK_Unpack_uint32_t(msg, result); + if (!Is_Valid_OEMCryptoResult(*result)) { + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_INVALID_ENUM_VALUE); + } + OPK_UnpackEOM(msg); + + if (SuccessResult(*result)) { + OPK_SharedBuffer_FinalizeUnpacking(); + } +} diff --git a/oemcrypto/opk/serialization/ree/ree_special_cases.h b/oemcrypto/opk/serialization/ree/ree_special_cases.h index b2b22a4..45b3cd4 100644 --- a/oemcrypto/opk/serialization/ree/ree_special_cases.h +++ b/oemcrypto/opk/serialization/ree/ree_special_cases.h @@ -27,6 +27,12 @@ void OPK_Pack_RewrapDeviceRSAKey_Request( const uint32_t* unaligned_nonce, const uint8_t* enc_rsa_key, size_t enc_rsa_key_length, const uint8_t* enc_rsa_key_iv, const uint8_t* wrapped_rsa_key, const size_t* wrapped_rsa_key_length); +ODK_Message OPK_Pack_LoadCasECMKeys_Request( + OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, + const OEMCrypto_EntitledContentKeyObject* even_key, + const OEMCrypto_EntitledContentKeyObject* odd_key); +void OPK_Unpack_LoadCasECMKeys_Response(ODK_Message* msg, + OEMCryptoResult* result); /* * Optional function declarations for custom REE-side hooks. See diff --git a/oemcrypto/opk/serialization/ree/special_case_apis.c b/oemcrypto/opk/serialization/ree/special_case_apis.c index 593045d..3a24efa 100644 --- a/oemcrypto/opk/serialization/ree/special_case_apis.c +++ b/oemcrypto/opk/serialization/ree/special_case_apis.c @@ -38,3 +38,37 @@ OEMCrypto_OPK_SerializationVersion(uint32_t* ree_major, uint32_t* ree_minor, pthread_mutex_unlock(&api_lock); return result; } + +OEMCRYPTO_API OEMCryptoResult OEMCrypto_LoadCasECMKeys( + OEMCrypto_SESSION session, const uint8_t* message, size_t message_length, + const OEMCrypto_EntitledContentKeyObject* even_key, + const OEMCrypto_EntitledContentKeyObject* odd_key) { + pthread_mutex_lock(&api_lock); + OEMCryptoResult result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + ODK_Message request = ODK_Message_Create(NULL, 0); + ODK_Message response = ODK_Message_Create(NULL, 0); + API_Initialize(); + request = OPK_Pack_LoadCasECMKeys_Request(session, message, message_length, + even_key, odd_key); + if (ODK_Message_GetStatus(&request) != MESSAGE_STATUS_OK) { + if (ODK_Message_GetStatus(&request) == MESSAGE_STATUS_BUFFER_TOO_LARGE) { + api_result = OEMCrypto_ERROR_BUFFER_TOO_LARGE; + } else { + api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + } + goto cleanup_and_return; + } + response = API_Transact(&request); + OPK_Unpack_LoadCasECMKeys_Response(&response, &result); + + if (ODK_Message_GetStatus(&response) != MESSAGE_STATUS_OK) { + api_result = OEMCrypto_ERROR_UNKNOWN_FAILURE; + } +cleanup_and_return: + TOS_Transport_ReleaseMessage(&request); + TOS_Transport_ReleaseMessage(&response); + + result = API_CheckResult(result); + pthread_mutex_unlock(&api_lock); + return result; +} diff --git a/oemcrypto/opk/serialization/tee/GEN_dispatcher.c b/oemcrypto/opk/serialization/tee/GEN_dispatcher.c index daa5a31..327d852 100644 --- a/oemcrypto/opk/serialization/tee/GEN_dispatcher.c +++ b/oemcrypto/opk/serialization/tee/GEN_dispatcher.c @@ -20,6 +20,7 @@ #include "oemcrypto_wall_clock.h" #include "opk_dispatcher.h" #include "shared_buffer_allocator.h" +#include "special_case_request_handlers.h" #include "tee_special_cases.h" #include "tos_shared_memory_interface.h" #include "tos_transport_interface.h" @@ -549,31 +550,8 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, } case 120: /* OEMCrypto_LoadCasECMKeys */ { - size_t message_length; - OPK_Init_size_t((size_t*)&message_length); - OEMCrypto_SESSION session; - OPK_Init_uint32_t((uint32_t*)&session); - uint8_t* message; - OPK_InitPointer((uint8_t**)&message); - OEMCrypto_EntitledContentKeyObject* even_key = - (OEMCrypto_EntitledContentKeyObject*)OPK_VarAlloc( - sizeof(OEMCrypto_EntitledContentKeyObject)); - OPK_Init_OEMCrypto_EntitledContentKeyObject( - (OEMCrypto_EntitledContentKeyObject*)even_key); - OEMCrypto_EntitledContentKeyObject* odd_key = - (OEMCrypto_EntitledContentKeyObject*)OPK_VarAlloc( - sizeof(OEMCrypto_EntitledContentKeyObject)); - OPK_Init_OEMCrypto_EntitledContentKeyObject( - (OEMCrypto_EntitledContentKeyObject*)odd_key); - OPK_Unpack_LoadCasECMKeys_Request(request, &session, &message, - &message_length, &even_key, &odd_key); - if (!ODK_Message_IsValid(request)) goto handle_invalid_request; - OEMCryptoResult result; - OPK_Init_uint32_t((uint32_t*)&result); - LOGD("LoadCasECMKeys"); - result = OEMCrypto_LoadCasECMKeys(session, message, message_length, - even_key, odd_key); - *response = OPK_Pack_LoadCasECMKeys_Response(result); + if (!Handle_OEMCrypto_LoadCasECMKeys(request, response)) + goto handle_invalid_request; break; } case 130: /* OEMCrypto_GetOEMKeyToken */ @@ -841,6 +819,23 @@ ODK_MessageStatus OPK_DispatchMessage(ODK_Message* request, *response = OPK_Pack_InstallKeyboxOrOEMCert_Response(result); break; } + case 142: /* OEMCrypto_FactoryInstallBCCSignature */ + { + size_t signature_length; + OPK_Init_size_t((size_t*)&signature_length); + uint8_t* signature; + OPK_InitPointer((uint8_t**)&signature); + OPK_Unpack_FactoryInstallBCCSignature_Request(request, &signature, + &signature_length); + if (!ODK_Message_IsValid(request)) goto handle_invalid_request; + OEMCryptoResult result; + OPK_Init_uint32_t((uint32_t*)&result); + LOGD("FactoryInstallBCCSignature"); + result = + OEMCrypto_FactoryInstallBCCSignature(signature, signature_length); + *response = OPK_Pack_FactoryInstallBCCSignature_Response(result); + break; + } case 49: /* OEMCrypto_GetProvisioningMethod */ { OPK_Unpack_GetProvisioningMethod_Request(request); diff --git a/oemcrypto/opk/serialization/tee/GEN_tee_serializer.c b/oemcrypto/opk/serialization/tee/GEN_tee_serializer.c index 0310c8e..2ba809c 100644 --- a/oemcrypto/opk/serialization/tee/GEN_tee_serializer.c +++ b/oemcrypto/opk/serialization/tee/GEN_tee_serializer.c @@ -635,35 +635,6 @@ ODK_Message OPK_Pack_ReassociateEntitledKeySession_Response( return msg; } -void OPK_Unpack_LoadCasECMKeys_Request( - ODK_Message* msg, OEMCrypto_SESSION* session, uint8_t** message, - size_t* message_length, OEMCrypto_EntitledContentKeyObject** even_key, - OEMCrypto_EntitledContentKeyObject** odd_key) { - uint32_t api_value = UINT32_MAX; - OPK_Unpack_uint32_t(msg, &api_value); - if (api_value != 120) - ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); - uint64_t timestamp; - OPK_Unpack_uint64_t(msg, ×tamp); - OPK_Unpack_size_t(msg, message_length); - OPK_Unpack_uint32_t(msg, session); - OPK_UnpackInPlace(msg, (uint8_t**)message, OPK_FromSizeTPtr(message_length)); - OPK_UnpackNullable_OEMCrypto_EntitledContentKeyObject(msg, even_key); - OPK_UnpackNullable_OEMCrypto_EntitledContentKeyObject(msg, odd_key); - OPK_UnpackEOM(msg); - OPK_SharedBuffer_FinalizeUnpacking(); -} - -ODK_Message OPK_Pack_LoadCasECMKeys_Response(OEMCryptoResult result) { - uint32_t api_value = 120; /* from _oecc120 */ - ODK_Message msg = TOS_Transport_GetResponse(); - OPK_Pack_uint32_t(&msg, &api_value); - OPK_Pack_uint32_t(&msg, &result); - OPK_PackEOM(&msg); - OPK_SharedBuffer_FinalizePacking(); - return msg; -} - void OPK_Unpack_GetOEMKeyToken_Request(ODK_Message* msg, OEMCrypto_SESSION* key_session, uint8_t** key_token, @@ -1078,6 +1049,33 @@ ODK_Message OPK_Pack_InstallKeyboxOrOEMCert_Response(OEMCryptoResult result) { return msg; } +void OPK_Unpack_FactoryInstallBCCSignature_Request(ODK_Message* msg, + uint8_t** signature, + size_t* signature_length) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != 142) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + uint64_t timestamp; + OPK_Unpack_uint64_t(msg, ×tamp); + OPK_Unpack_size_t(msg, signature_length); + OPK_UnpackInPlace(msg, (uint8_t**)signature, + OPK_FromSizeTPtr(signature_length)); + OPK_UnpackEOM(msg); + OPK_SharedBuffer_FinalizeUnpacking(); +} + +ODK_Message OPK_Pack_FactoryInstallBCCSignature_Response( + OEMCryptoResult result) { + uint32_t api_value = 142; /* from _oecc142 */ + ODK_Message msg = TOS_Transport_GetResponse(); + OPK_Pack_uint32_t(&msg, &api_value); + OPK_Pack_uint32_t(&msg, &result); + OPK_PackEOM(&msg); + OPK_SharedBuffer_FinalizePacking(); + return msg; +} + void OPK_Unpack_GetProvisioningMethod_Request(ODK_Message* msg) { uint32_t api_value = UINT32_MAX; OPK_Unpack_uint32_t(msg, &api_value); diff --git a/oemcrypto/opk/serialization/tee/GEN_tee_serializer.h b/oemcrypto/opk/serialization/tee/GEN_tee_serializer.h index 97316e2..23ad177 100644 --- a/oemcrypto/opk/serialization/tee/GEN_tee_serializer.h +++ b/oemcrypto/opk/serialization/tee/GEN_tee_serializer.h @@ -112,11 +112,6 @@ void OPK_Unpack_ReassociateEntitledKeySession_Request( OEMCrypto_SESSION* oec_session); ODK_Message OPK_Pack_ReassociateEntitledKeySession_Response( OEMCryptoResult result); -void OPK_Unpack_LoadCasECMKeys_Request( - ODK_Message* msg, OEMCrypto_SESSION* session, uint8_t** message, - size_t* message_length, OEMCrypto_EntitledContentKeyObject** even_key, - OEMCrypto_EntitledContentKeyObject** odd_key); -ODK_Message OPK_Pack_LoadCasECMKeys_Response(OEMCryptoResult result); void OPK_Unpack_GetOEMKeyToken_Request(ODK_Message* msg, OEMCrypto_SESSION* key_session, uint8_t** key_token, @@ -189,6 +184,11 @@ void OPK_Unpack_InstallKeyboxOrOEMCert_Request(ODK_Message* msg, uint8_t** keybox_or_cert, size_t* keybox_or_cert_length); ODK_Message OPK_Pack_InstallKeyboxOrOEMCert_Response(OEMCryptoResult result); +void OPK_Unpack_FactoryInstallBCCSignature_Request(ODK_Message* msg, + uint8_t** signature, + size_t* signature_length); +ODK_Message OPK_Pack_FactoryInstallBCCSignature_Response( + OEMCryptoResult result); void OPK_Unpack_GetProvisioningMethod_Request(ODK_Message* msg); ODK_Message OPK_Pack_GetProvisioningMethod_Response( OEMCrypto_ProvisioningMethod result); diff --git a/oemcrypto/opk/serialization/tee/special_case_request_handlers.c b/oemcrypto/opk/serialization/tee/special_case_request_handlers.c new file mode 100644 index 0000000..ebbfd05 --- /dev/null +++ b/oemcrypto/opk/serialization/tee/special_case_request_handlers.c @@ -0,0 +1,48 @@ +/* + * 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 "special_case_request_handlers.h" + +#include + +#include "GEN_tee_serializer.h" +#include "OEMCryptoCENC.h" +#include "log_macros.h" +#include "marshaller_base.h" +#include "tee_special_cases.h" + +void OPK_Init_OEMCrypto_EntitledContentKeyObject( + OEMCrypto_EntitledContentKeyObject* obj); + +bool Handle_OEMCrypto_LoadCasECMKeys(ODK_Message* request, + ODK_Message* response) { + size_t message_length; + OPK_Init_size_t((size_t*)&message_length); + OEMCrypto_SESSION session; + OPK_Init_uint32_t((uint32_t*)&session); + uint8_t* message; + OPK_InitPointer((uint8_t**)&message); + OEMCrypto_EntitledContentKeyObject* even_key = + (OEMCrypto_EntitledContentKeyObject*)OPK_VarAlloc( + sizeof(OEMCrypto_EntitledContentKeyObject)); + OPK_Init_OEMCrypto_EntitledContentKeyObject( + (OEMCrypto_EntitledContentKeyObject*)even_key); + OEMCrypto_EntitledContentKeyObject* odd_key = + (OEMCrypto_EntitledContentKeyObject*)OPK_VarAlloc( + sizeof(OEMCrypto_EntitledContentKeyObject)); + OPK_Init_OEMCrypto_EntitledContentKeyObject( + (OEMCrypto_EntitledContentKeyObject*)odd_key); + OPK_Unpack_LoadCasECMKeys_Request(request, &session, &message, + &message_length, &even_key, &odd_key); + if (!ODK_Message_IsValid(request)) return false; + OEMCryptoResult result; + OPK_Init_uint32_t((uint32_t*)&result); + LOGD("LoadCasECMKeys"); + result = OEMCrypto_LoadCasECMKeys(session, message, message_length, even_key, + odd_key); + *response = OPK_Pack_LoadCasECMKeys_Response(result); + return true; +} diff --git a/oemcrypto/opk/serialization/tee/special_case_request_handlers.h b/oemcrypto/opk/serialization/tee/special_case_request_handlers.h new file mode 100644 index 0000000..4c7273e --- /dev/null +++ b/oemcrypto/opk/serialization/tee/special_case_request_handlers.h @@ -0,0 +1,25 @@ +/* + * Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary + * source code may only be used and distributed under the Widevine + * License Agreement. + */ + +#ifndef OPK_SPECIAL_CASE_REQUEST_HANDLERS_H_ +#define OPK_SPECIAL_CASE_REQUEST_HANDLERS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include "odk_message.h" + +bool Handle_OEMCrypto_LoadCasECMKeys(ODK_Message* request, + ODK_Message* response); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // OPK_SPECIAL_CASE_REQUEST_HANDLERS_H_ diff --git a/oemcrypto/opk/serialization/tee/tee.gyp b/oemcrypto/opk/serialization/tee/tee.gyp index bf07781..9445a58 100644 --- a/oemcrypto/opk/serialization/tee/tee.gyp +++ b/oemcrypto/opk/serialization/tee/tee.gyp @@ -21,6 +21,7 @@ 'sources' : [ 'GEN_dispatcher.c', 'GEN_tee_serializer.c', + 'special_case_request_handlers.c', 'tee_special_cases.c', 'tee_os_type.c', 'tee_version.c', diff --git a/oemcrypto/opk/serialization/tee/tee_special_cases.c b/oemcrypto/opk/serialization/tee/tee_special_cases.c index 0fa1631..3cd6820 100644 --- a/oemcrypto/opk/serialization/tee/tee_special_cases.c +++ b/oemcrypto/opk/serialization/tee/tee_special_cases.c @@ -15,6 +15,7 @@ #include "GEN_tee_serializer.h" #include "OEMCryptoCENC.h" #include "log_macros.h" +#include "oemcrypto_overflow.h" #include "opk_serialization_base.h" #include "shared_buffer_allocator.h" #include "tos_shared_memory_interface.h" @@ -48,7 +49,7 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( size_t unaligned_nonce_offset = 0; uintptr_t unaligned_nonce_ptr = 0; OPK_Unpack_size_t(msg, &unaligned_nonce_offset); - if (__builtin_add_overflow((uintptr_t)*message, unaligned_nonce_offset, + if (OPK_AddOverflowUintptr((uintptr_t)*message, unaligned_nonce_offset, &unaligned_nonce_ptr)) { ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_PARSE_ERROR); return; @@ -58,7 +59,7 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( size_t enc_rsa_key_offset = 0; uintptr_t enc_rsa_key_ptr = 0; OPK_Unpack_size_t(msg, &enc_rsa_key_offset); - if (__builtin_add_overflow((uintptr_t)*message, enc_rsa_key_offset, + if (OPK_AddOverflowUintptr((uintptr_t)*message, enc_rsa_key_offset, &enc_rsa_key_ptr)) { ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_PARSE_ERROR); return; @@ -68,7 +69,7 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( size_t enc_rsa_key_iv_offset = 0; uintptr_t enc_rsa_key_iv_ptr = 0; OPK_Unpack_size_t(msg, &enc_rsa_key_iv_offset); - if (__builtin_add_overflow((uintptr_t)*message, enc_rsa_key_iv_offset, + if (OPK_AddOverflowUintptr((uintptr_t)*message, enc_rsa_key_iv_offset, &enc_rsa_key_iv_ptr)) { ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_PARSE_ERROR); return; @@ -79,3 +80,32 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( OPK_UnpackEOM(msg); OPK_SharedBuffer_FinalizeUnpacking(); } + +void OPK_Unpack_LoadCasECMKeys_Request( + ODK_Message* msg, OEMCrypto_SESSION* session, uint8_t** message, + size_t* message_length, OEMCrypto_EntitledContentKeyObject** even_key, + OEMCrypto_EntitledContentKeyObject** odd_key) { + uint32_t api_value = UINT32_MAX; + OPK_Unpack_uint32_t(msg, &api_value); + if (api_value != 120) + ODK_MESSAGE_SETSTATUS(msg, MESSAGE_STATUS_API_VALUE_ERROR); + uint64_t timestamp; + OPK_Unpack_uint64_t(msg, ×tamp); + OPK_Unpack_size_t(msg, message_length); + OPK_Unpack_uint32_t(msg, session); + OPK_UnpackInPlace(msg, (uint8_t**)message, OPK_FromSizeTPtr(message_length)); + OPK_UnpackNullable_OEMCrypto_EntitledContentKeyObject(msg, even_key); + OPK_UnpackNullable_OEMCrypto_EntitledContentKeyObject(msg, odd_key); + OPK_UnpackEOM(msg); + OPK_SharedBuffer_FinalizeUnpacking(); +} + +ODK_Message OPK_Pack_LoadCasECMKeys_Response(OEMCryptoResult result) { + uint32_t api_value = 120; /* from _oecc120 */ + ODK_Message msg = TOS_Transport_GetResponse(); + OPK_Pack_uint32_t(&msg, &api_value); + OPK_Pack_uint32_t(&msg, &result); + OPK_PackEOM(&msg); + OPK_SharedBuffer_FinalizePacking(); + return msg; +} diff --git a/oemcrypto/opk/serialization/tee/tee_special_cases.h b/oemcrypto/opk/serialization/tee/tee_special_cases.h index fac7f38..30bec40 100644 --- a/oemcrypto/opk/serialization/tee/tee_special_cases.h +++ b/oemcrypto/opk/serialization/tee/tee_special_cases.h @@ -28,6 +28,11 @@ void OPK_Unpack_RewrapDeviceRSAKey_Request( uint32_t** unaligned_nonce, uint8_t** enc_rsa_key, size_t* enc_rsa_key_length, uint8_t** enc_rsa_key_iv, uint8_t** wrapped_rsa_key, size_t** wrapped_rsa_key_length); +void OPK_Unpack_LoadCasECMKeys_Request( + ODK_Message* msg, OEMCrypto_SESSION* session, uint8_t** message, + size_t* message_length, OEMCrypto_EntitledContentKeyObject** even_key, + OEMCrypto_EntitledContentKeyObject** odd_key); +ODK_Message OPK_Pack_LoadCasECMKeys_Response(OEMCryptoResult result); #ifdef __cplusplus } // extern "C" diff --git a/oemcrypto/opk/serialization/tee/tee_version.c b/oemcrypto/opk/serialization/tee/tee_version.c index d5c3490..ce8bda6 100644 --- a/oemcrypto/opk/serialization/tee/tee_version.c +++ b/oemcrypto/opk/serialization/tee/tee_version.c @@ -20,24 +20,32 @@ OEMCryptoResult OEMCrypto_OPK_SerializationVersion(uint32_t* ree_major, uint32_t* ree_minor, uint32_t* tee_major, uint32_t* tee_minor) { - // unused variable warning if not debug, since LOG* functions become empty - // expressions - (void)ree_minor; - (void)tee_minor; - if (tee_major) *tee_major = OPK_SERIALIZATION_VERSION_MAJOR; if (tee_minor) *tee_minor = OPK_SERIALIZATION_VERSION_MINOR; if (tee_major && ree_major) { if (*tee_major != *ree_major) { - LOGE("Rejected connection from REE version %" PRIu32 ".%" PRIu32 - ". TEE version is %" PRIu32 ".%" PRIu32, - *ree_major, *ree_minor, *tee_major, *tee_minor); + if (tee_minor && ree_minor) { + LOGE("Rejected connection from REE version %" PRIu32 ".%" PRIu32 + ". TEE version is %" PRIu32 ".%" PRIu32 ".", + *ree_major, *ree_minor, *tee_major, *tee_minor); + } else { + LOGE("Rejected connection from REE version %" PRIu32 + ".x. TEE version is %" PRIu32 ".x.", + *ree_major, *tee_major); + } return OPK_ERROR_INCOMPATIBLE_VERSION; } - LOGI("Accepted connection from REE version %" PRIu32 ".%" PRIu32 - ". TEE version is %" PRIu32 ".%" PRIu32, - *ree_major, *ree_minor, *tee_major, *tee_minor); + + if (tee_minor && ree_minor) { + LOGI("Accepted connection from REE version %" PRIu32 ".%" PRIu32 + ". TEE version is %" PRIu32 ".%" PRIu32 ".", + *ree_major, *ree_minor, *tee_major, *tee_minor); + } else { + LOGI("Accepted connection from REE version %" PRIu32 + ".x. TEE version is %" PRIu32 ".x.", + *ree_major, *tee_major); + } } return OEMCrypto_SUCCESS; } diff --git a/oemcrypto/opk/setup.sh b/oemcrypto/opk/setup.sh index 0f23ad1..0360280 100755 --- a/oemcrypto/opk/setup.sh +++ b/oemcrypto/opk/setup.sh @@ -26,9 +26,8 @@ download_boringssl() { mkdir -p boringssl && cd boringssl mkdir -p kit && cd kit - # Commits after this change some filenames, which is incompatible with - # current OPK makefiles - download https://boringssl.googlesource.com/boringssl src 1e15682f1a4bb64c48b84884976a2b5c4201e878 + # e1b8685770d0e82e5a4a3c5d24ad1602e05f2e83 is the latest tested BoringSSL + download https://boringssl.googlesource.com/boringssl src e1b8685770d0e82e5a4a3c5d24ad1602e05f2e83 # generate boringssl source file list echo "Generating boringssl source file list" diff --git a/oemcrypto/test/GEN_api_lock_file.c b/oemcrypto/test/GEN_api_lock_file.c index 2a29201..9305120 100644 --- a/oemcrypto/test/GEN_api_lock_file.c +++ b/oemcrypto/test/GEN_api_lock_file.c @@ -366,3 +366,6 @@ OEMCryptoResult _oecc141(const uint8_t* challenge, size_t challenge_length, // OEMCrypto_EnterTestMode defined in v18.1 OEMCryptoResult _oecc140(void); + +// OEMCrypto_FactoryInstallBCCSignature defined in v18.3 +OEMCryptoResult _oecc142(const uint8_t* signature, size_t signature_length); diff --git a/oemcrypto/test/common.mk b/oemcrypto/test/common.mk index ce7a3c8..8624ca0 100644 --- a/oemcrypto/test/common.mk +++ b/oemcrypto/test/common.mk @@ -17,7 +17,9 @@ LOCAL_SRC_FILES:= \ oemcrypto_corpus_generator_helper.cpp \ oemcrypto_session_tests_helper.cpp \ oemcrypto_basic_test.cpp \ + oemcrypto_cast_test.cpp \ oemcrypto_decrypt_test.cpp \ + oemcrypto_generic_crypto_test.cpp \ oemcrypto_license_test.cpp \ oemcrypto_provisioning_test.cpp \ oemcrypto_usage_table_test.cpp \ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/0c7e14c42a24845ff54356b92cc20a3f9e2e6498 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/0c7e14c42a24845ff54356b92cc20a3f9e2e6498 deleted file mode 100644 index cb306f7..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/0c7e14c42a24845ff54356b92cc20a3f9e2e6498 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/23ef7d98cdd44b07f7a582b24e44984a835aeb59 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/23ef7d98cdd44b07f7a582b24e44984a835aeb59 new file mode 100644 index 0000000..71f0701 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/23ef7d98cdd44b07f7a582b24e44984a835aeb59 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/b02efc63fc06ecac3df93523d2318ec8a67e8d21 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/b02efc63fc06ecac3df93523d2318ec8a67e8d21 new file mode 100644 index 0000000..0cea3fe Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/b02efc63fc06ecac3df93523d2318ec8a67e8d21 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/d936772829ba7bfac4b239053fcb7a622ff81203 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/d936772829ba7bfac4b239053fcb7a622ff81203 deleted file mode 100644 index b73bdf8..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/d936772829ba7bfac4b239053fcb7a622ff81203 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 new file mode 100644 index 0000000..dab87bf Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/f8b4afb2db6344296026dad1cd863f04bab5f6b0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/fb094d421ad8099a07a15ae71060746b5ebcb129 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/fb094d421ad8099a07a15ae71060746b5ebcb129 deleted file mode 100644 index 60e15f8..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_copy_buffer_fuzz_seed_corpus/fb094d421ad8099a07a15ae71060746b5ebcb129 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0020aada9920cca0f1ca3bba3835c57ba1b64722 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0020aada9920cca0f1ca3bba3835c57ba1b64722 deleted file mode 100644 index 0d99959..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0020aada9920cca0f1ca3bba3835c57ba1b64722 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/01940cb7d91a0378062e3c34c6959c08cc64bfa7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/01940cb7d91a0378062e3c34c6959c08cc64bfa7 deleted file mode 100644 index 8132496..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/01940cb7d91a0378062e3c34c6959c08cc64bfa7 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0285ab6852dc82c1adee1ef77a6573df480161d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0285ab6852dc82c1adee1ef77a6573df480161d7 new file mode 100644 index 0000000..68f0ec7 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0285ab6852dc82c1adee1ef77a6573df480161d7 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03705943a03b55af8796a85ef076751c1a35dab3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03705943a03b55af8796a85ef076751c1a35dab3 new file mode 100644 index 0000000..c6d2bb4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03705943a03b55af8796a85ef076751c1a35dab3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03ddc96089c172b96ea359aa658b103e711b0824 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03ddc96089c172b96ea359aa658b103e711b0824 deleted file mode 100644 index 1a8ffc5..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/03ddc96089c172b96ea359aa658b103e711b0824 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04124cff8b8ddc8f4f245b86f054d21bf6bf1118 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04124cff8b8ddc8f4f245b86f054d21bf6bf1118 deleted file mode 100644 index e39f530..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04124cff8b8ddc8f4f245b86f054d21bf6bf1118 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea new file mode 100644 index 0000000..8a12877 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/04f3c6813639af694f3b8752798ddff9bbfa5fea differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0554387fba557ee5ad1222e62162d23733e507aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0554387fba557ee5ad1222e62162d23733e507aa deleted file mode 100644 index 79a0952..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0554387fba557ee5ad1222e62162d23733e507aa and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0c3f5ede5008d158e079e71b676179175fcaf451 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/080308d9a78045272feb864835800f3c963e4110 similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0c3f5ede5008d158e079e71b676179175fcaf451 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/080308d9a78045272feb864835800f3c963e4110 index 5f2ecf8..1829d60 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0c3f5ede5008d158e079e71b676179175fcaf451 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/080308d9a78045272feb864835800f3c963e4110 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/09064c11a50f1e5a7e3e561495aa4148c425ee41 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/09064c11a50f1e5a7e3e561495aa4148c425ee41 new file mode 100644 index 0000000..5942046 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/09064c11a50f1e5a7e3e561495aa4148c425ee41 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/096509f3e835e6235b48d6fb33ce73093f2996dc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/096509f3e835e6235b48d6fb33ce73093f2996dc new file mode 100644 index 0000000..92e9167 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/096509f3e835e6235b48d6fb33ce73093f2996dc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 new file mode 100644 index 0000000..3b169bf Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0a91e7678f5ed86ba853fc3383b1f0ece2c502b5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0b63f772494b90196d295375968a8da7f71add8c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0b63f772494b90196d295375968a8da7f71add8c deleted file mode 100644 index d0fe752..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0b63f772494b90196d295375968a8da7f71add8c and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0ffae4ac0412685f5278d748bf45f78c25dbed10 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0ffae4ac0412685f5278d748bf45f78c25dbed10 deleted file mode 100644 index 44b4cd7..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0ffae4ac0412685f5278d748bf45f78c25dbed10 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10e69df82df7df7a5d3cffe390d5073a37527c78 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10e69df82df7df7a5d3cffe390d5073a37527c78 new file mode 100644 index 0000000..7d8812f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/10e69df82df7df7a5d3cffe390d5073a37527c78 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1121c84038be5099dc3ce3d2d69d5e8d0b094c98 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1121c84038be5099dc3ce3d2d69d5e8d0b094c98 new file mode 100644 index 0000000..6240f90 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1121c84038be5099dc3ce3d2d69d5e8d0b094c98 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d new file mode 100644 index 0000000..294f86c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/114cdbe28fd549ca5bcc3fa19b4fed7d5a8af34d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/00d8703220de64723c9508d6fad24e9caca9b67c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 similarity index 55% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/00d8703220de64723c9508d6fad24e9caca9b67c rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 index 8a927ab..8150c2f 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/00d8703220de64723c9508d6fad24e9caca9b67c and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11bafc979e7ec7122d0f59c0f72f9cb8d449eaa5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11c19b2cc104b1cf85422685340d5e917498ee16 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11c19b2cc104b1cf85422685340d5e917498ee16 new file mode 100644 index 0000000..d41a250 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/11c19b2cc104b1cf85422685340d5e917498ee16 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/120f2cfe38baa03b5d58dcbc3b0be49d21f3c869 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/120f2cfe38baa03b5d58dcbc3b0be49d21f3c869 new file mode 100644 index 0000000..4a63de9 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/120f2cfe38baa03b5d58dcbc3b0be49d21f3c869 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/137d434df4e17271af719ad678e7e74edc284f18 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/137d434df4e17271af719ad678e7e74edc284f18 deleted file mode 100644 index 7663081..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/137d434df4e17271af719ad678e7e74edc284f18 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/13bdd5f2dbf82567a92c2a30b9ef2310a02af361 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/13bdd5f2dbf82567a92c2a30b9ef2310a02af361 deleted file mode 100644 index c8c042e..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/13bdd5f2dbf82567a92c2a30b9ef2310a02af361 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/02485b2bb1c97020e704aed055050a00d02362db b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/02485b2bb1c97020e704aed055050a00d02362db rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 index c37fec2..138d4de 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/02485b2bb1c97020e704aed055050a00d02362db and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/14e06e7cea4686bdd83742f7f9d7b111c7b9aa21 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/151941252771d6c9173ee1397d457db28bc20059 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/151941252771d6c9173ee1397d457db28bc20059 new file mode 100644 index 0000000..9bf34d9 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/151941252771d6c9173ee1397d457db28bc20059 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1522db2eb65a0eafe367151d77b3a4dbfe65bee4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1522db2eb65a0eafe367151d77b3a4dbfe65bee4 new file mode 100644 index 0000000..8e30396 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1522db2eb65a0eafe367151d77b3a4dbfe65bee4 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1539088d12d235bba441c8fb46b54d839110cc38 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1539088d12d235bba441c8fb46b54d839110cc38 deleted file mode 100644 index 823f50c..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1539088d12d235bba441c8fb46b54d839110cc38 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dd14c72951c6ee8245c7e8d77a15eaec5d9839a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca similarity index 55% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dd14c72951c6ee8245c7e8d77a15eaec5d9839a rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca index a63d947..1fec89e 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dd14c72951c6ee8245c7e8d77a15eaec5d9839a and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/161778100a4dcf30cb49fe57d0ed8cd55a1230ca differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/634cbe7377cbd3358e239c185ccb6a4a78be3f27 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/180835f71f4a9bfde27b61579c2a3a6d8d8e78ef similarity index 77% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/634cbe7377cbd3358e239c185ccb6a4a78be3f27 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/180835f71f4a9bfde27b61579c2a3a6d8d8e78ef index d186132..c0cca32 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/634cbe7377cbd3358e239c185ccb6a4a78be3f27 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/180835f71f4a9bfde27b61579c2a3a6d8d8e78ef differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/188bc9339e5b42687067e26369840c9eca20703f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/188bc9339e5b42687067e26369840c9eca20703f deleted file mode 100644 index de0284f..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/188bc9339e5b42687067e26369840c9eca20703f and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 new file mode 100644 index 0000000..7d0336c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b2a3b8415b5b7ec6a5e03cf644b39e732d63b60 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b40e1b853761bf6db5deac7df38532d8199aee5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b40e1b853761bf6db5deac7df38532d8199aee5 deleted file mode 100644 index 95784e7..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1b40e1b853761bf6db5deac7df38532d8199aee5 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ba27988b89d8936e9237fb758059df1bc3ac36a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ba27988b89d8936e9237fb758059df1bc3ac36a new file mode 100644 index 0000000..7f3f4f9 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1ba27988b89d8936e9237fb758059df1bc3ac36a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 new file mode 100644 index 0000000..401050b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1bd3f10a023bcc8163e1b8d70c285295f3fea4c6 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1be21d7100f97ffba5b208ee5715d2f7531f383b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1be21d7100f97ffba5b208ee5715d2f7531f383b new file mode 100644 index 0000000..17f40da Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1be21d7100f97ffba5b208ee5715d2f7531f383b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/53a0b89316eedbd09f44336f493067c223d3afa0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/53a0b89316eedbd09f44336f493067c223d3afa0 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e index 8ffedfa..44e1534 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/53a0b89316eedbd09f44336f493067c223d3afa0 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1efe003a4fc59c06e4e40756025e59753418e53e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2001ea8811ed0ce164b49879561918ef3b43a78c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2001ea8811ed0ce164b49879561918ef3b43a78c deleted file mode 100644 index 77f3762..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2001ea8811ed0ce164b49879561918ef3b43a78c and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1262bc5f3f1ecc414e8e21861e9d200c3b775e87 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1262bc5f3f1ecc414e8e21861e9d200c3b775e87 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 index ac50bf8..5afd776 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1262bc5f3f1ecc414e8e21861e9d200c3b775e87 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2032071963b1e60dac0ccd91cbd564e3c9e26a63 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21f47f867c422f05c68997e44f395bf6d6d0c4b3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21f47f867c422f05c68997e44f395bf6d6d0c4b3 new file mode 100644 index 0000000..f8fcf3e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/21f47f867c422f05c68997e44f395bf6d6d0c4b3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/249806515cd342087c40b0d529e68ea01e1b128e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/249806515cd342087c40b0d529e68ea01e1b128e new file mode 100644 index 0000000..bbd0d2c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/249806515cd342087c40b0d529e68ea01e1b128e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/27c685d38645723287ce2a36cf338aa3126ca787 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/27c685d38645723287ce2a36cf338aa3126ca787 new file mode 100644 index 0000000..1d46964 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/27c685d38645723287ce2a36cf338aa3126ca787 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 new file mode 100644 index 0000000..8788917 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a1ee60dabdf228a1c30e7f29fbf43389cb5c8d7 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2aba87702e45624da9e76eb525b469231c67d5cf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2aba87702e45624da9e76eb525b469231c67d5cf deleted file mode 100644 index 77ccd5b..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2aba87702e45624da9e76eb525b469231c67d5cf and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2bacc4d5c23a6eedcf6781480e31a36022ca5962 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2bacc4d5c23a6eedcf6781480e31a36022ca5962 deleted file mode 100644 index 2e0c3f5..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2bacc4d5c23a6eedcf6781480e31a36022ca5962 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2d611b2f63d41a650304b2b6712496b8392c2659 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2d611b2f63d41a650304b2b6712496b8392c2659 deleted file mode 100644 index 60ada77..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2d611b2f63d41a650304b2b6712496b8392c2659 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bf813f09576ef5dc365d4fae65be63a3c14c2de0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab similarity index 93% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bf813f09576ef5dc365d4fae65be63a3c14c2de0 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab index 4f1359c..88d5f37 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bf813f09576ef5dc365d4fae65be63a3c14c2de0 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2dce8534f57150afe93ca38282a60e6db0d0f7ab differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/638c5864a20d1ca04ad06d3a77181479f477ee91 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 similarity index 77% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/638c5864a20d1ca04ad06d3a77181479f477ee91 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 index 434048c..a0f1c95 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/638c5864a20d1ca04ad06d3a77181479f477ee91 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e6c5e96729128dcf9c7a38adc7e33185eb1b4a0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a new file mode 100644 index 0000000..832f1d5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2e7e7652ce6f56d00ab740749d65a886172ad01a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/308ecc136d6de9918abf890eef199d04df5bb2bb b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/308ecc136d6de9918abf890eef199d04df5bb2bb deleted file mode 100644 index a6546e4..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/308ecc136d6de9918abf890eef199d04df5bb2bb and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/30bc1ad7affa6c1e83b008e02d3d78e765b27a6c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/30bc1ad7affa6c1e83b008e02d3d78e765b27a6c new file mode 100644 index 0000000..f960b3d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/30bc1ad7affa6c1e83b008e02d3d78e765b27a6c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3131b2f1c4628f9a979eb6f01861d75382f7273d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3131b2f1c4628f9a979eb6f01861d75382f7273d deleted file mode 100644 index 45a9b93..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3131b2f1c4628f9a979eb6f01861d75382f7273d and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bcf58b9cf74875a7b938460b19e703876c2b3067 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 similarity index 60% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bcf58b9cf74875a7b938460b19e703876c2b3067 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 index cb20ada..c03096d 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bcf58b9cf74875a7b938460b19e703876c2b3067 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31bff9cf9d33d5cb82882a4f4a9ec3565123cba3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31cf7b90c83d6d4f1373d967fc7e230b13707cad b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31cf7b90c83d6d4f1373d967fc7e230b13707cad new file mode 100644 index 0000000..e190699 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/31cf7b90c83d6d4f1373d967fc7e230b13707cad differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d77fa923d5ec1c125ca9347d1f97b24995737806 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/325cc084469713e200c0af60c74292f395da6064 similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d77fa923d5ec1c125ca9347d1f97b24995737806 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/325cc084469713e200c0af60c74292f395da6064 index 64af970..1a28b34 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d77fa923d5ec1c125ca9347d1f97b24995737806 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/325cc084469713e200c0af60c74292f395da6064 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b new file mode 100644 index 0000000..cf6fd6c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/337fde52cf8682af547dd23d8c0c4f47d41e168b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/34aed6ffd3161dc96341772a0b081095fed4821a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/34aed6ffd3161dc96341772a0b081095fed4821a deleted file mode 100644 index 0016eb4..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/34aed6ffd3161dc96341772a0b081095fed4821a and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/34d51b3476208e187a14dbbea713c48e72eaca35 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/34d51b3476208e187a14dbbea713c48e72eaca35 deleted file mode 100644 index eae55b2..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/34d51b3476208e187a14dbbea713c48e72eaca35 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/35fe27def9bffe7aaca02f2d326b1109bd2c53e2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/35fe27def9bffe7aaca02f2d326b1109bd2c53e2 deleted file mode 100644 index 964189c..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/35fe27def9bffe7aaca02f2d326b1109bd2c53e2 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a5bc3e146138236be11224681b998194ec1ff9a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a5bc3e146138236be11224681b998194ec1ff9a rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 index af793db..03fbf77 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a5bc3e146138236be11224681b998194ec1ff9a and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/366aef68845adf6f2e1bcc4bc4928ff2e301aa06 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/36e2425af5b4a62301e9ebfbf70f9e28e8a39f3e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/36e2425af5b4a62301e9ebfbf70f9e28e8a39f3e deleted file mode 100644 index 33b4d53..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/36e2425af5b4a62301e9ebfbf70f9e28e8a39f3e and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca new file mode 100644 index 0000000..eb47250 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/372062024cbde403d2c135674db50d3013718eca differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38f06ab2029f7317904acba919fabdf25edc02ff b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38f06ab2029f7317904acba919fabdf25edc02ff deleted file mode 100644 index 5db4a6d..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/38f06ab2029f7317904acba919fabdf25edc02ff and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3abaedec5d45b91330b60a338f56906218ca1cbc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3abaedec5d45b91330b60a338f56906218ca1cbc deleted file mode 100644 index 6d191a5..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3abaedec5d45b91330b60a338f56906218ca1cbc and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 new file mode 100644 index 0000000..5f34500 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3c522e95e036fbedf884b59caba80f4d4a5eb9a9 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cab0134e48bd02f3262515075806ebc5502b0cc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cab0134e48bd02f3262515075806ebc5502b0cc deleted file mode 100644 index e3d8992..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cab0134e48bd02f3262515075806ebc5502b0cc and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/236647fd79907186bba5d42ebcc90e62ea632872 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3db0d75cfdb383714d6bb3c1d7ededaed2123be1 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/236647fd79907186bba5d42ebcc90e62ea632872 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3db0d75cfdb383714d6bb3c1d7ededaed2123be1 index 639397d..f1b831e 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/236647fd79907186bba5d42ebcc90e62ea632872 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3db0d75cfdb383714d6bb3c1d7ededaed2123be1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cd9a833ced641a1716ca14082589ce7ce2cbbb0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d similarity index 60% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cd9a833ced641a1716ca14082589ce7ce2cbbb0 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d index 2de08c6..41a0508 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/3cd9a833ced641a1716ca14082589ce7ce2cbbb0 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/403143beed32fa7cd4255ff9153515713447605d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4191139fe9afc02615ba9159bd3d35b6d6a7d073 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4191139fe9afc02615ba9159bd3d35b6d6a7d073 deleted file mode 100644 index 9f060a6..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4191139fe9afc02615ba9159bd3d35b6d6a7d073 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97034a7defd7d47912f2353de7e816382562f038 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/42105d003732a222e40d25c877bd182983d1d07e similarity index 77% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97034a7defd7d47912f2353de7e816382562f038 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/42105d003732a222e40d25c877bd182983d1d07e index 5470012..d846bb1 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97034a7defd7d47912f2353de7e816382562f038 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/42105d003732a222e40d25c877bd182983d1d07e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4227fd95d3dc45067dc19e80c31eaf293c8afbee b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4227fd95d3dc45067dc19e80c31eaf293c8afbee deleted file mode 100644 index a51590a..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4227fd95d3dc45067dc19e80c31eaf293c8afbee and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe new file mode 100644 index 0000000..c82175e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/437e26ba4817162fda786201e9f9348e8badf9fe differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/446ee48d8665b10ab1c51b4bb98c832d9fbd9d3a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/446ee48d8665b10ab1c51b4bb98c832d9fbd9d3a deleted file mode 100644 index dc366ff..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/446ee48d8665b10ab1c51b4bb98c832d9fbd9d3a and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/456ce34099fe25289e165eaa1f93a94b8c0beee9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/456ce34099fe25289e165eaa1f93a94b8c0beee9 new file mode 100644 index 0000000..feff4fa Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/456ce34099fe25289e165eaa1f93a94b8c0beee9 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4609e29ba8ece69cc08f7d93093768d9d3d959e4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4609e29ba8ece69cc08f7d93093768d9d3d959e4 deleted file mode 100644 index 01a1100..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4609e29ba8ece69cc08f7d93093768d9d3d959e4 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/478e8789ac549a52ab303897c03676879ba014e2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/478e8789ac549a52ab303897c03676879ba014e2 deleted file mode 100644 index 2a433e7..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/478e8789ac549a52ab303897c03676879ba014e2 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db new file mode 100644 index 0000000..c286002 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/48bc8352918a8225afcb7c6990a9d68983fb22db differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/494214feb44b57cb9e592c1ed220e87e0809db86 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/494214feb44b57cb9e592c1ed220e87e0809db86 deleted file mode 100644 index 141e743..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/494214feb44b57cb9e592c1ed220e87e0809db86 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a188fb2e329657694813f19d00d2634818ba22b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a188fb2e329657694813f19d00d2634818ba22b deleted file mode 100644 index 60c2347..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a188fb2e329657694813f19d00d2634818ba22b and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e new file mode 100644 index 0000000..62c3820 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4a1e8694a2a9ef8f55364a473c3160a15b7e979e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e490b158b6fc8ec4642f4ae51e0b9afbe2e4925 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a similarity index 93% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e490b158b6fc8ec4642f4ae51e0b9afbe2e4925 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a index bb8ba9d..09ef7f5 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e490b158b6fc8ec4642f4ae51e0b9afbe2e4925 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4badb31c370b762025e980d3d0e6e90dc0c4b22a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4bda3ac6a2ed0e63735181845273e44ee096a02d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4bda3ac6a2ed0e63735181845273e44ee096a02d new file mode 100644 index 0000000..8a882cd Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4bda3ac6a2ed0e63735181845273e44ee096a02d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4be9a6a1a463c1babc2fc82de8b855c622227200 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4be9a6a1a463c1babc2fc82de8b855c622227200 new file mode 100644 index 0000000..8a57eba Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4be9a6a1a463c1babc2fc82de8b855c622227200 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/348418909f835c0728dd2317f5117ec38fc1be08 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4c4b4ac81d0444b917c445c46f568e1ade6eebc8 similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/348418909f835c0728dd2317f5117ec38fc1be08 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4c4b4ac81d0444b917c445c46f568e1ade6eebc8 index 9e8f564..c7c32e0 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/348418909f835c0728dd2317f5117ec38fc1be08 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4c4b4ac81d0444b917c445c46f568e1ade6eebc8 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f new file mode 100644 index 0000000..2be6fc5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d08e1ffb6b7f9f1fa89de6c3a07d2c0be4c3a9f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e6ba7bcb6b209ae89e33fca8b04458f21983df0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e6ba7bcb6b209ae89e33fca8b04458f21983df0 deleted file mode 100644 index 237097b..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e6ba7bcb6b209ae89e33fca8b04458f21983df0 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e751fabb40fc3d2cd82d80acda4a60d3bffda45 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e751fabb40fc3d2cd82d80acda4a60d3bffda45 deleted file mode 100644 index 4e0d351..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4e751fabb40fc3d2cd82d80acda4a60d3bffda45 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 new file mode 100644 index 0000000..41f3e79 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/52c1fe05c67dd4caae0cc36ac41024600474e775 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/541a0b0c26a07b77109da181a00b0cc0e3b6c6c0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/541a0b0c26a07b77109da181a00b0cc0e3b6c6c0 deleted file mode 100644 index 3169e31..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/541a0b0c26a07b77109da181a00b0cc0e3b6c6c0 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 new file mode 100644 index 0000000..5c2b1d5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/565383265f1550107176113eb22943ad2178a731 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1094990c3689bc731ba000f7c144920750d254e3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1094990c3689bc731ba000f7c144920750d254e3 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d index 5572991..b34e5b9 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1094990c3689bc731ba000f7c144920750d254e3 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/569fe4adef9b529c33facecf2b14c320cebd820d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5745eabb985db8f6c6cd44f6bfbdccf2c3d69c08 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5745eabb985db8f6c6cd44f6bfbdccf2c3d69c08 deleted file mode 100644 index dcd345a..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5745eabb985db8f6c6cd44f6bfbdccf2c3d69c08 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb new file mode 100644 index 0000000..883d077 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/584cafd42a17936992f68b152b2a7af0ac5695bb differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/58750d3a6ae389e16bab9c8a5eb8f444d4822a56 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/58750d3a6ae389e16bab9c8a5eb8f444d4822a56 deleted file mode 100644 index 83302c1..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/58750d3a6ae389e16bab9c8a5eb8f444d4822a56 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0bb0b66fac20ba37c2858b7cc76c6af68b3c77a0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ac68c41431dc78942624816ddaf1c9284b90a1 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0bb0b66fac20ba37c2858b7cc76c6af68b3c77a0 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ac68c41431dc78942624816ddaf1c9284b90a1 index 425bc4a..9a9b2b6 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/0bb0b66fac20ba37c2858b7cc76c6af68b3c77a0 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ac68c41431dc78942624816ddaf1c9284b90a1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ca33a53cdcd43ca7bcfa317e6baa9e9274d5c4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ca33a53cdcd43ca7bcfa317e6baa9e9274d5c4 deleted file mode 100644 index 224e422..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/59ca33a53cdcd43ca7bcfa317e6baa9e9274d5c4 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5bd6daea2290abd4fd85fb7fc4ef767d0c31d59a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5bd6daea2290abd4fd85fb7fc4ef767d0c31d59a deleted file mode 100644 index 21e51bd..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5bd6daea2290abd4fd85fb7fc4ef767d0c31d59a and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 new file mode 100644 index 0000000..4012771 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5c3a4b2851af7350171172b52b354049b77be5d5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5ca0f3fcea25b2a8558315a52ed7ec10b31c8a06 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5ca0f3fcea25b2a8558315a52ed7ec10b31c8a06 deleted file mode 100644 index 67f7fa3..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5ca0f3fcea25b2a8558315a52ed7ec10b31c8a06 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d0f9ef8f9bb3ddd53f5fb90bb91b69dd76c7967 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d0f9ef8f9bb3ddd53f5fb90bb91b69dd76c7967 deleted file mode 100644 index 5e7065b..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d0f9ef8f9bb3ddd53f5fb90bb91b69dd76c7967 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d0abf7562348a077076a31f67dab240996227e6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d0abf7562348a077076a31f67dab240996227e6 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 index 9afe3b6..f6db736 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/4d0abf7562348a077076a31f67dab240996227e6 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5d15891a80d8172de682be6dace7f5bb300e4d36 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5f77b862460a773e87eca1a72d6ec68ed3a6b9db b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5f77b862460a773e87eca1a72d6ec68ed3a6b9db deleted file mode 100644 index ba15742..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/5f77b862460a773e87eca1a72d6ec68ed3a6b9db and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6240d30abd265d95c08193edecbc06900eafbc92 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6240d30abd265d95c08193edecbc06900eafbc92 deleted file mode 100644 index d40c3a2..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6240d30abd265d95c08193edecbc06900eafbc92 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/62a11e2f3482935ce23d81fa268c0094d5ad58e6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/62a11e2f3482935ce23d81fa268c0094d5ad58e6 deleted file mode 100644 index 9fab967..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/62a11e2f3482935ce23d81fa268c0094d5ad58e6 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/649a785d4fa52fc0db4d90d51b084353ad1e6f6d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/649a785d4fa52fc0db4d90d51b084353ad1e6f6d new file mode 100644 index 0000000..69a3bb8 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/649a785d4fa52fc0db4d90d51b084353ad1e6f6d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 new file mode 100644 index 0000000..19c2474 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/64f3143b18b3d922c77f4fcbed0f3ab2b6244b27 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1e148e9501ed59f5274e01ae905b2bf5db81ef79 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c similarity index 60% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1e148e9501ed59f5274e01ae905b2bf5db81ef79 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c index e636810..f0af357 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/1e148e9501ed59f5274e01ae905b2bf5db81ef79 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/65d11e1a8031645bd1bd1a21e1f1fa24e048999c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f new file mode 100644 index 0000000..294915b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6708bf88a56c292dd3c45abaa0e99314c4fddd9f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69ba9c487a8b2d6c4812a9a39d9e069265be4afa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69ba9c487a8b2d6c4812a9a39d9e069265be4afa deleted file mode 100644 index 549b3ff..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69ba9c487a8b2d6c4812a9a39d9e069265be4afa and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f new file mode 100644 index 0000000..17a1a5f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/69dd5d28b00400a20a1887ab5b655c4bb468f70f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6af75aec999c45b84de4d3247f791f1a63c4afe9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6af75aec999c45b84de4d3247f791f1a63c4afe9 deleted file mode 100644 index 18c87c2..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6af75aec999c45b84de4d3247f791f1a63c4afe9 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 new file mode 100644 index 0000000..6f90cce Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d020263a43603c5caa8f3274ed65dfc90e467d0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d0ee80399e88ffdb1778b0bae7b6605c099c2f6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d0ee80399e88ffdb1778b0bae7b6605c099c2f6 deleted file mode 100644 index eec9883..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6d0ee80399e88ffdb1778b0bae7b6605c099c2f6 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/67cd7db5d431fb1c35f96b0e8ce416d61cbfaa8b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f63549f4969ebcf0d8504159519f9b20cb259aa similarity index 55% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/67cd7db5d431fb1c35f96b0e8ce416d61cbfaa8b rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f63549f4969ebcf0d8504159519f9b20cb259aa index a41a924..ed18658 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/67cd7db5d431fb1c35f96b0e8ce416d61cbfaa8b and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/6f63549f4969ebcf0d8504159519f9b20cb259aa differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a0036c5d91f99392a7c334090fcbab08a6fcdb1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/70daf8991859146fff0f147d190594f07b2952b3 similarity index 93% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a0036c5d91f99392a7c334090fcbab08a6fcdb1 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/70daf8991859146fff0f147d190594f07b2952b3 index f14e71d..23dda90 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2a0036c5d91f99392a7c334090fcbab08a6fcdb1 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/70daf8991859146fff0f147d190594f07b2952b3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3554fe52837e96c0477f59c4574925959fa73b8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/733b4e9024aa0f32227da45a08b12d0715ed0834 similarity index 60% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3554fe52837e96c0477f59c4574925959fa73b8 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/733b4e9024aa0f32227da45a08b12d0715ed0834 index ffa2806..e605c21 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3554fe52837e96c0477f59c4574925959fa73b8 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/733b4e9024aa0f32227da45a08b12d0715ed0834 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/73606d355e70125052bd75183dc0fbc658238788 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/73606d355e70125052bd75183dc0fbc658238788 deleted file mode 100644 index dc243da..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/73606d355e70125052bd75183dc0fbc658238788 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/736dde51d09a2c4ff85d7b559d08176c951b07c8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/736dde51d09a2c4ff85d7b559d08176c951b07c8 deleted file mode 100644 index 820d188..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/736dde51d09a2c4ff85d7b559d08176c951b07c8 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7530e1b5149d2f3931560cbecfa27895179fd279 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7530e1b5149d2f3931560cbecfa27895179fd279 deleted file mode 100644 index f9e2071..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7530e1b5149d2f3931560cbecfa27895179fd279 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7691d3426449d4e2262b58f6be2c1018cd6d2e5f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7691d3426449d4e2262b58f6be2c1018cd6d2e5f deleted file mode 100644 index 545195d..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7691d3426449d4e2262b58f6be2c1018cd6d2e5f and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/790c61aca1614bd78a71ffd715b0498d2518dcd8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/790c61aca1614bd78a71ffd715b0498d2518dcd8 deleted file mode 100644 index 6ed97e9..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/790c61aca1614bd78a71ffd715b0498d2518dcd8 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 new file mode 100644 index 0000000..1ca4d68 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7986dbd3023ca4d6b964357ad5ae1fde7f75ea36 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7af21f77c85a086490b6447bcd70b2844b68101c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7af21f77c85a086490b6447bcd70b2844b68101c deleted file mode 100644 index dfe1b8f..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7af21f77c85a086490b6447bcd70b2844b68101c and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa new file mode 100644 index 0000000..1d950a8 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7bd3de5dc4ccc9f753c36d54340b4079b8cb30aa differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7c440058b109a6456c50bfc87cbbebd0360e51a0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7c440058b109a6456c50bfc87cbbebd0360e51a0 deleted file mode 100644 index 12c1f4e..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7c440058b109a6456c50bfc87cbbebd0360e51a0 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7cf33864cf4435593d27b9c4ca8974cfa5c9d7d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7cf33864cf4435593d27b9c4ca8974cfa5c9d7d7 deleted file mode 100644 index 7feed16..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7cf33864cf4435593d27b9c4ca8974cfa5c9d7d7 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7e55089df762082a4d8d905f5cb1ef27d976eb38 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7e55089df762082a4d8d905f5cb1ef27d976eb38 deleted file mode 100644 index 3418fcf..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/7e55089df762082a4d8d905f5cb1ef27d976eb38 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 new file mode 100644 index 0000000..50f265e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/80a95f4446f5e696769fc1e738a6b9166f8880b3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/81dbdffe5f44dcae32cd958cbe8f3f451819d07a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/81dbdffe5f44dcae32cd958cbe8f3f451819d07a deleted file mode 100644 index ed02f5b..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/81dbdffe5f44dcae32cd958cbe8f3f451819d07a and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82b8a9f56e65b3e2af929c4d62d95e7768850eb4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82b8a9f56e65b3e2af929c4d62d95e7768850eb4 deleted file mode 100644 index c36fbc5..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82b8a9f56e65b3e2af929c4d62d95e7768850eb4 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 new file mode 100644 index 0000000..df36b8b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/82d659133954be19147475562b9ca11f4bcf2056 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/74395b056ddfc22160234e4a4616bf87e2159eda b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d similarity index 93% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/74395b056ddfc22160234e4a4616bf87e2159eda rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d index 85d1c76..6c4b98b 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/74395b056ddfc22160234e4a4616bf87e2159eda and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/840a171b28b5c4d7b7b52d71a9926c8ad516fc0d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8483cbe550b4c9343c3361935bc8d3a7c30b3ece b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8483cbe550b4c9343c3361935bc8d3a7c30b3ece deleted file mode 100644 index cbb8c60..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8483cbe550b4c9343c3361935bc8d3a7c30b3ece and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84c5d943ba95108d4072c7843df631bcbd177391 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84c5d943ba95108d4072c7843df631bcbd177391 deleted file mode 100644 index f34be3e..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84c5d943ba95108d4072c7843df631bcbd177391 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 new file mode 100644 index 0000000..e23426d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/84ff4cce4c529e07e5b68e143d54a665c5969534 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/86638a56e2496c3c8cd2750db9b912956daaed1f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/86638a56e2496c3c8cd2750db9b912956daaed1f deleted file mode 100644 index fc7d9a4..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/86638a56e2496c3c8cd2750db9b912956daaed1f and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a new file mode 100644 index 0000000..b8d9ae1 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8768d10c0dc08dbbf002bdd81a8cb54a15e00c6a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87bc4b02fd7544d306e8db2629ee73fda0e4d581 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87bc4b02fd7544d306e8db2629ee73fda0e4d581 new file mode 100644 index 0000000..9f35bef Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87bc4b02fd7544d306e8db2629ee73fda0e4d581 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87e457fd00f48571ecc482ca7ff96e3375869ac3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87e457fd00f48571ecc482ca7ff96e3375869ac3 new file mode 100644 index 0000000..97054f4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/87e457fd00f48571ecc482ca7ff96e3375869ac3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b15a9c75b3043040a90f28e84de28e436e023d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b15a9c75b3043040a90f28e84de28e436e023d7 deleted file mode 100644 index 980fd4f..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b15a9c75b3043040a90f28e84de28e436e023d7 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b7a5c18731be9ba1c9d836667ec007a4169de23 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b7a5c18731be9ba1c9d836667ec007a4169de23 new file mode 100644 index 0000000..57c6a92 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8b7a5c18731be9ba1c9d836667ec007a4169de23 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8d47cedfb8c23677b10651e05645ab8b1835b6c1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8d47cedfb8c23677b10651e05645ab8b1835b6c1 new file mode 100644 index 0000000..3b1189f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8d47cedfb8c23677b10651e05645ab8b1835b6c1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8eeffea9e7c3876ffc477ce68a3c0ac4375ef3aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8eeffea9e7c3876ffc477ce68a3c0ac4375ef3aa deleted file mode 100644 index 01d7ba6..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8eeffea9e7c3876ffc477ce68a3c0ac4375ef3aa and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 new file mode 100644 index 0000000..bc99f9e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f4d31cb3817b34c73ebbbb9d594b3deb7c52111 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/596a7741bc1da115af7b9a5d9a38fdf109b7fcfc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/596a7741bc1da115af7b9a5d9a38fdf109b7fcfc rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d index 14b60cb..bdb8151 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/596a7741bc1da115af7b9a5d9a38fdf109b7fcfc and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/8f55993eb44bc293d662c18a407f915f03df1e9d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/901e4c6087322b69946ec8dd8d9fa401eebc826f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/901e4c6087322b69946ec8dd8d9fa401eebc826f deleted file mode 100644 index 0790556..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/901e4c6087322b69946ec8dd8d9fa401eebc826f and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/17cf1e48c441638a2874088ac78b42e8c4cca286 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 similarity index 60% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/17cf1e48c441638a2874088ac78b42e8c4cca286 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 index 5762de6..cd9b42c 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/17cf1e48c441638a2874088ac78b42e8c4cca286 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/903baaa085161d75d34d28dc743227c85f2f5b47 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 new file mode 100644 index 0000000..02d61fb Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/905f7519227f6a03890b23f2d4fa1808912c1709 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/950e3521352f0c27063a87618a490346f0a3c2f4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/950e3521352f0c27063a87618a490346f0a3c2f4 deleted file mode 100644 index cf62735..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/950e3521352f0c27063a87618a490346f0a3c2f4 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96831b586053575d609e63674190dc3219b9a003 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96831b586053575d609e63674190dc3219b9a003 new file mode 100644 index 0000000..29cb89e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96831b586053575d609e63674190dc3219b9a003 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96f9058e89bd44446e8f3e9f2eb62585668591f1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96f9058e89bd44446e8f3e9f2eb62585668591f1 new file mode 100644 index 0000000..b197967 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/96f9058e89bd44446e8f3e9f2eb62585668591f1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/970f2e92cbcc069ee31d32f5cda6c691b7ed7fc7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/970f2e92cbcc069ee31d32f5cda6c691b7ed7fc7 new file mode 100644 index 0000000..a0a20cd Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/970f2e92cbcc069ee31d32f5cda6c691b7ed7fc7 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97a3724c855e142691e1084ef45f02f614a032f4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97a3724c855e142691e1084ef45f02f614a032f4 new file mode 100644 index 0000000..4f1e368 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/97a3724c855e142691e1084ef45f02f614a032f4 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/988fc98ea6e4416b30e99ab39cd70813dd9ff828 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/988fc98ea6e4416b30e99ab39cd70813dd9ff828 new file mode 100644 index 0000000..54c7226 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/988fc98ea6e4416b30e99ab39cd70813dd9ff828 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9985d0be5ab329aaff9e18758af5cf7c2373b7f0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9985d0be5ab329aaff9e18758af5cf7c2373b7f0 new file mode 100644 index 0000000..8a42002 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9985d0be5ab329aaff9e18758af5cf7c2373b7f0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9a0b17f115defca3c9b789ea768168d18497bead b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9a0b17f115defca3c9b789ea768168d18497bead new file mode 100644 index 0000000..cc4c205 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9a0b17f115defca3c9b789ea768168d18497bead differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9b75f20679a2ba1ef2163893322a81fe6c54a0cd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9b75f20679a2ba1ef2163893322a81fe6c54a0cd new file mode 100644 index 0000000..9139008 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9b75f20679a2ba1ef2163893322a81fe6c54a0cd differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad new file mode 100644 index 0000000..37f6080 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9d730c77c10dc26ff49d9eb96f20c7d98fcc52ad differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9df1116c393c752cd6640ae70709774d6bb96f37 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9df1116c393c752cd6640ae70709774d6bb96f37 deleted file mode 100644 index 85d7c43..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9df1116c393c752cd6640ae70709774d6bb96f37 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e09a35f73eab1946a6b0db676e913c41222942a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e09a35f73eab1946a6b0db676e913c41222942a deleted file mode 100644 index 7f1cd0a..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9e09a35f73eab1946a6b0db676e913c41222942a and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f05626c0ea01489c75f0493ec02c973098a3d41 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f05626c0ea01489c75f0493ec02c973098a3d41 deleted file mode 100644 index 8c8cf46..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f05626c0ea01489c75f0493ec02c973098a3d41 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f7fefbfe661e56b0c07e931851389b041692567 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f7fefbfe661e56b0c07e931851389b041692567 new file mode 100644 index 0000000..99631e2 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9f7fefbfe661e56b0c07e931851389b041692567 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9fa54bed19e057df5194cf2232117e86d3b6dc0b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9fa54bed19e057df5194cf2232117e86d3b6dc0b new file mode 100644 index 0000000..3619785 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/9fa54bed19e057df5194cf2232117e86d3b6dc0b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0cf2b857c3f281595d4eae2b0a95dfeac5659ce b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0cf2b857c3f281595d4eae2b0a95dfeac5659ce deleted file mode 100644 index 469a399..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0cf2b857c3f281595d4eae2b0a95dfeac5659ce and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0d791df464e8a918a4995759714b191f9a2930e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0d791df464e8a918a4995759714b191f9a2930e new file mode 100644 index 0000000..d6f29cf Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a0d791df464e8a918a4995759714b191f9a2930e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a24f216f0ae2ae501bdd21cc9766ad46d51dce9f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a24f216f0ae2ae501bdd21cc9766ad46d51dce9f new file mode 100644 index 0000000..149b87e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a24f216f0ae2ae501bdd21cc9766ad46d51dce9f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe new file mode 100644 index 0000000..bb0ecfe Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a4ab8d7b3dacd35ff44fc41b4c8bdd28a62045fe differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a667500363948869dfc72acbd781e14d0dcfd56c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a667500363948869dfc72acbd781e14d0dcfd56c new file mode 100644 index 0000000..1430671 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a667500363948869dfc72acbd781e14d0dcfd56c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a8a356518396fa5b41de3c2e9359b1a906c8ce12 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a8a356518396fa5b41de3c2e9359b1a906c8ce12 new file mode 100644 index 0000000..b43d6f3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a8a356518396fa5b41de3c2e9359b1a906c8ce12 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a94aa8ced89b824652465e60330e474dc5a5ac15 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a94aa8ced89b824652465e60330e474dc5a5ac15 deleted file mode 100644 index cbd77d8..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a94aa8ced89b824652465e60330e474dc5a5ac15 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a99f51d8c51e9e70c6f5ef45702379aace415853 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a99f51d8c51e9e70c6f5ef45702379aace415853 deleted file mode 100644 index f78544f..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a99f51d8c51e9e70c6f5ef45702379aace415853 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a9d9462a602e9e54ebe86ad523a4cf509202239b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a9d9462a602e9e54ebe86ad523a4cf509202239b new file mode 100644 index 0000000..37870b7 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/a9d9462a602e9e54ebe86ad523a4cf509202239b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/aacbeaf7eadf2c9354f8b5cef48604212008eb33 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/aacbeaf7eadf2c9354f8b5cef48604212008eb33 new file mode 100644 index 0000000..2552558 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/aacbeaf7eadf2c9354f8b5cef48604212008eb33 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ac592ee43e003afa088bb5effbdc4679476e06a5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ac592ee43e003afa088bb5effbdc4679476e06a5 deleted file mode 100644 index d521dad..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ac592ee43e003afa088bb5effbdc4679476e06a5 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 new file mode 100644 index 0000000..695b4d0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ad91e7232e1ad6215179b5ac4f723d7e8e6fff04 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ade91aa40b8684929b4f3fe13632a09335f0767c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ade91aa40b8684929b4f3fe13632a09335f0767c deleted file mode 100644 index dcd9da2..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ade91aa40b8684929b4f3fe13632a09335f0767c and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c87d77a256014f0e9f443230be3cadf84b842da5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adfd0ced22d4b14d9472dd39ef6ada4137180844 similarity index 52% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c87d77a256014f0e9f443230be3cadf84b842da5 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adfd0ced22d4b14d9472dd39ef6ada4137180844 index eb9a62b..386fce1 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c87d77a256014f0e9f443230be3cadf84b842da5 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adfd0ced22d4b14d9472dd39ef6ada4137180844 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2748bf06f5a71cc5f30fae9f957e537f39b2aa77 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ae4904456f7c98fa460127cad5722629eaf375b7 similarity index 55% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2748bf06f5a71cc5f30fae9f957e537f39b2aa77 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ae4904456f7c98fa460127cad5722629eaf375b7 index 5ad09b6..d569563 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/2748bf06f5a71cc5f30fae9f957e537f39b2aa77 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ae4904456f7c98fa460127cad5722629eaf375b7 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0405d219290369a7507d9a9a4096209855ece5b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0405d219290369a7507d9a9a4096209855ece5b deleted file mode 100644 index b2a1d17..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0405d219290369a7507d9a9a4096209855ece5b and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 new file mode 100644 index 0000000..694a425 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0671a9ca0688908c35b0197bda0ff7cd91a7802 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0de353b0ff4b2dfbaba3574f6e84dcdf1b01d7d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0de353b0ff4b2dfbaba3574f6e84dcdf1b01d7d deleted file mode 100644 index 3a6abd3..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b0de353b0ff4b2dfbaba3574f6e84dcdf1b01d7d and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 new file mode 100644 index 0000000..5bff421 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b147ac2fd9218077a901f82afcbbbd71a032be28 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b33349107da622826c0de5883dfd2bc8adfb51f5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b33349107da622826c0de5883dfd2bc8adfb51f5 deleted file mode 100644 index a1c1bd1..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b33349107da622826c0de5883dfd2bc8adfb51f5 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3ae974d2558a81d2ce7f10caacced4f1f47c533 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3ae974d2558a81d2ce7f10caacced4f1f47c533 new file mode 100644 index 0000000..c5dd32d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b3ae974d2558a81d2ce7f10caacced4f1f47c533 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/22e370faf486d5e245dcc33671bbf15910a5e91e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c similarity index 77% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/22e370faf486d5e245dcc33671bbf15910a5e91e rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c index 6d6f168..7bc1890 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/22e370faf486d5e245dcc33671bbf15910a5e91e and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b428deb46505b6dddd37f4e68312096200804f1c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 new file mode 100644 index 0000000..7bac769 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b4668f08c1bd92ddb07602a61b2ed9ede6e9e355 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b53b0c974f3296788ed15885cdd393c19eaa833a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b53b0c974f3296788ed15885cdd393c19eaa833a new file mode 100644 index 0000000..f312dfc Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b53b0c974f3296788ed15885cdd393c19eaa833a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b572c5d6854c1a5048682c66e8856e9d36e7432d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b572c5d6854c1a5048682c66e8856e9d36e7432d new file mode 100644 index 0000000..6039271 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b572c5d6854c1a5048682c66e8856e9d36e7432d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/892a862becababdcb28d2a893f3a2ce01abc16e4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b7360deec7bff31dae35d0dbdd8de5d275f1191a similarity index 55% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/892a862becababdcb28d2a893f3a2ce01abc16e4 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b7360deec7bff31dae35d0dbdd8de5d275f1191a index 1cf5fa5..aa0e7f3 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/892a862becababdcb28d2a893f3a2ce01abc16e4 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/b7360deec7bff31dae35d0dbdd8de5d275f1191a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 new file mode 100644 index 0000000..003ee32 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ba9c7fade724d985d6ebac7f13fafdd76ffc5aa0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/baf88bf2463826c84b748aabdce12a406870f43a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/baf88bf2463826c84b748aabdce12a406870f43a deleted file mode 100644 index f93d377..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/baf88bf2463826c84b748aabdce12a406870f43a and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bc08741066ebc87d7d46ef6a5984971ae6186fa2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bc08741066ebc87d7d46ef6a5984971ae6186fa2 new file mode 100644 index 0000000..96440ae Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bc08741066ebc87d7d46ef6a5984971ae6186fa2 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bd2a9a445ebf80d33d947a94ef007d9da69fdd63 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bd2a9a445ebf80d33d947a94ef007d9da69fdd63 deleted file mode 100644 index d5def68..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/bd2a9a445ebf80d33d947a94ef007d9da69fdd63 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/be836532b3c69821faecb2ee70da56687e442c36 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/be836532b3c69821faecb2ee70da56687e442c36 deleted file mode 100644 index ff7e493..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/be836532b3c69821faecb2ee70da56687e442c36 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c04f75d30fdacb872a5bd369634ee4de4267661e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c04f75d30fdacb872a5bd369634ee4de4267661e deleted file mode 100644 index bd53ae6..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c04f75d30fdacb872a5bd369634ee4de4267661e and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef new file mode 100644 index 0000000..8658752 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c195fa7da39afc1bf330ae04bce401bb200b5aef differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2ab467b1f82ebbb4a595a34ed4688640acd67db b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2ab467b1f82ebbb4a595a34ed4688640acd67db deleted file mode 100644 index 5d84ede..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2ab467b1f82ebbb4a595a34ed4688640acd67db and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2cf6eb87d09bcad3662b2352c1e23d1e4765f46 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2cf6eb87d09bcad3662b2352c1e23d1e4765f46 deleted file mode 100644 index 48b7921..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c2cf6eb87d09bcad3662b2352c1e23d1e4765f46 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 new file mode 100644 index 0000000..9c36412 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c37c74ee9d3a0b4f65e7f70b2a287761df95cba8 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c46552eb7f6937cb598ae6ffc76964f7ae2364bc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c46552eb7f6937cb598ae6ffc76964f7ae2364bc deleted file mode 100644 index 0479bf7..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c46552eb7f6937cb598ae6ffc76964f7ae2364bc and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c5ebff5a561cbc77637919c5235a95246c755c15 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c5ebff5a561cbc77637919c5235a95246c755c15 deleted file mode 100644 index fa86f79..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c5ebff5a561cbc77637919c5235a95246c755c15 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c613e9ab2b629c7b897975460e5c33e8ac1a2232 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c613e9ab2b629c7b897975460e5c33e8ac1a2232 deleted file mode 100644 index b504855..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c613e9ab2b629c7b897975460e5c33e8ac1a2232 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 new file mode 100644 index 0000000..efbcc4d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/c96c75d639e0a0f6b25fa4c4f0ef65087b9f8c62 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ca9956ae8e38e999ec3c5113d8b05888aad6ce25 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ca9956ae8e38e999ec3c5113d8b05888aad6ce25 new file mode 100644 index 0000000..6ddfeac Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ca9956ae8e38e999ec3c5113d8b05888aad6ce25 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cad65bde385d438eac3f1b3b54d9735c3ea1c475 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cad65bde385d438eac3f1b3b54d9735c3ea1c475 new file mode 100644 index 0000000..5e31df5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cad65bde385d438eac3f1b3b54d9735c3ea1c475 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cb295c43921dc4bad7ea292e4b5dae704a18bc1f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cb295c43921dc4bad7ea292e4b5dae704a18bc1f new file mode 100644 index 0000000..f706ae5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cb295c43921dc4bad7ea292e4b5dae704a18bc1f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c new file mode 100644 index 0000000..0d7a293 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cc2c3bc03ecf6d9c9d9be4cefb26ef15d00fd43c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cd0ed0742b01b47f64707b0ceae55e4bddc8a53e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cd0ed0742b01b47f64707b0ceae55e4bddc8a53e deleted file mode 100644 index 543669b..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/cd0ed0742b01b47f64707b0ceae55e4bddc8a53e and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d2f3a5ef8bb1964340a5fac8bdef3a1cbd919907 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d2f3a5ef8bb1964340a5fac8bdef3a1cbd919907 deleted file mode 100644 index 511f396..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d2f3a5ef8bb1964340a5fac8bdef3a1cbd919907 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d32eb599a72c10c702179987c3bf9162c44e1a96 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d32eb599a72c10c702179987c3bf9162c44e1a96 new file mode 100644 index 0000000..6527a67 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d32eb599a72c10c702179987c3bf9162c44e1a96 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d3668cbdb23f199b8ecbf5f46a7fc2f03c6cb126 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d3668cbdb23f199b8ecbf5f46a7fc2f03c6cb126 new file mode 100644 index 0000000..6acee66 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d3668cbdb23f199b8ecbf5f46a7fc2f03c6cb126 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4be74f6acbd8a4ee481ce49a35659f7f3549e06 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4be74f6acbd8a4ee481ce49a35659f7f3549e06 new file mode 100644 index 0000000..dd9e537 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4be74f6acbd8a4ee481ce49a35659f7f3549e06 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d53171a36056241ea76c8ae089770d740241ab4b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d53171a36056241ea76c8ae089770d740241ab4b new file mode 100644 index 0000000..b396c39 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d53171a36056241ea76c8ae089770d740241ab4b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d5cf79b024f393643248821250f7042caa74b33e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d5cf79b024f393643248821250f7042caa74b33e deleted file mode 100644 index 4a2e690..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d5cf79b024f393643248821250f7042caa74b33e and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d6210463c5504048832ec428987ae12196879dbf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d6210463c5504048832ec428987ae12196879dbf new file mode 100644 index 0000000..07b87a0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d6210463c5504048832ec428987ae12196879dbf differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7041c3322321256350b0295456d933798b89c3b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7041c3322321256350b0295456d933798b89c3b new file mode 100644 index 0000000..6fdeda8 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7041c3322321256350b0295456d933798b89c3b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7c21613ad6684dc73e1515178d0cfcbffea1df2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7c21613ad6684dc73e1515178d0cfcbffea1df2 deleted file mode 100644 index 6aa20f3..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7c21613ad6684dc73e1515178d0cfcbffea1df2 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7ef40b0ea62d59bc4c8d1525aa3ee0ca5444532 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7ef40b0ea62d59bc4c8d1525aa3ee0ca5444532 deleted file mode 100644 index cb2e13e..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d7ef40b0ea62d59bc4c8d1525aa3ee0ca5444532 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa new file mode 100644 index 0000000..7bd771d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8569cb9f35686a68ea12980ffcf452f9fceb5aa differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/06703ef82d4a6446b3f0008ab5240a8007769563 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 similarity index 75% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/06703ef82d4a6446b3f0008ab5240a8007769563 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 index 615bf56..8f86ed9 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/06703ef82d4a6446b3f0008ab5240a8007769563 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d8e9a0bc4f923e9276f3d46b82662735a9a29ef5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d9833213bb3e03d7894ffb4016188d4afc4411b4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d9833213bb3e03d7894ffb4016188d4afc4411b4 deleted file mode 100644 index 095cb69..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d9833213bb3e03d7894ffb4016188d4afc4411b4 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/da19453351c3c97a6638c6459d5e6d52530ef2b0 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/da19453351c3c97a6638c6459d5e6d52530ef2b0 new file mode 100644 index 0000000..06c9e0d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/da19453351c3c97a6638c6459d5e6d52530ef2b0 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dacb7f933d8091949eb58a1d4742d63852b4940d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dacb7f933d8091949eb58a1d4742d63852b4940d new file mode 100644 index 0000000..81e2526 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dacb7f933d8091949eb58a1d4742d63852b4940d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db05326428a371755ad51eacbdce730d9fdfeb4e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db05326428a371755ad51eacbdce730d9fdfeb4e new file mode 100644 index 0000000..1d311d2 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db05326428a371755ad51eacbdce730d9fdfeb4e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db83511a3ced2c03600163abf429f3a68a2c419d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db83511a3ced2c03600163abf429f3a68a2c419d deleted file mode 100644 index c48ef81..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/db83511a3ced2c03600163abf429f3a68a2c419d and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd new file mode 100644 index 0000000..831373f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dc30a02c1536990acb36cb29373edbc7ad6637cd differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dd42a4c087d8e17e1dbabcba4e4bf48b98f3329f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dd42a4c087d8e17e1dbabcba4e4bf48b98f3329f deleted file mode 100644 index 8552bf1..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dd42a4c087d8e17e1dbabcba4e4bf48b98f3329f and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d new file mode 100644 index 0000000..2e284a5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/dfe36dc795d2b55c5f6d0fbc9f87f570ce31e51d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0282b8026051307d6821f4214fd732a82d2ca14 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0282b8026051307d6821f4214fd732a82d2ca14 new file mode 100644 index 0000000..f34b0dc Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0282b8026051307d6821f4214fd732a82d2ca14 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0a42c3dd45b6b2b1af036784202c319ca10f146 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0a42c3dd45b6b2b1af036784202c319ca10f146 new file mode 100644 index 0000000..37610f3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e0a42c3dd45b6b2b1af036784202c319ca10f146 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1542bc7ccdc101ae6a8051e6460fd5005097f79 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1542bc7ccdc101ae6a8051e6460fd5005097f79 deleted file mode 100644 index df259ac..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1542bc7ccdc101ae6a8051e6460fd5005097f79 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1d142ea43c04e41b757f01d8987dd6af069a463 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1d142ea43c04e41b757f01d8987dd6af069a463 deleted file mode 100644 index 4c749b8..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e1d142ea43c04e41b757f01d8987dd6af069a463 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e3e502902e40348546d1352eaba467591b3df7f4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e3e502902e40348546d1352eaba467591b3df7f4 deleted file mode 100644 index 3a243d3..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e3e502902e40348546d1352eaba467591b3df7f4 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e43bf4879aa0837380a0d93342b30a193c4af677 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e43bf4879aa0837380a0d93342b30a193c4af677 deleted file mode 100644 index c6ef4a6..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e43bf4879aa0837380a0d93342b30a193c4af677 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e564ac5e15a78f795629ab31a8a88e91898095a1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e564ac5e15a78f795629ab31a8a88e91898095a1 deleted file mode 100644 index 15c9a7e..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e564ac5e15a78f795629ab31a8a88e91898095a1 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e751c0f21a9ebccab51d453d0fe32f249e632070 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e751c0f21a9ebccab51d453d0fe32f249e632070 deleted file mode 100644 index 9bf92e2..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e751c0f21a9ebccab51d453d0fe32f249e632070 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e7d4d0e761252d3de02e3d5c9f98cbc4920ff445 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e7d4d0e761252d3de02e3d5c9f98cbc4920ff445 deleted file mode 100644 index 95374a4..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e7d4d0e761252d3de02e3d5c9f98cbc4920ff445 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e8216eb21330e411b6aca3fd6803bb61a7808483 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e8216eb21330e411b6aca3fd6803bb61a7808483 deleted file mode 100644 index af2be3f..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e8216eb21330e411b6aca3fd6803bb61a7808483 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 new file mode 100644 index 0000000..4b79614 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e9019d481211e8c40574ccc15907bd89922381e6 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e914b2a8555bb893176180e01044325cfc2f8bf1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e914b2a8555bb893176180e01044325cfc2f8bf1 deleted file mode 100644 index b502858..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e914b2a8555bb893176180e01044325cfc2f8bf1 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e974276349af1ab8387631f597bfba994bd5da9c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e974276349af1ab8387631f597bfba994bd5da9c new file mode 100644 index 0000000..82a41d4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/e974276349af1ab8387631f597bfba994bd5da9c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eb533db3c1a3fb6e75363004769aab5a45dedddb b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eb533db3c1a3fb6e75363004769aab5a45dedddb new file mode 100644 index 0000000..f0f3365 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/eb533db3c1a3fb6e75363004769aab5a45dedddb differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4a96cf0b53f7342e749a0791a513dbfaf6d4ccf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 similarity index 79% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4a96cf0b53f7342e749a0791a513dbfaf6d4ccf rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 index 986208e..4ae7c11 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/d4a96cf0b53f7342e749a0791a513dbfaf6d4ccf and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ee63e1eec358c118f02bc9a0f426cd9df72fabf1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ef880a270034e0f210254f3f3574bca5cfe13b54 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ef880a270034e0f210254f3f3574bca5cfe13b54 deleted file mode 100644 index f19a44e..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ef880a270034e0f210254f3f3574bca5cfe13b54 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f0950c0364b9ab5aa1aa584c183098f262817088 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f0950c0364b9ab5aa1aa584c183098f262817088 deleted file mode 100644 index 4c6aec8..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f0950c0364b9ab5aa1aa584c183098f262817088 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2b4023c8bafb4c2423751ee5e070eca4026c050 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2b4023c8bafb4c2423751ee5e070eca4026c050 deleted file mode 100644 index d44c14b..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2b4023c8bafb4c2423751ee5e070eca4026c050 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b new file mode 100644 index 0000000..8ce1436 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f2db36b7af0430c073936a17a9005dc45265ff3b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f31d50d032713c24334c3ca21cffc16c5fa2cc0a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f31d50d032713c24334c3ca21cffc16c5fa2cc0a deleted file mode 100644 index 0cd2c5c..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f31d50d032713c24334c3ca21cffc16c5fa2cc0a and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f4432c2a09512441123fd68f6ee3ede217067444 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f4432c2a09512441123fd68f6ee3ede217067444 deleted file mode 100644 index 3ffb03b..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f4432c2a09512441123fd68f6ee3ede217067444 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f61ea517b82990485bff8a973a91a717d1a6bf94 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f61ea517b82990485bff8a973a91a717d1a6bf94 deleted file mode 100644 index d635eec..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f61ea517b82990485bff8a973a91a717d1a6bf94 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f64d8aac4b4c11f8226965fa11a2cfb4295f7987 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f64d8aac4b4c11f8226965fa11a2cfb4295f7987 new file mode 100644 index 0000000..d4b9e73 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f64d8aac4b4c11f8226965fa11a2cfb4295f7987 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f85ac377234f5f7b4b15ace9365eefae27881876 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f85ac377234f5f7b4b15ace9365eefae27881876 new file mode 100644 index 0000000..41d1e60 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f85ac377234f5f7b4b15ace9365eefae27881876 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f860eb559bcb2592b50273cf176aab4c624ab387 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f860eb559bcb2592b50273cf176aab4c624ab387 deleted file mode 100644 index face2ba..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f860eb559bcb2592b50273cf176aab4c624ab387 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f8eec32608e9d330b3973576735646427a6731f8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f8eec32608e9d330b3973576735646427a6731f8 new file mode 100644 index 0000000..32c83fd Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/f8eec32608e9d330b3973576735646427a6731f8 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fb655444ed95def5326f642c7ac3a6a7e7cae5de b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fb655444ed95def5326f642c7ac3a6a7e7cae5de new file mode 100644 index 0000000..8bff785 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fb655444ed95def5326f642c7ac3a6a7e7cae5de differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fba13dc4063739e6d3b1651a742cfb80e5053fdf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fba13dc4063739e6d3b1651a742cfb80e5053fdf new file mode 100644 index 0000000..955f276 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fba13dc4063739e6d3b1651a742cfb80e5053fdf differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fd63517f1edf14196b80b795c08995f3a4cdbd35 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fd63517f1edf14196b80b795c08995f3a4cdbd35 new file mode 100644 index 0000000..27e29c7 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/fd63517f1edf14196b80b795c08995f3a4cdbd35 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adab987e21e9838b02e500658ea0818a18ac0403 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e similarity index 77% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adab987e21e9838b02e500658ea0818a18ac0403 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e index 77d070f..e90b662 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/adab987e21e9838b02e500658ea0818a18ac0403 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/feabcbfd6a97b797941d0989be77e8156a75a02e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ffc43d4749a49d8db8fb96d498a34bbb62af2e0e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ffc43d4749a49d8db8fb96d498a34bbb62af2e0e deleted file mode 100644 index 48e5f63..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_decrypt_cenc_fuzz_seed_corpus/ffc43d4749a49d8db8fb96d498a34bbb62af2e0e and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c new file mode 100644 index 0000000..94594c4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/02e3dc401871be9b4fcbf6dfd658842567ca7c1c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f deleted file mode 100644 index 411b41c..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/6c6a072aa58399454ee759bac539109a20f7e97f and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a deleted file mode 100644 index dd245f4..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/75ae4c5769c9568d631452df3b3702d876e4863a and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b deleted file mode 100644 index ff53f68..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9bdb356ec50807b86c807c09c780267101fd1a0b and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc new file mode 100644 index 0000000..7d7969d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/9d6f8b174b9b82447f3fdb65a24c21b9d0ca36dc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/b0b757465797a5e49307b325481c338ddb591afa b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/b0b757465797a5e49307b325481c338ddb591afa new file mode 100644 index 0000000..1950646 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/b0b757465797a5e49307b325481c338ddb591afa differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 new file mode 100644 index 0000000..e12eb9d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_decrypt_fuzz_seed_corpus/d3d6e16a36ca8931d6cb18f74243b0cd027e6ed2 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/898b59f382a227ba7f3977fabeecce928a1c8f33 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/898b59f382a227ba7f3977fabeecce928a1c8f33 new file mode 100644 index 0000000..876de8a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_encrypt_fuzz_seed_corpus/898b59f382a227ba7f3977fabeecce928a1c8f33 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/94dde36e88bca50f24c228c5e5e9811c711a1b49 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/94dde36e88bca50f24c228c5e5e9811c711a1b49 new file mode 100644 index 0000000..3a9a4b8 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_sign_fuzz_seed_corpus/94dde36e88bca50f24c228c5e5e9811c711a1b49 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/d1ef093f11c8e8c42da35501230bb7030067602e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 similarity index 71% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/d1ef093f11c8e8c42da35501230bb7030067602e rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 index 6bdca2d..083b686 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/d1ef093f11c8e8c42da35501230bb7030067602e and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/080255be6f3f6d8f95f8779116af43da3c7c7fe1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/3f4491c53865cf9d8975423626980c1a5d547dae b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/3f4491c53865cf9d8975423626980c1a5d547dae new file mode 100644 index 0000000..94d5aa7 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/3f4491c53865cf9d8975423626980c1a5d547dae differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/401f966cf4d9f594cd993c9e429833ae2b298f2b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/401f966cf4d9f594cd993c9e429833ae2b298f2b new file mode 100644 index 0000000..d2484b2 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/401f966cf4d9f594cd993c9e429833ae2b298f2b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/44c74993d4832e49d818af03c8469ceb6482802f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/44c74993d4832e49d818af03c8469ceb6482802f new file mode 100644 index 0000000..1cb2273 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/44c74993d4832e49d818af03c8469ceb6482802f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/6a7338ef51621a3936d362be039348682d3f42bc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/6a7338ef51621a3936d362be039348682d3f42bc new file mode 100644 index 0000000..477306b Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/6a7338ef51621a3936d362be039348682d3f42bc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7196add7d06e51a0b6a583581f81dac29df69f7b b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7196add7d06e51a0b6a583581f81dac29df69f7b new file mode 100644 index 0000000..231f7f8 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/7196add7d06e51a0b6a583581f81dac29df69f7b differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a94b2e9c5f7896643f5405d040cddacb15f8866a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 similarity index 71% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a94b2e9c5f7896643f5405d040cddacb15f8866a rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 index 9775e6c..ee4a672 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a94b2e9c5f7896643f5405d040cddacb15f8866a and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/76a08035bc9c0772c895b73439a9d19d84737744 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/78c3819333632152791a0a58eacbd67ca19abc4e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/78c3819333632152791a0a58eacbd67ca19abc4e new file mode 100644 index 0000000..a92d163 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/78c3819333632152791a0a58eacbd67ca19abc4e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/814054a30f7cdc10e4d83e48e6a5b00becf46cf1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/814054a30f7cdc10e4d83e48e6a5b00becf46cf1 new file mode 100644 index 0000000..112ab0f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/814054a30f7cdc10e4d83e48e6a5b00becf46cf1 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/8c4ea32a7996921e51ec7717035f2826eb9d0853 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/8c4ea32a7996921e51ec7717035f2826eb9d0853 new file mode 100644 index 0000000..4d62d87 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/8c4ea32a7996921e51ec7717035f2826eb9d0853 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9628ef383581ef1f7591d4316fd75276959c2cab b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9628ef383581ef1f7591d4316fd75276959c2cab new file mode 100644 index 0000000..131cd7a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9628ef383581ef1f7591d4316fd75276959c2cab differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9b80edcb955ebf5d52f0e9c754a51aafd03a032d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9b80edcb955ebf5d52f0e9c754a51aafd03a032d new file mode 100644 index 0000000..2701f83 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/9b80edcb955ebf5d52f0e9c754a51aafd03a032d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a5c27f614414c51fafa12bbc298f061d111ac5dd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a5c27f614414c51fafa12bbc298f061d111ac5dd new file mode 100644 index 0000000..4ceea01 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a5c27f614414c51fafa12bbc298f061d111ac5dd differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a6873ce79ac837648b62cf89f6c568706ac00c99 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a6873ce79ac837648b62cf89f6c568706ac00c99 new file mode 100644 index 0000000..c3c516a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/a6873ce79ac837648b62cf89f6c568706ac00c99 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/b93ff0791e1995e5014d1b717afda122e6ade75f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/b93ff0791e1995e5014d1b717afda122e6ade75f new file mode 100644 index 0000000..4114ff6 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/b93ff0791e1995e5014d1b717afda122e6ade75f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c179fc48504dbe00aa946d65d71e2a0165423b2f b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c179fc48504dbe00aa946d65d71e2a0165423b2f new file mode 100644 index 0000000..8bda288 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/c179fc48504dbe00aa946d65d71e2a0165423b2f differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/cf7792686f978e3b5c6105d97a3a7c9837368f0d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/cf7792686f978e3b5c6105d97a3a7c9837368f0d new file mode 100644 index 0000000..fc9409f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/cf7792686f978e3b5c6105d97a3a7c9837368f0d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/e007898e3ade64f83149acb974f39b00ed05cde4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/e007898e3ade64f83149acb974f39b00ed05cde4 new file mode 100644 index 0000000..e637ca1 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_generic_verify_fuzz_seed_corpus/e007898e3ade64f83149acb974f39b00ed05cde4 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 new file mode 100644 index 0000000..2f4df33 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/04a5434a6ccbfc5fd730762eb03b4aedc02fecb3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c new file mode 100644 index 0000000..7d11b56 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/0a1de0f3c6da0125dcf7573a37a144ffde4d7b3c differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1bac9ff28790816e80d3f7f2c87f72c3d5485987 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1bac9ff28790816e80d3f7f2c87f72c3d5485987 new file mode 100644 index 0000000..af5021d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1bac9ff28790816e80d3f7f2c87f72c3d5485987 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1c2e50d75ca628b62b3b05ffe17dcb0bd815074d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1c2e50d75ca628b62b3b05ffe17dcb0bd815074d new file mode 100644 index 0000000..613b52f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/1c2e50d75ca628b62b3b05ffe17dcb0bd815074d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/26dd022e20552f6c36def4f19eed5954e9ecbf08 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/26dd022e20552f6c36def4f19eed5954e9ecbf08 new file mode 100644 index 0000000..e80b576 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/26dd022e20552f6c36def4f19eed5954e9ecbf08 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2b900789bbacbb6581ce5eb82cb32c845b74ac01 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2b900789bbacbb6581ce5eb82cb32c845b74ac01 new file mode 100644 index 0000000..039b9be Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2b900789bbacbb6581ce5eb82cb32c845b74ac01 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc new file mode 100644 index 0000000..900a201 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/2f0790c9a2bc5ef7075cd503925ee48fc8efd7cc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/3063b747267c41526835726740e2752b0efd277a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/3063b747267c41526835726740e2752b0efd277a new file mode 100644 index 0000000..41affc3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/3063b747267c41526835726740e2752b0efd277a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/46e509ae9a53927b3c36f04c17cc4bffb9d63619 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/46e509ae9a53927b3c36f04c17cc4bffb9d63619 new file mode 100644 index 0000000..8ac3bac Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/46e509ae9a53927b3c36f04c17cc4bffb9d63619 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe new file mode 100644 index 0000000..2864ac9 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e685aa56f776523ece6ffcf9f47f0a35dcc8cbe differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e8535ce0b1c5294f35d4f957effef1532ac6560 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e8535ce0b1c5294f35d4f957effef1532ac6560 new file mode 100644 index 0000000..90e0108 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/4e8535ce0b1c5294f35d4f957effef1532ac6560 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a new file mode 100644 index 0000000..1c6aea4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/54b079a9b59e9c5c0b9bde3a8517c1d7dc06336a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/5d798c32f5c1e458077509799531cca5ac956343 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/5d798c32f5c1e458077509799531cca5ac956343 new file mode 100644 index 0000000..43950c9 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/5d798c32f5c1e458077509799531cca5ac956343 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6008f01a62c84227dab6dd3187b4107465ebca14 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6008f01a62c84227dab6dd3187b4107465ebca14 new file mode 100644 index 0000000..2f0ec24 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6008f01a62c84227dab6dd3187b4107465ebca14 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60d8d9532b4dae783871f1befc1a71da4caa8405 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60d8d9532b4dae783871f1befc1a71da4caa8405 new file mode 100644 index 0000000..9167c83 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60d8d9532b4dae783871f1befc1a71da4caa8405 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60df090dd8440f5b29c173fc04e6ac4fd83fcfbf b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60df090dd8440f5b29c173fc04e6ac4fd83fcfbf new file mode 100644 index 0000000..72c00ef Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/60df090dd8440f5b29c173fc04e6ac4fd83fcfbf differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/67eb049639b91a7ad90147c323f4494d21ad92af b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/67eb049639b91a7ad90147c323f4494d21ad92af new file mode 100644 index 0000000..1c22e83 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/67eb049639b91a7ad90147c323f4494d21ad92af differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6aeafb823a606e97ab896a5fde5b2e771b1ddd86 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6aeafb823a606e97ab896a5fde5b2e771b1ddd86 new file mode 100644 index 0000000..b0ee50d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6aeafb823a606e97ab896a5fde5b2e771b1ddd86 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 deleted file mode 100644 index baf0a05..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/6f8b954fb7f8be2c3632f931aaf55e3d1a6c58d8 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/714731f02b06f331811f54cd92dede72377d6e7e b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/714731f02b06f331811f54cd92dede72377d6e7e new file mode 100644 index 0000000..ac50b91 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/714731f02b06f331811f54cd92dede72377d6e7e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/72a401ddc314e9cdf3cd79080610a57cfedc47ad b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/72a401ddc314e9cdf3cd79080610a57cfedc47ad new file mode 100644 index 0000000..24b4ee1 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/72a401ddc314e9cdf3cd79080610a57cfedc47ad differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d deleted file mode 100644 index 4e60052..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/7997b5673d5a9402b2f8acc43f92cdf6ad1f913d and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8196b2365ca56224853dfeeddde216b4f467f0dd b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8196b2365ca56224853dfeeddde216b4f467f0dd deleted file mode 100644 index 639ab6a..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8196b2365ca56224853dfeeddde216b4f467f0dd and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 deleted file mode 100644 index 16a14bc..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81ac6d013d80da7f67fe6fbb5e8c15a35a0d8134 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81dd1ccd2485b5f87a1bc69c337fbed7b46bb208 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81dd1ccd2485b5f87a1bc69c337fbed7b46bb208 new file mode 100644 index 0000000..2f0c8d4 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/81dd1ccd2485b5f87a1bc69c337fbed7b46bb208 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8479d72571edf5016e1ea108d9fe5cde9aefb212 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8479d72571edf5016e1ea108d9fe5cde9aefb212 new file mode 100644 index 0000000..4b8218a Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/8479d72571edf5016e1ea108d9fe5cde9aefb212 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/92ebd373b454fa4569a884216e0382de5505a629 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/92ebd373b454fa4569a884216e0382de5505a629 new file mode 100644 index 0000000..651de5d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/92ebd373b454fa4569a884216e0382de5505a629 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/93cd53951a9d66d88c5f67223becf152b59fcbdc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/93cd53951a9d66d88c5f67223becf152b59fcbdc new file mode 100644 index 0000000..93314a0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/93cd53951a9d66d88c5f67223becf152b59fcbdc differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/9808dd01e64b4afef70b73e36c4b535dd1cc66c5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/9808dd01e64b4afef70b73e36c4b535dd1cc66c5 new file mode 100644 index 0000000..950e043 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/9808dd01e64b4afef70b73e36c4b535dd1cc66c5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5c1794fbf1849e99591df8932fdd396605e9738 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5c1794fbf1849e99591df8932fdd396605e9738 new file mode 100644 index 0000000..cbaf7cc Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5c1794fbf1849e99591df8932fdd396605e9738 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5df528e8b43462969b8b861342a1d61a0974275 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5df528e8b43462969b8b861342a1d61a0974275 new file mode 100644 index 0000000..a820254 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/a5df528e8b43462969b8b861342a1d61a0974275 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/ae43d3634880e8325da476ab4544faaff31d3165 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/ae43d3634880e8325da476ab4544faaff31d3165 new file mode 100644 index 0000000..d99206f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/ae43d3634880e8325da476ab4544faaff31d3165 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/b64e63f278751a31b4bb63044b680811b0f6bcc9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/b64e63f278751a31b4bb63044b680811b0f6bcc9 new file mode 100644 index 0000000..55d7039 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/b64e63f278751a31b4bb63044b680811b0f6bcc9 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd1b8656218819db11065037bc8681fd2a113bf3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd1b8656218819db11065037bc8681fd2a113bf3 new file mode 100644 index 0000000..7b17d35 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd1b8656218819db11065037bc8681fd2a113bf3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd5fb0e7e72fb293d516857246e3b94941b76517 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd5fb0e7e72fb293d516857246e3b94941b76517 new file mode 100644 index 0000000..14f0e6c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/bd5fb0e7e72fb293d516857246e3b94941b76517 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/d6350f4e6eaff1726c48e6b283bbeae4f5b30468 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/d6350f4e6eaff1726c48e6b283bbeae4f5b30468 new file mode 100644 index 0000000..3f785b0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/d6350f4e6eaff1726c48e6b283bbeae4f5b30468 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/dd618d63065009c9812b2834e623ae90cd363c1a b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/dd618d63065009c9812b2834e623ae90cd363c1a new file mode 100644 index 0000000..0905ec1 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/dd618d63065009c9812b2834e623ae90cd363c1a differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/debf636b4ae4c2b7ce3a14e866777e4a1bc10594 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/debf636b4ae4c2b7ce3a14e866777e4a1bc10594 new file mode 100644 index 0000000..bf169c2 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/debf636b4ae4c2b7ce3a14e866777e4a1bc10594 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 new file mode 100644 index 0000000..a414e81 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e0fe1c95d8361dee4a3f5e68685ea864a86ad0d4 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e4913cf245772fc597307400caa868f3da21a8f6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e4913cf245772fc597307400caa868f3da21a8f6 new file mode 100644 index 0000000..ffe0dc5 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e4913cf245772fc597307400caa868f3da21a8f6 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 new file mode 100644 index 0000000..8766c31 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/e7e70c300f83ca4e989a2e0ebea9d89b22a6b2c9 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/eb9d4867ea92f1abccb3495e9976bbd297df3f82 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/eb9d4867ea92f1abccb3495e9976bbd297df3f82 new file mode 100644 index 0000000..6b9777d Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_entitled_content_keys_fuzz_seed_corpus/eb9d4867ea92f1abccb3495e9976bbd297df3f82 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0567e5f52c00fed0ad7858164434b02d8e629064 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0567e5f52c00fed0ad7858164434b02d8e629064 deleted file mode 100644 index 08541f4..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0567e5f52c00fed0ad7858164434b02d8e629064 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/618cdf5927b2b092d9d7b5e93c30af8708270f11 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/06ae1005d93d4a19b67d090a020ae37db54e6e3e similarity index 53% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/618cdf5927b2b092d9d7b5e93c30af8708270f11 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/06ae1005d93d4a19b67d090a020ae37db54e6e3e index dc58149..d2cfb47 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/618cdf5927b2b092d9d7b5e93c30af8708270f11 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/06ae1005d93d4a19b67d090a020ae37db54e6e3e differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0f5cc252aaf43eaa1570ca07d174a0f96333c592 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0f5cc252aaf43eaa1570ca07d174a0f96333c592 deleted file mode 100644 index 6f71c2e..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0f5cc252aaf43eaa1570ca07d174a0f96333c592 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0fdcae4df7bc325099fb4b3b01a1c9290229f86c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0fdcae4df7bc325099fb4b3b01a1c9290229f86c deleted file mode 100644 index 6f61946..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/0fdcae4df7bc325099fb4b3b01a1c9290229f86c and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb deleted file mode 100644 index cab8c50..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/1ee4b9ce1a4acc41e912487383ad77f3ccaa97fb and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2d7246bd48ed8b68599445c98bb822c87f86acd1 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2d7246bd48ed8b68599445c98bb822c87f86acd1 deleted file mode 100644 index 0aded9d..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2d7246bd48ed8b68599445c98bb822c87f86acd1 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2f64b8ffa25844924fe24678067feee9be80f4ec b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2f64b8ffa25844924fe24678067feee9be80f4ec deleted file mode 100644 index 7aac2f9..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/2f64b8ffa25844924fe24678067feee9be80f4ec and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/3acf30d485a4370ceb8e64785094a50b768e1ca4 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/3acf30d485a4370ceb8e64785094a50b768e1ca4 deleted file mode 100644 index 57edbd7..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/3acf30d485a4370ceb8e64785094a50b768e1ca4 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/461c08228ae6a0eaa191d24eea1823b46f4a9d67 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/461c08228ae6a0eaa191d24eea1823b46f4a9d67 deleted file mode 100644 index 591c0e9..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/461c08228ae6a0eaa191d24eea1823b46f4a9d67 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/4b69b92f45febc4dbf5b8fb9a216a290ba51d478 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/4b69b92f45febc4dbf5b8fb9a216a290ba51d478 deleted file mode 100644 index 0a09fb4..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/4b69b92f45febc4dbf5b8fb9a216a290ba51d478 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/5891055a8932cac4c24862377ab912ff6d775247 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/5891055a8932cac4c24862377ab912ff6d775247 new file mode 100644 index 0000000..77e5207 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/5891055a8932cac4c24862377ab912ff6d775247 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/592f446db007b4db2d056983a7bb098bf021babe b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/592f446db007b4db2d056983a7bb098bf021babe new file mode 100644 index 0000000..72a258e Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/592f446db007b4db2d056983a7bb098bf021babe differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/5db53de009652f61b1ed21ee988d0156ce287033 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/5db53de009652f61b1ed21ee988d0156ce287033 deleted file mode 100644 index dc80cb8..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/5db53de009652f61b1ed21ee988d0156ce287033 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/642df2594991f9b5720fce364d0001d8c56d3a89 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/642df2594991f9b5720fce364d0001d8c56d3a89 new file mode 100644 index 0000000..e81aa3f Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/642df2594991f9b5720fce364d0001d8c56d3a89 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/6449230f671fe77b73dc6e0d40f542c0720628f2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/6449230f671fe77b73dc6e0d40f542c0720628f2 new file mode 100644 index 0000000..8a8e73c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/6449230f671fe77b73dc6e0d40f542c0720628f2 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/78e527f05b03c2ecd8a0ffc2baeb5dab57088934 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/78e527f05b03c2ecd8a0ffc2baeb5dab57088934 deleted file mode 100644 index bd4f876..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/78e527f05b03c2ecd8a0ffc2baeb5dab57088934 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7e120b1ec852c448490b9b060a5f35deb486c360 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7e120b1ec852c448490b9b060a5f35deb486c360 deleted file mode 100644 index 9bed284..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7e120b1ec852c448490b9b060a5f35deb486c360 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7f701c0f31e68192bc8c829f343fa2326aa4d3dc b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7f701c0f31e68192bc8c829f343fa2326aa4d3dc deleted file mode 100644 index 7cd10af..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7f701c0f31e68192bc8c829f343fa2326aa4d3dc and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/134a0d85fbcbe367e66d69127114bece71add806 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/81d43836885e32dc8c2b187cb9545bd5c01dfef5 similarity index 54% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/134a0d85fbcbe367e66d69127114bece71add806 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/81d43836885e32dc8c2b187cb9545bd5c01dfef5 index 70ed9c5..9fc97a3 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/134a0d85fbcbe367e66d69127114bece71add806 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/81d43836885e32dc8c2b187cb9545bd5c01dfef5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8243212a7a7160c91e2f9717b855b568f9a34233 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8243212a7a7160c91e2f9717b855b568f9a34233 deleted file mode 100644 index 352ae2e..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8243212a7a7160c91e2f9717b855b568f9a34233 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/85bff933def1ce530a1febd93ef2890ed4bcdcb5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/85bff933def1ce530a1febd93ef2890ed4bcdcb5 deleted file mode 100644 index 1e5f340..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/85bff933def1ce530a1febd93ef2890ed4bcdcb5 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8aeedd64cffd1f59badda7c7e62150d0e7ed4065 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8aeedd64cffd1f59badda7c7e62150d0e7ed4065 new file mode 100644 index 0000000..24fd910 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/8aeedd64cffd1f59badda7c7e62150d0e7ed4065 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/903224efa0cc5213ac2aefdf1191d05c703343f6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/903224efa0cc5213ac2aefdf1191d05c703343f6 new file mode 100644 index 0000000..96f694c Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/903224efa0cc5213ac2aefdf1191d05c703343f6 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 deleted file mode 100644 index 02ccf56..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a06905d0b9421966c527b5ef2ac68bdce1e0cfe5 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a3ea4b0c65a01f18d11ad39862b9ef501ed25423 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a3ea4b0c65a01f18d11ad39862b9ef501ed25423 new file mode 100644 index 0000000..70c6fdc Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a3ea4b0c65a01f18d11ad39862b9ef501ed25423 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a5daf115b5376cc8052df9ae1bb7693d0c6c64a5 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a5daf115b5376cc8052df9ae1bb7693d0c6c64a5 new file mode 100644 index 0000000..f026287 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/a5daf115b5376cc8052df9ae1bb7693d0c6c64a5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b26b7f292dee13cf6e0366f48ea199ee86a0c201 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b26b7f292dee13cf6e0366f48ea199ee86a0c201 new file mode 100644 index 0000000..5b18771 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b26b7f292dee13cf6e0366f48ea199ee86a0c201 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b452f7b6c615035d63a9825c5c17e049f54648ef b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b452f7b6c615035d63a9825c5c17e049f54648ef deleted file mode 100644 index c708d1e..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/b452f7b6c615035d63a9825c5c17e049f54648ef and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb3b1f380ed32d09a2c2811b68bc7ff5960fb0ff b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb3b1f380ed32d09a2c2811b68bc7ff5960fb0ff new file mode 100644 index 0000000..ae1d6cd Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb3b1f380ed32d09a2c2811b68bc7ff5960fb0ff differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb8c2201cf10fd7d24fc0c8009a44525f426b033 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb8c2201cf10fd7d24fc0c8009a44525f426b033 deleted file mode 100644 index 8f98344..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bb8c2201cf10fd7d24fc0c8009a44525f426b033 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bd3c74122b8b6ba809feaa063c0e0caf081def4d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bd3c74122b8b6ba809feaa063c0e0caf081def4d new file mode 100644 index 0000000..5f3c553 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bd3c74122b8b6ba809feaa063c0e0caf081def4d differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7dcdad1c2df1656678947b2009a9fcea44f4025d b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bea0876bed5520626024667d4f9dc0a4f485aa76 similarity index 54% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7dcdad1c2df1656678947b2009a9fcea44f4025d rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bea0876bed5520626024667d4f9dc0a4f485aa76 index e320261..e75a285 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/7dcdad1c2df1656678947b2009a9fcea44f4025d and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/bea0876bed5520626024667d4f9dc0a4f485aa76 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e26757270b3d149d1ce10bef32ed0b3a5794977c b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c1fa9299a3e1e9d51a2239488cb2e7333b58a9e5 similarity index 54% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e26757270b3d149d1ce10bef32ed0b3a5794977c rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c1fa9299a3e1e9d51a2239488cb2e7333b58a9e5 index d891152..2ed91aa 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e26757270b3d149d1ce10bef32ed0b3a5794977c and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c1fa9299a3e1e9d51a2239488cb2e7333b58a9e5 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c7a7cd07925450628efa677165d403510d89bf51 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c7a7cd07925450628efa677165d403510d89bf51 deleted file mode 100644 index 5442beb..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c7a7cd07925450628efa677165d403510d89bf51 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c862e8c9d33f4b01c20a9dc77849e5c5856f2474 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c862e8c9d33f4b01c20a9dc77849e5c5856f2474 new file mode 100644 index 0000000..2593830 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c862e8c9d33f4b01c20a9dc77849e5c5856f2474 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c96ae0dca69ceb11a79855a19786a559d6b255e3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c96ae0dca69ceb11a79855a19786a559d6b255e3 new file mode 100644 index 0000000..c4692d0 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/c96ae0dca69ceb11a79855a19786a559d6b255e3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-5919435528601600 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-5919435528601600 deleted file mode 100644 index 58dc14f..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-5919435528601600 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-6406770604638208 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d0a0d8d0c842875b97e89957095af3c71f7e9744 similarity index 54% rename from oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-6406770604638208 rename to oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d0a0d8d0c842875b97e89957095af3c71f7e9744 index 1a0f23c..2e0d879 100644 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/clusterfuzz-testcase-minimized-oemcrypto_load_license_fuzz-6406770604638208 and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d0a0d8d0c842875b97e89957095af3c71f7e9744 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d7014f417415314dd83162570bcafd7935875f00 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d7014f417415314dd83162570bcafd7935875f00 deleted file mode 100644 index 3df5267..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/d7014f417415314dd83162570bcafd7935875f00 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/df85865da57cab1bcbf9a081b850c3c8525098f6 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/df85865da57cab1bcbf9a081b850c3c8525098f6 new file mode 100644 index 0000000..f675201 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/df85865da57cab1bcbf9a081b850c3c8525098f6 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e44281948ed00f87ec981eb880561d983c0c16c3 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e44281948ed00f87ec981eb880561d983c0c16c3 new file mode 100644 index 0000000..6081976 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e44281948ed00f87ec981eb880561d983c0c16c3 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 deleted file mode 100644 index b54027c..0000000 Binary files a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/e598a949c6b14e1a3f96bcdf1b3d9335b07a6085 and /dev/null differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ecffb38d73f504442070cf4f754d9d2cd87a87d7 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ecffb38d73f504442070cf4f754d9d2cd87a87d7 new file mode 100644 index 0000000..0d43c08 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ecffb38d73f504442070cf4f754d9d2cd87a87d7 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ef6f1be8c575823ab46f6cf0e38717809d180301 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ef6f1be8c575823ab46f6cf0e38717809d180301 new file mode 100644 index 0000000..fa03168 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/ef6f1be8c575823ab46f6cf0e38717809d180301 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/f0d0117a070069c19108d17b834c6aa44ba11ab2 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/f0d0117a070069c19108d17b834c6aa44ba11ab2 new file mode 100644 index 0000000..afa4721 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/f0d0117a070069c19108d17b834c6aa44ba11ab2 differ diff --git a/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/fa7ec04e797198608d77692abd2c13e98e6e6d28 b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/fa7ec04e797198608d77692abd2c13e98e6e6d28 new file mode 100644 index 0000000..a1bbac3 Binary files /dev/null and b/oemcrypto/test/fuzz_tests/corpus/oemcrypto_load_license_fuzz_seed_corpus/fa7ec04e797198608d77692abd2c13e98e6e6d28 differ diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc index b9a1ce8..0c4d76d 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_copy_buffer_fuzz.cc @@ -7,31 +7,39 @@ #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + return 0; +} extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - // OEMCrypto_DestBufferDesc and a buffer from which data needs to be copied // are expected as inputs to copy buffer API. // Input fuzzed data is interpreted as: // (OEMCrypto_DestBufferDesc | subsample_flags | input_buffer) - OEMCrypto_Copy_Buffer_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Copy_Buffer_Fuzz fuzzed_structure; if (size < sizeof(fuzzed_structure)) { return 0; } FuzzedDataProvider fuzzed_data(data, size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_BufferType_MaxValue, - &fuzzed_structure.dest_buffer_desc.type); - fuzzed_structure.dest_buffer_desc.buffer_config %= MAX_FUZZ_OUTPUT_LENGTH + 1; + wvoec::ConvertDataToValidEnum(OEMCrypto_BufferType_MaxValue, + fuzzed_structure.dest_buffer_desc.type); + fuzzed_structure.dest_buffer_desc.buffer_config %= + wvoec::MAX_FUZZ_OUTPUT_LENGTH + 1; const std::vector input_buffer = fuzzed_data.ConsumeRemainingBytes(); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - const uint32_t session_id = license_api_fuzz.session()->session_id(); + const uint32_t session_id = license_api_fuzz.session().session_id(); // Initialize output buffer. OEMCrypto_DestBufferDesc dest_buffer_desc; @@ -79,5 +87,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc index 952946e..07c0bd4 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_create_and_remove_entitled_key_session_fuzz.cc @@ -2,33 +2,31 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - if (size < sizeof(ODK_ParsedLicense) + sizeof(MessageData)) { - return 0; + wvoec::RedirectStdoutToFile(); + + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); + + FuzzedDataProvider fuzzed_data(data, size); + + uint32_t key_session; + uint32_t* const key_session_ptr = + fuzzed_data.ConsumeBool() ? &key_session : nullptr; + + OEMCrypto_CreateEntitledKeySession(session_fuzz.session().session_id(), + key_session_ptr); + + if (key_session_ptr == nullptr || fuzzed_data.ConsumeBool()) { + key_session = fuzzed_data.ConsumeIntegral(); } - OEMCryptoLicenseAPIFuzz license_api_fuzz; - license_api_fuzz.license_messages().set_license_type( - OEMCrypto_EntitlementLicense); - license_api_fuzz.license_messages().SignAndVerifyRequest(); - // Interpreting input fuzz data as unencrypted (core_response + license - // message data) from license server. - license_api_fuzz.license_messages().InjectFuzzedResponseData(data, size); - license_api_fuzz.license_messages().EncryptAndSignResponse(); - license_api_fuzz.license_messages().LoadResponse(); - uint32_t key_session_id; - OEMCrypto_CreateEntitledKeySession(license_api_fuzz.session_id(), - &key_session_id); - - OEMCrypto_RemoveEntitledKeySession(key_session_id); + OEMCrypto_RemoveEntitledKeySession(key_session); + session_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc index 0c96b6b..9644106 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_deactivate_usage_entry_fuzz.cc @@ -2,29 +2,24 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - // Open a session, create a usage entry. - Session* session = entry.license_messages().session(); - session->open(); - entry.InstallTestDrmKey(session); - session->CreateNewUsageEntry(); - session->GenerateNonce(); - vector encrypted_usage_header; - session->UpdateUsageEntry(&encrypted_usage_header); + entry.InstallTestDrmKey(); + entry.session().CreateNewUsageEntry(); + entry.session().GenerateNonce(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); // LoadLicense sets the pst for usage entry. entry.LoadLicense(); + OEMCrypto_DeactivateUsageEntry(entry.session().session_id(), data, size); + entry.Terminate(); - OEMCrypto_DeactivateUsageEntry(session->session_id(), data, size); - session->close(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc index 8ddef79..7519959 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_cenc_fuzz.cc @@ -2,42 +2,55 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { +namespace { // Limit output buffer size to 5 MB as 4 MB is maximum size specified by // resource rating tier documentation. -const size_t MAX_FUZZ_SAMPLE_SIZE = 5 * MB; +constexpr size_t MAX_FUZZ_SAMPLE_SIZE = 5 * wvoec::MB; + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicense(); + return 0; +} extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - // Split data using separator. - const std::vector inputs = SplitFuzzedData(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 3) { return 0; } // Read cipher mode and pattern from fuzzed data. - OEMCrypto_Decrypt_Cenc_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Decrypt_Cenc_Fuzz fuzzed_structure; if (inputs[0].size < sizeof(fuzzed_structure)) { return 0; } FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); // Allocate sample descriptions. std::vector sample_descriptions( - fuzzed_data.remaining_bytes() / sizeof(OEMCrypto_SampleDescription_Fuzz)); + fuzzed_data.remaining_bytes() / + sizeof(wvoec::OEMCrypto_SampleDescription_Fuzz)); // Allocate input buffers for each sample description. std::vector> input_buffers( @@ -50,8 +63,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { std::vector> subsamples( sample_descriptions.size()); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - const uint32_t session_id = license_api_fuzz.session()->session_id(); + const uint32_t session_id = license_api_fuzz.session().session_id(); // Free first given number of output buffers. const auto FreeOutputBuffers = [&sample_descriptions, session_id, @@ -81,14 +93,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { FuzzedDataProvider subsample_data(inputs[2].data, inputs[2].size); for (size_t i = 0; i < sample_descriptions.size(); i++) { // Read and normalize sample description fuzzed properties. - OEMCrypto_SampleDescription_Fuzz fuzzed_sample_description; + wvoec::OEMCrypto_SampleDescription_Fuzz fuzzed_sample_description; sample_description_data.ConsumeData(&fuzzed_sample_description, sizeof(fuzzed_sample_description)); fuzzed_sample_description.buffers.input_data_length %= MAX_FUZZ_SAMPLE_SIZE + 1; - ConvertDataToValidEnum( + wvoec::ConvertDataToValidEnum( OEMCrypto_BufferType_MaxValue, - &fuzzed_sample_description.buffers.output_descriptor.type); + fuzzed_sample_description.buffers.output_descriptor.type); fuzzed_sample_description.buffers.output_descriptor.buffer_config %= MAX_FUZZ_SAMPLE_SIZE + 1; @@ -126,7 +138,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Initialize output buffer. OEMCrypto_DestBufferDesc& output_descriptor = sample_descriptions[i].buffers.output_descriptor; - const OEMCrypto_DestBufferDesc_Fuzz& fuzzed_output_descriptor = + const wvoec::OEMCrypto_DestBufferDesc_Fuzz& fuzzed_output_descriptor = fuzzed_sample_description.buffers.output_descriptor; output_descriptor.type = fuzzed_output_descriptor.type; switch (output_descriptor.type) { @@ -154,11 +166,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { } // Load license and call decrypt_cenc API. - license_api_fuzz.LoadLicense(); - const MessageKeyData& key = license_api_fuzz.session()->license().keys[0]; - vector key_handle; - GetKeyHandleIntoVector(session_id, key.key_id, key.key_id_length, - fuzzed_structure.cipher_mode, key_handle); + const wvoec::MessageKeyData& key = + license_api_fuzz.session().license().keys[0]; + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session_id, key.key_id, key.key_id_length, + fuzzed_structure.cipher_mode, key_handle); OEMCrypto_DecryptCENC(key_handle.data(), key_handle.size(), sample_descriptions.data(), sample_descriptions.size(), &fuzzed_structure.pattern); @@ -168,5 +180,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc new file mode 100644 index 0000000..e894884 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_decrypt_hash_fuzz.cc @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + wvoec::RedirectStdoutToFile(); + + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); + + FuzzedDataProvider fuzzed_data(data, size); + + if (fuzzed_data.ConsumeBool()) { + license_api_fuzz.license_messages().set_control( + license_api_fuzz.license_messages().control() | + wvoec::kControlAllowHashVerification); + } + + const uint32_t session_id = license_api_fuzz.session().session_id(); + const std::array content_key_id{}; + const uint32_t frame_number = fuzzed_data.ConsumeIntegral(); + std::array sample_buffer{}; + + OEMCrypto_SubSampleDescription subsample; + subsample.num_bytes_clear = 0; + subsample.num_bytes_encrypted = sample_buffer.size(); + subsample.subsample_flags = + OEMCrypto_FirstSubsample | OEMCrypto_LastSubsample; + subsample.block_offset = 0; + + OEMCrypto_SampleDescription sample; + sample.buffers.input_data = sample_buffer.data(); + sample.buffers.input_data_length = sample_buffer.size(); + sample.buffers.output_descriptor.type = OEMCrypto_BufferType_Clear; + sample.buffers.output_descriptor.buffer.clear.clear_buffer = + sample_buffer.data(); + sample.buffers.output_descriptor.buffer.clear.clear_buffer_length = + sample_buffer.size(); + memset(sample.iv, 0, sizeof(sample.iv)); + sample.subsamples = &subsample; + sample.subsamples_length = 1; + + OEMCrypto_CENCEncryptPatternDesc pattern; + pattern.encrypt = 0; + pattern.skip = 0; + + uint32_t failed_frame_number_data; + uint32_t* const failed_frame_number = + fuzzed_data.ConsumeBool() ? &failed_frame_number_data : nullptr; + + const std::vector hash = + fuzzed_data.ConsumeRemainingBytes(); + + license_api_fuzz.LoadLicense(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session_id, content_key_id.data(), + content_key_id.size(), + OEMCrypto_CipherMode_CENC, key_handle); + OEMCrypto_SetDecryptHash(session_id, frame_number, hash.data(), hash.size()); + OEMCrypto_DecryptCENC(key_handle.data(), key_handle.size(), &sample, 1, + &pattern); + OEMCrypto_GetHashErrorCode(session_id, failed_frame_number); + + license_api_fuzz.Terminate(); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc index eb6a351..50929b1 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.cc @@ -1,9 +1,12 @@ // Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary // source code may only be used and distributed under the Widevine // License Agreement. + +#include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" namespace wvoec { + void RedirectStdoutToFile() { freopen("log.txt", "a", stdout); } std::vector SplitFuzzedData(const uint8_t* data, size_t size) { @@ -22,14 +25,58 @@ std::vector SplitFuzzedData(const uint8_t* data, size_t size) { return result; } -void OEMCryptoLicenseAPIFuzz::LoadLicense() { +void InitializeFuzz(SessionUtil& session_util) { + wvoec::global_features.Initialize(); + OEMCrypto_SetSandbox(kTestSandbox, sizeof(kTestSandbox)); + OEMCrypto_Initialize(); + OEMCrypto_EnterTestMode(); + session_util.EnsureTestROT(); +} + +void SessionFuzz::Initialize() { + InitializeFuzz(session_util_); + session_.open(); +} + +void SessionFuzz::Terminate() { + session_.close(); + OEMCrypto_Terminate(); +} + +void OEMCryptoLicenseAPIFuzz::Initialize() { + session_fuzz_.Initialize(); + session_fuzz_.InstallTestDrmKey(); + session_fuzz_.session().GenerateNonce(); +} + +void OEMCryptoLicenseAPIFuzz::Terminate() { + session_fuzz_.Terminate(); +} + +void OEMCryptoLicenseAPIFuzz::LoadLicense(bool generic_crypto_keys) { license_messages_.SignAndVerifyRequest(); - license_messages_.CreateDefaultResponse(); + if (generic_crypto_keys) { + license_messages_.CreateResponseWithGenericCryptoKeys(); + } else { + license_messages_.CreateDefaultResponse(); + } license_messages_.EncryptAndSignResponse(); OEMCryptoResult sts = license_messages_.LoadResponse(); CheckStatusAndExitFuzzerOnFailure(sts, OEMCrypto_SUCCESS); } +void OEMCryptoProvisioningAPIFuzz::Initialize() { + InitializeFuzz(session_util_); + + // Opens a session and Generates Nonce. + provisioning_messages_.PrepareSession(session_util_.keybox_); +} + +void OEMCryptoProvisioningAPIFuzz::Terminate() { + session_.close(); + OEMCrypto_Terminate(); +} + void OEMCryptoProvisioningAPIFuzz::LoadProvisioning() { provisioning_messages_.SignAndVerifyRequest(); provisioning_messages_.CreateDefaultResponse(); @@ -62,4 +109,5 @@ void CheckStatusAndExitFuzzerOnFailure(OEMCryptoResult result, abort(); } } + } // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h index 15b7363..a322ebc 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzz_helper.h @@ -1,28 +1,31 @@ // Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary // source code may only be used and distributed under the Widevine // License Agreement. + #ifndef OEMCRYPTO_FUZZ_HELPER_H_ #define OEMCRYPTO_FUZZ_HELPER_H_ +#include +#include #include #include "FuzzedDataProvider.h" -#include "OEMCryptoCENC.h" #include "oec_device_features.h" #include "oemcrypto_corpus_generator_helper.h" #include "oemcrypto_session_tests_helper.h" -namespace wvoec { // Forward-declare the libFuzzer's mutator callback. Mark it weak so that // the program links successfully even outside of --config=asan-fuzzer // (apparently the only config in which LLVM uses our custom mutator). extern "C" size_t LLVMFuzzerMutate(uint8_t* Data, size_t Size, size_t MaxSize) __attribute__((weak)); -const size_t KB = 1024; +namespace wvoec { + +constexpr size_t KB = 1024; // Default maximum length of fuzzing output parameters. -const size_t MAX_FUZZ_OUTPUT_LENGTH = 5 * KB; +constexpr size_t MAX_FUZZ_OUTPUT_LENGTH = 5 * KB; // Fuzzed data region. struct FuzzedData { @@ -33,106 +36,165 @@ struct FuzzedData { // Initial setup to create a valid OEMCrypto state such as initializing crypto // firmware/hardware, installing golden key box etc. in order to fuzz // OEMCrypto APIs. -class InitializeFuzz : public SessionUtil { +void InitializeFuzz(SessionUtil& session_util); + +class SessionFuzz { public: - InitializeFuzz() { - wvoec::global_features.Initialize(); - OEMCrypto_SetSandbox(kTestSandbox, sizeof(kTestSandbox)); - OEMCrypto_Initialize(); - OEMCrypto_EnterTestMode(); - EnsureTestROT(); + void Initialize(); + + void Terminate(); + + void InstallTestDrmKey() { + session_util_.InstallTestDrmKey(&session_); } - ~InitializeFuzz() { OEMCrypto_Terminate(); } + Session& session() { return session_; } + + const Session& session() const { return session_; } + + private: + SessionUtil session_util_; + Session session_; }; -class OEMCryptoLicenseAPIFuzz : public InitializeFuzz { +class OEMCryptoLicenseAPIFuzz { public: - OEMCryptoLicenseAPIFuzz() : license_messages_(&session_) { - session_.open(); - InstallTestDrmKey(&session_); - session_.GenerateNonce(); - } + OEMCryptoLicenseAPIFuzz() : license_messages_(&session_fuzz_.session()) {} - ~OEMCryptoLicenseAPIFuzz() { session_.close(); } + void Initialize(); + + void Terminate(); + + void LoadLicense() { LoadLicense(false); } + + void LoadLicenseWithGenericCryptoKeys() { LoadLicense(true); } LicenseRoundTrip& license_messages() { return license_messages_; } - Session* session() { return &session_; } + const LicenseRoundTrip& license_messages() const { return license_messages_; } - uint32_t session_id() { return session_.session_id(); } + Session& session() { return session_fuzz_.session(); } - void LoadLicense(); + const Session& session() const { return session_fuzz_.session(); } private: - Session session_; + void LoadLicense(bool generic_crypto_keys); + + SessionFuzz session_fuzz_; LicenseRoundTrip license_messages_; }; -class OEMCryptoProvisioningAPIFuzz : public InitializeFuzz { +class OEMCryptoProvisioningAPIFuzz { public: OEMCryptoProvisioningAPIFuzz() - : provisioning_messages_(&session_, encoded_rsa_key_) { - // Opens a session and Generates Nonce. - provisioning_messages_.PrepareSession(keybox_); - } + : provisioning_messages_(&session_, session_util_.encoded_rsa_key_) {} - ~OEMCryptoProvisioningAPIFuzz() { session_.close(); } + void Initialize(); + + void Terminate(); void LoadProvisioning(); + ProvisioningRoundTrip& provisioning_messages() { return provisioning_messages_; } - Session* session() { return &session_; } + + const ProvisioningRoundTrip& provisioning_messages() const { + return provisioning_messages_; + } + + Session& session() { return session_; } + + const Session& session() const { return session_; } private: + SessionUtil session_util_; Session session_; ProvisioningRoundTrip provisioning_messages_; }; // Initial setup to create a valid state such as creating session, installing // golden key box etc. in order to fuzz Load Renewal API. -class OEMCryptoRenewalAPIFuzz : public OEMCryptoLicenseAPIFuzz { +class OEMCryptoRenewalAPIFuzz { public: - OEMCryptoRenewalAPIFuzz() : renewal_messages_(&license_messages()) {} + OEMCryptoRenewalAPIFuzz() + : renewal_messages_(&license_api_fuzz_.license_messages()) {} + + void Initialize() { license_api_fuzz_.Initialize(); } + + void Terminate() { license_api_fuzz_.Terminate(); } + + LicenseRoundTrip& license_messages() { + return license_api_fuzz_.license_messages(); + } + + const LicenseRoundTrip& license_messages() const { + return license_api_fuzz_.license_messages(); + } RenewalRoundTrip& renewal_messages() { return renewal_messages_; } + const RenewalRoundTrip& renewal_messages() const { return renewal_messages_; } + private: + OEMCryptoLicenseAPIFuzz license_api_fuzz_; RenewalRoundTrip renewal_messages_; }; -class LicenseWithUsageEntryFuzz : public InitializeFuzz { +class LicenseWithUsageEntryFuzz { public: - LicenseWithUsageEntryFuzz() : license_messages_(&session_) { + LicenseWithUsageEntryFuzz() : license_messages_(&session_fuzz_.session()) { license_messages_.set_pst("my_pst"); } + void Initialize() { session_fuzz_.Initialize(); } + + void Terminate() { session_fuzz_.Terminate(); } + void CreateUsageTableHeader(); - LicenseRoundTrip& license_messages() { return license_messages_; } - const vector& encrypted_usage_header() { - return encrypted_usage_header_; - } + + void InstallTestDrmKey() { session_fuzz_.InstallTestDrmKey(); } + void LoadLicense(); + LicenseRoundTrip& license_messages() { return license_messages_; } + + const LicenseRoundTrip& license_messages() const { return license_messages_; } + + const std::vector& encrypted_usage_header() const { + return encrypted_usage_header_; + } + + Session& session() { return session_fuzz_.session(); } + + const Session& session() const { return session_fuzz_.session(); } + private: - vector encrypted_usage_header_; + SessionFuzz session_fuzz_; LicenseRoundTrip license_messages_; - Session session_; + std::vector encrypted_usage_header_; }; // Convert data from FuzzedDataProvider to valid enum value. template T ConvertDataToValidEnum(FuzzedDataProvider& fuzzed_data, T max_enum_value) { - return static_cast(fuzzed_data.ConsumeIntegralInRange( - 0, static_cast(max_enum_value))); + using UnsignedT = + typename std::make_unsigned::type>::type; + return static_cast(fuzzed_data.ConsumeIntegralInRange( + 0, static_cast(max_enum_value))); } // Convert data to valid enum value in place. template -void ConvertDataToValidEnum(T max_enum_value, T* t) { - FuzzedDataProvider fuzzed_enum_data(reinterpret_cast(t), sizeof(T)); - *t = ConvertDataToValidEnum(fuzzed_enum_data, max_enum_value); +void ConvertDataToValidEnum(T max_enum_value, T& enum_data) { + using UnsignedT = + typename std::make_unsigned::type>::type; + UnsignedT data; + std::memcpy(&data, &enum_data, sizeof(T)); + const auto max_value = static_cast(max_enum_value); + if (data > max_value) { + enum_data = static_cast(data % (max_value + 1)); + } } // Redirect printf and log statements from oemcrypto functions to a file to @@ -146,6 +208,7 @@ std::vector SplitFuzzedData(const uint8_t* data, size_t size); // called to check status of APIs which are called to setup state for fuzzers. void CheckStatusAndExitFuzzerOnFailure(OEMCryptoResult result, OEMCryptoResult expected_status); + } // namespace wvoec #endif // OEMCRYPTO_FUZZ_HELPER_H_ diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi b/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi index f8abdec..d4db950 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi +++ b/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gypi @@ -63,7 +63,7 @@ '-D_POSIX_C_SOURCE=200809L', ], 'cflags_cc': [ - '-std=c++11', + '-std=c++14', ], 'ldflags': [ '-fPIC', diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc new file mode 100644 index 0000000..f66353a --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generate_certificate_key_pair_fuzz.cc @@ -0,0 +1,95 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoProvisioningAPIFuzz& provisioning_api_fuzz = + *new wvoec::OEMCryptoProvisioningAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + provisioning_api_fuzz.Initialize(); + +#ifdef SECOND_STAGE + + const uint32_t session_id = provisioning_api_fuzz.session().session_id(); + + size_t public_key_length = 0; + size_t public_key_signature_length = 0; + size_t wrapped_private_key_length = 0; + OEMCrypto_PrivateKeyType key_type = OEMCrypto_RSA_Private_Key; + OEMCryptoResult result = OEMCrypto_GenerateCertificateKeyPair( + session_id, nullptr, &public_key_length, nullptr, + &public_key_signature_length, nullptr, &wrapped_private_key_length, + &key_type); + wvoec::CheckStatusAndExitFuzzerOnFailure(result, + OEMCrypto_ERROR_SHORT_BUFFER); + + std::vector public_key(public_key_length); + std::vector public_key_signature(public_key_signature_length); + std::vector wrapped_private_key(wrapped_private_key_length); + result = OEMCrypto_GenerateCertificateKeyPair( + session_id, public_key.data(), &public_key_length, + public_key_signature.data(), &public_key_signature_length, + wrapped_private_key.data(), &wrapped_private_key_length, &key_type); + wvoec::CheckStatusAndExitFuzzerOnFailure(result, OEMCrypto_SUCCESS); + + result = OEMCrypto_InstallOemPrivateKey(session_id, key_type, + wrapped_private_key.data(), + wrapped_private_key_length); + wvoec::CheckStatusAndExitFuzzerOnFailure(result, OEMCrypto_SUCCESS); + +#endif + + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // public_key and public_key_length parameters + size_t public_key_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector public_key(public_key_length_data); + size_t* const public_key_length = + fuzzed_data.ConsumeBool() ? &public_key_length_data : nullptr; + + // public_key_signature and public_key_signature_length parameters + size_t public_key_signature_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector public_key_signature(public_key_signature_length_data); + size_t* const public_key_signature_length = + fuzzed_data.ConsumeBool() ? &public_key_signature_length_data : nullptr; + + // wrapped_private_key and wrapped_private_key_length parameters + size_t wrapped_private_key_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector wrapped_private_key(wrapped_private_key_length_data); + size_t* const wrapped_private_key_length = + fuzzed_data.ConsumeBool() ? &wrapped_private_key_length_data : nullptr; + + // key_type parameter + OEMCrypto_PrivateKeyType key_type_data; + OEMCrypto_PrivateKeyType* const key_type = + fuzzed_data.ConsumeBool() ? &key_type_data : nullptr; + + OEMCrypto_GenerateCertificateKeyPair( + provisioning_api_fuzz.session().session_id(), public_key.data(), + public_key_length, public_key_signature.data(), + public_key_signature_length, wrapped_private_key.data(), + wrapped_private_key_length, key_type); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc index 39aa72c..f30eed8 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generate_rsa_signature_fuzz.cc @@ -2,36 +2,35 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" - -namespace wvoec { +#include "oemcrypto_fuzz_structs.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); - OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; if (size < sizeof(fuzzed_structure)) { return 0; } FuzzedDataProvider fuzzed_data(data, size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + fuzzed_structure.signature_length %= wvoec::MAX_FUZZ_OUTPUT_LENGTH + 1; const std::vector message = fuzzed_data.ConsumeRemainingBytes(); - - // Creates wrapped rsa key and calls load drm private key. - static OEMCryptoLicenseAPIFuzz license_api_fuzz; - // We cannot allocate buffers of random huge lengths in memory. - // This also slows down the fuzzer. - fuzzed_structure.signature_length %= MAX_FUZZ_OUTPUT_LENGTH + 1; std::vector signature(fuzzed_structure.signature_length); + + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); + session_fuzz.InstallTestDrmKey(); OEMCrypto_GenerateRSASignature( - license_api_fuzz.session()->session_id(), message.data(), message.size(), + session_fuzz.session().session_id(), message.data(), message.size(), signature.data(), &fuzzed_structure.signature_length, fuzzed_structure.padding_scheme); + session_fuzz.Terminate(); + return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc deleted file mode 100644 index 6531457..0000000 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generate_signature.cc +++ /dev/null @@ -1,37 +0,0 @@ -#include "properties.h" -#include "oemcrypto_session_tests_helper.h" - -using namespace wvoec; - -static bool is_init = false; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - SessionUtil session_helper; - if (!is_init) { - wvoec::global_features.Initialize(); - wvoec::global_features.RestrictFilter("*"); - wvutil::Properties::Init(); - is_init = true; - } - - OEMCrypto_Initialize(); - OEMCrypto_EnterTestMode(); - session_helper.EnsureTestROT(); - - Session s; - s.open(); - s.GenerateDerivedKeysFromKeybox(session_helper.keybox_); - - static const uint32_t SignatureBufferMaxLength = size; - vector signature(SignatureBufferMaxLength); - size_t signature_length = signature.size(); - - OEMCryptoResult sts; - sts = OEMCrypto_GenerateSignature(s.session_id(), data, size, - &signature[0], &signature_length); - - s.close(); - OEMCrypto_Terminate(); - - return 0; -} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc index 1bf5570..a38cf8b 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_decrypt_fuzz.cc @@ -2,58 +2,67 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" -#include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - // Split data using separator. - const std::vector inputs = SplitFuzzedData(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 2) { return 0; } - OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; if (inputs[0].size < sizeof(fuzzed_structure)) { return 0; } // Copy OEMCrypto_Generic_Api_Fuzz from input data. FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); // Copy iv from input data. - const std::vector iv = fuzzed_data.ConsumeRemainingBytes(); + constexpr size_t iv_length = 16; + const std::vector iv = fuzzed_data.ConsumeBytes( + fuzzed_data.remaining_bytes() < iv_length ? 0 : iv_length); // Initialize encrypted and clear buffers. const std::vector encrypted_buffer(inputs[1].data, inputs[1].data + inputs[1].size); std::vector clear_buffer(encrypted_buffer.size()); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_decrypt API. - license_api_fuzz.LoadLicense(); - vector key_handle; - GetKeyHandleIntoVector(session->session_id(), - session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_structure.cipher_mode, key_handle); + // Select key and decrypt. + wvoec::Session& session = license_api_fuzz.session(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session.session_id(), + session.license().keys[1].key_id, + session.license().keys[1].key_id_length, + fuzzed_structure.cipher_mode, key_handle); OEMCrypto_Generic_Decrypt(key_handle.data(), key_handle.size(), encrypted_buffer.data(), encrypted_buffer.size(), iv.data(), fuzzed_structure.algorithm, clear_buffer.data()); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc index 0c9c8fa..e40c2bb 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_encrypt_fuzz.cc @@ -2,58 +2,67 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" -#include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - // Split data using separator. - const std::vector inputs = SplitFuzzedData(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 2) { return 0; } - OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; if (inputs[0].size < sizeof(fuzzed_structure)) { return 0; } // Copy OEMCrypto_Generic_Api_Fuzz from input data. FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); // Copy iv from input data. - const std::vector iv = fuzzed_data.ConsumeRemainingBytes(); + constexpr size_t iv_length = 16; + const std::vector iv = fuzzed_data.ConsumeBytes( + fuzzed_data.remaining_bytes() < iv_length ? 0 : iv_length); // Initialize clear and encrypted buffers. const std::vector clear_buffer(inputs[1].data, inputs[1].data + inputs[1].size); std::vector encrypted_buffer(clear_buffer.size()); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_encrypt API. - license_api_fuzz.LoadLicense(); - vector key_handle; - GetKeyHandleIntoVector(session->session_id(), - session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_structure.cipher_mode, key_handle); + // Select key and encrypt. + wvoec::Session& session = license_api_fuzz.session(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session.session_id(), + session.license().keys[0].key_id, + session.license().keys[0].key_id_length, + fuzzed_structure.cipher_mode, key_handle); OEMCrypto_Generic_Encrypt(key_handle.data(), key_handle.size(), clear_buffer.data(), clear_buffer.size(), iv.data(), fuzzed_structure.algorithm, encrypted_buffer.data()); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc index 103668e..a01b3bb 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_sign_fuzz.cc @@ -2,44 +2,51 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" -#include "log.h" -#include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); + return 0; +} + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - - OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; if (size < sizeof(fuzzed_structure)) { return 0; } // Copy OEMCrypto_Generic_Api_Fuzz from input data. FuzzedDataProvider fuzzed_data(data, size); fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_structure.algorithm); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); // Copy clear buffer from input data. const std::vector clear_buffer = fuzzed_data.ConsumeRemainingBytes(); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - Session* session = license_api_fuzz.session(); - // Load license and call generic_sign API. - license_api_fuzz.LoadLicense(); - vector key_handle; - GetKeyHandleIntoVector(session->session_id(), - session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_structure.cipher_mode, key_handle); + // Select key and sign. + wvoec::Session& session = license_api_fuzz.session(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session.session_id(), + session.license().keys[2].key_id, + session.license().keys[2].key_id_length, + fuzzed_structure.cipher_mode, key_handle); size_t signature_length = 0; OEMCrypto_Generic_Sign(key_handle.data(), key_handle.size(), clear_buffer.data(), clear_buffer.size(), @@ -52,4 +59,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { &signature_length); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc index 23f598d..a7698fc 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_generic_verify_fuzz.cc @@ -2,135 +2,62 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oec_session_util.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -#include "oemcrypto_types.h" -namespace wvoec { +namespace { -// Properties deserialized from fuzzed data. -struct FuzzedProperties { - OEMCrypto_Generic_Api_Fuzz structure; - std::vector buffer; - std::vector signature; -}; +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; -// Contains value only if has_value is true. -struct OptionalFuzzedProperties { - FuzzedProperties value; - bool has_value; -}; - -OEMCryptoLicenseAPIFuzz license_api_fuzz; - -OptionalFuzzedProperties DeserializeFuzzedData(const uint8_t* data, - size_t size) { - OptionalFuzzedProperties fuzzed_properties; - const std::vector inputs = SplitFuzzedData(data, size); - if (inputs.size() < 2 || - inputs[0].size < sizeof(fuzzed_properties.value.structure)) { - fuzzed_properties.has_value = false; - return fuzzed_properties; - } - FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); - fuzzed_data.ConsumeData(&fuzzed_properties.value.structure, - sizeof(fuzzed_properties.value.structure)); - ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, - &fuzzed_properties.value.structure.cipher_mode); - ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, - &fuzzed_properties.value.structure.algorithm); - fuzzed_properties.value.buffer = fuzzed_data.ConsumeRemainingBytes(); - fuzzed_properties.value.signature.assign(inputs[1].data, - inputs[1].data + inputs[1].size); - fuzzed_properties.has_value = true; - return fuzzed_properties; -} +} // namespace extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { - RedirectStdoutToFile(); - license_api_fuzz.LoadLicense(); + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicenseWithGenericCryptoKeys(); return 0; } -extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, - size_t max_size, unsigned int seed) { - // Deserialize fuzzed data. - OptionalFuzzedProperties fuzzed_properties = - DeserializeFuzzedData(data, size); - if (!fuzzed_properties.has_value) { - return 0; - } - - // Get key handle for signing and verifying. - Session* const session = license_api_fuzz.session(); - vector key_handle; - OEMCryptoResult result = GetKeyHandleIntoVector( - session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_properties.value.structure.cipher_mode, key_handle); - if (result == OEMCrypto_SUCCESS) { - // Generate a new signature if verification fails. - result = - OEMCrypto_Generic_Verify(key_handle.data(), key_handle.size(), - fuzzed_properties.value.buffer.data(), - fuzzed_properties.value.buffer.size(), - fuzzed_properties.value.structure.algorithm, - fuzzed_properties.value.signature.data(), - fuzzed_properties.value.signature.size()); - if (result != OEMCrypto_SUCCESS) { - size_t signature_length = 0; - OEMCrypto_Generic_Sign(key_handle.data(), key_handle.size(), - fuzzed_properties.value.buffer.data(), - fuzzed_properties.value.buffer.size(), - fuzzed_properties.value.structure.algorithm, - nullptr, &signature_length); - fuzzed_properties.value.signature.resize(signature_length); - OEMCrypto_Generic_Sign(key_handle.data(), key_handle.size(), - fuzzed_properties.value.buffer.data(), - fuzzed_properties.value.buffer.size(), - fuzzed_properties.value.structure.algorithm, - fuzzed_properties.value.signature.data(), - &signature_length); - const size_t signature_offset = - sizeof(fuzzed_properties.value.structure) + - fuzzed_properties.value.buffer.size() + sizeof(kFuzzDataSeparator); - size = signature_offset + signature_length; - if (size > max_size) { - return 0; - } - memcpy(data + signature_offset, fuzzed_properties.value.signature.data(), - signature_length); - } - } - - return LLVMFuzzerMutate(data, size, max_size); -} - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Deserialize fuzzed data. - const OptionalFuzzedProperties fuzzed_properties = - DeserializeFuzzedData(data, size); - if (!fuzzed_properties.has_value) { + // Split data using separator. + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); + if (inputs.size() < 2) { return 0; } - // Select key and perform verification. - Session* const session = license_api_fuzz.session(); - vector key_handle; - GetKeyHandleIntoVector( - session->session_id(), session->license().keys[0].key_id, - session->license().keys[0].key_id_length, - fuzzed_properties.value.structure.cipher_mode, key_handle); - OEMCrypto_Generic_Verify(key_handle.data(), key_handle.size(), - fuzzed_properties.value.buffer.data(), - fuzzed_properties.value.buffer.size(), - fuzzed_properties.value.structure.algorithm, - fuzzed_properties.value.signature.data(), - fuzzed_properties.value.signature.size()); + // Deserialize fuzzed data. + wvoec::OEMCrypto_Generic_Api_Fuzz fuzzed_structure; + if (inputs[0].size < sizeof(fuzzed_structure)) { + return 0; + } + FuzzedDataProvider fuzzed_data(inputs[0].data, inputs[0].size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + wvoec::ConvertDataToValidEnum(OEMCrypto_CipherMode_MaxValue, + fuzzed_structure.cipher_mode); + wvoec::ConvertDataToValidEnum(OEMCrypto_Algorithm_MaxValue, + fuzzed_structure.algorithm); + const std::vector buffer = + fuzzed_data.ConsumeRemainingBytes(); + const std::vector signature(inputs[1].data, + inputs[1].data + inputs[1].size); + + // Select key and verify. + wvoec::Session& session = license_api_fuzz.session(); + std::vector key_handle; + wvoec::GetKeyHandleIntoVector(session.session_id(), + session.license().keys[3].key_id, + session.license().keys[3].key_id_length, + fuzzed_structure.cipher_mode, key_handle); + OEMCrypto_Generic_Verify(key_handle.data(), key_handle.size(), buffer.data(), + buffer.size(), fuzzed_structure.algorithm, + signature.data(), signature.size()); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc new file mode 100644 index 0000000..ea71f8a --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_boot_certificate_chain_fuzz.cc @@ -0,0 +1,41 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // bcc and bcc_length parameters + size_t bcc_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector bcc(bcc_length_data); + size_t* const bcc_length = + fuzzed_data.ConsumeBool() ? &bcc_length_data : nullptr; + + // additional_signature and additional_signature_length parameters + size_t additional_signature_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector additional_signature(additional_signature_length_data); + size_t* const additional_signature_length = + fuzzed_data.ConsumeBool() ? &additional_signature_length_data : nullptr; + + OEMCrypto_GetBootCertificateChain(bcc.data(), bcc_length, + additional_signature.data(), + additional_signature_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_device_information_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_device_information_fuzz.cc new file mode 100644 index 0000000..191fe38 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_device_information_fuzz.cc @@ -0,0 +1,31 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // device_info and device_info_length parameters + size_t device_info_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector device_info(device_info_length_data); + size_t* const device_info_length = + fuzzed_data.ConsumeBool() ? &device_info_length_data : nullptr; + + OEMCrypto_GetDeviceInformation(device_info.data(), device_info_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_device_signed_csr_payload_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_device_signed_csr_payload_fuzz.cc new file mode 100644 index 0000000..b30fa60 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_device_signed_csr_payload_fuzz.cc @@ -0,0 +1,50 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Split data using separator. + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); + if (inputs.size() < 3) { + return 0; + } + + const std::vector challenge(inputs[0].data, + inputs[0].data + inputs[0].size); + + const std::vector encoded_device_info( + inputs[1].data, inputs[1].data + inputs[1].size); + + // signed_csr_payload and signed_csr_payload_length parameters + FuzzedDataProvider signed_csr_payload_fuzzed_data(inputs[2].data, + inputs[2].size); + size_t signed_csr_payload_length_data = + signed_csr_payload_fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector signed_csr_payload(signed_csr_payload_length_data); + size_t* const signed_csr_payload_length = + signed_csr_payload_fuzzed_data.ConsumeBool() + ? &signed_csr_payload_length_data + : nullptr; + + OEMCrypto_GetDeviceSignedCsrPayload( + challenge.data(), challenge.size(), encoded_device_info.data(), + encoded_device_info.size(), signed_csr_payload.data(), + signed_csr_payload_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_key_handle_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_key_handle_fuzz.cc new file mode 100644 index 0000000..9d70470 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_key_handle_fuzz.cc @@ -0,0 +1,47 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicense(); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + const OEMCryptoCipherMode cipher_mode = + wvoec::ConvertDataToValidEnum(fuzzed_data, OEMCrypto_CipherMode_MaxValue); + + // key_handle and key_handle_length parameters + size_t key_handle_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector key_handle(key_handle_length_data); + size_t* const key_handle_length = + fuzzed_data.ConsumeBool() ? &key_handle_length_data : nullptr; + + const std::vector content_key_id = + fuzzed_data.ConsumeRemainingBytes(); + + OEMCrypto_GetKeyHandle(license_api_fuzz.session().session_id(), + content_key_id.data(), content_key_id.size(), + cipher_mode, key_handle.data(), key_handle_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc new file mode 100644 index 0000000..e81f956 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_get_random_fuzz.cc @@ -0,0 +1,24 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + wvoec::SessionUtil session_util; + wvoec::InitializeFuzz(session_util); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + std::vector random_data( + FuzzedDataProvider(data, size) + .ConsumeIntegralInRange(0, wvoec::MAX_FUZZ_OUTPUT_LENGTH)); + OEMCrypto_GetRandom(random_data.data(), random_data.size()); + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc index dcd3c05..310999c 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_install_oem_private_key_fuzz.cc @@ -6,36 +6,20 @@ #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); - if (size < sizeof(OEMCrypto_PrivateKeyType)) { - return 0; - } - - LicenseWithUsageEntryFuzz entry; - entry.CreateUsageTableHeader(); - // Open a session, create a usage entry. - Session* session = entry.license_messages().session(); - session->open(); - entry.InstallTestDrmKey(session); - session->GenerateNonce(); - session->CreateNewUsageEntry(); - std::vector encrypted_usage_header; - session->UpdateUsageEntry(&encrypted_usage_header); + wvoec::SessionFuzz session_fuzz; + session_fuzz.Initialize(); FuzzedDataProvider fuzzed_data(data, size); - const OEMCrypto_PrivateKeyType key_type = - ConvertDataToValidEnum(fuzzed_data, OEMCrypto_PrivateKeyType_MaxValue); + const OEMCrypto_PrivateKeyType key_type = wvoec::ConvertDataToValidEnum( + fuzzed_data, OEMCrypto_PrivateKeyType_MaxValue); const std::vector wrapped_private_key = fuzzed_data.ConsumeRemainingBytes(); - OEMCrypto_InstallOemPrivateKey(session->session_id(), key_type, + OEMCrypto_InstallOemPrivateKey(session_fuzz.session().session_id(), key_type, wrapped_private_key.data(), wrapped_private_key.size()); - session->close(); + session_fuzz.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc index 52d3493..a0e5342 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_license_request_fuzz.cc @@ -2,27 +2,26 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); + // Reject the input if it is less than fuzz data structure size. - if (size < sizeof(OEMCrypto_Request_Fuzz)) { + if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) { return 0; } // Input for license request API will be modified by OEMCrypto, hence it // cannot be a const. Fuzzer complains if const identifier is removed of data, // hence copying data into a non const pointer. - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - OEMCryptoLicenseAPIFuzz license_api_fuzz; - license_api_fuzz.license_messages().InjectFuzzedRequestData(input, size); - delete[] input; + std::vector input(data, data + size); + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); + license_api_fuzz.license_messages().InjectFuzzedRequestData(input.data(), + input.size()); + license_api_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc index fcc53a0..f0a9b45 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_entitled_content_keys_fuzz.cc @@ -2,20 +2,20 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + +#include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); // Corpus format is as below, let | be separator. // message buffer with key data | entitled content key object array with // offsets and lengths to read key data from message buffer. // Split data using separator. - const std::vector inputs = SplitFuzzedData(data, size); + const std::vector inputs = + wvoec::SplitFuzzedData(data, size); if (inputs.size() < 2) { return 0; } @@ -29,19 +29,28 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { sizeof(OEMCrypto_EntitledContentKeyObject)); } - OEMCryptoLicenseAPIFuzz license_api_fuzz; + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); + // Setting up state. Load default entitlement license to load entitlement // keys into sessions key table. license_api_fuzz.license_messages().set_license_type( OEMCrypto_EntitlementLicense); license_api_fuzz.LoadLicense(); + + // Create entitled key session. + OEMCrypto_SESSION key_session; + const OEMCryptoResult result = OEMCrypto_CreateEntitledKeySession( + license_api_fuzz.session().session_id(), &key_session); + wvoec::CheckStatusAndExitFuzzerOnFailure(result, OEMCrypto_SUCCESS); + // Call OEMCrypto_LoadEntitledContentKeys with fuzzed buffers. const std::vector message(inputs[0].data, inputs[0].data + inputs[0].size); - OEMCrypto_LoadEntitledContentKeys( - license_api_fuzz.session()->session_id(), message.data(), message.size(), - entitled_content_keys.size(), entitled_content_keys.data()); + OEMCrypto_LoadEntitledContentKeys(key_session, message.data(), message.size(), + entitled_content_keys.size(), + entitled_content_keys.data()); + + license_api_fuzz.Terminate(); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc index 64f5f4b..3dc3b07 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_license_fuzz.cc @@ -4,27 +4,26 @@ #include "oemcrypto_fuzz_helper.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - if (size < sizeof(ODK_ParsedLicense) + sizeof(MessageData)) { + wvoec::RedirectStdoutToFile(); + + if (size < sizeof(ODK_Packing_ParsedLicense) + sizeof(wvoec::MessageData)) { return 0; } - OEMCryptoLicenseAPIFuzz license_api_fuzz; + wvoec::OEMCryptoLicenseAPIFuzz license_api_fuzz; + license_api_fuzz.Initialize(); license_api_fuzz.license_messages().SignAndVerifyRequest(); - // Interpreting input fuzz data as unencrypted (core_response + license - // message data) from license server. + // Interpreting input fuzz data as unencrypted core_response + response_data + + // key_array from license server. license_api_fuzz.license_messages().InjectFuzzedResponseData(data, size); // Convert OEMCrypto_LicenseType in core_response to a valid enum value. - ConvertDataToValidEnum( + wvoec::ConvertDataToValidEnum( OEMCrypto_LicenseType_MaxValue, - &license_api_fuzz.license_messages().core_response().license_type); + license_api_fuzz.license_messages().core_response().license_type); license_api_fuzz.license_messages().EncryptAndSignResponse(); license_api_fuzz.license_messages().LoadResponse(); + license_api_fuzz.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc index 757ab24..bda7ce3 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_provisioning_fuzz.cc @@ -4,17 +4,16 @@ #include "oemcrypto_fuzz_helper.h" -namespace wvoec { - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - if (size < sizeof(ODK_ParsedProvisioning) + sizeof(RSAPrivateKeyMessage)) { + wvoec::RedirectStdoutToFile(); + + if (size < + sizeof(ODK_ParsedProvisioning) + sizeof(wvoec::RSAPrivateKeyMessage)) { return 0; } - OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; + wvoec::OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; + provisioning_api_fuzz.Initialize(); provisioning_api_fuzz.provisioning_messages().SignAndVerifyRequest(); // Interpreting input fuzz data as unencrypted(core_response + provisioning // message data) from provisioning server. @@ -22,6 +21,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { size); provisioning_api_fuzz.provisioning_messages().EncryptAndSignResponse(); provisioning_api_fuzz.provisioning_messages().LoadResponse(); + provisioning_api_fuzz.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc index 1b6ecfc..8957ee0 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_renewal_fuzz.cc @@ -2,41 +2,41 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include "FuzzedDataProvider.h" #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - if (size < sizeof(OEMCrypto_Renewal_Response_Fuzz)) { - return 0; - } + wvoec::RedirectStdoutToFile(); + // Copy input data to OEMCrypto_Renewal_Response_Fuzz and rest of message // into encrypted license_renewal_response. - OEMCrypto_Renewal_Response_Fuzz fuzzed_data; - memcpy(&fuzzed_data, data, sizeof(fuzzed_data)); - const uint8_t* renewal_response = - data + sizeof(OEMCrypto_Renewal_Response_Fuzz); - const size_t renewal_response_size = - size - sizeof(OEMCrypto_Renewal_Response_Fuzz); + wvoec::OEMCrypto_Renewal_Response_Fuzz fuzzed_structure; + if (size < sizeof(fuzzed_structure)) { + return 0; + } + FuzzedDataProvider fuzzed_data(data, size); + fuzzed_data.ConsumeData(&fuzzed_structure, sizeof(fuzzed_structure)); + const std::vector renewal_response = + fuzzed_data.ConsumeRemainingBytes(); - OEMCryptoRenewalAPIFuzz renewal_response_fuzz; + wvoec::OEMCryptoRenewalAPIFuzz renewal_response_fuzz; + renewal_response_fuzz.Initialize(); renewal_response_fuzz.license_messages().SignAndVerifyRequest(); renewal_response_fuzz.license_messages().CreateDefaultResponse(); + // Inject timer limits from fuzzed input to timer_limits field from // core license response. - renewal_response_fuzz.license_messages().InjectFuzzedTimerLimits(fuzzed_data); + renewal_response_fuzz.license_messages().InjectFuzzedTimerLimits( + fuzzed_structure); renewal_response_fuzz.license_messages().EncryptAndSignResponse(); renewal_response_fuzz.license_messages().LoadResponse(); // Call renewal response API using fuzzed data. renewal_response_fuzz.renewal_messages().SignAndVerifyRequest(); renewal_response_fuzz.renewal_messages().InjectFuzzedResponseData( - fuzzed_data, renewal_response, renewal_response_size); + fuzzed_structure, renewal_response.data(), renewal_response.size()); renewal_response_fuzz.renewal_messages().LoadResponse(); + renewal_response_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc index 17c5150..d39ef00 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_entry_fuzz.cc @@ -2,42 +2,49 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. -#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { +namespace { + +// Avoid calling non-trivial destructor. +wvoec::LicenseWithUsageEntryFuzz& entry = *new wvoec::LicenseWithUsageEntryFuzz; OEMCryptoResult LoadUsageEntryWithFuzzedData(OEMCrypto_SESSION session, const uint8_t* data, size_t size) { - if (size < sizeof(uint32_t)) { + uint32_t usage_entry_number; + if (size < sizeof(usage_entry_number)) { return OEMCrypto_ERROR_SHORT_BUFFER; } - - FuzzedDataProvider fuzzed_data(data, size); - const uint32_t usage_entry_number = fuzzed_data.ConsumeIntegral(); - const std::vector buffer = - fuzzed_data.ConsumeRemainingBytes(); + memcpy(&usage_entry_number, data, sizeof(usage_entry_number)); + const std::vector buffer(data + sizeof(usage_entry_number), + data + size); return OEMCrypto_LoadUsageEntry(session, usage_entry_number, buffer.data(), buffer.size()); } +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + entry.Initialize(); + return 0; +} + // The custom mutator to mutate created encrypted usage entry. extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, size_t max_size, unsigned int seed) { - LicenseWithUsageEntryFuzz entry; entry.CreateUsageTableHeader(); - Session* s = entry.license_messages().session(); - s->open(); - entry.InstallTestDrmKey(s); - if (LoadUsageEntryWithFuzzedData(s->session_id(), data, size) != + entry.session().open(); + entry.InstallTestDrmKey(); + if (LoadUsageEntryWithFuzzedData(entry.session().session_id(), data, size) != OEMCrypto_SUCCESS) { - s->CreateNewUsageEntry(); + entry.session().CreateNewUsageEntry(); std::vector encrypted_usage_header; - s->UpdateUsageEntry(&encrypted_usage_header); - const uint32_t usage_entry_number = s->usage_entry_number(); + entry.session().UpdateUsageEntry(&encrypted_usage_header); + const uint32_t usage_entry_number = entry.session().usage_entry_number(); const std::vector& encrypted_usage_entry = - s->encrypted_usage_entry(); + entry.session().encrypted_usage_entry(); size = sizeof(usage_entry_number) + encrypted_usage_entry.size(); if (size > max_size) { return 0; @@ -47,20 +54,13 @@ extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, memcpy(data + sizeof(usage_entry_number), encrypted_usage_entry.data(), encrypted_usage_entry.size()); } - s->close(); + entry.session().close(); return LLVMFuzzerMutate(data, size, max_size); } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - - Session s; - s.open(); - LoadUsageEntryWithFuzzedData(s.session_id(), data, size); - s.close(); + entry.session().open(); + LoadUsageEntryWithFuzzedData(entry.session().session_id(), data, size); + entry.session().close(); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc index 19c699a..ebf92fa 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_load_usage_table_header_fuzz.cc @@ -5,12 +5,11 @@ #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { - // The custom mutator to mutate created encrypted usage table header. extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, size_t max_size, unsigned int seed) { - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); if (OEMCrypto_LoadUsageTableHeader(data, size) != OEMCrypto_SUCCESS) { entry.CreateUsageTableHeader(); size = entry.encrypted_usage_header().size(); @@ -21,17 +20,17 @@ extern "C" size_t LLVMFuzzerCustomMutator(uint8_t* data, size_t size, memcpy(data, entry.encrypted_usage_header().data(), entry.encrypted_usage_header().size()); } + entry.Terminate(); return LLVMFuzzerMutate(data, size, max_size); } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); + // Initialize OEMCrypto and call API. - InitializeFuzz initialize_fuzz; + wvoec::SessionUtil session_util; + InitializeFuzz(session_util); OEMCrypto_LoadUsageTableHeader(data, size); + OEMCrypto_Terminate(); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc index 10c2d30..0c65ed0 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_move_usage_entry_fuzz.cc @@ -2,32 +2,28 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { -LicenseWithUsageEntryFuzz entry; extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - - uint32_t usage_entry_number = 0; - if (size < sizeof(usage_entry_number)) { - return 0; - } + wvoec::RedirectStdoutToFile(); + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - Session* s = entry.license_messages().session(); - s->open(); - entry.InstallTestDrmKey(s); - memcpy(&usage_entry_number, data, sizeof(uint32_t)); - s->CreateNewUsageEntry(); - vector encrypted_usage_header; - s->UpdateUsageEntry(&encrypted_usage_header); - OEMCrypto_MoveEntry(s->session_id(), usage_entry_number); - s ->close(); + entry.InstallTestDrmKey(); + entry.session().CreateNewUsageEntry(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); + entry.session().close(); + entry.session().open(); + entry.session().ReloadUsageEntry(); + OEMCrypto_MoveEntry( + entry.session().session_id(), + FuzzedDataProvider(data, size).ConsumeIntegral()); + + entry.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc index 537e90e..231cf40 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_opk_dispatcher_fuzz.cc @@ -3,7 +3,7 @@ #include "opk_dispatcher.h" #include "opk_init.h" -namespace wvoec { +namespace { void OpenOEMCryptoTASession() { uint8_t request_body[] = { @@ -35,6 +35,8 @@ void InitializeOEMCryptoTA() { OPK_DispatchMessage(&request, &response); } +} // namespace + extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { OPK_Initialize(); InitializeOEMCryptoTA(); @@ -51,5 +53,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { OPK_DispatchMessage(&request, &response); return 0; } - -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp index b5a73a1..f5ac011 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp +++ b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gyp @@ -16,114 +16,36 @@ }, 'targets': [ { - 'target_name': 'oemcrypto_opk_load_license_fuzz', - 'sources': [ - 'oemcrypto_load_license_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_provisioning_fuzz', - 'sources': [ - 'oemcrypto_load_provisioning_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_renewal_fuzz', - 'sources': [ - 'oemcrypto_load_renewal_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_license_request_fuzz', - 'sources': [ - 'oemcrypto_license_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_provisioning_request_fuzz', - 'sources': [ - 'oemcrypto_provisioning_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_renewal_request_fuzz', - 'sources': [ - 'oemcrypto_renewal_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_decrypt_cenc_fuzz', - 'sources': [ - 'oemcrypto_decrypt_cenc_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_entitled_content_keys_fuzz', - 'sources': [ - 'oemcrypto_load_entitled_content_keys_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_encrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_encrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_decrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_decrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_sign_fuzz', - 'sources': [ - 'oemcrypto_generic_sign_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generic_verify_fuzz', - 'sources': [ - 'oemcrypto_generic_verify_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_generate_rsa_signature_fuzz', - 'sources': [ - 'oemcrypto_generate_rsa_signature_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_usage_table_header_fuzz', - 'sources': [ - 'oemcrypto_load_usage_table_header_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_load_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_load_usage_entry_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_deactivate_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_deactivate_usage_entry_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_opk_report_usage_fuzz', - 'sources': [ - 'oemcrypto_report_usage_fuzz.cc', - ], - }, - { 'target_name': 'oemcrypto_opk_copy_buffer_fuzz', 'sources': [ 'oemcrypto_copy_buffer_fuzz.cc', ], - }, - { + }, + { + 'target_name': 'oemcrypto_opk_create_and_remove_entitled_key_session_fuzz', + 'sources': [ + 'oemcrypto_create_and_remove_entitled_key_session_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_deactivate_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_deactivate_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_decrypt_cenc_fuzz', + 'sources': [ + 'oemcrypto_decrypt_cenc_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_decrypt_hash_fuzz', + 'sources': [ + 'oemcrypto_decrypt_hash_fuzz.cc', + ], + }, + { 'target_name': 'oemcrypto_opk_dispatcher_fuzz', 'include_dirs': [ '<(oemcrypto_dir)/opk/serialization/common', @@ -144,5 +66,170 @@ '<(oemcrypto_dir)/opk/ports/trusty/serialization_adapter/shared_memory.c', ], }, + { + 'target_name': 'oemcrypto_opk_generate_certificate_key_pair_first_stage_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generate_certificate_key_pair_second_stage_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + 'defines': [ + 'SECOND_STAGE', + ], + }, + { + 'target_name': 'oemcrypto_opk_generate_rsa_signature_fuzz', + 'sources': [ + 'oemcrypto_generate_rsa_signature_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_decrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_decrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_encrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_encrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_sign_fuzz', + 'sources': [ + 'oemcrypto_generic_sign_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_generic_verify_fuzz', + 'sources': [ + 'oemcrypto_generic_verify_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_boot_certificate_chain_fuzz', + 'sources': [ + 'oemcrypto_get_boot_certificate_chain_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_device_information_fuzz', + 'sources': [ + 'oemcrypto_get_device_information_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_device_signed_csr_payload_fuzz', + 'sources': [ + 'oemcrypto_get_device_signed_csr_payload_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_key_handle_fuzz', + 'sources': [ + 'oemcrypto_get_key_handle_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_get_random_fuzz', + 'sources': [ + 'oemcrypto_get_random_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_install_oem_private_key_fuzz', + 'sources': [ + 'oemcrypto_install_oem_private_key_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_license_request_fuzz', + 'sources': [ + 'oemcrypto_license_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_entitled_content_keys_fuzz', + 'sources': [ + 'oemcrypto_load_entitled_content_keys_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_license_fuzz', + 'sources': [ + 'oemcrypto_load_license_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_provisioning_fuzz', + 'sources': [ + 'oemcrypto_load_provisioning_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_renewal_fuzz', + 'sources': [ + 'oemcrypto_load_renewal_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_load_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_load_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_load_usage_table_header_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_move_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_move_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_provisioning_request_fuzz', + 'sources': [ + 'oemcrypto_provisioning_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_query_key_control_fuzz', + 'sources': [ + 'oemcrypto_query_key_control_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_renewal_request_fuzz', + 'sources': [ + 'oemcrypto_renewal_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_report_usage_fuzz', + 'sources': [ + 'oemcrypto_report_usage_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_reuse_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_reuse_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_opk_shrink_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_shrink_usage_table_header_fuzz.cc', + ], + }, ], } diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi index 5c99ee4..4e7efc7 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi +++ b/oemcrypto/test/fuzz_tests/oemcrypto_opk_fuzztests.gypi @@ -27,12 +27,12 @@ '-g3', ], 'cflags_c': [ - '-std=c99', + '-std=c11', '-D_POSIX_C_SOURCE=200809L', ], 'cflags_cc' : [ '-frtti', - '-std=c++11', + '-std=c++14', ], 'ldflags': [ '-fPIC', @@ -53,6 +53,7 @@ 'OPK_CONFIG_TEE_OS_VERSION=0.0.0', 'OPK_CONFIG_DEVICE_FORM_FACTOR=oemcrypto_opk_fuzztests', 'OPK_CONFIG_IMPLEMENTER_NAME=Widevine', + 'FACTORY_BUILD_ONLY', ], 'conditions': [ ['generate_code_coverage_report=="true"', { diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc index b66aab6..7e709f6 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_provisioning_request_fuzz.cc @@ -2,27 +2,26 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); + // If input size is less than fuzz data structure size, reject the input. - if (size < sizeof(OEMCrypto_Request_Fuzz)) { + if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) { return 0; } // Input for provisioning request API will be modified by OEMCrypto, hence it // cannot be a const. Fuzzer complains if const identifier is removed of data, // hence copying data into a non const pointer. - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; - provisioning_api_fuzz.provisioning_messages().InjectFuzzedRequestData(input, - size); - delete[] input; + std::vector input(data, data + size); + wvoec::OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz; + provisioning_api_fuzz.Initialize(); + provisioning_api_fuzz.provisioning_messages().InjectFuzzedRequestData( + input.data(), input.size()); + provisioning_api_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc new file mode 100644 index 0000000..fb97187 --- /dev/null +++ b/oemcrypto/test/fuzz_tests/oemcrypto_query_key_control_fuzz.cc @@ -0,0 +1,43 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. + +#include "FuzzedDataProvider.h" +#include "OEMCryptoCENC.h" +#include "oemcrypto_fuzz_helper.h" + +namespace { + +// Avoid calling non-trivial destructor. +wvoec::OEMCryptoLicenseAPIFuzz& license_api_fuzz = + *new wvoec::OEMCryptoLicenseAPIFuzz; + +} // namespace + +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { + wvoec::RedirectStdoutToFile(); + license_api_fuzz.Initialize(); + license_api_fuzz.LoadLicense(); + return 0; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fuzzed_data(data, size); + + // key_control_block and key_control_block_length parameters + size_t key_control_block_length_data = + fuzzed_data.ConsumeIntegralInRange(0, + wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector key_control_block(key_control_block_length_data); + size_t* const key_control_block_length = + fuzzed_data.ConsumeBool() ? &key_control_block_length_data : nullptr; + + const std::vector content_key_id = + fuzzed_data.ConsumeRemainingBytes(); + + OEMCrypto_QueryKeyControl(license_api_fuzz.session().session_id(), + content_key_id.data(), content_key_id.size(), + key_control_block.data(), key_control_block_length); + + return 0; +} diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc index 8b7fd79..658bdc1 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_renewal_request_fuzz.cc @@ -2,26 +2,26 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "oemcrypto_fuzz_helper.h" #include "oemcrypto_fuzz_structs.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); + // If input size is less than fuzz data structure, reject the input. - if (size < sizeof(OEMCrypto_Request_Fuzz)) { + if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) { return 0; } // Input for renewal request API will be modified by OEMCrypto, hence it // cannot be a const. Fuzzer complains if const identifier is removed of data, // hence copying data into a non const pointer. - uint8_t* input = new uint8_t[size]; - memcpy(input, data, size); - OEMCryptoRenewalAPIFuzz renewal_api_fuzz; - renewal_api_fuzz.renewal_messages().InjectFuzzedRequestData(input, size); - delete[] input; + std::vector input(data, data + size); + wvoec::OEMCryptoRenewalAPIFuzz renewal_api_fuzz; + renewal_api_fuzz.Initialize(); + renewal_api_fuzz.renewal_messages().InjectFuzzedRequestData(input.data(), + input.size()); + renewal_api_fuzz.Terminate(); return 0; } -} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc index d4df351..8b63654 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_report_usage_fuzz.cc @@ -2,42 +2,46 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { -const size_t MAX_FUZZ_PST_REPORT_BUFFER_LENGTH = 5 * MB; +namespace { + +constexpr size_t MAX_FUZZ_PST_REPORT_BUFFER_LENGTH = 5 * wvoec::MB; + +} // namespace + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); - if (size < sizeof(size_t)) { - return 0; - } - - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - // Open a session, create a usage entry. - Session* session = entry.license_messages().session(); - session->open(); - entry.InstallTestDrmKey(session); - session->CreateNewUsageEntry(); - session->GenerateNonce(); - vector encrypted_usage_header; - session->UpdateUsageEntry(&encrypted_usage_header); + entry.InstallTestDrmKey(); + entry.session().CreateNewUsageEntry(); + entry.session().GenerateNonce(); + std::vector encrypted_usage_header; + entry.session().UpdateUsageEntry(&encrypted_usage_header); // Sets pst for usage entry. entry.LoadLicense(); FuzzedDataProvider fuzzed_data(data, size); - size_t pst_report_buffer_length = fuzzed_data.ConsumeIntegralInRange( - 0, MAX_FUZZ_PST_REPORT_BUFFER_LENGTH); + + // pst_report_buffer and pst_report_buffer_length parameters + size_t pst_report_buffer_length_data = + fuzzed_data.ConsumeIntegralInRange( + 0, MAX_FUZZ_PST_REPORT_BUFFER_LENGTH); + std::vector pst_report_buffer(pst_report_buffer_length_data); + size_t* const pst_report_buffer_length = + fuzzed_data.ConsumeBool() ? &pst_report_buffer_length_data : nullptr; + const std::vector pst = fuzzed_data.ConsumeRemainingBytes(); - std::vector pst_report_buffer(pst_report_buffer_length); - // Call API with fuzzed pst_buffer_length, pst. - OEMCrypto_ReportUsage(session->session_id(), pst.data(), pst.size(), - pst_report_buffer.data(), &pst_report_buffer_length); - session->close(); + + OEMCrypto_ReportUsage(entry.session().session_id(), pst.data(), pst.size(), + pst_report_buffer.data(), pst_report_buffer_length); + + entry.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc index c825498..700e67b 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_reuse_usage_entry_fuzz.cc @@ -2,32 +2,25 @@ // source code may only be used and distributed under the Widevine Master // License Agreement. +#include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { -LicenseWithUsageEntryFuzz entry; extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); - - uint32_t usage_entry_number = 0; - if (size < sizeof(usage_entry_number)) { - return 0; - } + wvoec::RedirectStdoutToFile(); + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - Session* s = entry.license_messages().session(); - s->open(); - entry.InstallTestDrmKey(s); - s->CreateNewUsageEntry(); - s->close(); - s->open(); - memcpy(&usage_entry_number, data, sizeof(uint32_t)); - OEMCrypto_ReuseUsageEntry(s->session_id(), usage_entry_number); - s->close(); + entry.InstallTestDrmKey(); + entry.session().CreateNewUsageEntry(); + entry.session().close(); + entry.session().open(); + OEMCrypto_ReuseUsageEntry( + entry.session().session_id(), + FuzzedDataProvider(data, size).ConsumeIntegral()); + + entry.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc b/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc index 625b0f0..4806ed5 100644 --- a/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc +++ b/oemcrypto/test/fuzz_tests/oemcrypto_shrink_usage_table_header_fuzz.cc @@ -2,30 +2,33 @@ // source code may only be used and distributed under the Widevine // License Agreement. +#include + #include "FuzzedDataProvider.h" #include "OEMCryptoCENC.h" #include "oemcrypto_fuzz_helper.h" -namespace wvoec { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - // Redirect printf and log statements from oemcrypto functions to a file to - // reduce noise - RedirectStdoutToFile(); + wvoec::RedirectStdoutToFile(); - if (size < sizeof(uint32_t) + sizeof(size_t)) { - return 0; - } - - LicenseWithUsageEntryFuzz entry; + wvoec::LicenseWithUsageEntryFuzz entry; + entry.Initialize(); entry.CreateUsageTableHeader(); - FuzzedDataProvider fuzzed_data(data, size); - const uint32_t new_entry_count = fuzzed_data.ConsumeIntegral(); - size_t header_buffer_length = - fuzzed_data.ConsumeIntegralInRange(0, MAX_FUZZ_OUTPUT_LENGTH); - std::vector header_buffer(header_buffer_length); - OEMCrypto_ShrinkUsageTableHeader(new_entry_count, header_buffer.data(), - &header_buffer_length); + FuzzedDataProvider fuzzed_data(data, size); + + const uint32_t new_entry_count = fuzzed_data.ConsumeIntegral(); + + // header_buffer and header_buffer_length parameters + size_t header_buffer_length_data = fuzzed_data.ConsumeIntegralInRange( + 0, wvoec::MAX_FUZZ_OUTPUT_LENGTH); + std::vector header_buffer(header_buffer_length_data); + size_t* const header_buffer_length = + fuzzed_data.ConsumeBool() ? &header_buffer_length_data : nullptr; + + OEMCrypto_ShrinkUsageTableHeader(new_entry_count, header_buffer.data(), + header_buffer_length); + + entry.Terminate(); return 0; } -} // namespace wvoec diff --git a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp index bd72a5c..c970e50 100644 --- a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp +++ b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gyp @@ -14,106 +14,199 @@ }, 'targets': [ { - 'target_name': 'oemcrypto_load_license_fuzz', + 'target_name': 'oemcrypto_copy_buffer_fuzz', 'sources': [ - 'oemcrypto_load_license_fuzz.cc', + 'oemcrypto_copy_buffer_fuzz.cc', ], - }, - { - 'target_name': 'oemcrypto_load_provisioning_fuzz', + }, + { + 'target_name': 'oemcrypto_create_and_remove_entitled_key_session_fuzz', 'sources': [ - 'oemcrypto_load_provisioning_fuzz.cc', + 'oemcrypto_create_and_remove_entitled_key_session_fuzz.cc', ], - }, - { - 'target_name': 'oemcrypto_load_renewal_fuzz', - 'sources': [ - 'oemcrypto_load_renewal_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_license_request_fuzz', - 'sources': [ - 'oemcrypto_license_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_provisioning_request_fuzz', - 'sources': [ - 'oemcrypto_provisioning_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_renewal_request_fuzz', - 'sources': [ - 'oemcrypto_renewal_request_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_decrypt_cenc_fuzz', - 'sources': [ - 'oemcrypto_decrypt_cenc_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_entitled_content_keys_fuzz', - 'sources': [ - 'oemcrypto_load_entitled_content_keys_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_encrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_encrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_decrypt_fuzz', - 'sources': [ - 'oemcrypto_generic_decrypt_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_sign_fuzz', - 'sources': [ - 'oemcrypto_generic_sign_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generic_verify_fuzz', - 'sources': [ - 'oemcrypto_generic_verify_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_generate_rsa_signature_fuzz', - 'sources': [ - 'oemcrypto_generate_rsa_signature_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_usage_table_header_fuzz', - 'sources': [ - 'oemcrypto_load_usage_table_header_fuzz.cc', - ], - }, - { - 'target_name': 'oemcrypto_load_usage_entry_fuzz', - 'sources': [ - 'oemcrypto_load_usage_entry_fuzz.cc', - ], - }, - { + }, + { 'target_name': 'oemcrypto_deactivate_usage_entry_fuzz', 'sources': [ 'oemcrypto_deactivate_usage_entry_fuzz.cc', ], - }, - { + }, + { + 'target_name': 'oemcrypto_decrypt_cenc_fuzz', + 'sources': [ + 'oemcrypto_decrypt_cenc_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_decrypt_hash_fuzz', + 'sources': [ + 'oemcrypto_decrypt_hash_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generate_certificate_key_pair_first_stage_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generate_certificate_key_pair_second_stage_fuzz', + 'sources': [ + 'oemcrypto_generate_certificate_key_pair_fuzz.cc', + ], + 'defines': [ + 'SECOND_STAGE', + ], + }, + { + 'target_name': 'oemcrypto_generate_rsa_signature_fuzz', + 'sources': [ + 'oemcrypto_generate_rsa_signature_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_decrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_decrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_encrypt_fuzz', + 'sources': [ + 'oemcrypto_generic_encrypt_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_sign_fuzz', + 'sources': [ + 'oemcrypto_generic_sign_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_generic_verify_fuzz', + 'sources': [ + 'oemcrypto_generic_verify_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_boot_certificate_chain_fuzz', + 'sources': [ + 'oemcrypto_get_boot_certificate_chain_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_device_information_fuzz', + 'sources': [ + 'oemcrypto_get_device_information_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_device_signed_csr_payload_fuzz', + 'sources': [ + 'oemcrypto_get_device_signed_csr_payload_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_key_handle_fuzz', + 'sources': [ + 'oemcrypto_get_key_handle_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_get_random_fuzz', + 'sources': [ + 'oemcrypto_get_random_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_install_oem_private_key_fuzz', + 'sources': [ + 'oemcrypto_install_oem_private_key_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_license_request_fuzz', + 'sources': [ + 'oemcrypto_license_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_entitled_content_keys_fuzz', + 'sources': [ + 'oemcrypto_load_entitled_content_keys_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_license_fuzz', + 'sources': [ + 'oemcrypto_load_license_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_provisioning_fuzz', + 'sources': [ + 'oemcrypto_load_provisioning_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_renewal_fuzz', + 'sources': [ + 'oemcrypto_load_renewal_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_load_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_load_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_load_usage_table_header_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_move_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_move_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_provisioning_request_fuzz', + 'sources': [ + 'oemcrypto_provisioning_request_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_query_key_control_fuzz', + 'sources': [ + 'oemcrypto_query_key_control_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_renewal_request_fuzz', + 'sources': [ + 'oemcrypto_renewal_request_fuzz.cc', + ], + }, + { 'target_name': 'oemcrypto_report_usage_fuzz', 'sources': [ 'oemcrypto_report_usage_fuzz.cc', ], - }, + }, + { + 'target_name': 'oemcrypto_reuse_usage_entry_fuzz', + 'sources': [ + 'oemcrypto_reuse_usage_entry_fuzz.cc', + ], + }, + { + 'target_name': 'oemcrypto_shrink_usage_table_header_fuzz', + 'sources': [ + 'oemcrypto_shrink_usage_table_header_fuzz.cc', + ], + }, ], } diff --git a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gypi b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gypi index ddf927d..0a9e92f 100644 --- a/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gypi +++ b/oemcrypto/test/fuzz_tests/partner_oemcrypto_fuzztests.gypi @@ -69,7 +69,7 @@ '-D_POSIX_C_SOURCE=200809L', ], 'cflags_cc': [ - '-std=c++11', + '-std=c++14', '-frtti', ], 'ldflags': [ diff --git a/oemcrypto/test/oec_device_features.cpp b/oemcrypto/test/oec_device_features.cpp index 9c91f5a..2264053 100644 --- a/oemcrypto/test/oec_device_features.cpp +++ b/oemcrypto/test/oec_device_features.cpp @@ -60,17 +60,12 @@ void DeviceFeatures::Initialize() { printf("--- ERROR: Could not open session: %d ----\n", result); } // If the device uses a keybox, check to see if loading a certificate is - // installed. - if (provisioning_method == OEMCrypto_Keybox || - provisioning_method == OEMCrypto_OEMCertificate || - provisioning_method == OEMCrypto_BootCertificateChain) { - // Devices with a keybox or OEM Certificate are required to support loading - // a DRM certificate. - loads_certificate = true; - } else { - // Other devices are either broken, or they have a baked in certificate. - loads_certificate = false; - } + // installed. Devices with a keybox or OEM Certificate are required to support + // loading a DRM certificate. Other devices are either broken, or they have a + // baked in certificate. + loads_certificate = provisioning_method == OEMCrypto_Keybox || + provisioning_method == OEMCrypto_OEMCertificate || + provisioning_method == OEMCrypto_BootCertificateChain; printf("loads_certificate = %s.\n", loads_certificate ? "true" : "false"); generic_crypto = (OEMCrypto_ERROR_NOT_IMPLEMENTED != @@ -160,13 +155,7 @@ std::string DeviceFeatures::RestrictFilter(const std::string& initial_filter) { provisioning_method == OEMCrypto_BootCertificateChain) FilterOut(&filter, "OEMCryptoLoadsCert*"); if (!generic_crypto) FilterOut(&filter, "*GenericCrypto*"); - if (!supports_cas) FilterOut(&filter, "*CasOnly*"); if (derive_key_method == NO_METHOD) FilterOut(&filter, "*SessionTest*"); - if (provisioning_method - != OEMCrypto_OEMCertificate) FilterOut(&filter, "*Prov30*"); - if (provisioning_method != OEMCrypto_BootCertificateChain) - FilterOut(&filter, "*Prov40*"); - if (!supports_rsa_3072) FilterOut(&filter, "*RSAKey3072*"); if (api_version < 17) FilterOut(&filter, "*API17*"); if (api_version < 18) FilterOut(&filter, "*API18*"); // clang-format on diff --git a/oemcrypto/test/oec_session_util.cpp b/oemcrypto/test/oec_session_util.cpp index efed598..9e442fb 100644 --- a/oemcrypto/test/oec_session_util.cpp +++ b/oemcrypto/test/oec_session_util.cpp @@ -603,6 +603,161 @@ OEMCryptoResult Provisioning40RoundTrip::LoadDRMCertResponse() { wrapped_drm_key_.size()); } +void Provisioning40CastRoundTrip::PrepareSession() { + const size_t buffer_size = 5000; // Make sure it is large enough. + std::vector public_key(buffer_size); + size_t public_key_size = buffer_size; + std::vector public_key_signature(buffer_size); + size_t public_key_signature_size = buffer_size; + std::vector wrapped_private_key(buffer_size); + size_t wrapped_private_key_size = buffer_size; + OEMCrypto_PrivateKeyType key_type; + ASSERT_EQ( + OEMCrypto_SUCCESS, + OEMCrypto_GenerateCertificateKeyPair( + session()->session_id(), public_key.data(), &public_key_size, + public_key_signature.data(), &public_key_signature_size, + wrapped_private_key.data(), &wrapped_private_key_size, &key_type)); + wrapped_private_key.resize(wrapped_private_key_size); + public_key.resize(public_key_size); + + wrapped_drm_key_ = wrapped_private_key; + drm_public_key_ = public_key; + drm_key_type_ = key_type; +} + +void Provisioning40CastRoundTrip::LoadDRMPrivateKey() { + ASSERT_EQ(OEMCrypto_SUCCESS, + OEMCrypto_LoadDRMPrivateKey(session()->session_id(), drm_key_type_, + wrapped_drm_key_.data(), + wrapped_drm_key_.size())); +} + +void Provisioning40CastRoundTrip::FillAndVerifyCoreRequest( + const std::string& core_message_string) { + EXPECT_TRUE( + oemcrypto_core_message::deserialize::CoreProvisioning40RequestFromMessage( + core_message_string, &core_request_)); + EXPECT_EQ(global_features.api_version, core_request_.api_major_version); + EXPECT_EQ(session()->nonce(), core_request_.nonce); + EXPECT_EQ(session()->session_id(), core_request_.session_id); +} + +void Provisioning40CastRoundTrip::VerifyRequestSignature( + const vector& data, const vector& generated_signature, + size_t /* core_message_length */) { + ASSERT_NO_FATAL_FAILURE( + session()->VerifySignature(data, generated_signature.data(), + generated_signature.size(), kSign_RSASSA_PSS)); +} + +// Creates a prov2 response +void Provisioning40CastRoundTrip::CreateDefaultResponse() { + uint32_t algorithm_n = htonl(allowed_schemes_); + memcpy(response_data_.rsa_key, "SIGN", 4); + memcpy(response_data_.rsa_key + 4, &algorithm_n, 4); + memcpy(response_data_.rsa_key + 8, encoded_rsa_key_.data(), + encoded_rsa_key_.size()); + response_data_.rsa_key_length = 8 + encoded_rsa_key_.size(); + response_data_.nonce = session_->nonce(); + response_data_.enc_message_key_length = 0; + core_response_.key_type = OEMCrypto_RSA_Private_Key; + core_response_.enc_private_key = + FindSubstring(response_data_.rsa_key, response_data_.rsa_key_length); + core_response_.enc_private_key_iv = FindSubstring( + response_data_.rsa_key_iv, sizeof(response_data_.rsa_key_iv)); + core_response_.encrypted_message_key = FindSubstring( + response_data_.enc_message_key, response_data_.enc_message_key_length); +} + +void Provisioning40CastRoundTrip::EncryptAndSignResponse() { + session()->key_deriver().PadAndEncryptProvisioningMessage( + &response_data_, &encrypted_response_data_); + core_response_.enc_private_key.length = + encrypted_response_data_.rsa_key_length; + SignResponse(); +} + +void Provisioning40CastRoundTrip::SignResponse() { + CoreMessageFeatures features = + CoreMessageFeatures::DefaultFeatures(ODK_MAJOR_VERSION); + + // Create prov 2 request struct from prov 4 request + oemcrypto_core_message::ODK_ProvisioningRequest core_request_prov2; + core_request_prov2.api_minor_version = core_request_.api_minor_version; + core_request_prov2.api_major_version = core_request_.api_major_version; + core_request_prov2.nonce = core_request_.nonce; + core_request_prov2.session_id = core_request_.session_id; + memcpy(&core_request_prov2.counter_info, &core_request_.counter_info, + sizeof(core_request_.counter_info)); + + ASSERT_TRUE(oemcrypto_core_message::serialize::CreateCoreProvisioningResponse( + features, core_response_, core_request_prov2, &serialized_core_message_)); + // Resizing for huge core message length unit tests. + serialized_core_message_.resize( + std::max(required_core_message_size_, serialized_core_message_.size())); + // Make the message buffer a just big enough, or the + // required size, whichever is larger. + const size_t message_size = + std::max(required_message_size_, serialized_core_message_.size() + + sizeof(encrypted_response_data_)); + // Stripe the encrypted message. + encrypted_response_.resize(message_size); + for (size_t i = 0; i < encrypted_response_.size(); i++) { + encrypted_response_[i] = i & 0xFF; + } + ASSERT_GE(encrypted_response_.size(), serialized_core_message_.size()); + memcpy(encrypted_response_.data(), serialized_core_message_.data(), + serialized_core_message_.size()); + ASSERT_GE(encrypted_response_.size(), + serialized_core_message_.size() + sizeof(encrypted_response_data_)); + memcpy(encrypted_response_.data() + serialized_core_message_.size(), + reinterpret_cast(&encrypted_response_data_), + sizeof(encrypted_response_data_)); + session()->key_deriver().ServerSignBuffer(encrypted_response_.data(), + encrypted_response_.size(), + &response_signature_); + SetEncryptAndSignResponseLengths(); +} + +OEMCryptoResult Provisioning40CastRoundTrip::LoadResponse(Session* session) { + EXPECT_NE(session, nullptr); + // Write corpus for oemcrypto_load_provisioning_fuzz. Fuzz script expects + // unencrypted response from provisioning server as input corpus data. + // Data will be encrypted and signed again explicitly by fuzzer script after + // mutations. + if (ShouldGenerateCorpus()) { + const std::string file_name = + GetFileName("oemcrypto_load_provisioning_fuzz_seed_corpus"); + // Corpus for license response fuzzer should be in the format: + // unencrypted (core_response + response_data). + AppendToFile(file_name, reinterpret_cast(&core_response_), + sizeof(ODK_ParsedProvisioning)); + AppendToFile(file_name, reinterpret_cast(&response_data_), + sizeof(response_data_)); + } + size_t wrapped_key_length = 0; + OEMCryptoResult sts = LoadResponseNoRetry(session, &wrapped_key_length); + if (sts != OEMCrypto_ERROR_SHORT_BUFFER) return sts; + wrapped_rsa_key_.assign(wrapped_key_length, 0); + sts = LoadResponseNoRetry(session, &wrapped_key_length); + if (sts == OEMCrypto_SUCCESS) { + wrapped_rsa_key_.resize(wrapped_key_length); + } + return sts; +} + +OEMCryptoResult Provisioning40CastRoundTrip::LoadResponseNoRetry( + Session* session, size_t* wrapped_key_length) { + EXPECT_NE(session, nullptr); + VerifyEncryptAndSignResponseLengths(); + return OEMCrypto_LoadProvisioning( + session->session_id(), encrypted_response_.data(), + encrypted_response_.size(), serialized_core_message_.size(), + response_signature_.data(), response_signature_.size(), + wrapped_rsa_key_.data(), wrapped_key_length); +} + void LicenseRoundTrip::VerifyRequestSignature( const vector& data, const vector& generated_signature, size_t core_message_length) { @@ -685,16 +840,14 @@ void LicenseRoundTrip::CreateDefaultResponse() { // Fill in the default core_response_ fields, except the substrings, which are // filled in the next function. core_response_.nonce_required = - ((wvoec::kControlNonceEnabled | wvoec::kControlNonceOrEntry | - wvoec::kControlNonceRequired) & - control_) - ? 1 - : 0; + (wvoec::kControlNonceEnabled | wvoec::kControlNonceOrEntry | + wvoec::kControlNonceRequired) & + control_; core_response_.license_type = license_type_; FillCoreResponseSubstrings(); } -void LicenseRoundTrip::ConvertDataToValidBools(ODK_ParsedLicense* t) { +void LicenseRoundTrip::ConvertDataToValidBools(ODK_Packing_ParsedLicense* t) { t->nonce_required = ConvertByteToValidBoolean(&t->nonce_required); t->timer_limits.soft_enforce_playback_duration = ConvertByteToValidBoolean( &t->timer_limits.soft_enforce_playback_duration); @@ -713,19 +866,19 @@ void LicenseRoundTrip::InjectFuzzedTimerLimits( void LicenseRoundTrip::InjectFuzzedResponseData(const uint8_t* data, size_t size) { - // Interpreting fuzz data as unencrypted core_response + message_data + // Interpreting fuzz data as unencrypted core_response + response_data + + // key_array FuzzedData fuzzed_data(data, size); // Copy core_response from data. fuzzed_data.Fill(&core_response_, sizeof(core_response_)); - // Maximum number of keys could be kMaxNumKeys(30). key_array_length can be - // any random value as it is read from fuzz data. - // Key data array(MessageKeyData keys[kMaxNumKeys]) will be looped over - // key_array_length number of times during LoadLicense. If key_array_length is - // more than kMaxNumKeys, setting it to max value of kMaxNumKeys as we should - // not go out of bounds of this array length. For corpus, this value is - // already hard coded to 4. + // Copy response_data from data. + fuzzed_data.Fill(&response_data_, sizeof(response_data_)); + + // If key_array_length is more than kMaxNumKeys, we set it to kMaxNumKeys to + // prevent it from going out of bounds. For corpus, this value is already hard + // coded to 4. if (core_response_.key_array_length > kMaxNumKeys) { core_response_.key_array_length = kMaxNumKeys; } @@ -733,6 +886,13 @@ void LicenseRoundTrip::InjectFuzzedResponseData(const uint8_t* data, // For corpus data, this value gets set to 4, but we need to test other // scenarios too, hence reading key_array_length value. set_num_keys(core_response_.key_array_length); + + // Copy key_array from data. + key_array_.resize(num_keys_); + core_response_.key_array = key_array_.data(); + fuzzed_data.Fill(core_response_.key_array, + num_keys_ * sizeof(*core_response_.key_array)); + ConvertDataToValidBools(&core_response_); // TODO(b/157520981): Once assertion bug is fixed, for loop can be removed. @@ -753,11 +913,9 @@ void LicenseRoundTrip::InjectFuzzedResponseData(const uint8_t* data, } } - // Copy response_data from data and set nonce to match one in request to pass - // nonce validations. - fuzzed_data.Fill(&response_data_, sizeof(response_data_)); + // Set nonce to match one in request to pass nonce validations. for (uint32_t i = 0; i < num_keys_; ++i) { - response_data_.keys[i].control.nonce = session()->nonce(); + response_data_.keys[i].control.nonce = htonl(session()->nonce()); } } @@ -802,27 +960,30 @@ void LicenseRoundTrip::FillCoreResponseSubstrings() { sizeof(response_data_.srm_restriction_data)); } core_response_.key_array_length = num_keys_; + key_array_.clear(); for (unsigned int i = 0; i < num_keys_; i++) { - core_response_.key_array[i].key_id = FindSubstring( - response_data_.keys[i].key_id, response_data_.keys[i].key_id_length); - core_response_.key_array[i].key_data_iv = FindSubstring( - response_data_.keys[i].key_iv, sizeof(response_data_.keys[i].key_iv)); - core_response_.key_array[i].key_data = - FindSubstring(response_data_.keys[i].key_data, - response_data_.keys[i].key_data_length); + OEMCrypto_KeyObject obj; + obj.key_id = FindSubstring(response_data_.keys[i].key_id, + response_data_.keys[i].key_id_length); + obj.key_data_iv = FindSubstring(response_data_.keys[i].key_iv, + sizeof(response_data_.keys[i].key_iv)); + obj.key_data = FindSubstring(response_data_.keys[i].key_data, + response_data_.keys[i].key_data_length); if (core_request().api_major_version < kClearControlBlockAPIMajor || (core_request().api_major_version == kClearControlBlockAPIMajor && core_request().api_minor_version < kClearControlBlockAPIMinor)) { - core_response_.key_array[i].key_control_iv = + obj.key_control_iv = FindSubstring(response_data_.keys[i].control_iv, sizeof(response_data_.keys[i].control_iv)); } else { - core_response_.key_array[i].key_control_iv = FindSubstring(nullptr, 0); + obj.key_control_iv = FindSubstring(nullptr, 0); } - core_response_.key_array[i].key_control = - FindSubstring(&response_data_.keys[i].control, - sizeof(response_data_.keys[i].control)); + obj.key_control = FindSubstring(&response_data_.keys[i].control, + sizeof(response_data_.keys[i].control)); + key_array_.push_back(obj); } + core_response_.key_array = key_array_.data(); + core_response_.key_array_length = static_cast(key_array_.size()); } void LicenseRoundTrip::EncryptResponse(bool force_clear_kcb) { @@ -947,11 +1108,14 @@ OEMCryptoResult LicenseRoundTrip::LoadResponse(Session* session, const std::string file_name = GetFileName("oemcrypto_load_license_fuzz_seed_corpus"); // Corpus for license response fuzzer should be in the format: - // core_response + response_data. + // core_response + response_data + key_array. AppendToFile(file_name, reinterpret_cast(&core_response_), - sizeof(ODK_ParsedLicense)); + sizeof(core_response_)); AppendToFile(file_name, reinterpret_cast(&response_data_), sizeof(response_data_)); + AppendToFile( + file_name, reinterpret_cast(core_response_.key_array), + core_response_.key_array_length * sizeof(*core_response_.key_array)); } // Some tests adjust the offset to be beyond the length of the message. Here, @@ -1855,10 +2019,7 @@ bool Session::GenerateRsaSessionKey(vector* session_key, } *session_key = wvutil::a2b_hex("6fa479c731d2770b6a61a5d1420bb9d1"); *enc_session_key = public_rsa_->EncryptSessionKey(*session_key); - if (enc_session_key->empty()) { - return false; - } - return true; + return !enc_session_key->empty(); } bool Session::GenerateEccSessionKey(vector* session_key, diff --git a/oemcrypto/test/oec_session_util.h b/oemcrypto/test/oec_session_util.h index cdf7642..e13bb51 100644 --- a/oemcrypto/test/oec_session_util.h +++ b/oemcrypto/test/oec_session_util.h @@ -27,8 +27,6 @@ #include "oemcrypto_types.h" #include "pst_report.h" -using namespace std; - // GTest requires PrintTo to be in the same namespace as the thing it prints, // which is std::vector in this case. namespace std { @@ -38,13 +36,15 @@ void PrintTo(const vector& value, ostream* os); } // namespace std namespace wvoec { + +using namespace std; + // OEMCrypto Fuzzing: Set max signture length to 1mb. const size_t MB = 1024 * 1024; // Make sure this is larger than kMaxKeysPerSession. constexpr size_t kMaxNumKeys = 30; -namespace { #if defined(TEST_SPEED_MULTIPLIER) // Can slow test time limits when // debugging is slowing everything. constexpr int kSpeedMultiplier = TEST_SPEED_MULTIPLIER; @@ -57,7 +57,6 @@ constexpr uint32_t kDuration = 2 * kSpeedMultiplier; constexpr uint32_t kLongDuration = 5 * kSpeedMultiplier; constexpr int32_t kTimeTolerance = 3 * kSpeedMultiplier; constexpr int64_t kUsageTableTimeTolerance = 10 * kSpeedMultiplier; -} // namespace // Note: The API does not specify a maximum key id length. We specify a // maximum just for these tests, so that we have a fixed message size. @@ -158,7 +157,7 @@ class RoundTrip { required_request_signature_size_(0), encrypted_response_length_(0), response_signature_length_(0) {} - virtual ~RoundTrip() {} + virtual ~RoundTrip() = default; // Have OEMCrypto sign a request message and then verify the signature and the // core message. @@ -369,18 +368,69 @@ class Provisioning40RoundTrip OEMCrypto_PrivateKeyType drm_key_type_; }; +class Provisioning40CastRoundTrip + : public RoundTrip< + /* CoreRequest */ oemcrypto_core_message::ODK_Provisioning40Request, + OEMCrypto_PrepAndSignProvisioningRequest, + /* CoreResponse */ ODK_ParsedProvisioning, + /* ResponseData */ RSAPrivateKeyMessage> { + public: + Provisioning40CastRoundTrip(Session* session, + const std::vector& encoded_rsa_key) + : RoundTrip(session), encryptor_(), + encoded_rsa_key_(encoded_rsa_key) {} + + void PrepareSession(); + void LoadDRMPrivateKey(); + void CreateDefaultResponse() override; + void SignResponse(); + void EncryptAndSignResponse() override; + OEMCryptoResult LoadResponse() override { return LoadResponse(session_); } + OEMCryptoResult LoadResponse(Session* session) override; + OEMCryptoResult LoadResponseNoRetry(Session* session, size_t* wrapped_key_length) ; + + // Returned + const std::vector& wrapped_drm_key() { return wrapped_drm_key_; } + const std::vector& wrapped_rsa_key() { return wrapped_rsa_key_; } + const std::vector& drm_public_key() { return drm_public_key_; } + OEMCrypto_PrivateKeyType drm_key_type() { return drm_key_type_; } + void set_allowed_schemes(uint32_t allowed_schemes) { + allowed_schemes_ = allowed_schemes; + } + + protected: + bool RequestHasNonce() override { return true; } + void VerifyRequestSignature(const vector& data, + const vector& generated_signature, + size_t core_message_length) override; + // Verify the values of the core response. + virtual void FillAndVerifyCoreRequest( + const std::string& core_message_string) override; + + uint32_t allowed_schemes_; + Encryptor encryptor_; + std::vector wrapped_oem_key_; + std::vector oem_public_key_; + OEMCrypto_PrivateKeyType oem_key_type_; + std::vector wrapped_drm_key_; + std::vector drm_public_key_; + OEMCrypto_PrivateKeyType drm_key_type_; + std::vector encoded_rsa_key_; + std::vector wrapped_rsa_key_; +}; + class LicenseRoundTrip : public RoundTrip< /* CoreRequest */ oemcrypto_core_message::ODK_LicenseRequest, OEMCrypto_PrepAndSignLicenseRequest, - /* CoreResponse */ ODK_ParsedLicense, + /* CoreResponse */ ODK_Packing_ParsedLicense, /* ResponseData */ MessageData> { public: LicenseRoundTrip(Session* session) : RoundTrip(session), control_(wvoec::kControlNonceEnabled), num_keys_(4), - pst_(""), + pst_(), minimum_srm_version_(0), update_mac_keys_(true), api_version_(kCurrentAPI), @@ -399,7 +449,7 @@ class LicenseRoundTrip void InjectFuzzedResponseData(const uint8_t* data, size_t size); // Used for OEMCrypto Fuzzing: Convert boolean flags in parsed_license to // valid bytes to avoid errors from msan. - void ConvertDataToValidBools(ODK_ParsedLicense* t); + void ConvertDataToValidBools(ODK_Packing_ParsedLicense* t); // Create a license with four keys. Each key is responsible for one of generic // encrypt (key 0), decrypt (key 1), sign (key 2) and verify (key 3). Each key // is allowed only one type of operation. @@ -494,6 +544,9 @@ class LicenseRoundTrip // CreateDefaultResponse. OEMCrypto_LicenseType license_type_; uint8_t request_hash_[ODK_SHA256_HASH_SIZE]; + // Used to hold and add/update key information to be transferred into the core + // response later on. + std::vector key_array_; }; class RenewalRoundTrip @@ -516,7 +569,7 @@ class RenewalRoundTrip void EncryptAndSignResponse() override; void InjectFuzzedResponseData(OEMCrypto_Renewal_Response_Fuzz& fuzzed_data, const uint8_t* renewal_response, - const size_t renewal_response_size); + size_t renewal_response_size); OEMCryptoResult LoadResponse() override { return LoadResponse(session_); } OEMCryptoResult LoadResponse(Session* session) override; uint64_t renewal_duration_seconds() const { @@ -849,6 +902,7 @@ OEMCryptoResult GetKeyHandleIntoVector(OEMCrypto_SESSION session, size_t key_id_length, OEMCryptoCipherMode cipher_mode, vector& key_handle); + } // namespace wvoec #endif // CDM_OEC_SESSION_UTIL_H_ diff --git a/oemcrypto/test/oemcrypto_basic_test.cpp b/oemcrypto/test/oemcrypto_basic_test.cpp index 719af19..7b07053 100644 --- a/oemcrypto/test/oemcrypto_basic_test.cpp +++ b/oemcrypto/test/oemcrypto_basic_test.cpp @@ -156,7 +156,7 @@ TEST_F(OEMCryptoClientTest, FreeUnallocatedSecureBufferNoFailure) { */ TEST_F(OEMCryptoClientTest, VersionNumber) { const std::string log_message = - "OEMCrypto unit tests for API 18.1. Tests last updated 2023-03-08"; + "OEMCrypto unit tests for API 18.3. Tests last updated 2023-07-07"; cout << " " << log_message << "\n"; cout << " " << "These tests are part of Android U." @@ -165,7 +165,7 @@ TEST_F(OEMCryptoClientTest, VersionNumber) { // If any of the following fail, then it is time to update the log message // above. EXPECT_EQ(ODK_MAJOR_VERSION, 18); - EXPECT_EQ(ODK_MINOR_VERSION, 1); + EXPECT_EQ(ODK_MINOR_VERSION, 3); EXPECT_EQ(kCurrentAPI, static_cast(ODK_MAJOR_VERSION)); OEMCrypto_Security_Level level = OEMCrypto_SecurityLevel(); EXPECT_GT(level, OEMCrypto_Level_Unknown); @@ -189,7 +189,6 @@ TEST_F(OEMCryptoClientTest, VersionNumber) { if (sts != OEMCrypto_SUCCESS) { LOGW("Device is not production ready, returns %d", sts); } - sts = OEMCrypto_SUCCESS; std::string build_info; size_t buf_length = 0; sts = OEMCrypto_BuildInformation(&build_info[0], &buf_length); diff --git a/oemcrypto/test/oemcrypto_cast_test.cpp b/oemcrypto/test/oemcrypto_cast_test.cpp new file mode 100644 index 0000000..6dc2552 --- /dev/null +++ b/oemcrypto/test/oemcrypto_cast_test.cpp @@ -0,0 +1,977 @@ +// 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 "oemcrypto_cast_test.h" + +#include "oemcrypto_usage_table_test.h" + +using ::testing::Range; + +namespace wvoec { + +// The alternate padding is only required for cast receivers, but all devices +// should forbid the alternate padding for regular certificates. +TEST_F(OEMCryptoLoadsCertificateAlternates, DisallowForbiddenPaddingAPI09) { + LoadWithAllowedSchemes(kSign_RSASSA_PSS, + true); // Use default padding scheme + DisallowForbiddenPadding(kSign_PKCS1_Block1, 50); +} + +// The alternate padding is only required for cast receivers, but if a device +// does load an alternate certificate, it should NOT use it for generating +// a license request signature. +TEST_F(OEMCryptoLoadsCertificateAlternates, TestSignaturePKCS1) { + // Try to load an RSA key with alternative padding schemes. This signing + // scheme is used by cast receivers. + LoadWithAllowedSchemes(kSign_PKCS1_Block1, false); + // If the device is a cast receiver, then this scheme is required. + if (global_features.cast_receiver) { + ASSERT_TRUE(key_loaded_); + } + // If the key loaded with no error, then we will verify that it is not used + // for forbidden padding schemes. + if (key_loaded_) { + // The other padding scheme should fail. + DisallowForbiddenPadding(kSign_RSASSA_PSS, 83); + DisallowDeriveKeys(); + if (global_features.cast_receiver) { + // A signature with a valid size should succeed. + TestSignature(kSign_PKCS1_Block1, 83); + TestSignature(kSign_PKCS1_Block1, 50); + } + // A signature with padding that is too big should fail. + DisallowForbiddenPadding(kSign_PKCS1_Block1, 84); // too big. + } +} + +// This test verifies RSA signing with the alternate padding scheme used by +// Android cast receivers, PKCS1 Block 1. These tests are not required for +// other devices, and should be filtered out by DeviceFeatures::Initialize for +// those devices. +class OEMCryptoCastReceiverTest : public OEMCryptoLoadsCertificateAlternates { + protected: + void SetUp() override { + OEMCryptoLoadsCertificateAlternates::SetUp(); + if (!global_features.cast_receiver) { + GTEST_SKIP() << "OEMCrypto does not support CAST Receiver functionality"; + } + } + + vector encode(uint8_t type, const vector& substring) { + vector result; + result.push_back(type); + if (substring.size() < 0x80) { + uint8_t length = substring.size(); + result.push_back(length); + } else if (substring.size() < 0x100) { + result.push_back(0x81); + uint8_t length = substring.size(); + result.push_back(length); + } else { + result.push_back(0x82); + uint16_t length = substring.size(); + result.push_back(length >> 8); + result.push_back(length & 0xFF); + } + result.insert(result.end(), substring.begin(), substring.end()); + return result; + } + vector concat(const vector& a, const vector& b) { + vector result = a; + result.insert(result.end(), b.begin(), b.end()); + return result; + } + + // This encodes the RSA key used in the PKCS#1 signing tests below. + void BuildRSAKey() { + vector field_n = + encode(0x02, wvutil::a2b_hex("00" + "df271fd25f8644496b0c81be4bd50297" + "ef099b002a6fd67727eb449cea566ed6" + "a3981a71312a141cabc9815c1209e320" + "a25b32464e9999f18ca13a9fd3892558" + "f9e0adefdd3650dd23a3f036d60fe398" + "843706a40b0b8462c8bee3bce12f1f28" + "60c2444cdc6a44476a75ff4aa24273cc" + "be3bf80248465f8ff8c3a7f3367dfc0d" + "f5b6509a4f82811cedd81cdaaa73c491" + "da412170d544d4ba96b97f0afc806549" + "8d3a49fd910992a1f0725be24f465cfe" + "7e0eabf678996c50bc5e7524abf73f15" + "e5bef7d518394e3138ce4944506aaaaf" + "3f9b236dcab8fc00f87af596fdc3d9d6" + "c75cd508362fae2cbeddcc4c7450b17b" + "776c079ecca1f256351a43b97dbe2153")); + vector field_e = encode(0x02, wvutil::a2b_hex("010001")); + vector field_d = + encode(0x02, wvutil::a2b_hex("5bd910257830dce17520b03441a51a8c" + "ab94020ac6ecc252c808f3743c95b7c8" + "3b8c8af1a5014346ebc4242cdfb5d718" + "e30a733e71f291e4d473b61bfba6daca" + "ed0a77bd1f0950ae3c91a8f901118825" + "89e1d62765ee671e7baeea309f64d447" + "bbcfa9ea12dce05e9ea8939bc5fe6108" + "581279c982b308794b3448e7f7b95229" + "2df88c80cb40142c4b5cf5f8ddaa0891" + "678d610e582fcb880f0d707caf47d09a" + "84e14ca65841e5a3abc5e9dba94075a9" + "084341f0edad9b68e3b8e082b80b6e6e" + "8a0547b44fb5061b6a9131603a5537dd" + "abd01d8e863d8922e9aa3e4bfaea0b39" + "d79283ad2cbc8a59cce7a6ecf4e4c81e" + "d4c6591c807defd71ab06866bb5e7745")); + vector field_p = + encode(0x02, wvutil::a2b_hex("00" + "f44f5e4246391f482b2f5296e3602eb3" + "4aa136427710f7c0416d403fd69d4b29" + "130cfebef34e885abdb1a8a0a5f0e9b5" + "c33e1fc3bfc285b1ae17e40cc67a1913" + "dd563719815ebaf8514c2a7aa0018e63" + "b6c631dc315a46235716423d11ff5803" + "4e610645703606919f5c7ce2660cd148" + "bd9efc123d9c54b6705590d006cfcf3f")); + vector field_q = + encode(0x02, wvutil::a2b_hex("00" + "e9d49841e0e0a6ad0d517857133e36dc" + "72c1bdd90f9174b52e26570f373640f1" + "c185e7ea8e2ed7f1e4ebb951f70a5802" + "3633b0097aec67c6dcb800fc1a67f9bb" + "0563610f08ebc8746ad129772136eb1d" + "daf46436450d318332a84982fe5d28db" + "e5b3e912407c3e0e03100d87d436ee40" + "9eec1cf85e80aba079b2e6106b97bced")); + vector field_exp1 = + encode(0x02, wvutil::a2b_hex("00" + "ed102acdb26871534d1c414ecad9a4d7" + "32fe95b10eea370da62f05de2c393b1a" + "633303ea741b6b3269c97f704b352702" + "c9ae79922f7be8d10db67f026a8145de" + "41b30c0a42bf923bac5f7504c248604b" + "9faa57ed6b3246c6ba158e36c644f8b9" + "548fcf4f07e054a56f768674054440bc" + "0dcbbc9b528f64a01706e05b0b91106f")); + vector field_exp2 = + encode(0x02, wvutil::a2b_hex("6827924a85e88b55ba00f8219128bd37" + "24c6b7d1dfe5629ef197925fecaff5ed" + "b9cdf3a7befd8ea2e8dd3707138b3ff8" + "7c3c39c57f439e562e2aa805a39d7cd7" + "9966d2ece7845f1dbc16bee99999e4d0" + "bf9eeca45fcda8a8500035fe6b5f03bc" + "2f6d1bfc4d4d0a3723961af0cdce4a01" + "eec82d7f5458ec19e71b90eeef7dff61")); + vector field_invq = + encode(0x02, wvutil::a2b_hex("57b73888d183a99a6307422277551a3d" + "9e18adf06a91e8b55ceffef9077c8496" + "948ecb3b16b78155cb2a3a57c119d379" + "951c010aa635edcf62d84c5a122a8d67" + "ab5fa9e5a4a8772a1e943bafc70ae3a4" + "c1f0f3a4ddffaefd1892c8cb33bb0d0b" + "9590e963a69110fb34db7b906fc4ba28" + "36995aac7e527490ac952a02268a4f18")); + + // Header of rsa key is constant. + encoded_rsa_key_ = wvutil::a2b_hex( + // 0x02 0x01 0x00 == integer, size 1 byte, value = 0 + // (field=version) + "020100" + // 0x30, sequence, size = d = 13 (field=pkeyalg) + // AlgorithmIdentifier + "300d" + // 0x06 = object identifier. length = 9 + // (this should be 1.2.840.113549.1.1.1) (field=algorithm) + "0609" + "2a" // 1*0x40 + 2 = 42 = 0x2a. + "8648" // 840 = 0x348, 0x03 *2 + 0x80 + (0x48>>15) = 0x86. + // 0x48 -> 0x48 + "86f70d" // 113549 = 0x1668d -> (110 , 1110111, 0001101) + // -> (0x80+0x06, 0x80+0x77, 0x0d) + "01" // 1 + "01" // 1 + "01" // 1 + "05" // null object. (field=parameter?) + "00" // size of null object + ); + + vector pkey = wvutil::a2b_hex("020100"); // integer, version = 0. + pkey = concat(pkey, field_n); + pkey = concat(pkey, field_e); + pkey = concat(pkey, field_d); + pkey = concat(pkey, field_p); + pkey = concat(pkey, field_q); + pkey = concat(pkey, field_exp1); + pkey = concat(pkey, field_exp2); + pkey = concat(pkey, field_invq); + pkey = encode(0x30, pkey); + pkey = encode(0x04, pkey); + + encoded_rsa_key_ = concat(encoded_rsa_key_, pkey); + encoded_rsa_key_ = encode(0x30, encoded_rsa_key_); // 0x30=sequence + } + + // This is used to test a signature from the file pkcs1v15sign-vectors.txt. + void TestSignature(RSA_Padding_Scheme scheme, const vector& message, + const vector& correct_signature) { + OEMCryptoResult sts; + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + // The application will compute the SHA-1 Hash of the message, so this + // test must do that also. + uint8_t hash[SHA_DIGEST_LENGTH]; + if (!SHA1(message.data(), message.size(), hash)) { + dump_boringssl_error(); + FAIL() << "boringssl error creating SHA1 hash."; + } + + // The application will prepend the digest info to the hash. + // SHA-1 digest info prefix = 0x30 0x21 0x30 ... + vector digest = wvutil::a2b_hex("3021300906052b0e03021a05000414"); + digest.insert(digest.end(), hash, hash + SHA_DIGEST_LENGTH); + + // OEMCrypto will apply the padding, and encrypt to generate the + // signature. + size_t signature_length = 0; + sts = OEMCrypto_GenerateRSASignature(s.session_id(), digest.data(), + digest.size(), nullptr, + &signature_length, scheme); + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); + ASSERT_NE(static_cast(0), signature_length); + + vector signature(signature_length); + sts = OEMCrypto_GenerateRSASignature(s.session_id(), digest.data(), + digest.size(), signature.data(), + &signature_length, scheme); + + ASSERT_EQ(OEMCrypto_SUCCESS, sts) + << "Failed to sign with padding scheme=" << (int)scheme + << ", size=" << message.size(); + signature.resize(signature_length); + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + + // Verify that the signature matches the official test vector. + ASSERT_EQ(correct_signature.size(), signature_length); + signature.resize(signature_length); + ASSERT_EQ(correct_signature, signature); + + // Also verify that our verification algorithm agrees. This is not + // needed to test OEMCrypto, but it does verify that this test is valid. + ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature(digest, signature.data(), + signature_length, scheme)); + ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature( + digest, correct_signature.data(), correct_signature.size(), scheme)); + } +}; + +// CAST Receivers should report that they support cast certificates. +TEST_F(OEMCryptoCastReceiverTest, SupportsCertificatesAPI13) { + ASSERT_NE(0u, + OEMCrypto_Supports_RSA_CAST & OEMCrypto_SupportedCertificates()); +} + +// # PKCS#1 v1.5 Signature Example 15.1 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_1) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "f45d55f35551e975d6a8dc7ea9f48859" + "3940cc75694a278f27e578a163d839b3" + "4040841808cf9c58c9b8728bf5f9ce8e" + "e811ea91714f47bab92d0f6d5a26fcfe" + "ea6cd93b910c0a2c963e64eb1823f102" + "753d41f0335910ad3a977104f1aaf6c3" + "742716a9755d11b8eed690477f445c5d" + "27208b2e284330fa3d301423fa7f2d08" + "6e0ad0b892b9db544e456d3f0dab85d9" + "53c12d340aa873eda727c8a649db7fa6" + "3740e25e9af1533b307e61329993110e" + "95194e039399c3824d24c51f22b26bde" + "1024cd395958a2dfeb4816a6e8adedb5" + "0b1f6b56d0b3060ff0f1c4cb0d0e001d" + "d59d73be12"); + vector signature = wvutil::a2b_hex( + "b75a5466b65d0f300ef53833f2175c8a" + "347a3804fc63451dc902f0b71f908345" + "9ed37a5179a3b723a53f1051642d7737" + "4c4c6c8dbb1ca20525f5c9f32db77695" + "3556da31290e22197482ceb69906c46a" + "758fb0e7409ba801077d2a0a20eae7d1" + "d6d392ab4957e86b76f0652d68b83988" + "a78f26e11172ea609bf849fbbd78ad7e" + "dce21de662a081368c040607cee29db0" + "627227f44963ad171d2293b633a392e3" + "31dca54fe3082752f43f63c161b447a4" + "c65a6875670d5f6600fcc860a1caeb0a" + "88f8fdec4e564398a5c46c87f68ce070" + "01f6213abe0ab5625f87d19025f08d81" + "dac7bd4586bc9382191f6d2880f6227e" + "5df3eed21e7792d249480487f3655261"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} +// # PKCS#1 v1.5 Signature Example 15.2 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_2) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "c14b4c6075b2f9aad661def4ecfd3cb9" + "33c623f4e63bf53410d2f016d1ab98e2" + "729eccf8006cd8e08050737d95fdbf29" + "6b66f5b9792a902936c4f7ac69f51453" + "ce4369452dc22d96f037748114662000" + "dd9cd3a5e179f4e0f81fa6a0311ca1ae" + "e6519a0f63cec78d27bb726393fb7f1f" + "88cde7c97f8a66cd66301281dac3f3a4" + "33248c75d6c2dcd708b6a97b0a3f325e" + "0b2964f8a5819e479b"); + vector signature = wvutil::a2b_hex( + "afa7343462bea122cc149fca70abdae7" + "9446677db5373666af7dc313015f4de7" + "86e6e394946fad3cc0e2b02bedba5047" + "fe9e2d7d099705e4a39f28683279cf0a" + "c85c1530412242c0e918953be000e939" + "cf3bf182525e199370fa7907eba69d5d" + "b4631017c0e36df70379b5db8d4c695a" + "979a8e6173224065d7dc15132ef28cd8" + "22795163063b54c651141be86d36e367" + "35bc61f31fca574e5309f3a3bbdf91ef" + "f12b99e9cc1744f1ee9a1bd22c5bad96" + "ad481929251f0343fd36bcf0acde7f11" + "e5ad60977721202796fe061f9ada1fc4" + "c8e00d6022a8357585ffe9fdd59331a2" + "8c4aa3121588fb6cf68396d8ac054659" + "9500c9708500a5972bd54f72cf8db0c8"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.3 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_3) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "d02371ad7ee48bbfdb2763de7a843b94" + "08ce5eb5abf847ca3d735986df84e906" + "0bdbcdd3a55ba55dde20d4761e1a21d2" + "25c1a186f4ac4b3019d3adf78fe63346" + "67f56f70c901a0a2700c6f0d56add719" + "592dc88f6d2306c7009f6e7a635b4cb3" + "a502dfe68ddc58d03be10a1170004fe7" + "4dd3e46b82591ff75414f0c4a03e605e" + "20524f2416f12eca589f111b75d639c6" + "1baa80cafd05cf3500244a219ed9ced9" + "f0b10297182b653b526f400f2953ba21" + "4d5bcd47884132872ae90d4d6b1f4215" + "39f9f34662a56dc0e7b4b923b6231e30" + "d2676797817f7c337b5ac824ba93143b" + "3381fa3dce0e6aebd38e67735187b1eb" + "d95c02"); + vector signature = wvutil::a2b_hex( + "3bac63f86e3b70271203106b9c79aabd" + "9f477c56e4ee58a4fce5baf2cab4960f" + "88391c9c23698be75c99aedf9e1abf17" + "05be1dac33140adb48eb31f450bb9efe" + "83b7b90db7f1576d33f40c1cba4b8d6b" + "1d3323564b0f1774114fa7c08e6d1e20" + "dd8fbba9b6ac7ad41e26b4568f4a8aac" + "bfd178a8f8d2c9d5f5b88112935a8bc9" + "ae32cda40b8d20375510735096536818" + "ce2b2db71a9772c9b0dda09ae10152fa" + "11466218d091b53d92543061b7294a55" + "be82ff35d5c32fa233f05aaac7585030" + "7ecf81383c111674397b1a1b9d3bf761" + "2ccbe5bacd2b38f0a98397b24c83658f" + "b6c0b4140ef11970c4630d44344e76ea" + "ed74dcbee811dbf6575941f08a6523b8"); + TestSignature(kSign_PKCS1_Block1, message, signature); +}; + +// # PKCS#1 v1.5 Signature Example 15.4 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_4) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "29035584ab7e0226a9ec4b02e8dcf127" + "2dc9a41d73e2820007b0f6e21feccd5b" + "d9dbb9ef88cd6758769ee1f956da7ad1" + "8441de6fab8386dbc693"); + vector signature = wvutil::a2b_hex( + "28d8e3fcd5dddb21ffbd8df1630d7377" + "aa2651e14cad1c0e43ccc52f907f946d" + "66de7254e27a6c190eb022ee89ecf622" + "4b097b71068cd60728a1aed64b80e545" + "7bd3106dd91706c937c9795f2b36367f" + "f153dc2519a8db9bdf2c807430c451de" + "17bbcd0ce782b3e8f1024d90624dea7f" + "1eedc7420b7e7caa6577cef43141a726" + "4206580e44a167df5e41eea0e69a8054" + "54c40eefc13f48e423d7a32d02ed42c0" + "ab03d0a7cf70c5860ac92e03ee005b60" + "ff3503424b98cc894568c7c56a023355" + "1cebe588cf8b0167b7df13adcad82867" + "6810499c704da7ae23414d69e3c0d2db" + "5dcbc2613bc120421f9e3653c5a87672" + "97643c7e0740de016355453d6c95ae72"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.5 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_5) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex("bda3a1c79059eae598308d3df609"); + vector signature = wvutil::a2b_hex( + "a156176cb96777c7fb96105dbd913bc4" + "f74054f6807c6008a1a956ea92c1f81c" + "b897dc4b92ef9f4e40668dc7c556901a" + "cb6cf269fe615b0fb72b30a513386923" + "14b0e5878a88c2c7774bd16939b5abd8" + "2b4429d67bd7ac8e5ea7fe924e20a6ec" + "662291f2548d734f6634868b039aa5f9" + "d4d906b2d0cb8585bf428547afc91c6e" + "2052ddcd001c3ef8c8eefc3b6b2a82b6" + "f9c88c56f2e2c3cb0be4b80da95eba37" + "1d8b5f60f92538743ddbb5da2972c71f" + "e7b9f1b790268a0e770fc5eb4d5dd852" + "47d48ae2ec3f26255a3985520206a1f2" + "68e483e9dbb1d5cab190917606de31e7" + "c5182d8f151bf41dfeccaed7cde690b2" + "1647106b490c729d54a8fe2802a6d126"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.6 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_6) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "c187915e4e87da81c08ed4356a0cceac" + "1c4fb5c046b45281b387ec28f1abfd56" + "7e546b236b37d01ae71d3b2834365d3d" + "f380b75061b736b0130b070be58ae8a4" + "6d12166361b613dbc47dfaeb4ca74645" + "6c2e888385525cca9dd1c3c7a9ada76d" + "6c"); + vector signature = wvutil::a2b_hex( + "9cab74163608669f7555a333cf196fe3" + "a0e9e5eb1a32d34bb5c85ff689aaab0e" + "3e65668ed3b1153f94eb3d8be379b8ee" + "f007c4a02c7071ce30d8bb341e58c620" + "f73d37b4ecbf48be294f6c9e0ecb5e63" + "fec41f120e5553dfa0ebebbb72640a95" + "37badcb451330229d9f710f62e3ed8ec" + "784e50ee1d9262b42671340011d7d098" + "c6f2557b2131fa9bd0254636597e88ec" + "b35a240ef0fd85957124df8080fee1e1" + "49af939989e86b26c85a5881fae8673d" + "9fd40800dd134eb9bdb6410f420b0aa9" + "7b20efcf2eb0c807faeb83a3ccd9b51d" + "4553e41dfc0df6ca80a1e81dc234bb83" + "89dd195a38b42de4edc49d346478b9f1" + "1f0557205f5b0bd7ffe9c850f396d7c4"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.7 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_7) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "abfa2ecb7d29bd5bcb9931ce2bad2f74" + "383e95683cee11022f08e8e7d0b8fa05" + "8bf9eb7eb5f98868b5bb1fb5c31ceda3" + "a64f1a12cdf20fcd0e5a246d7a1773d8" + "dba0e3b277545babe58f2b96e3f4edc1" + "8eabf5cd2a560fca75fe96e07d859def" + "b2564f3a34f16f11e91b3a717b41af53" + "f6605323001aa406c6"); + vector signature = wvutil::a2b_hex( + "c4b437bcf703f352e1faf74eb9622039" + "426b5672caf2a7b381c6c4f0191e7e4a" + "98f0eebcd6f41784c2537ff0f99e7498" + "2c87201bfbc65eae832db71d16dacadb" + "0977e5c504679e40be0f9db06ffd848d" + "d2e5c38a7ec021e7f68c47dfd38cc354" + "493d5339b4595a5bf31e3f8f13816807" + "373df6ad0dc7e731e51ad19eb4754b13" + "4485842fe709d378444d8e36b1724a4f" + "da21cafee653ab80747f7952ee804dea" + "b1039d84139945bbf4be82008753f3c5" + "4c7821a1d241f42179c794ef7042bbf9" + "955656222e45c34369a384697b6ae742" + "e18fa5ca7abad27d9fe71052e3310d0f" + "52c8d12ea33bf053a300f4afc4f098df" + "4e6d886779d64594d369158fdbc1f694"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.8 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_8) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "df4044a89a83e9fcbf1262540ae3038b" + "bc90f2b2628bf2a4467ac67722d8546b" + "3a71cb0ea41669d5b4d61859c1b4e47c" + "ecc5933f757ec86db0644e311812d00f" + "b802f03400639c0e364dae5aebc5791b" + "c655762361bc43c53d3c7886768f7968" + "c1c544c6f79f7be820c7e2bd2f9d73e6" + "2ded6d2e937e6a6daef90ee37a1a52a5" + "4f00e31addd64894cf4c02e16099e29f" + "9eb7f1a7bb7f84c47a2b594813be02a1" + "7b7fc43b34c22c91925264126c89f86b" + "b4d87f3ef131296c53a308e0331dac8b" + "af3b63422266ecef2b90781535dbda41" + "cbd0cf22a8cbfb532ec68fc6afb2ac06"); + vector signature = wvutil::a2b_hex( + "1414b38567ae6d973ede4a06842dcc0e" + "0559b19e65a4889bdbabd0fd02806829" + "13bacd5dc2f01b30bb19eb810b7d9ded" + "32b284f147bbe771c930c6052aa73413" + "90a849f81da9cd11e5eccf246dbae95f" + "a95828e9ae0ca3550325326deef9f495" + "30ba441bed4ac29c029c9a2736b1a419" + "0b85084ad150426b46d7f85bd702f48d" + "ac5f71330bc423a766c65cc1dcab20d3" + "d3bba72b63b3ef8244d42f157cb7e3a8" + "ba5c05272c64cc1ad21a13493c3911f6" + "0b4e9f4ecc9900eb056ee59d6fe4b8ff" + "6e8048ccc0f38f2836fd3dfe91bf4a38" + "6e1ecc2c32839f0ca4d1b27a568fa940" + "dd64ad16bd0125d0348e383085f08894" + "861ca18987227d37b42b584a8357cb04"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.9 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_9) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "ea941ff06f86c226927fcf0e3b11b087" + "2676170c1bfc33bda8e265c77771f9d0" + "850164a5eecbcc5ce827fbfa07c85214" + "796d8127e8caa81894ea61ceb1449e72" + "fea0a4c943b2da6d9b105fe053b9039a" + "9cc53d420b7539fab2239c6b51d17e69" + "4c957d4b0f0984461879a0759c4401be" + "ecd4c606a0afbd7a076f50a2dfc2807f" + "24f1919baa7746d3a64e268ed3f5f8e6" + "da83a2a5c9152f837cb07812bd5ba7d3" + "a07985de88113c1796e9b466ec299c5a" + "c1059e27f09415"); + vector signature = wvutil::a2b_hex( + "ceeb84ccb4e9099265650721eea0e8ec" + "89ca25bd354d4f64564967be9d4b08b3" + "f1c018539c9d371cf8961f2291fbe0dc" + "2f2f95fea47b639f1e12f4bc381cef0c" + "2b7a7b95c3adf27605b7f63998c3cbad" + "542808c3822e064d4ad14093679e6e01" + "418a6d5c059684cd56e34ed65ab605b8" + "de4fcfa640474a54a8251bbb7326a42d" + "08585cfcfc956769b15b6d7fdf7da84f" + "81976eaa41d692380ff10eaecfe0a579" + "682909b5521fade854d797b8a0345b9a" + "864e0588f6caddbf65f177998e180d1f" + "102443e6dca53a94823caa9c3b35f322" + "583c703af67476159ec7ec93d1769b30" + "0af0e7157dc298c6cd2dee2262f8cddc" + "10f11e01741471bbfd6518a175734575"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.10 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_10) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "d8b81645c13cd7ecf5d00ed2c91b9acd" + "46c15568e5303c4a9775ede76b48403d" + "6be56c05b6b1cf77c6e75de096c5cb35" + "51cb6fa964f3c879cf589d28e1da2f9d" + "ec"); + vector signature = wvutil::a2b_hex( + "2745074ca97175d992e2b44791c323c5" + "7167165cdd8da579cdef4686b9bb404b" + "d36a56504eb1fd770f60bfa188a7b24b" + "0c91e881c24e35b04dc4dd4ce38566bc" + "c9ce54f49a175fc9d0b22522d9579047" + "f9ed42eca83f764a10163997947e7d2b" + "52ff08980e7e7c2257937b23f3d279d4" + "cd17d6f495546373d983d536efd7d1b6" + "7181ca2cb50ac616c5c7abfbb9260b91" + "b1a38e47242001ff452f8de10ca6eaea" + "dcaf9edc28956f28a711291fc9a80878" + "b8ba4cfe25b8281cb80bc9cd6d2bd182" + "5246eebe252d9957ef93707352084e6d" + "36d423551bf266a85340fb4a6af37088" + "0aab07153d01f48d086df0bfbec05e7b" + "443b97e71718970e2f4bf62023e95b67"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.11 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_11) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "e5739b6c14c92d510d95b826933337ff" + "0d24ef721ac4ef64c2bad264be8b44ef" + "a1516e08a27eb6b611d3301df0062dae" + "fc73a8c0d92e2c521facbc7b26473876" + "7ea6fc97d588a0baf6ce50adf79e600b" + "d29e345fcb1dba71ac5c0289023fe4a8" + "2b46a5407719197d2e958e3531fd54ae" + "f903aabb4355f88318994ed3c3dd62f4" + "20a7"); + vector signature = wvutil::a2b_hex( + "be40a5fb94f113e1b3eff6b6a33986f2" + "02e363f07483b792e68dfa5554df0466" + "cc32150950783b4d968b639a04fd2fb9" + "7f6eb967021f5adccb9fca95acc8f2cd" + "885a380b0a4e82bc760764dbab88c1e6" + "c0255caa94f232199d6f597cc9145b00" + "e3d4ba346b559a8833ad1516ad5163f0" + "16af6a59831c82ea13c8224d84d0765a" + "9d12384da460a8531b4c407e04f4f350" + "709eb9f08f5b220ffb45abf6b75d1579" + "fd3f1eb55fc75b00af8ba3b087827fe9" + "ae9fb4f6c5fa63031fe582852fe2834f" + "9c89bff53e2552216bc7c1d4a3d5dc2b" + "a6955cd9b17d1363e7fee8ed7629753f" + "f3125edd48521ae3b9b03217f4496d0d" + "8ede57acbc5bd4deae74a56f86671de2"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.12 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_12) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "7af42835917a88d6b3c6716ba2f5b0d5" + "b20bd4e2e6e574e06af1eef7c81131be" + "22bf8128b9cbc6ec00275ba80294a5d1" + "172d0824a79e8fdd830183e4c00b9678" + "2867b1227fea249aad32ffc5fe007bc5" + "1f21792f728deda8b5708aa99cabab20" + "a4aa783ed86f0f27b5d563f42e07158c" + "ea72d097aa6887ec411dd012912a5e03" + "2bbfa678507144bcc95f39b58be7bfd1" + "759adb9a91fa1d6d8226a8343a8b849d" + "ae76f7b98224d59e28f781f13ece605f" + "84f6c90bae5f8cf378816f4020a7dda1" + "bed90c92a23634d203fac3fcd86d68d3" + "182a7d9ccabe7b0795f5c655e9acc4e3" + "ec185140d10cef053464ab175c83bd83" + "935e3dabaf3462eebe63d15f573d269a"); + vector signature = wvutil::a2b_hex( + "4e78c5902b807914d12fa537ae6871c8" + "6db8021e55d1adb8eb0ccf1b8f36ab7d" + "ad1f682e947a627072f03e627371781d" + "33221d174abe460dbd88560c22f69011" + "6e2fbbe6e964363a3e5283bb5d946ef1" + "c0047eba038c756c40be7923055809b0" + "e9f34a03a58815ebdde767931f018f6f" + "1878f2ef4f47dd374051dd48685ded6e" + "fb3ea8021f44be1d7d149398f98ea9c0" + "8d62888ebb56192d17747b6b8e170954" + "31f125a8a8e9962aa31c285264e08fb2" + "1aac336ce6c38aa375e42bc92ab0ab91" + "038431e1f92c39d2af5ded7e43bc151e" + "6ebea4c3e2583af3437e82c43c5e3b5b" + "07cf0359683d2298e35948ed806c063c" + "606ea178150b1efc15856934c7255cfe"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.13 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_13) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "ebaef3f9f23bdfe5fa6b8af4c208c189" + "f2251bf32f5f137b9de4406378686b3f" + "0721f62d24cb8688d6fc41a27cbae21d" + "30e429feacc7111941c277"); + vector signature = wvutil::a2b_hex( + "c48dbef507114f03c95fafbeb4df1bfa" + "88e0184a33cc4f8a9a1035ff7f822a5e" + "38cda18723915ff078244429e0f6081c" + "14fd83331fa65c6ba7bb9a12dbf66223" + "74cd0ca57de3774e2bd7ae823677d061" + "d53ae9c4040d2da7ef7014f3bbdc95a3" + "61a43855c8ce9b97ecabce174d926285" + "142b534a3087f9f4ef74511ec742b0d5" + "685603faf403b5072b985df46adf2d25" + "29a02d40711e2190917052371b79b749" + "b83abf0ae29486c3f2f62477b2bd362b" + "039c013c0c5076ef520dbb405f42cee9" + "5425c373a975e1cdd032c49622c85079" + "b09e88dab2b13969ef7a723973781040" + "459f57d5013638483de2d91cb3c490da" + "81c46de6cd76ea8a0c8f6fe331712d24"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.14 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_14) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "c5a2711278761dfcdd4f0c99e6f5619d" + "6c48b5d4c1a80982faa6b4cf1cf7a60f" + "f327abef93c801429efde08640858146" + "1056acc33f3d04f5ada21216cacd5fd1" + "f9ed83203e0e2fe6138e3eae8424e591" + "5a083f3f7ab76052c8be55ae882d6ec1" + "482b1e45c5dae9f41015405327022ec3" + "2f0ea2429763b255043b1958ee3cf6d6" + "3983596eb385844f8528cc9a9865835d" + "c5113c02b80d0fca68aa25e72bcaaeb3" + "cf9d79d84f984fd417"); + vector signature = wvutil::a2b_hex( + "6bd5257aa06611fb4660087cb4bc4a9e" + "449159d31652bd980844daf3b1c7b353" + "f8e56142f7ea9857433b18573b4deede" + "818a93b0290297783f1a2f23cbc72797" + "a672537f01f62484cd4162c3214b9ac6" + "28224c5de01f32bb9b76b27354f2b151" + "d0e8c4213e4615ad0bc71f515e300d6a" + "64c6743411fffde8e5ff190e54923043" + "126ecfc4c4539022668fb675f25c07e2" + "0099ee315b98d6afec4b1a9a93dc3349" + "6a15bd6fde1663a7d49b9f1e639d3866" + "4b37a010b1f35e658682d9cd63e57de0" + "f15e8bdd096558f07ec0caa218a8c06f" + "4788453940287c9d34b6d40a3f09bf77" + "99fe98ae4eb49f3ff41c5040a50cefc9" + "bdf2394b749cf164480df1ab6880273b"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.15 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_15) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "9bf8aa253b872ea77a7e23476be26b23" + "29578cf6ac9ea2805b357f6fc3ad130d" + "baeb3d869a13cce7a808bbbbc969857e" + "03945c7bb61df1b5c2589b8e046c2a5d" + "7e4057b1a74f24c711216364288529ec" + "9570f25197213be1f5c2e596f8bf8b2c" + "f3cb38aa56ffe5e31df7395820e94ecf" + "3b1189a965dcf9a9cb4298d3c88b2923" + "c19fc6bc34aacecad4e0931a7c4e5d73" + "dc86dfa798a8476d82463eefaa90a8a9" + "192ab08b23088dd58e1280f7d72e4548" + "396baac112252dd5c5346adb2004a2f7" + "101ccc899cc7fafae8bbe295738896a5" + "b2012285014ef6"); + vector signature = wvutil::a2b_hex( + "27f7f4da9bd610106ef57d32383a448a" + "8a6245c83dc1309c6d770d357ba89e73" + "f2ad0832062eb0fe0ac915575bcd6b8b" + "cadb4e2ba6fa9da73a59175152b2d4fe" + "72b070c9b7379e50000e55e6c269f665" + "8c937972797d3add69f130e34b85bdec" + "9f3a9b392202d6f3e430d09caca82277" + "59ab825f7012d2ff4b5b62c8504dbad8" + "55c05edd5cab5a4cccdc67f01dd6517c" + "7d41c43e2a4957aff19db6f18b17859a" + "f0bc84ab67146ec1a4a60a17d7e05f8b" + "4f9ced6ad10908d8d78f7fc88b76adc8" + "290f87daf2a7be10ae408521395d54ed" + "2556fb7661854a730ce3d82c71a8d493" + "ec49a378ac8a3c74439f7cc555ba13f8" + "59070890ee18ff658fa4d741969d70a5"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.16 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_16) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "32474830e2203754c8bf0681dc4f842a" + "fe360930378616c108e833656e5640c8" + "6856885bb05d1eb9438efede679263de" + "07cb39553f6a25e006b0a52311a063ca" + "088266d2564ff6490c46b5609818548f" + "88764dad34a25e3a85d575023f0b9e66" + "5048a03c350579a9d32446c7bb96cc92" + "e065ab94d3c8952e8df68ef0d9fa456b" + "3a06bb80e3bbc4b28e6a94b6d0ff7696" + "a64efe05e735fea025d7bdbc4139f3a3" + "b546075cba7efa947374d3f0ac80a68d" + "765f5df6210bca069a2d88647af7ea04" + "2dac690cb57378ec0777614fb8b65ff4" + "53ca6b7dce6098451a2f8c0da9bfecf1" + "fdf391bbaa4e2a91ca18a1121a7523a2" + "abd42514f489e8"); + vector signature = wvutil::a2b_hex( + "6917437257c22ccb5403290c3dee82d9" + "cf7550b31bd31c51bd57bfd35d452ab4" + "db7c4be6b2e25ac9a59a1d2a7feb627f" + "0afd4976b3003cc9cffd8896505ec382" + "f265104d4cf8c932fa9fe86e00870795" + "9912389da4b2d6b369b36a5e72e29d24" + "c9a98c9d31a3ab44e643e6941266a47a" + "45e3446ce8776abe241a8f5fc6423b24" + "b1ff250dc2c3a8172353561077e850a7" + "69b25f0325dac88965a3b9b472c494e9" + "5f719b4eac332caa7a65c7dfe46d9aa7" + "e6e00f525f303dd63ab7919218901868" + "f9337f8cd26aafe6f33b7fb2c98810af" + "19f7fcb282ba1577912c1d368975fd5d" + "440b86e10c199715fa0b6f4250b53373" + "2d0befe1545150fc47b876de09b00a94"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.17 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_17) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "008e59505eafb550aae5e845584cebb0" + "0b6de1733e9f95d42c882a5bbeb5ce1c" + "57e119e7c0d4daca9f1ff7870217f7cf" + "d8a6b373977cac9cab8e71e420"); + vector signature = wvutil::a2b_hex( + "922503b673ee5f3e691e1ca85e9ff417" + "3cf72b05ac2c131da5603593e3bc259c" + "94c1f7d3a06a5b9891bf113fa39e59ff" + "7c1ed6465e908049cb89e4e125cd37d2" + "ffd9227a41b4a0a19c0a44fbbf3de55b" + "ab802087a3bb8d4ff668ee6bbb8ad89e" + "6857a79a9c72781990dfcf92cd519404" + "c950f13d1143c3184f1d250c90e17ac6" + "ce36163b9895627ad6ffec1422441f55" + "e4499dba9be89546ae8bc63cca01dd08" + "463ae7f1fce3d893996938778c1812e6" + "74ad9c309c5acca3fde44e7dd8695993" + "e9c1fa87acda99ece5c8499e468957ad" + "66359bf12a51adbe78d3a213b449bf0b" + "5f8d4d496acf03d3033b7ccd196bc22f" + "68fb7bef4f697c5ea2b35062f48a36dd"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.18 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_18) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "6abc54cf8d1dff1f53b17d8160368878" + "a8788cc6d22fa5c2258c88e660b09a89" + "33f9f2c0504ddadc21f6e75e0b833beb" + "555229dee656b9047b92f62e76b8ffcc" + "60dab06b80"); + vector signature = wvutil::a2b_hex( + "0b6daf42f7a862147e417493c2c401ef" + "ae32636ab4cbd44192bbf5f195b50ae0" + "96a475a1614f0a9fa8f7a026cb46c650" + "6e518e33d83e56477a875aca8c7e714c" + "e1bdbd61ef5d535239b33f2bfdd61771" + "bab62776d78171a1423cea8731f82e60" + "766d6454265620b15f5c5a584f55f95b" + "802fe78c574ed5dacfc831f3cf2b0502" + "c0b298f25ccf11f973b31f85e4744219" + "85f3cff702df3946ef0a6605682111b2" + "f55b1f8ab0d2ea3a683c69985ead93ed" + "449ea48f0358ddf70802cb41de2fd83f" + "3c808082d84936948e0c84a131b49278" + "27460527bb5cd24bfab7b48e071b2417" + "1930f99763272f9797bcb76f1d248157" + "5558fcf260b1f0e554ebb3df3cfcb958"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.19 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_19) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "af2d78152cf10efe01d274f217b177f6" + "b01b5e749f1567715da324859cd3dd88" + "db848ec79f48dbba7b6f1d33111ef31b" + "64899e7391c2bffd69f49025cf201fc5" + "85dbd1542c1c778a2ce7a7ee108a309f" + "eca26d133a5ffedc4e869dcd7656596a" + "c8427ea3ef6e3fd78fe99d8ddc71d839" + "f6786e0da6e786bd62b3a4f19b891a56" + "157a554ec2a2b39e25a1d7c7d37321c7" + "a1d946cf4fbe758d9276f08563449d67" + "414a2c030f4251cfe2213d04a5410637" + "87"); + vector signature = wvutil::a2b_hex( + "209c61157857387b71e24bf3dd564145" + "50503bec180ff53bdd9bac062a2d4995" + "09bf991281b79527df9136615b7a6d9d" + "b3a103b535e0202a2caca197a7b74e53" + "56f3dd595b49acfd9d30049a98ca88f6" + "25bca1d5f22a392d8a749efb6eed9b78" + "21d3110ac0d244199ecb4aa3d735a83a" + "2e8893c6bf8581383ccaee834635b7fa" + "1faffa45b13d15c1da33af71e89303d6" + "8090ff62ee615fdf5a84d120711da53c" + "2889198ab38317a9734ab27d67924cea" + "74156ff99bef9876bb5c339e93745283" + "e1b34e072226b88045e017e9f05b2a8c" + "416740258e223b2690027491732273f3" + "229d9ef2b1b3807e321018920ad3e53d" + "ae47e6d9395c184b93a374c671faa2ce"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +// # PKCS#1 v1.5 Signature Example 15.20 +TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_20) { + BuildRSAKey(); + LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); + vector message = wvutil::a2b_hex( + "40ee992458d6f61486d25676a96dd2cb" + "93a37f04b178482f2b186cf88215270d" + "ba29d786d774b0c5e78c7f6e56a956e7" + "f73950a2b0c0c10a08dbcd67e5b210bb" + "21c58e2767d44f7dd4014e3966143bf7" + "e3d66ff0c09be4c55f93b39994b8518d" + "9c1d76d5b47374dea08f157d57d70634" + "978f3856e0e5b481afbbdb5a3ac48d48" + "4be92c93de229178354c2de526e9c65a" + "31ede1ef68cb6398d7911684fec0babc" + "3a781a66660783506974d0e14825101c" + "3bfaea"); + vector signature = wvutil::a2b_hex( + "927502b824afc42513ca6570de338b8a" + "64c3a85eb828d3193624f27e8b1029c5" + "5c119c9733b18f5849b3500918bcc005" + "51d9a8fdf53a97749fa8dc480d6fe974" + "2a5871f973926528972a1af49e3925b0" + "adf14a842719b4a5a2d89fa9c0b6605d" + "212bed1e6723b93406ad30e86829a5c7" + "19b890b389306dc5506486ee2f36a8df" + "e0a96af678c9cbd6aff397ca200e3edc" + "1e36bd2f08b31d540c0cb282a9559e4a" + "dd4fc9e6492eed0ccbd3a6982e5faa2d" + "dd17be47417c80b4e5452d31f72401a0" + "42325109544d954c01939079d409a5c3" + "78d7512dfc2d2a71efcc3432a765d1c6" + "a52cfce899cd79b15b4fc3723641ef6b" + "d00acc10407e5df58dd1c3c5c559a506"); + TestSignature(kSign_PKCS1_Block1, message, signature); +} + +TEST_P(OEMCryptoSessionTestLoadCasKeysWithHDCP, CasOnlyLoadCasKeysAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } + // Test parameterized by HDCP version. + LoadCasKeysWithHDCP(static_cast(GetParam())); +} +INSTANTIATE_TEST_SUITE_P(TestHDCP, OEMCryptoSessionTestLoadCasKeysWithHDCP, + Range(1, 6)); +} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_cast_test.h b/oemcrypto/test/oemcrypto_cast_test.h new file mode 100644 index 0000000..b6e2116 --- /dev/null +++ b/oemcrypto/test/oemcrypto_cast_test.h @@ -0,0 +1,228 @@ +// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary +// source code may only be used and distributed under the Widevine +// License Agreement. +// +// Test data for OEMCrypto unit tests. +// +#ifndef CDM_OEMCRYPTO_CAST_TEST_ +#define CDM_OEMCRYPTO_CAST_TEST_ + +#include + +#include + +#include "OEMCryptoCENC.h" +#include "oemcrypto_provisioning_test.h" +#include "oemcrypto_session_tests_helper.h" + +namespace wvoec { + +const char* HDCPCapabilityAsString(OEMCrypto_HDCP_Capability value); + +std::string MaybeHex(const uint8_t* data, size_t length); +std::string MaybeHex(const std::vector& data); + +// This test attempts to use alternate algorithms for loaded device certs. +class OEMCryptoLoadsCertificateAlternates : public OEMCryptoLoadsCertificate { + protected: + void DisallowForbiddenPadding(RSA_Padding_Scheme scheme, size_t size) { + OEMCryptoResult sts; + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + // Sign a Message + vector licenseRequest(size); + GetRandBytes(licenseRequest.data(), licenseRequest.size()); + size_t signature_length = 256; + vector signature(signature_length); + sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), + signature.data(), &signature_length, scheme); + // Allow OEMCrypto to request a full buffer. + if (sts == OEMCrypto_ERROR_SHORT_BUFFER) { + ASSERT_NE(static_cast(0), signature_length); + signature.assign(signature_length, 0); + sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), + signature.data(), &signature_length, scheme); + } + + EXPECT_NE(OEMCrypto_SUCCESS, sts) + << "Signed with forbidden padding scheme=" << (int)scheme + << ", size=" << (int)size; + const vector zero(signature.size(), 0); + ASSERT_EQ(zero, signature); // signature should not be computed. + } + + void TestSignature(RSA_Padding_Scheme scheme, size_t size) { + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + vector licenseRequest(size); + GetRandBytes(licenseRequest.data(), licenseRequest.size()); + size_t signature_length = 0; + OEMCryptoResult sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), nullptr, + &signature_length, scheme); + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); + ASSERT_NE(static_cast(0), signature_length); + + std::vector signature(signature_length, 0); + sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), + signature.data(), &signature_length, scheme); + + ASSERT_EQ(OEMCrypto_SUCCESS, sts) + << "Failed to sign with padding scheme=" << (int)scheme + << ", size=" << size; + signature.resize(signature_length); + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature( + licenseRequest, signature.data(), signature_length, scheme)); + } + + void DisallowDeriveKeys() { + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + s.GenerateNonce(); + vector session_key; + vector enc_session_key; + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_TRUE(s.GenerateRsaSessionKey(&session_key, &enc_session_key)); + vector mac_context; + vector enc_context; + s.FillDefaultContext(&mac_context, &enc_context); + ASSERT_NE(OEMCrypto_SUCCESS, + OEMCrypto_DeriveKeysFromSessionKey( + s.session_id(), enc_session_key.data(), + enc_session_key.size(), mac_context.data(), + mac_context.size(), enc_context.data(), enc_context.size())); + } + + // If force is true, we assert that the key loads successfully. + void LoadWithAllowedSchemes(uint32_t schemes, bool force) { + // prov 2 or prov 3 + if (global_features.provisioning_method == OEMCrypto_Keybox || + global_features.provisioning_method == OEMCrypto_OEMCertificate) { + Session s; + ProvisioningRoundTrip provisioning_messages(&s, encoded_rsa_key_); + provisioning_messages.set_allowed_schemes(schemes); + provisioning_messages.PrepareSession(keybox_); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.EncryptAndSignResponse()); + OEMCryptoResult sts = provisioning_messages.LoadResponse(); + key_loaded_ = (OEMCrypto_SUCCESS == sts); + if (key_loaded_) { + uint8_t* ptr = provisioning_messages.response_data().rsa_key; + size_t len = provisioning_messages.response_data().rsa_key_length; + encoded_rsa_key_ = std::vector(ptr, ptr + len); + wrapped_drm_key_ = provisioning_messages.wrapped_rsa_key(); + drm_key_type_ = OEMCrypto_RSA_Private_Key; + EXPECT_GT(wrapped_drm_key_.size(), 0u); + EXPECT_EQ(nullptr, find(wrapped_drm_key_, encoded_rsa_key_)); + } + if (force) { + EXPECT_EQ(OEMCrypto_SUCCESS, sts); + } + } else if (global_features.provisioning_method == + OEMCrypto_BootCertificateChain) { + Session s1; + ASSERT_NO_FATAL_FAILURE(s1.open()); + ASSERT_NO_FATAL_FAILURE(CreateProv4OEMKey(&s1)); + + Session s2; + ASSERT_NO_FATAL_FAILURE(s2.open()); + ASSERT_EQ(OEMCrypto_InstallOemPrivateKey(s2.session_id(), oem_key_type_, + wrapped_oem_key_.data(), + wrapped_oem_key_.size()), + OEMCrypto_SUCCESS); + Provisioning40CastRoundTrip prov_cast(&s2, encoded_rsa_key_); + prov_cast.set_allowed_schemes(schemes); + ASSERT_NO_FATAL_FAILURE(prov_cast.PrepareSession()); + ASSERT_NO_FATAL_FAILURE(prov_cast.LoadDRMPrivateKey()); + + ASSERT_NO_FATAL_FAILURE(s2.SetPublicKeyFromSubjectPublicKey( + prov_cast.drm_key_type(), prov_cast.drm_public_key().data(), + prov_cast.drm_public_key().size())); + ASSERT_NO_FATAL_FAILURE(prov_cast.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(s2.GenerateDerivedKeysFromSessionKey()); + ASSERT_NO_FATAL_FAILURE(prov_cast.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(prov_cast.EncryptAndSignResponse()); + OEMCryptoResult sts = prov_cast.LoadResponse(); + key_loaded_ = (OEMCrypto_SUCCESS == sts); + if (key_loaded_) { + uint8_t* ptr = prov_cast.response_data().rsa_key; + size_t len = prov_cast.response_data().rsa_key_length; + encoded_rsa_key_ = std::vector(ptr, ptr + len); + wrapped_drm_key_ = prov_cast.wrapped_rsa_key(); + drm_key_type_ = OEMCrypto_RSA_Private_Key; + EXPECT_GT(wrapped_drm_key_.size(), 0u); + EXPECT_EQ(nullptr, find(wrapped_drm_key_, encoded_rsa_key_)); + } + if (force) { + EXPECT_EQ(OEMCrypto_SUCCESS, sts); + } + } else { + FAIL() << "Unsupported provisioning method"; + } + } + + bool key_loaded_ = false; +}; + +// Used to test the different HDCP versions. This test is parameterized by the +// required HDCP version in the key control block. +class OEMCryptoSessionTestLoadCasKeysWithHDCP : public OEMCryptoSessionTests, + public WithParamInterface { + protected: + void LoadCasKeysWithHDCP(OEMCrypto_HDCP_Capability version) { + OEMCryptoResult sts; + OEMCrypto_HDCP_Capability current, maximum; + sts = OEMCrypto_GetHDCPCapability(¤t, &maximum); + ASSERT_EQ(OEMCrypto_SUCCESS, sts); + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&s)); + LicenseRoundTrip license_messages(&s); + license_messages.set_control((version << wvoec::kControlHDCPVersionShift) | + wvoec::kControlObserveHDCP | + wvoec::kControlHDCPRequired); + license_messages.set_license_type(OEMCrypto_EntitlementLicense); + ASSERT_NO_FATAL_FAILURE(license_messages.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages.LoadResponse()); + + uint32_t key_session_id; + sts = OEMCrypto_CreateEntitledKeySession(s.session_id(), &key_session_id); + ASSERT_EQ(OEMCrypto_SUCCESS, sts); + EntitledMessage entitled_message_1(&license_messages); + entitled_message_1.FillKeyArray(); + entitled_message_1.SetEntitledKeySession(key_session_id); + + if (((version <= HDCP_V2_3 || current >= HDCP_V1_0) && version > current) || + (current == HDCP_V1 && version >= HDCP_V1_0)) { + ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadCasKeys( + /*load_even=*/true, /*load_odd=*/true, + OEMCrypto_ERROR_INSUFFICIENT_HDCP)) + << "Failed when current HDCP = " << HDCPCapabilityAsString(current) + << ", maximum HDCP = " << HDCPCapabilityAsString(maximum) + << ", license HDCP = " << HDCPCapabilityAsString(version); + } else { + ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadCasKeys( + /*load_even=*/true, /*load_odd=*/true, OEMCrypto_SUCCESS)) + << "Failed when current HDCP = " << HDCPCapabilityAsString(current) + << ", maximum HDCP = " << HDCPCapabilityAsString(maximum) + << ", license HDCP = " << HDCPCapabilityAsString(version); + } + } +}; +} // namespace wvoec + +#endif // CDM_OEMCRYPTO_CAST_TEST_ diff --git a/oemcrypto/test/oemcrypto_corpus_generator_helper.h b/oemcrypto/test/oemcrypto_corpus_generator_helper.h index 7b7b399..e3a73b4 100644 --- a/oemcrypto/test/oemcrypto_corpus_generator_helper.h +++ b/oemcrypto/test/oemcrypto_corpus_generator_helper.h @@ -14,7 +14,7 @@ namespace wvoec { const uint8_t kFuzzDataSeparator[] = {'-', '_', '^', '_'}; void AppendToFile(const std::string& file_name, const char* message, - const size_t message_size); + size_t message_size); // Function to append separator "-_^_" between contents of corpus file. void AppendSeparator(const std::string& file_name); diff --git a/oemcrypto/test/oemcrypto_generic_crypto_test.cpp b/oemcrypto/test/oemcrypto_generic_crypto_test.cpp new file mode 100644 index 0000000..867b4f8 --- /dev/null +++ b/oemcrypto/test/oemcrypto_generic_crypto_test.cpp @@ -0,0 +1,577 @@ +// 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 "oemcrypto_usage_table_test.h" + +using ::testing::Range; + +namespace wvoec { + +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyLoad) { EncryptAndLoadKeys(); } + +// Test that the Generic_Encrypt function works correctly. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncrypt) { + EncryptAndLoadKeys(); + unsigned int key_index = 0; + vector expected_encrypted; + EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector encrypted(clear_buffer_.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericEncrypt(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); + ASSERT_EQ(expected_encrypted, encrypted); +} + +// Test that the Generic_Encrypt function fails when not allowed. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadEncrypt) { + EncryptAndLoadKeys(); + BadEncrypt(0, OEMCrypto_HMAC_SHA256, buffer_size_); + // The buffer size must be a multiple of 16, so subtracting 10 is bad. + BadEncrypt(0, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_ - 10); + BadEncrypt(1, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); + BadEncrypt(2, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); + BadEncrypt(3, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); +} + +// Test that the Generic_Encrypt works if the input and output buffers are the +// same. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncryptSameBufferAPI12) { + EncryptAndLoadKeys(); + unsigned int key_index = 0; + vector expected_encrypted; + EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + // Input and output are same buffer: + vector buffer = clear_buffer_; + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericEncrypt(key_handle.data(), key_handle.size(), buffer.data(), + buffer.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, + buffer.data())); + ASSERT_EQ(expected_encrypted, buffer); +} + +TEST_P( + OEMCryptoGenericCryptoTest, + OEMCryptoMemoryGenericKeyEncryptForHugeBufferWithBufferLengthNotMultipleOf16) { + EncryptAndLoadKeys(); + unsigned int key_index = 0; + vector expected_encrypted; + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector buffer(17); + ASSERT_NO_FATAL_FAILURE(OEMCrypto_Generic_Encrypt( + key_handle.data(), key_handle.size(), buffer.data(), buffer.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, buffer.data())); +} + +// Test Generic_Decrypt works correctly. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecrypt) { + EncryptAndLoadKeys(); + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); + ASSERT_EQ(clear_buffer_, resultant); +} + +// Test that Generic_Decrypt works correctly when the input and output buffers +// are the same. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecryptSameBufferAPI12) { + EncryptAndLoadKeys(); + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector buffer = encrypted; + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), buffer.data(), + buffer.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, + buffer.data())); + ASSERT_EQ(clear_buffer_, buffer); +} + +// Test that Generic_Decrypt fails to decrypt to an insecure buffer if the key +// requires a secure data path. +TEST_P(OEMCryptoGenericCryptoTest, GenericSecureToClear) { + license_messages_.set_control(wvoec::kControlObserveDataPath | + wvoec::kControlDataPathSecure); + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_NE(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); + ASSERT_NE(clear_buffer_, resultant); +} + +// Test that the Generic_Decrypt function fails when not allowed. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadDecrypt) { + EncryptAndLoadKeys(); + BadDecrypt(1, OEMCrypto_HMAC_SHA256, buffer_size_); + // The buffer size must be a multiple of 16, so subtracting 10 is bad. + BadDecrypt(1, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_ - 10); + BadDecrypt(0, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); + BadDecrypt(2, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); + BadDecrypt(3, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); +} + +TEST_P(OEMCryptoGenericCryptoTest, GenericKeySign) { + EncryptAndLoadKeys(); + unsigned int key_index = 2; + vector expected_signature; + SignBuffer(key_index, clear_buffer_, &expected_signature); + + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + size_t gen_signature_length = 0; + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, + GenericSign(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), + OEMCrypto_HMAC_SHA256, nullptr, &gen_signature_length)); + ASSERT_EQ(static_cast(SHA256_DIGEST_LENGTH), gen_signature_length); + vector signature(SHA256_DIGEST_LENGTH); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + &gen_signature_length)); + ASSERT_EQ(expected_signature, signature); +} + +// Test that the Generic_Sign function fails when not allowed. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadSign) { + EncryptAndLoadKeys(); + BadSign(0, OEMCrypto_HMAC_SHA256); // Can't sign with encrypt key. + BadSign(1, OEMCrypto_HMAC_SHA256); // Can't sign with decrypt key. + BadSign(3, OEMCrypto_HMAC_SHA256); // Can't sign with verify key. + BadSign(2, OEMCrypto_AES_CBC_128_NO_PADDING); // Bad signing algorithm. +} + +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyVerify) { + EncryptAndLoadKeys(); + unsigned int key_index = 3; + vector signature; + SignBuffer(key_index, clear_buffer_, &signature); + + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, + signature.data(), signature.size())); +} + +// Test that the Generic_Verify function fails when not allowed. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadVerify) { + EncryptAndLoadKeys(); + BadVerify(0, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); + BadVerify(1, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); + BadVerify(2, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); + BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, true); + BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH - 1, false); + BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH + 1, false); + BadVerify(3, OEMCrypto_AES_CBC_128_NO_PADDING, SHA256_DIGEST_LENGTH, false); +} + +// Test Generic_Encrypt with the maximum buffer size. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncryptLargeBuffer) { + ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); + EncryptAndLoadKeys(); + unsigned int key_index = 0; + vector expected_encrypted; + EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector encrypted(clear_buffer_.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericEncrypt(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); + ASSERT_EQ(expected_encrypted, encrypted); +} + +// Test Generic_Decrypt with the maximum buffer size. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecryptLargeBuffer) { + // Some applications are known to pass in a block that is almost 400k. + ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); + EncryptAndLoadKeys(); + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); + ASSERT_EQ(clear_buffer_, resultant); +} + +// Test Generic_Sign with the maximum buffer size. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeySignLargeBuffer) { + ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); + EncryptAndLoadKeys(); + unsigned int key_index = 2; + vector expected_signature; + SignBuffer(key_index, clear_buffer_, &expected_signature); + + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + size_t gen_signature_length = 0; + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, + GenericSign(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), + OEMCrypto_HMAC_SHA256, nullptr, &gen_signature_length)); + ASSERT_EQ(static_cast(SHA256_DIGEST_LENGTH), gen_signature_length); + vector signature(SHA256_DIGEST_LENGTH); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + &gen_signature_length)); + ASSERT_EQ(expected_signature, signature); +} + +// Test Generic_Verify with the maximum buffer size. +TEST_P(OEMCryptoGenericCryptoTest, GenericKeyVerifyLargeBuffer) { + ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); + EncryptAndLoadKeys(); + unsigned int key_index = 3; + vector signature; + SignBuffer(key_index, clear_buffer_, &signature); + + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, + signature.data(), signature.size())); +} + +// Test Generic_Encrypt when the key duration has expired. +TEST_P(OEMCryptoGenericCryptoTest, KeyDurationEncrypt) { + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + vector expected_encrypted; + EncryptBuffer(0, clear_buffer_, &expected_encrypted); + unsigned int key_index = 0; + vector encrypted(clear_buffer_.size()); + + vector key_handle; + // Should be valid key at the start. + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericEncrypt(key_handle.data(), key_handle.size(), + clear_buffer_.data(), clear_buffer_.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); + ASSERT_EQ(expected_encrypted, encrypted); + + wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. + encrypted.assign(clear_buffer_.size(), 0); + OEMCryptoResult status = OEMCrypto_Generic_Encrypt( + key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, + encrypted.data()); + ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); + ASSERT_NE(encrypted, expected_encrypted); + ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); +} + +// Test Generic_Decrypt when the key duration has expired. +TEST_P(OEMCryptoGenericCryptoTest, KeyDurationDecrypt) { + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + + // Should be valid key at the start. + unsigned int key_index = 1; + vector encrypted; + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + GenericDecrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); + ASSERT_EQ(clear_buffer_, resultant); + + wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. + resultant.assign(encrypted.size(), 0); + OEMCryptoResult status = GenericDecrypt( + key_handle.data(), key_handle.size(), encrypted.data(), encrypted.size(), + iv_, OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data()); + ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); + ASSERT_NE(clear_buffer_, resultant); + ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); +} + +// Test Generic_Sign when the key duration has expired. +TEST_P(OEMCryptoGenericCryptoTest, KeyDurationSign) { + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + + unsigned int key_index = 2; + vector expected_signature; + vector signature(SHA256_DIGEST_LENGTH); + size_t signature_length = signature.size(); + SignBuffer(key_index, clear_buffer_, &expected_signature); + + vector key_handle; + // Should be valid key at the start. + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + &signature_length)); + ASSERT_EQ(expected_signature, signature); + + wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. + signature.assign(SHA256_DIGEST_LENGTH, 0); + OEMCryptoResult status = + GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + &signature_length); + ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); + ASSERT_NE(expected_signature, signature); + ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); +} + +// Test Generic_Verify when the key duration has expired. +TEST_P(OEMCryptoGenericCryptoTest, KeyDurationVerify) { + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + license_messages_.CreateResponseWithGenericCryptoKeys(); + EncryptAndLoadKeys(); + + unsigned int key_index = 3; + vector signature; + SignBuffer(key_index, clear_buffer_, &signature); + + vector key_handle; + // Should be valid key at the start. + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), + session_.license().keys[key_index].key_id, + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + ASSERT_EQ( + OEMCrypto_SUCCESS, + GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, + signature.data(), signature.size())); + + wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. + OEMCryptoResult status = OEMCrypto_Generic_Verify( + key_handle.data(), key_handle.size(), clear_buffer_.data(), + clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), + signature.size()); + ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); + ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); +} + +const unsigned int kLongKeyId = 2; + +// Test that short key ids are allowed. +class OEMCryptoGenericCryptoKeyIdLengthTest + : public OEMCryptoGenericCryptoTest { + protected: + void SetUp() override { + OEMCryptoGenericCryptoTest::SetUp(); + license_messages_.set_num_keys(5); + license_messages_.set_control(wvoec::kControlAllowDecrypt); + license_messages_.core_response() + .timer_limits.total_playback_duration_seconds = kDuration; + ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); + SetUniformKeyIdLength(16); // Start with all key ids being 16 bytes. + // But, we are testing that the key ids do not have to have the same + // length. + // 12 bytes (common key id length). + license_messages_.SetKeyId(0, "123456789012"); + license_messages_.SetKeyId(1, "12345"); // short key id. + // 16 byte key id. (default) + license_messages_.SetKeyId(2, "1234567890123456"); + license_messages_.SetKeyId(3, "12345678901234"); // 14 byte. (uncommon) + license_messages_.SetKeyId(4, "1"); // very short key id. + ASSERT_EQ(2u, kLongKeyId); + ASSERT_NO_FATAL_FAILURE(license_messages_.FillCoreResponseSubstrings()); + } + + // Make all four keys have the same length. + void SetUniformKeyIdLength(size_t key_id_length) { + for (size_t i = 0; i < license_messages_.num_keys(); i++) { + string key_id; + key_id.resize(key_id_length, i + 'a'); + license_messages_.SetKeyId(i, key_id); + } + ASSERT_NO_FATAL_FAILURE(license_messages_.FillCoreResponseSubstrings()); + } + + void TestWithKey(unsigned int key_index) { + ASSERT_LT(key_index, license_messages_.num_keys()); + EncryptAndLoadKeys(); + vector encrypted; + // To make sure OEMCrypto is not expecting the key_id to be zero padded, + // we will create a buffer that is padded with 'Z'. Then, we use fill + // the buffer with the longer of the three keys. If OEMCrypto is paying + // attention to the key id length, it should pick out the correct key. + vector key_id_buffer( + session_.license().keys[kLongKeyId].key_id_length + 5, + 'Z'); // Fill a bigger buffer with letter 'Z'. + memcpy(key_id_buffer.data(), session_.license().keys[kLongKeyId].key_id, + session_.license().keys[kLongKeyId].key_id_length); + EncryptBuffer(key_index, clear_buffer_, &encrypted); + vector key_handle; + ASSERT_EQ( + OEMCrypto_SUCCESS, + GetKeyHandleIntoVector(session_.session_id(), key_id_buffer.data(), + session_.license().keys[key_index].key_id_length, + OEMCrypto_CipherMode_CENC, key_handle)); + vector resultant(encrypted.size()); + ASSERT_EQ(OEMCrypto_SUCCESS, + OEMCrypto_Generic_Decrypt(key_handle.data(), key_handle.size(), + encrypted.data(), encrypted.size(), iv_, + OEMCrypto_AES_CBC_128_NO_PADDING, + resultant.data())); + ASSERT_EQ(clear_buffer_, resultant); + } +}; + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, MediumKeyId) { TestWithKey(0); } + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, ShortKeyId) { TestWithKey(1); } + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, LongKeyId) { TestWithKey(2); } + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, FourteenByteKeyId) { + TestWithKey(3); +} + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, VeryShortKeyId) { + TestWithKey(4); +} + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, UniformShortKeyId) { + SetUniformKeyIdLength(5); + TestWithKey(2); +} + +TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, UniformLongKeyId) { + SetUniformKeyIdLength(kTestKeyIdMaxLength); + TestWithKey(2); +} + +INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoGenericCryptoTest, + Range(kCoreMessagesAPI, kCurrentAPI + 1)); + +INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoGenericCryptoKeyIdLengthTest, + Range(kCoreMessagesAPI, kCurrentAPI + 1)); + +/// @} +} // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_license_test.cpp b/oemcrypto/test/oemcrypto_license_test.cpp index 25cf89b..fedd8f9 100644 --- a/oemcrypto/test/oemcrypto_license_test.cpp +++ b/oemcrypto/test/oemcrypto_license_test.cpp @@ -6,6 +6,9 @@ #include "oemcrypto_license_test.h" #include "platform.h" +#include "test_sleep.h" + +using ::testing::Range; namespace wvoec { @@ -800,5 +803,168 @@ TEST_F(OEMCryptoSessionTests, CheckMinimumPatchLevel) { } } +// +// Load, Refresh Keys Test +// + +// Refresh keys should work if the license uses a nonce. +TEST_P(OEMCryptoRefreshTest, RefreshWithNonce) { + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); +} + +// Refresh keys should work if the license does not use a nonce. +TEST_P(OEMCryptoRefreshTest, RefreshNoNonce) { + license_messages_.set_control(0); + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); +} + +// Refresh keys should NOT work if a license has not been loaded. +TEST_P(OEMCryptoRefreshTestAPI16, RefreshNoLicense) { + Session s; + s.open(); + constexpr size_t message_size = kMaxCoreMessage + 42; + std::vector data(message_size); + for (size_t i = 0; i < data.size(); i++) data[i] = i & 0xFF; + size_t gen_signature_length = 0; + size_t core_message_length = 0; + OEMCryptoResult sts = OEMCrypto_PrepAndSignRenewalRequest( + s.session_id(), data.data(), data.size(), &core_message_length, nullptr, + &gen_signature_length); + ASSERT_LT(core_message_length, message_size); + if (sts == OEMCrypto_ERROR_SHORT_BUFFER) { + vector gen_signature(gen_signature_length); + sts = OEMCrypto_PrepAndSignRenewalRequest( + s.session_id(), data.data(), data.size(), &core_message_length, + gen_signature.data(), &gen_signature_length); + } + ASSERT_NE(OEMCrypto_SUCCESS, sts); +} + +// Refresh keys should fail if the nonce is not in the session. +TEST_P(OEMCryptoRefreshTestAPI16, RefreshBadNonce) { + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + renewal_messages.core_request().nonce ^= 42; + LoadRenewal(&renewal_messages, OEMCrypto_ERROR_INVALID_NONCE); +} + +// Refresh keys should fail if the session_id does not match the license. +TEST_P(OEMCryptoRefreshTestAPI16, RefreshBadSessionID) { + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + renewal_messages.core_request().session_id += 1; + LoadRenewal(&renewal_messages, OEMCrypto_ERROR_INVALID_NONCE); +} + +// Refresh keys should handle the maximum message size. +TEST_P(OEMCryptoRefreshTest, RefreshLargeBuffer) { + LoadLicense(); + RenewalRoundTrip renewal_messages(&license_messages_); + const size_t max_size = GetResourceValue(kLargeMessageSize); + renewal_messages.set_message_size(max_size); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); +} + +// This situation would occur if an app only uses one key in the license. When +// that happens, SelectKey would be called before the first decrypt, and then +// would not need to be called again, even if the license is refreshed. +TEST_P(OEMCryptoRefreshTest, RefreshWithNoSelectKey) { + LoadLicense(); + + // Call select key before the refresh. No calls below to TestDecryptCTR with + // select key set to true. + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(true)); + + // This should still be valid key, even if the refresh failed, because this + // is before the original license duration. + wvutil::TestSleep::Sleep(kShortSleep); + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); + + // This should be after duration of the original license, but before the + // expiration of the refresh message. This should fail until we have loaded + // the renewal. + wvutil::TestSleep::Sleep(kShortSleep + kLongSleep); + ASSERT_NO_FATAL_FAILURE( + session_.TestDecryptCTR(false, OEMCrypto_ERROR_KEY_EXPIRED)); + + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); + + // After we've loaded the renewal, decrypt should succeed again. + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); +} + +// Test that playback clock is correctly started and that the license can be +// renewed. +TEST_P(OEMCryptoRefreshTest, RenewLicenseLoadSuccess) { + license_messages_.core_response().renewal_delay_base = OEMCrypto_License_Load; + timer_limits_.rental_duration_seconds = kDuration; // 2 seconds. + timer_limits_.initial_renewal_duration_seconds = kLongDuration; // 5 seconds. + // First version to support Renew on Load. + constexpr uint32_t kFeatureVersion = 18; + + // Loading the license should start the playback clock. + LoadLicense(); + // Sleep until just after rental window is over. + wvutil::TestSleep::Sleep(kDuration + kShortSleep); + if (license_api_version_ < kFeatureVersion || + global_features.api_version < kFeatureVersion) { + // If the feature is not supported, then we expect failure because the + // playback clock was not started and we are outside the rental window. + ASSERT_NO_FATAL_FAILURE( + session_.TestDecryptCTR(true, OEMCrypto_ERROR_KEY_EXPIRED)); + return; + } else { + // If the feature is supported, we expect decrypt to work because we are + // still within the initial renewal window, and the playback clock should + // have started. + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(true, OEMCrypto_SUCCESS)); + } + // This is after the initial renewal duration, so we expect failure before + // loading the renewal. + wvutil::TestSleep::Sleep(kShortSleep + kLongSleep); + ASSERT_NO_FATAL_FAILURE( + session_.TestDecryptCTR(false, OEMCrypto_ERROR_KEY_EXPIRED)); + + RenewalRoundTrip renewal_messages(&license_messages_); + MakeRenewalRequest(&renewal_messages); + LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); + + // After we've loaded the renewal, decrypt should succeed again. + ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); +} + +TEST_P(OEMCryptoRefreshTest, RenewLicenseLoadOutsideRentalDuration) { + license_messages_.core_response().renewal_delay_base = OEMCrypto_License_Load; + timer_limits_.rental_duration_seconds = kDuration; // 2 seconds. + timer_limits_.initial_renewal_duration_seconds = kLongDuration; // 5 seconds. + + // Sleep until just after rental window is over. + wvutil::TestSleep::Sleep(kDuration + kShortSleep); + // Loading the license should start the playback clock. + LoadLicense(); + // If the license is loaded after the rental duration window, we expect + // failure. + ASSERT_NO_FATAL_FAILURE( + session_.TestDecryptCTR(false, OEMCrypto_ERROR_UNKNOWN_FAILURE)); +} + +INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoRefreshTest, + Range(kCurrentAPI - 1, kCurrentAPI + 1)); + +// These tests only work when the license has a core message. +INSTANTIATE_TEST_SUITE_P(TestAPI16, OEMCryptoRefreshTestAPI16, + Range(kCoreMessagesAPI, kCurrentAPI + 1)); + /// @} } // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_license_test.h b/oemcrypto/test/oemcrypto_license_test.h index fd59d15..a286050 100644 --- a/oemcrypto/test/oemcrypto_license_test.h +++ b/oemcrypto/test/oemcrypto_license_test.h @@ -17,10 +17,10 @@ #include "oemcrypto_resource_test.h" #include "wvcrc32.h" -using ::testing::WithParamInterface; - namespace wvoec { +using ::testing::WithParamInterface; + // Used for testing oemcrypto APIs with huge buffers. typedef const std::function oemcrypto_function; void TestHugeLengthDoesNotCrashAPI(oemcrypto_function f, @@ -359,6 +359,52 @@ class LicenseWithUsageEntry { bool active_; }; +class OEMCryptoRefreshTest : public OEMCryptoLicenseTest { + protected: + void SetUp() override { + OEMCryptoLicenseTest::SetUp(); + // These values allow us to run a few simple duration tests or just start + // playback right away. All times are in seconds since the license was + // signed. + // Soft expiry false means timers are strictly enforce. + timer_limits_.soft_enforce_rental_duration = true; + timer_limits_.soft_enforce_playback_duration = false; + // Playback may begin immediately. + timer_limits_.earliest_playback_start_seconds = 0; + // First playback may be within the first two seconds. + timer_limits_.rental_duration_seconds = kDuration; + // Once started, playback may last two seconds without a renewal. + timer_limits_.initial_renewal_duration_seconds = kDuration; + // Total playback is not limited. + timer_limits_.total_playback_duration_seconds = 0; + } + + void LoadLicense() { + license_messages_.core_response().timer_limits = timer_limits_; + ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages_.LoadResponse()); + } + + void MakeRenewalRequest(RenewalRoundTrip* renewal_messages) { + ASSERT_NO_FATAL_FAILURE(renewal_messages->SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(renewal_messages->CreateDefaultResponse()); + } + + void LoadRenewal(RenewalRoundTrip* renewal_messages, + OEMCryptoResult expected_result) { + ASSERT_NO_FATAL_FAILURE(renewal_messages->EncryptAndSignResponse()); + ASSERT_EQ(expected_result, renewal_messages->LoadResponse()); + } + + ODK_TimerLimits timer_limits_; +}; + +// This class is for the refresh tests that should only be run on licenses with +// a core message. +class OEMCryptoRefreshTestAPI16 : public OEMCryptoRefreshTest {}; + } // namespace wvoec #endif // CDM_OEMCRYPTO_LICENSE_TEST_ \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_provisioning_test.cpp b/oemcrypto/test/oemcrypto_provisioning_test.cpp index ea687ee..5504e76 100644 --- a/oemcrypto/test/oemcrypto_provisioning_test.cpp +++ b/oemcrypto/test/oemcrypto_provisioning_test.cpp @@ -7,12 +7,10 @@ #include "log.h" #include "platform.h" +#include "test_sleep.h" namespace wvoec { -/// @addtogroup provision -/// @{ - // This test is used to print the device ID to stdout. TEST_F(OEMCryptoKeyboxTest, NormalGetDeviceId) { OEMCryptoResult sts; @@ -620,6 +618,42 @@ TEST_F(OEMCryptoProv40Test, ProvisionDrmCert) { ASSERT_EQ(s.IsPublicKeySet(), true); } +TEST_P(OEMCryptoProv40CastTest, ProvisionCastWorks) { + // Generate an OEM key first, to load into next session + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + size_t public_key_size = 10000; + std::vector public_key(public_key_size); + size_t public_key_signature_size = 10000; + std::vector public_key_signature(public_key_signature_size); + size_t wrapped_private_key_size = 10000; + std::vector wrapped_private_key(wrapped_private_key_size); + OEMCrypto_PrivateKeyType key_type; + ASSERT_EQ( + OEMCrypto_GenerateCertificateKeyPair( + s.session_id(), public_key.data(), &public_key_size, + public_key_signature.data(), &public_key_signature_size, + wrapped_private_key.data(), &wrapped_private_key_size, &key_type), + OEMCrypto_SUCCESS); + public_key.resize(public_key_size); + public_key_signature.resize(public_key_signature_size); + wrapped_private_key.resize(wrapped_private_key_size); + ASSERT_NO_FATAL_FAILURE(s.close()); + + // Install OEM key and get cast RSA + Session s1; + ASSERT_NO_FATAL_FAILURE(s1.open()); + ASSERT_EQ(OEMCrypto_InstallOemPrivateKey(s1.session_id(), key_type, + wrapped_private_key.data(), + wrapped_private_key_size), + OEMCrypto_SUCCESS); + + ASSERT_NO_FATAL_FAILURE(CreateProv4CastKey(&s1, GetParam())); +} + +INSTANTIATE_TEST_SUITE_P(Prov4CastProvisioningBasic, OEMCryptoProv40CastTest, + testing::Values(true, false)); + TEST_F(OEMCryptoLoadsCertificate, PrepAndSignLicenseRequestCounterAPI18) { ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); Session s; @@ -768,6 +802,9 @@ TEST_F(OEMCryptoLoadsCertificate, CertificateProvisionBadRange4_API16) { // Verify that RewrapDeviceRSAKey checks pointers are within the provisioning // message. TEST_F(OEMCryptoLoadsCertificate, CertificateProvisionBadRange5Prov30_API16) { + if (global_features.provisioning_method != OEMCrypto_OEMCertificate) { + GTEST_SKIP() << "Test for Prov 3.0 devices only."; + } Session s; ProvisioningRoundTrip provisioning_messages(&s, encoded_rsa_key_); provisioning_messages.PrepareSession(keybox_); @@ -865,5 +902,327 @@ TEST_F(OEMCryptoLoadsCertificate, CertificateProvisionLargeBuffer) { provisioning_messages.encoded_rsa_key())); } -/// @} +// Test that a wrapped RSA key can be loaded. +TEST_F(OEMCryptoLoadsCertificate, LoadWrappedRSAKey) { + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); +} + +class OEMCryptoLoadsCertVariousKeys : public OEMCryptoLoadsCertificate { + public: + void TestKey(const uint8_t* key, size_t key_length) { + encoded_rsa_key_.assign(key, key + key_length); + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + LicenseRoundTrip license_messages(&s); + ASSERT_NO_FATAL_FAILURE(license_messages.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages.LoadResponse()); + ASSERT_NO_FATAL_FAILURE(s.TestDecryptCTR()); + } +}; + +// Test a 3072 bit RSA key certificate. +TEST_F(OEMCryptoLoadsCertVariousKeys, TestLargeRSAKey3072) { + if (!global_features.supports_rsa_3072) { + GTEST_SKIP() << "OEMCrypto does not support RSA 3072"; + } + TestKey(kTestRSAPKCS8PrivateKeyInfo3_3072, + sizeof(kTestRSAPKCS8PrivateKeyInfo3_3072)); +} + +// Test an RSA key certificate which has a private key generated using the +// Carmichael totient. +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelRSAKey) { + TestKey(kTestKeyRSACarmichael_2048, sizeof(kTestKeyRSACarmichael_2048)); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelNonZeroNormalDer) { + TestKey(kCarmichaelNonZeroNormalDer, kCarmichaelNonZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelNonZeroShortDer) { + TestKey(kCarmichaelNonZeroShortDer, kCarmichaelNonZeroShortDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelZeroNormalDer) { + TestKey(kCarmichaelZeroNormalDer, kCarmichaelZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelZeroShortDer) { + TestKey(kCarmichaelZeroShortDer, kCarmichaelZeroShortDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualNonZeroNormalDer) { + TestKey(kDualNonZeroNormalDer, kDualNonZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualNonZeroShortDer) { + TestKey(kDualNonZeroShortDer, kDualNonZeroShortDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualZeroNormalDer) { + TestKey(kDualZeroNormalDer, kDualZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualZeroShortDer) { + TestKey(kDualZeroShortDer, kDualZeroShortDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestEulerNonZeroNormalDer) { + TestKey(kEulerNonZeroNormalDer, kEulerNonZeroNormalDerLen); +} + +TEST_F(OEMCryptoLoadsCertVariousKeys, TestEulerZeroNormalDer) { + TestKey(kEulerZeroNormalDer, kEulerZeroNormalDerLen); +} + +// This tests that two sessions can use different RSA keys simultaneously. +TEST_F(OEMCryptoLoadsCertificate, TestMultipleRSAKeys) { + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + Session s1; // Session s1 loads the default rsa key, but doesn't use it + // until after s2 uses its key. + ASSERT_NO_FATAL_FAILURE(s1.open()); + ASSERT_NO_FATAL_FAILURE(s1.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_NO_FATAL_FAILURE(s1.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + + Session s2; // Session s2 uses a different rsa key. + encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeyInfo4_2048, + kTestRSAPKCS8PrivateKeyInfo4_2048 + + sizeof(kTestRSAPKCS8PrivateKeyInfo4_2048)); + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + ASSERT_NO_FATAL_FAILURE(s2.open()); + ASSERT_NO_FATAL_FAILURE(s2.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_NO_FATAL_FAILURE(s2.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + LicenseRoundTrip license_messages2(&s2); + ASSERT_NO_FATAL_FAILURE(license_messages2.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages2.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages2.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages2.LoadResponse()); + ASSERT_NO_FATAL_FAILURE(s2.TestDecryptCTR()); + s2.close(); + + // After s2 has loaded its rsa key, we continue using s1's key. + LicenseRoundTrip license_messages1(&s1); + ASSERT_NO_FATAL_FAILURE(license_messages1.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages1.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages1.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages1.LoadResponse()); + ASSERT_NO_FATAL_FAILURE(s1.TestDecryptCTR()); +} + +// This tests the maximum number of DRM private keys that OEMCrypto can load +TEST_F(OEMCryptoLoadsCertificate, TestMaxDRMKeys) { + const size_t max_total_keys = GetResourceValue(kMaxTotalDRMPrivateKeys); + std::vector> sessions; + std::vector> licenses; + + // It should be able to load up to kMaxTotalDRMPrivateKeys keys + for (size_t i = 0; i < max_total_keys; i++) { + sessions.push_back(std::unique_ptr(new Session())); + licenses.push_back(std::unique_ptr( + new LicenseRoundTrip(sessions[i].get()))); + const size_t key_index = i % kTestRSAPKCS8PrivateKeys_2048.size(); + encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeys_2048[key_index].begin(), + kTestRSAPKCS8PrivateKeys_2048[key_index].end()); + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + ASSERT_NO_FATAL_FAILURE(sessions[i]->open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(sessions[i].get())); + } + + // Attempts to load one more key than the kMaxTotalDRMPrivateKeys + if (global_features.provisioning_method == OEMCrypto_BootCertificateChain) { + Session s; + const size_t buffer_size = 5000; // Make sure it is large enough. + std::vector public_key(buffer_size); + size_t public_key_size = buffer_size; + std::vector public_key_signature(buffer_size); + size_t public_key_signature_size = buffer_size; + std::vector wrapped_private_key(buffer_size); + size_t wrapped_private_key_size = buffer_size; + OEMCrypto_PrivateKeyType key_type; + OEMCryptoResult result = OEMCrypto_GenerateCertificateKeyPair( + s.session_id(), public_key.data(), &public_key_size, + public_key_signature.data(), &public_key_signature_size, + wrapped_private_key.data(), &wrapped_private_key_size, &key_type); + // Key creation is allowed to fail due to resource restriction + if (result != OEMCrypto_SUCCESS) { + ASSERT_TRUE(result == OEMCrypto_ERROR_INSUFFICIENT_RESOURCES || + result == OEMCrypto_ERROR_TOO_MANY_KEYS); + } + } else { + Session s; + encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeyInfo2_2048, + kTestRSAPKCS8PrivateKeyInfo2_2048 + + sizeof(kTestRSAPKCS8PrivateKeyInfo2_2048)); + Session ps; + ProvisioningRoundTrip provisioning_messages(&ps, encoded_rsa_key_); + provisioning_messages.PrepareSession(keybox_); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(provisioning_messages.EncryptAndSignResponse()); + OEMCryptoResult result = provisioning_messages.LoadResponse(); + // Key loading is allowed to fail due to resource restriction + if (result != OEMCrypto_SUCCESS) { + ASSERT_TRUE(result == OEMCrypto_ERROR_INSUFFICIENT_RESOURCES || + result == OEMCrypto_ERROR_TOO_MANY_KEYS); + } + } + // Verifies that the DRM keys which are already loaded should still function + for (size_t i = 0; i < licenses.size(); i++) { + ASSERT_NO_FATAL_FAILURE(licenses[i]->SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(licenses[i]->CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(licenses[i]->EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, licenses[i]->LoadResponse()); + ASSERT_NO_FATAL_FAILURE(sessions[i]->TestDecryptCTR()); + } +} + +// Devices that load certificates, should at least support RSA 2048 keys. +TEST_F(OEMCryptoLoadsCertificate, SupportsCertificatesAPI13) { + ASSERT_NE(0u, + OEMCrypto_Supports_RSA_2048bit & OEMCrypto_SupportedCertificates()) + << "Supported certificates is only " << OEMCrypto_SupportedCertificates(); +} + +// This test is not run by default, because it takes a long time and +// is used to measure RSA performance, not test functionality. +TEST_F(OEMCryptoLoadsCertificate, RSAPerformance) { + const std::chrono::milliseconds kTestDuration(5000); + OEMCryptoResult sts; + std::chrono::steady_clock clock; + wvutil::TestSleep::Sleep(kShortSleep); // Make sure we are not nonce limited. + + auto start_time = clock.now(); + int count = 15; + for (int i = 0; i < count; i++) { // Only 20 nonce available. + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + } + auto delta_time = clock.now() - start_time; + const double provision_time = + delta_time / std::chrono::milliseconds(1) / count; + + Session session; + ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); + start_time = clock.now(); + count = 0; + while (clock.now() - start_time < kTestDuration) { + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + const size_t size = 50; + vector licenseRequest(size); + GetRandBytes(licenseRequest.data(), licenseRequest.size()); + size_t signature_length = 0; + sts = OEMCrypto_GenerateRSASignature(s.session_id(), licenseRequest.data(), + licenseRequest.size(), nullptr, + &signature_length, kSign_RSASSA_PSS); + ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); + ASSERT_NE(static_cast(0), signature_length); + + if (ShouldGenerateCorpus()) { + const std::string file_name = + GetFileName("oemcrypto_generate_rsa_signature_fuzz_seed_corpus"); + OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; + fuzzed_structure.padding_scheme = kSign_RSASSA_PSS; + fuzzed_structure.signature_length = signature_length; + // Cipher mode and algorithm. + AppendToFile(file_name, reinterpret_cast(&fuzzed_structure), + sizeof(fuzzed_structure)); + AppendToFile(file_name, + reinterpret_cast(licenseRequest.data()), + licenseRequest.size()); + } + + std::vector signature(signature_length, 0); + sts = OEMCrypto_GenerateRSASignature( + s.session_id(), licenseRequest.data(), licenseRequest.size(), + signature.data(), &signature_length, kSign_RSASSA_PSS); + ASSERT_EQ(OEMCrypto_SUCCESS, sts); + count++; + } + delta_time = clock.now() - start_time; + const double license_request_time = + delta_time / std::chrono::milliseconds(1) / count; + + Session s; + ASSERT_NO_FATAL_FAILURE(s.open()); + ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); + vector session_key; + vector enc_session_key; + ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + ASSERT_TRUE(s.GenerateRsaSessionKey(&session_key, &enc_session_key)); + vector mac_context; + vector enc_context; + s.FillDefaultContext(&mac_context, &enc_context); + + enc_session_key = wvutil::a2b_hex( + "7789c619aa3b9fa3c0a53f57a4abc6" + "02157c8aa57e3c6fb450b0bea22667fb" + "0c3200f9d9d618e397837c720dc2dadf" + "486f33590744b2a4e54ca134ae7dbf74" + "434c2fcf6b525f3e132262f05ea3b3c1" + "198595c0e52b573335b2e8a3debd0d0d" + "d0306f8fcdde4e76476be71342957251" + "e1688c9ca6c1c34ed056d3b989394160" + "cf6937e5ce4d39cc73d11a2e93da21a2" + "fa019d246c852fe960095b32f120c3c2" + "7085f7b64aac344a68d607c0768676ce" + "d4c5b2d057f7601921b453a451e1dea0" + "843ebfef628d9af2784d68e86b730476" + "e136dfe19989de4be30a4e7878efcde5" + "ad2b1254f80c0c5dd3cf111b56572217" + "b9f58fc1dacbf74b59d354a1e62cfa0e" + "bf"); + start_time = clock.now(); + while (clock.now() - start_time < kTestDuration) { + ASSERT_EQ(OEMCrypto_SUCCESS, + OEMCrypto_DeriveKeysFromSessionKey( + s.session_id(), enc_session_key.data(), + enc_session_key.size(), mac_context.data(), + mac_context.size(), enc_context.data(), enc_context.size())); + count++; + } + delta_time = clock.now() - start_time; + const double derive_keys_time = + delta_time / std::chrono::milliseconds(1) / count; + + OEMCrypto_Security_Level level = OEMCrypto_SecurityLevel(); + printf("PERF:head, security, provision (ms), lic req(ms), derive keys(ms)\n"); + printf("PERF:stat, %u, %8.3f, %8.3f, %8.3f\n", + static_cast(level), provision_time, license_request_time, + derive_keys_time); +} + +// Test DeriveKeysFromSessionKey using the maximum size for the HMAC context. +TEST_F(OEMCryptoUsesCertificate, GenerateDerivedKeysLargeBuffer) { + vector session_key; + vector enc_session_key; + ASSERT_TRUE(session_.GenerateSessionKey(&session_key, &enc_session_key)); + const size_t max_size = GetResourceValue(kLargeMessageSize); + vector mac_context(max_size); + vector enc_context(max_size); + // Stripe the data so the two vectors are not identical, and not all zeroes. + for (size_t i = 0; i < max_size; i++) { + mac_context[i] = i % 0x100; + enc_context[i] = (3 * i) % 0x100; + } + ASSERT_EQ(OEMCrypto_SUCCESS, + OEMCrypto_DeriveKeysFromSessionKey( + session_.session_id(), enc_session_key.data(), + enc_session_key.size(), mac_context.data(), mac_context.size(), + enc_context.data(), enc_context.size())); +} + } // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_provisioning_test.h b/oemcrypto/test/oemcrypto_provisioning_test.h index 2233842..b44369c 100644 --- a/oemcrypto/test/oemcrypto_provisioning_test.h +++ b/oemcrypto/test/oemcrypto_provisioning_test.h @@ -10,6 +10,7 @@ #include #include "OEMCryptoCENC.h" +#include "oec_extra_test_keys.h" #include "oemcrypto_basic_test.h" #include "oemcrypto_license_test.h" #include "oemcrypto_resource_test.h" @@ -35,10 +36,37 @@ class OEMCryptoKeyboxTest : public OEMCryptoClientTest { }; // This class is for tests that have an OEM Certificate instead of a keybox. -class OEMCryptoProv30Test : public OEMCryptoClientTest {}; +class OEMCryptoProv30Test : public OEMCryptoClientTest { + void SetUp() override { + OEMCryptoClientTest::SetUp(); + if (global_features.provisioning_method != OEMCrypto_OEMCertificate) { + GTEST_SKIP() << "Test for Prov 3.0 devices only."; + } + } +}; // This class is for tests that have boot certificate chain instead of a keybox. -class OEMCryptoProv40Test : public OEMCryptoClientTest {}; +class OEMCryptoProv40Test : public OEMCryptoClientTest { + void SetUp() override { + OEMCryptoClientTest::SetUp(); + if (global_features.provisioning_method != OEMCrypto_BootCertificateChain) { + GTEST_SKIP() << "Test for Prov 4.0 devices only."; + } + } +}; + +class OEMCryptoProv40CastTest : public OEMCryptoClientTest, + public testing::WithParamInterface { + void SetUp() override { + OEMCryptoClientTest::SetUp(); + if (!global_features.cast_receiver) { + GTEST_SKIP() << "Test for cast devices only."; + } + if (global_features.provisioning_method != OEMCrypto_BootCertificateChain) { + GTEST_SKIP() << "Test for Prov 4.0 devices only."; + } + } +}; // // Certificate Root of Trust Tests @@ -111,6 +139,31 @@ class OEMCryptoLoadsCertificate : public OEMCryptoSessionTestKeyboxTest { } }; +// These tests are run by all L1 devices that load and use certificates. It is +// also run by a few L3 devices that use a baked in certificate, but cannot load +// a certificate. +class OEMCryptoUsesCertificate : public OEMCryptoLoadsCertificate { + protected: + void SetUp() override { + OEMCryptoLoadsCertificate::SetUp(); + ASSERT_NO_FATAL_FAILURE(session_.open()); + if (global_features.derive_key_method == + DeviceFeatures::LOAD_TEST_RSA_KEY) { + ASSERT_NO_FATAL_FAILURE(session_.SetRsaPublicKeyFromPrivateKeyInfo( + encoded_rsa_key_.data(), encoded_rsa_key_.size())); + } else { + InstallTestDrmKey(&session_); + } + } + + void TearDown() override { + ASSERT_NO_FATAL_FAILURE(session_.close()); + OEMCryptoLoadsCertificate::TearDown(); + } + + Session session_; +}; + } // namespace wvoec #endif // CDM_OEMCRYPTO_PROVISIONING_TEST_ \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_security_test.cpp b/oemcrypto/test/oemcrypto_security_test.cpp index dc39198..af9b046 100644 --- a/oemcrypto/test/oemcrypto_security_test.cpp +++ b/oemcrypto/test/oemcrypto_security_test.cpp @@ -984,6 +984,9 @@ TEST_P(OEMCryptoGenericCryptoTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryUpdateUsageEntryForHugeHeaderBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { if (buffer_length < encrypted_usage_header_.size()) { return OEMCrypto_ERROR_SHORT_BUFFER; @@ -1011,6 +1014,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryUpdateUsageEntryForHugeUsageEntryBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1035,6 +1041,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryDeactivateUsageEntryForHugePstBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; std::string pst("pst"); @@ -1054,6 +1063,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryLoadUsageTableHeaderForHugeHeader) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { if (buffer_length < encrypted_usage_header_.size()) { return OEMCrypto_ERROR_SHORT_BUFFER; @@ -1078,6 +1090,9 @@ TEST_P(OEMCryptoUsageTableTest, TEST_P( OEMCryptoUsageTableTest, OEMCryptoMemoryLoadUsageTableHeaderForHugeHeaderStartingHeaderLengthFrom1) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1094,6 +1109,9 @@ TEST_P( TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryLoadUsageEntryForHugeUsageEntryBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1121,6 +1139,9 @@ TEST_P(OEMCryptoUsageTableTest, } TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugeReportBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1147,6 +1168,9 @@ TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugeReportBuffer) { } TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugePstBuffer) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } auto oemcrypto_function = [&](size_t buffer_length) { LicenseWithUsageEntry entry; entry.license_messages().set_api_version(license_api_version_); @@ -1167,6 +1191,9 @@ TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryReportUsageForHugePstBuffer) { TEST_P(OEMCryptoUsageTableTest, OEMCryptoMemoryShrinkUsageTableHeaderForHugeHeaderBufferLength) { + if (!wvoec::global_features.usage_table) { + GTEST_SKIP() << "Usage tables are not supported."; + } LicenseWithUsageEntry entry0; entry0.set_pst("pst 0"); entry0.MakeOfflineAndClose(this); diff --git a/oemcrypto/test/oemcrypto_session_tests_helper.cpp b/oemcrypto/test/oemcrypto_session_tests_helper.cpp index 48e163f..2a3d525 100644 --- a/oemcrypto/test/oemcrypto_session_tests_helper.cpp +++ b/oemcrypto/test/oemcrypto_session_tests_helper.cpp @@ -167,4 +167,45 @@ void SessionUtil::CreateProv4DRMKey() { drm_public_key_ = provisioning_messages.drm_public_key(); } +// Requires stage 1 prov4 to be complete, ie OEM key is available +void SessionUtil::CreateProv4CastKey(Session* s, + bool load_drm_before_prov_req) { + if (global_features.provisioning_method != OEMCrypto_BootCertificateChain) { + FAIL() << "Provisioning 4.0 is required."; + } + + Provisioning40CastRoundTrip prov_cast(s, encoded_rsa_key_); + + // Calls GenerateCertificateKeyPair(). Generated keys stored in + // prov_cast.drm_public_key_ and prov_cast.wrapped_drm_key_ + ASSERT_NO_FATAL_FAILURE(prov_cast.PrepareSession()); + + // Can choose to load DRM key before preparing the provisioning request, or + // after + if (load_drm_before_prov_req) { + ASSERT_NO_FATAL_FAILURE(prov_cast.LoadDRMPrivateKey()); + } + ASSERT_NO_FATAL_FAILURE(s->SetPublicKeyFromSubjectPublicKey( + prov_cast.drm_key_type(), prov_cast.drm_public_key().data(), + prov_cast.drm_public_key().size())); + ASSERT_NO_FATAL_FAILURE(prov_cast.SignAndVerifyRequest()); + if (!load_drm_before_prov_req) { + ASSERT_NO_FATAL_FAILURE(prov_cast.LoadDRMPrivateKey()); + } + + // Generate derived keys in order to verify and decrypt response. + // We are cheating a little bit here since this GenerateDerivedKeys helper + // simulates work on both client side (calls + // OEMCrypto_GenerateDerivedKeysFromSessionKey) and server side (sets + // key_deriver() keys used to create response) + ASSERT_NO_FATAL_FAILURE(s->GenerateDerivedKeysFromSessionKey()); + + // Response is provisioning 2 with CAST key + ASSERT_NO_FATAL_FAILURE(prov_cast.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(prov_cast.EncryptAndSignResponse()); + + // Should parse and load successfully + ASSERT_EQ(OEMCrypto_SUCCESS, prov_cast.LoadResponse()); +} + } // namespace wvoec diff --git a/oemcrypto/test/oemcrypto_session_tests_helper.h b/oemcrypto/test/oemcrypto_session_tests_helper.h index b29f37e..1b35239 100644 --- a/oemcrypto/test/oemcrypto_session_tests_helper.h +++ b/oemcrypto/test/oemcrypto_session_tests_helper.h @@ -44,6 +44,8 @@ class SessionUtil { // Create a new DRM Cert. Only for provisioning 4.0 void CreateProv4DRMKey(); + void CreateProv4CastKey(Session *s, bool load_drm_before_prov_req); + // Used by prov2.0, prov3.0, and prov 4.0 std::vector encoded_rsa_key_; std::vector wrapped_drm_key_; diff --git a/oemcrypto/test/oemcrypto_test.cpp b/oemcrypto/test/oemcrypto_test.cpp index 01647b0..4452e93 100644 --- a/oemcrypto/test/oemcrypto_test.cpp +++ b/oemcrypto/test/oemcrypto_test.cpp @@ -87,11 +87,8 @@ #include "test_sleep.h" #include "wvcrc32.h" -using ::testing::Bool; -using ::testing::Combine; using ::testing::Range; using ::testing::tuple; -using ::testing::Values; using ::testing::WithParamInterface; using namespace std; @@ -294,6 +291,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, LoadEntitlementKeysAPI17) { } TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( @@ -344,6 +344,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, */ TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysNoEntitlementKeysAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } license_messages_.set_license_type(OEMCrypto_EntitlementLicense); ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); @@ -380,6 +383,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysWrongEntitlementKeysAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( @@ -414,6 +420,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysWrongEntitledKeySessionAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( @@ -452,6 +461,9 @@ TEST_P(OEMCryptoEntitlementLicenseTest, TEST_P(OEMCryptoEntitlementLicenseTest, CasOnlyLoadCasKeysOemcryptoSessionAPI17) { + if (!global_features.supports_cas) { + GTEST_SKIP() << "OEMCrypto does not support CAS"; + } LoadEntitlementLicense(); uint32_t key_session_id = 0; ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_CreateEntitledKeySession( @@ -942,11 +954,7 @@ TEST_P(OEMCryptoEntitlementLicenseTest, ReassociateEntitledKeySessionAPI17) { ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); ASSERT_EQ(OEMCrypto_SUCCESS, license_messages_.LoadResponse()); - // Setup another session. - Session session2; - ASSERT_NO_FATAL_FAILURE(session2.open()); - ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&session2)); - ASSERT_NO_FATAL_FAILURE(session2.GenerateDerivedKeysFromSessionKey()); + // Setup an entitled key session in the first OEMCrypto session. uint32_t key_session_id; OEMCryptoResult sts = OEMCrypto_CreateEntitledKeySession( @@ -957,7 +965,12 @@ TEST_P(OEMCryptoEntitlementLicenseTest, ReassociateEntitledKeySessionAPI17) { entitled_message.SetEntitledKeySession(key_session_id); ASSERT_NO_FATAL_FAILURE(entitled_message.LoadKeys(true)); - // Now reassociate the entitled key session to the second OEMCrypto session. + // Setup another session. + Session session2; + ASSERT_NO_FATAL_FAILURE(session2.open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&session2)); + // session2 does not have entitlement keys. Re-associating the entitled key + // session to session2 should fail OEMCryptoResult status = OEMCrypto_ReassociateEntitledKeySession( key_session_id, session2.session_id()); if (status == OEMCrypto_ERROR_NOT_IMPLEMENTED && @@ -965,15 +978,39 @@ TEST_P(OEMCryptoEntitlementLicenseTest, ReassociateEntitledKeySessionAPI17) { GTEST_SKIP() << "Skipping test because " "OEMCrypto_ReassociateEntitledKeySession not implemented."; } - ASSERT_EQ(OEMCrypto_SUCCESS, status); - // session2 does not have entitlement keys. - ASSERT_NO_FATAL_FAILURE(entitled_message.LoadKeys(false)); + EXPECT_NE(OEMCrypto_SUCCESS, status); + + // session2 loads the correct entitlement keys. + LicenseRoundTrip license_messages2(&session2); + license_messages2.set_license_type(OEMCrypto_EntitlementLicense); + ASSERT_NO_FATAL_FAILURE(license_messages2.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages2.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages2.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages2.LoadResponse()); + // Re-associating to session2 should succeed. + ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_ReassociateEntitledKeySession( + key_session_id, session2.session_id())); // Now reassociate the entitled key session back to the first OEMCrypto // session. ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_ReassociateEntitledKeySession( key_session_id, session_.session_id())); ASSERT_NO_FATAL_FAILURE(entitled_message.LoadKeys(true)); + + // session3 has unmatched key policies + Session session3; + ASSERT_NO_FATAL_FAILURE(session3.open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&session3)); + LicenseRoundTrip license_messages3(&session3); + license_messages3.set_license_type(OEMCrypto_EntitlementLicense); + license_messages3.set_control(license_messages_.control() + 1); + ASSERT_NO_FATAL_FAILURE(license_messages3.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages3.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages3.EncryptAndSignResponse()); + ASSERT_EQ(OEMCrypto_SUCCESS, license_messages3.LoadResponse()); + // Re-associating to session3 should fail. + EXPECT_NE(OEMCrypto_SUCCESS, OEMCrypto_ReassociateEntitledKeySession( + key_session_id, session3.session_id())); } /// @} @@ -1376,233 +1413,6 @@ INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoLicenseOverflowTest, /// @addtogroup cas /// @{ -// Used to test the different HDCP versions. This test is parameterized by the -// required HDCP version in the key control block. -class OEMCryptoSessionTestLoadCasKeysWithHDCP : public OEMCryptoSessionTests, - public WithParamInterface { - protected: - void LoadCasKeysWithHDCP(OEMCrypto_HDCP_Capability version) { - OEMCryptoResult sts; - OEMCrypto_HDCP_Capability current, maximum; - sts = OEMCrypto_GetHDCPCapability(¤t, &maximum); - ASSERT_EQ(OEMCrypto_SUCCESS, sts); - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&s)); - LicenseRoundTrip license_messages(&s); - license_messages.set_control((version << wvoec::kControlHDCPVersionShift) | - wvoec::kControlObserveHDCP | - wvoec::kControlHDCPRequired); - license_messages.set_license_type(OEMCrypto_EntitlementLicense); - ASSERT_NO_FATAL_FAILURE(license_messages.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages.LoadResponse()); - - uint32_t key_session_id; - sts = OEMCrypto_CreateEntitledKeySession(s.session_id(), &key_session_id); - ASSERT_EQ(OEMCrypto_SUCCESS, sts); - EntitledMessage entitled_message_1(&license_messages); - entitled_message_1.FillKeyArray(); - entitled_message_1.SetEntitledKeySession(key_session_id); - - if (((version <= HDCP_V2_3 || current >= HDCP_V1_0) && version > current) || - (current == HDCP_V1 && version >= HDCP_V1_0)) { - ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadCasKeys( - /*load_even=*/true, /*load_odd=*/true, - OEMCrypto_ERROR_INSUFFICIENT_HDCP)) - << "Failed when current HDCP = " << HDCPCapabilityAsString(current) - << ", maximum HDCP = " << HDCPCapabilityAsString(maximum) - << ", license HDCP = " << HDCPCapabilityAsString(version); - } else { - ASSERT_NO_FATAL_FAILURE(entitled_message_1.LoadCasKeys( - /*load_even=*/true, /*load_odd=*/true, OEMCrypto_SUCCESS)) - << "Failed when current HDCP = " << HDCPCapabilityAsString(current) - << ", maximum HDCP = " << HDCPCapabilityAsString(maximum) - << ", license HDCP = " << HDCPCapabilityAsString(version); - } - } -}; - -TEST_P(OEMCryptoSessionTestLoadCasKeysWithHDCP, CasOnlyLoadCasKeysAPI17) { - // Test parameterized by HDCP version. - LoadCasKeysWithHDCP(static_cast(GetParam())); -} -INSTANTIATE_TEST_SUITE_P(TestHDCP, OEMCryptoSessionTestLoadCasKeysWithHDCP, - Range(1, 6)); -/// @} - -/// @addtogroup renewal -/// @{ - -// -// Load, Refresh Keys Test -// - -// This class is for the refresh tests that should only be run on licenses with -// a core message. -class OEMCryptoRefreshTestAPI16 : public OEMCryptoRefreshTest {}; - -// Refresh keys should work if the license uses a nonce. -TEST_P(OEMCryptoRefreshTest, RefreshWithNonce) { - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); -} - -// Refresh keys should work if the license does not use a nonce. -TEST_P(OEMCryptoRefreshTest, RefreshNoNonce) { - license_messages_.set_control(0); - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); -} - -// Refresh keys should NOT work if a license has not been loaded. -TEST_P(OEMCryptoRefreshTestAPI16, RefreshNoLicense) { - Session s; - s.open(); - constexpr size_t message_size = kMaxCoreMessage + 42; - std::vector data(message_size); - for (size_t i = 0; i < data.size(); i++) data[i] = i & 0xFF; - size_t gen_signature_length = 0; - size_t core_message_length = 0; - OEMCryptoResult sts = OEMCrypto_PrepAndSignRenewalRequest( - s.session_id(), data.data(), data.size(), &core_message_length, nullptr, - &gen_signature_length); - ASSERT_LT(core_message_length, message_size); - if (sts == OEMCrypto_ERROR_SHORT_BUFFER) { - vector gen_signature(gen_signature_length); - sts = OEMCrypto_PrepAndSignRenewalRequest( - s.session_id(), data.data(), data.size(), &core_message_length, - gen_signature.data(), &gen_signature_length); - } - ASSERT_NE(OEMCrypto_SUCCESS, sts); -} - -// Refresh keys should fail if the nonce is not in the session. -TEST_P(OEMCryptoRefreshTestAPI16, RefreshBadNonce) { - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - renewal_messages.core_request().nonce ^= 42; - LoadRenewal(&renewal_messages, OEMCrypto_ERROR_INVALID_NONCE); -} - -// Refresh keys should fail if the session_id does not match the license. -TEST_P(OEMCryptoRefreshTestAPI16, RefreshBadSessionID) { - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - renewal_messages.core_request().session_id += 1; - LoadRenewal(&renewal_messages, OEMCrypto_ERROR_INVALID_NONCE); -} - -// Refresh keys should handle the maximum message size. -TEST_P(OEMCryptoRefreshTest, RefreshLargeBuffer) { - LoadLicense(); - RenewalRoundTrip renewal_messages(&license_messages_); - const size_t max_size = GetResourceValue(kLargeMessageSize); - renewal_messages.set_message_size(max_size); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); -} - -// This situation would occur if an app only uses one key in the license. When -// that happens, SelectKey would be called before the first decrypt, and then -// would not need to be called again, even if the license is refreshed. -TEST_P(OEMCryptoRefreshTest, RefreshWithNoSelectKey) { - LoadLicense(); - - // Call select key before the refresh. No calls below to TestDecryptCTR with - // select key set to true. - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(true)); - - // This should still be valid key, even if the refresh failed, because this - // is before the original license duration. - wvutil::TestSleep::Sleep(kShortSleep); - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); - - // This should be after duration of the original license, but before the - // expiration of the refresh message. This should fail until we have loaded - // the renewal. - wvutil::TestSleep::Sleep(kShortSleep + kLongSleep); - ASSERT_NO_FATAL_FAILURE( - session_.TestDecryptCTR(false, OEMCrypto_ERROR_KEY_EXPIRED)); - - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); - - // After we've loaded the renewal, decrypt should succeed again. - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); -} - -// Test that playback clock is correctly started and that the license can be -// renewed. -TEST_P(OEMCryptoRefreshTest, RenewLicenseLoadSuccess) { - license_messages_.core_response().renewal_delay_base = OEMCrypto_License_Load; - timer_limits_.rental_duration_seconds = kDuration; // 2 seconds. - timer_limits_.initial_renewal_duration_seconds = kLongDuration; // 5 seconds. - // First version to support Renew on Load. - constexpr uint32_t kFeatureVersion = 18; - - // Loading the license should start the playback clock. - LoadLicense(); - // Sleep until just after rental window is over. - wvutil::TestSleep::Sleep(kDuration + kShortSleep); - if (license_api_version_ < kFeatureVersion || - global_features.api_version < kFeatureVersion) { - // If the feature is not supported, then we expect failure because the - // playback clock was not started and we are outside the rental window. - ASSERT_NO_FATAL_FAILURE( - session_.TestDecryptCTR(true, OEMCrypto_ERROR_KEY_EXPIRED)); - return; - } else { - // If the feature is supported, we expect decrypt to work because we are - // still within the initial renewal window, and the playback clock should - // have started. - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(true, OEMCrypto_SUCCESS)); - } - // This is after the initial renewal duration, so we expect failure before - // loading the renewal. - wvutil::TestSleep::Sleep(kShortSleep + kLongSleep); - ASSERT_NO_FATAL_FAILURE( - session_.TestDecryptCTR(false, OEMCrypto_ERROR_KEY_EXPIRED)); - - RenewalRoundTrip renewal_messages(&license_messages_); - MakeRenewalRequest(&renewal_messages); - LoadRenewal(&renewal_messages, OEMCrypto_SUCCESS); - - // After we've loaded the renewal, decrypt should succeed again. - ASSERT_NO_FATAL_FAILURE(session_.TestDecryptCTR(false)); -} - -TEST_P(OEMCryptoRefreshTest, RenewLicenseLoadOutsideRentalDuration) { - license_messages_.core_response().renewal_delay_base = OEMCrypto_License_Load; - timer_limits_.rental_duration_seconds = kDuration; // 2 seconds. - timer_limits_.initial_renewal_duration_seconds = kLongDuration; // 5 seconds. - - // Sleep until just after rental window is over. - wvutil::TestSleep::Sleep(kDuration + kShortSleep); - // Loading the license should start the playback clock. - LoadLicense(); - // If the license is loaded after the rental duration window, we expect - // failure. - ASSERT_NO_FATAL_FAILURE( - session_.TestDecryptCTR(false, OEMCrypto_ERROR_UNKNOWN_FAILURE)); - return; -} - -INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoRefreshTest, - Range(kCurrentAPI - 1, kCurrentAPI + 1)); - -// These tests only work when the license has a core message. -INSTANTIATE_TEST_SUITE_P(TestAPI16, OEMCryptoRefreshTestAPI16, - Range(kCoreMessagesAPI, kCurrentAPI + 1)); - /// @} /// @addtogroup security @@ -1739,6 +1549,9 @@ TEST_F(OEMCryptoLoadsCertificate, TEST_F( OEMCryptoLoadsCertificate, OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncMessageKeyLengthProv30) { + if (global_features.provisioning_method != OEMCrypto_OEMCertificate) { + GTEST_SKIP() << "Test for Prov 3.0 devices only."; + } TestLoadProvisioningForOutOfRangeSubstringOffsetAndLengths( [](size_t response_message_length, ProvisioningRoundTrip* provisioning_messages) { @@ -1752,6 +1565,9 @@ TEST_F( TEST_F( OEMCryptoLoadsCertificate, OEMCryptoMemoryLoadProvisioningForOutOfRangeCoreMessageEncMessageKeyOffsetProv30) { + if (global_features.provisioning_method != OEMCrypto_OEMCertificate) { + GTEST_SKIP() << "Test for Prov 3.0 devices only."; + } TestLoadProvisioningForOutOfRangeSubstringOffsetAndLengths( [](size_t response_message_length, ProvisioningRoundTrip* provisioning_messages) { @@ -1764,201 +1580,6 @@ TEST_F( /// @} -/// @addtogroup provision -/// @{ - -// Test that a wrapped RSA key can be loaded. -TEST_F(OEMCryptoLoadsCertificate, LoadWrappedRSAKey) { - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); -} - -class OEMCryptoLoadsCertVariousKeys : public OEMCryptoLoadsCertificate { - public: - void TestKey(const uint8_t* key, size_t key_length) { - encoded_rsa_key_.assign(key, key + key_length); - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - LicenseRoundTrip license_messages(&s); - ASSERT_NO_FATAL_FAILURE(license_messages.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages.LoadResponse()); - ASSERT_NO_FATAL_FAILURE(s.TestDecryptCTR()); - } -}; - -// Test a 3072 bit RSA key certificate. -TEST_F(OEMCryptoLoadsCertVariousKeys, TestLargeRSAKey3072) { - TestKey(kTestRSAPKCS8PrivateKeyInfo3_3072, - sizeof(kTestRSAPKCS8PrivateKeyInfo3_3072)); -} - -// Test an RSA key certificate which has a private key generated using the -// Carmichael totient. -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelRSAKey) { - TestKey(kTestKeyRSACarmichael_2048, sizeof(kTestKeyRSACarmichael_2048)); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelNonZeroNormalDer) { - TestKey(kCarmichaelNonZeroNormalDer, kCarmichaelNonZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelNonZeroShortDer) { - TestKey(kCarmichaelNonZeroShortDer, kCarmichaelNonZeroShortDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelZeroNormalDer) { - TestKey(kCarmichaelZeroNormalDer, kCarmichaelZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestCarmichaelZeroShortDer) { - TestKey(kCarmichaelZeroShortDer, kCarmichaelZeroShortDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualNonZeroNormalDer) { - TestKey(kDualNonZeroNormalDer, kDualNonZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualNonZeroShortDer) { - TestKey(kDualNonZeroShortDer, kDualNonZeroShortDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualZeroNormalDer) { - TestKey(kDualZeroNormalDer, kDualZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestDualZeroShortDer) { - TestKey(kDualZeroShortDer, kDualZeroShortDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestEulerNonZeroNormalDer) { - TestKey(kEulerNonZeroNormalDer, kEulerNonZeroNormalDerLen); -} - -TEST_F(OEMCryptoLoadsCertVariousKeys, TestEulerZeroNormalDer) { - TestKey(kEulerZeroNormalDer, kEulerZeroNormalDerLen); -} - -// This tests that two sessions can use different RSA keys simultaneously. -TEST_F(OEMCryptoLoadsCertificate, TestMultipleRSAKeys) { - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - Session s1; // Session s1 loads the default rsa key, but doesn't use it - // until after s2 uses its key. - ASSERT_NO_FATAL_FAILURE(s1.open()); - ASSERT_NO_FATAL_FAILURE(s1.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_NO_FATAL_FAILURE(s1.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - Session s2; // Session s2 uses a different rsa key. - encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeyInfo4_2048, - kTestRSAPKCS8PrivateKeyInfo4_2048 + - sizeof(kTestRSAPKCS8PrivateKeyInfo4_2048)); - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - ASSERT_NO_FATAL_FAILURE(s2.open()); - ASSERT_NO_FATAL_FAILURE(s2.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_NO_FATAL_FAILURE(s2.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - LicenseRoundTrip license_messages2(&s2); - ASSERT_NO_FATAL_FAILURE(license_messages2.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages2.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages2.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages2.LoadResponse()); - ASSERT_NO_FATAL_FAILURE(s2.TestDecryptCTR()); - s2.close(); - - // After s2 has loaded its rsa key, we continue using s1's key. - LicenseRoundTrip license_messages1(&s1); - ASSERT_NO_FATAL_FAILURE(license_messages1.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages1.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages1.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages1.LoadResponse()); - ASSERT_NO_FATAL_FAILURE(s1.TestDecryptCTR()); -} - -// This tests the maximum number of DRM private keys that OEMCrypto can load -TEST_F(OEMCryptoLoadsCertificate, TestMaxDRMKeys) { - const size_t max_total_keys = GetResourceValue(kMaxTotalDRMPrivateKeys); - std::vector> sessions; - std::vector> licenses; - - // It should be able to load up to kMaxTotalDRMPrivateKeys keys - for (size_t i = 0; i < max_total_keys; i++) { - sessions.push_back(std::unique_ptr(new Session())); - licenses.push_back(std::unique_ptr( - new LicenseRoundTrip(sessions[i].get()))); - const size_t key_index = i % kTestRSAPKCS8PrivateKeys_2048.size(); - encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeys_2048[key_index].begin(), - kTestRSAPKCS8PrivateKeys_2048[key_index].end()); - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - ASSERT_NO_FATAL_FAILURE(sessions[i]->open()); - ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(sessions[i].get())); - } - - // Attempts to load one more key than the kMaxTotalDRMPrivateKeys - if (global_features.provisioning_method == OEMCrypto_BootCertificateChain) { - Session s; - const size_t buffer_size = 5000; // Make sure it is large enough. - std::vector public_key(buffer_size); - size_t public_key_size = buffer_size; - std::vector public_key_signature(buffer_size); - size_t public_key_signature_size = buffer_size; - std::vector wrapped_private_key(buffer_size); - size_t wrapped_private_key_size = buffer_size; - OEMCrypto_PrivateKeyType key_type; - OEMCryptoResult result = OEMCrypto_GenerateCertificateKeyPair( - s.session_id(), public_key.data(), &public_key_size, - public_key_signature.data(), &public_key_signature_size, - wrapped_private_key.data(), &wrapped_private_key_size, &key_type); - // Key creation is allowed to fail due to resource restriction - if (result != OEMCrypto_SUCCESS) { - ASSERT_TRUE(result == OEMCrypto_ERROR_INSUFFICIENT_RESOURCES || - result == OEMCrypto_ERROR_TOO_MANY_KEYS); - } - } else { - Session s; - encoded_rsa_key_.assign(kTestRSAPKCS8PrivateKeyInfo2_2048, - kTestRSAPKCS8PrivateKeyInfo2_2048 + - sizeof(kTestRSAPKCS8PrivateKeyInfo2_2048)); - Session ps; - ProvisioningRoundTrip provisioning_messages(&ps, encoded_rsa_key_); - provisioning_messages.PrepareSession(keybox_); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.EncryptAndSignResponse()); - OEMCryptoResult result = provisioning_messages.LoadResponse(); - // Key loading is allowed to fail due to resource restriction - if (result != OEMCrypto_SUCCESS) { - ASSERT_TRUE(result == OEMCrypto_ERROR_INSUFFICIENT_RESOURCES || - result == OEMCrypto_ERROR_TOO_MANY_KEYS); - } - } - // Verifies that the DRM keys which are already loaded should still function - for (size_t i = 0; i < licenses.size(); i++) { - ASSERT_NO_FATAL_FAILURE(licenses[i]->SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(licenses[i]->CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(licenses[i]->EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, licenses[i]->LoadResponse()); - ASSERT_NO_FATAL_FAILURE(sessions[i]->TestDecryptCTR()); - } -} - -// Devices that load certificates, should at least support RSA 2048 keys. -TEST_F(OEMCryptoLoadsCertificate, SupportsCertificatesAPI13) { - ASSERT_NE(0u, - OEMCrypto_Supports_RSA_2048bit & OEMCrypto_SupportedCertificates()) - << "Supported certificates is only " << OEMCrypto_SupportedCertificates(); -} - -/// @} - /// @addtogroup security /// @{ @@ -1991,1794 +1612,8 @@ TEST_F(OEMCryptoLoadsCertificate, /// @} -/// @addtogroup provision -/// @{ - -// These tests are run by all L1 devices that load and use certificates. It is -// also run by a few L3 devices that use a baked in certificate, but cannot load -// a certificate. -class OEMCryptoUsesCertificate : public OEMCryptoLoadsCertificate { - protected: - void SetUp() override { - OEMCryptoLoadsCertificate::SetUp(); - ASSERT_NO_FATAL_FAILURE(session_.open()); - if (global_features.derive_key_method == - DeviceFeatures::LOAD_TEST_RSA_KEY) { - ASSERT_NO_FATAL_FAILURE(session_.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - } else { - InstallTestDrmKey(&session_); - } - } - - void TearDown() override { - ASSERT_NO_FATAL_FAILURE(session_.close()); - OEMCryptoLoadsCertificate::TearDown(); - } - - Session session_; -}; - -// This test is not run by default, because it takes a long time and -// is used to measure RSA performance, not test functionality. -TEST_F(OEMCryptoLoadsCertificate, RSAPerformance) { - const std::chrono::milliseconds kTestDuration(5000); - OEMCryptoResult sts; - std::chrono::steady_clock clock; - wvutil::TestSleep::Sleep(kShortSleep); // Make sure we are not nonce limited. - - auto start_time = clock.now(); - int count = 15; - for (int i = 0; i < count; i++) { // Only 20 nonce available. - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - } - auto delta_time = clock.now() - start_time; - const double provision_time = - delta_time / std::chrono::milliseconds(1) / count; - - Session session; - ASSERT_NO_FATAL_FAILURE(CreateWrappedDRMKey()); - start_time = clock.now(); - count = 0; - while (clock.now() - start_time < kTestDuration) { - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - const size_t size = 50; - vector licenseRequest(size); - GetRandBytes(licenseRequest.data(), licenseRequest.size()); - size_t signature_length = 0; - sts = OEMCrypto_GenerateRSASignature(s.session_id(), licenseRequest.data(), - licenseRequest.size(), nullptr, - &signature_length, kSign_RSASSA_PSS); - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); - ASSERT_NE(static_cast(0), signature_length); - - if (ShouldGenerateCorpus()) { - const std::string file_name = - GetFileName("oemcrypto_generate_rsa_signature_fuzz_seed_corpus"); - OEMCrypto_Generate_RSA_Signature_Fuzz fuzzed_structure; - fuzzed_structure.padding_scheme = kSign_RSASSA_PSS; - fuzzed_structure.signature_length = signature_length; - // Cipher mode and algorithm. - AppendToFile(file_name, reinterpret_cast(&fuzzed_structure), - sizeof(fuzzed_structure)); - AppendToFile(file_name, - reinterpret_cast(licenseRequest.data()), - licenseRequest.size()); - } - - std::vector signature(signature_length, 0); - sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), - signature.data(), &signature_length, kSign_RSASSA_PSS); - ASSERT_EQ(OEMCrypto_SUCCESS, sts); - count++; - } - delta_time = clock.now() - start_time; - const double license_request_time = - delta_time / std::chrono::milliseconds(1) / count; - - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - vector session_key; - vector enc_session_key; - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_TRUE(s.GenerateRsaSessionKey(&session_key, &enc_session_key)); - vector mac_context; - vector enc_context; - s.FillDefaultContext(&mac_context, &enc_context); - - enc_session_key = wvutil::a2b_hex( - "7789c619aa3b9fa3c0a53f57a4abc6" - "02157c8aa57e3c6fb450b0bea22667fb" - "0c3200f9d9d618e397837c720dc2dadf" - "486f33590744b2a4e54ca134ae7dbf74" - "434c2fcf6b525f3e132262f05ea3b3c1" - "198595c0e52b573335b2e8a3debd0d0d" - "d0306f8fcdde4e76476be71342957251" - "e1688c9ca6c1c34ed056d3b989394160" - "cf6937e5ce4d39cc73d11a2e93da21a2" - "fa019d246c852fe960095b32f120c3c2" - "7085f7b64aac344a68d607c0768676ce" - "d4c5b2d057f7601921b453a451e1dea0" - "843ebfef628d9af2784d68e86b730476" - "e136dfe19989de4be30a4e7878efcde5" - "ad2b1254f80c0c5dd3cf111b56572217" - "b9f58fc1dacbf74b59d354a1e62cfa0e" - "bf"); - start_time = clock.now(); - while (clock.now() - start_time < kTestDuration) { - ASSERT_EQ(OEMCrypto_SUCCESS, - OEMCrypto_DeriveKeysFromSessionKey( - s.session_id(), enc_session_key.data(), - enc_session_key.size(), mac_context.data(), - mac_context.size(), enc_context.data(), enc_context.size())); - count++; - } - delta_time = clock.now() - start_time; - const double derive_keys_time = - delta_time / std::chrono::milliseconds(1) / count; - - OEMCrypto_Security_Level level = OEMCrypto_SecurityLevel(); - printf("PERF:head, security, provision (ms), lic req(ms), derive keys(ms)\n"); - printf("PERF:stat, %u, %8.3f, %8.3f, %8.3f\n", - static_cast(level), provision_time, license_request_time, - derive_keys_time); -} - -// Test DeriveKeysFromSessionKey using the maximum size for the HMAC context. -TEST_F(OEMCryptoUsesCertificate, GenerateDerivedKeysLargeBuffer) { - vector session_key; - vector enc_session_key; - ASSERT_TRUE(session_.GenerateSessionKey(&session_key, &enc_session_key)); - const size_t max_size = GetResourceValue(kLargeMessageSize); - vector mac_context(max_size); - vector enc_context(max_size); - // Stripe the data so the two vectors are not identical, and not all zeroes. - for (size_t i = 0; i < max_size; i++) { - mac_context[i] = i % 0x100; - enc_context[i] = (3 * i) % 0x100; - } - ASSERT_EQ(OEMCrypto_SUCCESS, - OEMCrypto_DeriveKeysFromSessionKey( - session_.session_id(), enc_session_key.data(), - enc_session_key.size(), mac_context.data(), mac_context.size(), - enc_context.data(), enc_context.size())); -} - -/// @} - /// @addtogroup cast /// @{ -// This test attempts to use alternate algorithms for loaded device certs. -class OEMCryptoLoadsCertificateAlternates : public OEMCryptoLoadsCertificate { - protected: - void DisallowForbiddenPadding(RSA_Padding_Scheme scheme, size_t size) { - OEMCryptoResult sts; - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - // Sign a Message - vector licenseRequest(size); - GetRandBytes(licenseRequest.data(), licenseRequest.size()); - size_t signature_length = 256; - vector signature(signature_length); - sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), - signature.data(), &signature_length, scheme); - // Allow OEMCrypto to request a full buffer. - if (sts == OEMCrypto_ERROR_SHORT_BUFFER) { - ASSERT_NE(static_cast(0), signature_length); - signature.assign(signature_length, 0); - sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), - signature.data(), &signature_length, scheme); - } - - EXPECT_NE(OEMCrypto_SUCCESS, sts) - << "Signed with forbidden padding scheme=" << (int)scheme - << ", size=" << (int)size; - const vector zero(signature.size(), 0); - ASSERT_EQ(zero, signature); // signature should not be computed. - } - - void TestSignature(RSA_Padding_Scheme scheme, size_t size) { - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - vector licenseRequest(size); - GetRandBytes(licenseRequest.data(), licenseRequest.size()); - size_t signature_length = 0; - OEMCryptoResult sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), nullptr, - &signature_length, scheme); - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); - ASSERT_NE(static_cast(0), signature_length); - - std::vector signature(signature_length, 0); - sts = OEMCrypto_GenerateRSASignature( - s.session_id(), licenseRequest.data(), licenseRequest.size(), - signature.data(), &signature_length, scheme); - - ASSERT_EQ(OEMCrypto_SUCCESS, sts) - << "Failed to sign with padding scheme=" << (int)scheme - << ", size=" << size; - signature.resize(signature_length); - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature( - licenseRequest, signature.data(), signature_length, scheme)); - } - - void DisallowDeriveKeys() { - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - s.GenerateNonce(); - vector session_key; - vector enc_session_key; - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - ASSERT_TRUE(s.GenerateRsaSessionKey(&session_key, &enc_session_key)); - vector mac_context; - vector enc_context; - s.FillDefaultContext(&mac_context, &enc_context); - ASSERT_NE(OEMCrypto_SUCCESS, - OEMCrypto_DeriveKeysFromSessionKey( - s.session_id(), enc_session_key.data(), - enc_session_key.size(), mac_context.data(), - mac_context.size(), enc_context.data(), enc_context.size())); - } - - // If force is true, we assert that the key loads successfully. - void LoadWithAllowedSchemes(uint32_t schemes, bool force) { - Session s; - ProvisioningRoundTrip provisioning_messages(&s, encoded_rsa_key_); - provisioning_messages.set_allowed_schemes(schemes); - provisioning_messages.PrepareSession(keybox_); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(provisioning_messages.EncryptAndSignResponse()); - OEMCryptoResult sts = provisioning_messages.LoadResponse(); - key_loaded_ = (OEMCrypto_SUCCESS == sts); - if (key_loaded_) { - uint8_t* ptr = provisioning_messages.response_data().rsa_key; - size_t len = provisioning_messages.response_data().rsa_key_length; - encoded_rsa_key_ = std::vector(ptr, ptr + len); - wrapped_drm_key_ = provisioning_messages.wrapped_rsa_key(); - drm_key_type_ = OEMCrypto_RSA_Private_Key; - EXPECT_GT(wrapped_drm_key_.size(), 0u); - EXPECT_EQ(nullptr, find(wrapped_drm_key_, encoded_rsa_key_)); - } - if (force) { - EXPECT_EQ(OEMCrypto_SUCCESS, sts); - } - } - - bool key_loaded_ = false; -}; - -// The alternate padding is only required for cast receivers, but all devices -// should forbid the alternate padding for regular certificates. -TEST_F(OEMCryptoLoadsCertificateAlternates, DisallowForbiddenPaddingAPI09) { - LoadWithAllowedSchemes(kSign_RSASSA_PSS, true); // Use default padding scheme - DisallowForbiddenPadding(kSign_PKCS1_Block1, 50); -} - -// The alternate padding is only required for cast receivers, but if a device -// does load an alternate certificate, it should NOT use it for generating -// a license request signature. -TEST_F(OEMCryptoLoadsCertificateAlternates, TestSignaturePKCS1) { - // Try to load an RSA key with alternative padding schemes. This signing - // scheme is used by cast receivers. - LoadWithAllowedSchemes(kSign_PKCS1_Block1, false); - // If the device is a cast receiver, then this scheme is required. - if (global_features.cast_receiver) { - ASSERT_TRUE(key_loaded_); - } - // If the key loaded with no error, then we will verify that it is not used - // for forbidden padding schemes. - if (key_loaded_) { - // The other padding scheme should fail. - DisallowForbiddenPadding(kSign_RSASSA_PSS, 83); - DisallowDeriveKeys(); - if (global_features.cast_receiver) { - // A signature with a valid size should succeed. - TestSignature(kSign_PKCS1_Block1, 83); - TestSignature(kSign_PKCS1_Block1, 50); - } - // A signature with padding that is too big should fail. - DisallowForbiddenPadding(kSign_PKCS1_Block1, 84); // too big. - } -} - -// This test verifies RSA signing with the alternate padding scheme used by -// Android cast receivers, PKCS1 Block 1. These tests are not required for -// other devices, and should be filtered out by DeviceFeatures::Initialize for -// those devices. -class OEMCryptoCastReceiverTest : public OEMCryptoLoadsCertificateAlternates { - protected: - void SetUp() override { - OEMCryptoLoadsCertificateAlternates::SetUp(); - if (!global_features.cast_receiver) { - GTEST_SKIP() << "OEMCrypto does not support CAST Receiver functionality"; - } - } - - vector encode(uint8_t type, const vector& substring) { - vector result; - result.push_back(type); - if (substring.size() < 0x80) { - uint8_t length = substring.size(); - result.push_back(length); - } else if (substring.size() < 0x100) { - result.push_back(0x81); - uint8_t length = substring.size(); - result.push_back(length); - } else { - result.push_back(0x82); - uint16_t length = substring.size(); - result.push_back(length >> 8); - result.push_back(length & 0xFF); - } - result.insert(result.end(), substring.begin(), substring.end()); - return result; - } - vector concat(const vector& a, const vector& b) { - vector result = a; - result.insert(result.end(), b.begin(), b.end()); - return result; - } - - // This encodes the RSA key used in the PKCS#1 signing tests below. - void BuildRSAKey() { - vector field_n = - encode(0x02, wvutil::a2b_hex("00" - "df271fd25f8644496b0c81be4bd50297" - "ef099b002a6fd67727eb449cea566ed6" - "a3981a71312a141cabc9815c1209e320" - "a25b32464e9999f18ca13a9fd3892558" - "f9e0adefdd3650dd23a3f036d60fe398" - "843706a40b0b8462c8bee3bce12f1f28" - "60c2444cdc6a44476a75ff4aa24273cc" - "be3bf80248465f8ff8c3a7f3367dfc0d" - "f5b6509a4f82811cedd81cdaaa73c491" - "da412170d544d4ba96b97f0afc806549" - "8d3a49fd910992a1f0725be24f465cfe" - "7e0eabf678996c50bc5e7524abf73f15" - "e5bef7d518394e3138ce4944506aaaaf" - "3f9b236dcab8fc00f87af596fdc3d9d6" - "c75cd508362fae2cbeddcc4c7450b17b" - "776c079ecca1f256351a43b97dbe2153")); - vector field_e = encode(0x02, wvutil::a2b_hex("010001")); - vector field_d = - encode(0x02, wvutil::a2b_hex("5bd910257830dce17520b03441a51a8c" - "ab94020ac6ecc252c808f3743c95b7c8" - "3b8c8af1a5014346ebc4242cdfb5d718" - "e30a733e71f291e4d473b61bfba6daca" - "ed0a77bd1f0950ae3c91a8f901118825" - "89e1d62765ee671e7baeea309f64d447" - "bbcfa9ea12dce05e9ea8939bc5fe6108" - "581279c982b308794b3448e7f7b95229" - "2df88c80cb40142c4b5cf5f8ddaa0891" - "678d610e582fcb880f0d707caf47d09a" - "84e14ca65841e5a3abc5e9dba94075a9" - "084341f0edad9b68e3b8e082b80b6e6e" - "8a0547b44fb5061b6a9131603a5537dd" - "abd01d8e863d8922e9aa3e4bfaea0b39" - "d79283ad2cbc8a59cce7a6ecf4e4c81e" - "d4c6591c807defd71ab06866bb5e7745")); - vector field_p = - encode(0x02, wvutil::a2b_hex("00" - "f44f5e4246391f482b2f5296e3602eb3" - "4aa136427710f7c0416d403fd69d4b29" - "130cfebef34e885abdb1a8a0a5f0e9b5" - "c33e1fc3bfc285b1ae17e40cc67a1913" - "dd563719815ebaf8514c2a7aa0018e63" - "b6c631dc315a46235716423d11ff5803" - "4e610645703606919f5c7ce2660cd148" - "bd9efc123d9c54b6705590d006cfcf3f")); - vector field_q = - encode(0x02, wvutil::a2b_hex("00" - "e9d49841e0e0a6ad0d517857133e36dc" - "72c1bdd90f9174b52e26570f373640f1" - "c185e7ea8e2ed7f1e4ebb951f70a5802" - "3633b0097aec67c6dcb800fc1a67f9bb" - "0563610f08ebc8746ad129772136eb1d" - "daf46436450d318332a84982fe5d28db" - "e5b3e912407c3e0e03100d87d436ee40" - "9eec1cf85e80aba079b2e6106b97bced")); - vector field_exp1 = - encode(0x02, wvutil::a2b_hex("00" - "ed102acdb26871534d1c414ecad9a4d7" - "32fe95b10eea370da62f05de2c393b1a" - "633303ea741b6b3269c97f704b352702" - "c9ae79922f7be8d10db67f026a8145de" - "41b30c0a42bf923bac5f7504c248604b" - "9faa57ed6b3246c6ba158e36c644f8b9" - "548fcf4f07e054a56f768674054440bc" - "0dcbbc9b528f64a01706e05b0b91106f")); - vector field_exp2 = - encode(0x02, wvutil::a2b_hex("6827924a85e88b55ba00f8219128bd37" - "24c6b7d1dfe5629ef197925fecaff5ed" - "b9cdf3a7befd8ea2e8dd3707138b3ff8" - "7c3c39c57f439e562e2aa805a39d7cd7" - "9966d2ece7845f1dbc16bee99999e4d0" - "bf9eeca45fcda8a8500035fe6b5f03bc" - "2f6d1bfc4d4d0a3723961af0cdce4a01" - "eec82d7f5458ec19e71b90eeef7dff61")); - vector field_invq = - encode(0x02, wvutil::a2b_hex("57b73888d183a99a6307422277551a3d" - "9e18adf06a91e8b55ceffef9077c8496" - "948ecb3b16b78155cb2a3a57c119d379" - "951c010aa635edcf62d84c5a122a8d67" - "ab5fa9e5a4a8772a1e943bafc70ae3a4" - "c1f0f3a4ddffaefd1892c8cb33bb0d0b" - "9590e963a69110fb34db7b906fc4ba28" - "36995aac7e527490ac952a02268a4f18")); - - // Header of rsa key is constant. - encoded_rsa_key_ = wvutil::a2b_hex( - // 0x02 0x01 0x00 == integer, size 1 byte, value = 0 (field=version) - "020100" - // 0x30, sequence, size = d = 13 (field=pkeyalg) AlgorithmIdentifier - "300d" - // 0x06 = object identifier. length = 9 - // (this should be 1.2.840.113549.1.1.1) (field=algorithm) - "0609" - "2a" // 1*0x40 + 2 = 42 = 0x2a. - "8648" // 840 = 0x348, 0x03 *2 + 0x80 + (0x48>>15) = 0x86. - // 0x48 -> 0x48 - "86f70d" // 113549 = 0x1668d -> (110 , 1110111, 0001101) - // -> (0x80+0x06, 0x80+0x77, 0x0d) - "01" // 1 - "01" // 1 - "01" // 1 - "05" // null object. (field=parameter?) - "00" // size of null object - ); - - vector pkey = wvutil::a2b_hex("020100"); // integer, version = 0. - pkey = concat(pkey, field_n); - pkey = concat(pkey, field_e); - pkey = concat(pkey, field_d); - pkey = concat(pkey, field_p); - pkey = concat(pkey, field_q); - pkey = concat(pkey, field_exp1); - pkey = concat(pkey, field_exp2); - pkey = concat(pkey, field_invq); - pkey = encode(0x30, pkey); - pkey = encode(0x04, pkey); - - encoded_rsa_key_ = concat(encoded_rsa_key_, pkey); - encoded_rsa_key_ = encode(0x30, encoded_rsa_key_); // 0x30=sequence - } - - // This is used to test a signature from the file pkcs1v15sign-vectors.txt. - void TestSignature(RSA_Padding_Scheme scheme, const vector& message, - const vector& correct_signature) { - OEMCryptoResult sts; - Session s; - ASSERT_NO_FATAL_FAILURE(s.open()); - ASSERT_NO_FATAL_FAILURE(s.LoadWrappedRsaDrmKey(wrapped_drm_key_)); - - // The application will compute the SHA-1 Hash of the message, so this - // test must do that also. - uint8_t hash[SHA_DIGEST_LENGTH]; - if (!SHA1(message.data(), message.size(), hash)) { - dump_boringssl_error(); - FAIL() << "boringssl error creating SHA1 hash."; - } - - // The application will prepend the digest info to the hash. - // SHA-1 digest info prefix = 0x30 0x21 0x30 ... - vector digest = wvutil::a2b_hex("3021300906052b0e03021a05000414"); - digest.insert(digest.end(), hash, hash + SHA_DIGEST_LENGTH); - - // OEMCrypto will apply the padding, and encrypt to generate the signature. - size_t signature_length = 0; - sts = OEMCrypto_GenerateRSASignature(s.session_id(), digest.data(), - digest.size(), nullptr, - &signature_length, scheme); - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); - ASSERT_NE(static_cast(0), signature_length); - - vector signature(signature_length); - sts = OEMCrypto_GenerateRSASignature(s.session_id(), digest.data(), - digest.size(), signature.data(), - &signature_length, scheme); - - ASSERT_EQ(OEMCrypto_SUCCESS, sts) - << "Failed to sign with padding scheme=" << (int)scheme - << ", size=" << message.size(); - signature.resize(signature_length); - ASSERT_NO_FATAL_FAILURE(s.SetRsaPublicKeyFromPrivateKeyInfo( - encoded_rsa_key_.data(), encoded_rsa_key_.size())); - - // Verify that the signature matches the official test vector. - ASSERT_EQ(correct_signature.size(), signature_length); - signature.resize(signature_length); - ASSERT_EQ(correct_signature, signature); - - // Also verify that our verification algorithm agrees. This is not needed - // to test OEMCrypto, but it does verify that this test is valid. - ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature(digest, signature.data(), - signature_length, scheme)); - ASSERT_NO_FATAL_FAILURE(s.VerifyRsaSignature( - digest, correct_signature.data(), correct_signature.size(), scheme)); - } -}; - -// CAST Receivers should report that they support cast certificates. -TEST_F(OEMCryptoCastReceiverTest, SupportsCertificatesAPI13) { - ASSERT_NE(0u, - OEMCrypto_Supports_RSA_CAST & OEMCrypto_SupportedCertificates()); -} - -// # PKCS#1 v1.5 Signature Example 15.1 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_1) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "f45d55f35551e975d6a8dc7ea9f48859" - "3940cc75694a278f27e578a163d839b3" - "4040841808cf9c58c9b8728bf5f9ce8e" - "e811ea91714f47bab92d0f6d5a26fcfe" - "ea6cd93b910c0a2c963e64eb1823f102" - "753d41f0335910ad3a977104f1aaf6c3" - "742716a9755d11b8eed690477f445c5d" - "27208b2e284330fa3d301423fa7f2d08" - "6e0ad0b892b9db544e456d3f0dab85d9" - "53c12d340aa873eda727c8a649db7fa6" - "3740e25e9af1533b307e61329993110e" - "95194e039399c3824d24c51f22b26bde" - "1024cd395958a2dfeb4816a6e8adedb5" - "0b1f6b56d0b3060ff0f1c4cb0d0e001d" - "d59d73be12"); - vector signature = wvutil::a2b_hex( - "b75a5466b65d0f300ef53833f2175c8a" - "347a3804fc63451dc902f0b71f908345" - "9ed37a5179a3b723a53f1051642d7737" - "4c4c6c8dbb1ca20525f5c9f32db77695" - "3556da31290e22197482ceb69906c46a" - "758fb0e7409ba801077d2a0a20eae7d1" - "d6d392ab4957e86b76f0652d68b83988" - "a78f26e11172ea609bf849fbbd78ad7e" - "dce21de662a081368c040607cee29db0" - "627227f44963ad171d2293b633a392e3" - "31dca54fe3082752f43f63c161b447a4" - "c65a6875670d5f6600fcc860a1caeb0a" - "88f8fdec4e564398a5c46c87f68ce070" - "01f6213abe0ab5625f87d19025f08d81" - "dac7bd4586bc9382191f6d2880f6227e" - "5df3eed21e7792d249480487f3655261"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} -// # PKCS#1 v1.5 Signature Example 15.2 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_2) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "c14b4c6075b2f9aad661def4ecfd3cb9" - "33c623f4e63bf53410d2f016d1ab98e2" - "729eccf8006cd8e08050737d95fdbf29" - "6b66f5b9792a902936c4f7ac69f51453" - "ce4369452dc22d96f037748114662000" - "dd9cd3a5e179f4e0f81fa6a0311ca1ae" - "e6519a0f63cec78d27bb726393fb7f1f" - "88cde7c97f8a66cd66301281dac3f3a4" - "33248c75d6c2dcd708b6a97b0a3f325e" - "0b2964f8a5819e479b"); - vector signature = wvutil::a2b_hex( - "afa7343462bea122cc149fca70abdae7" - "9446677db5373666af7dc313015f4de7" - "86e6e394946fad3cc0e2b02bedba5047" - "fe9e2d7d099705e4a39f28683279cf0a" - "c85c1530412242c0e918953be000e939" - "cf3bf182525e199370fa7907eba69d5d" - "b4631017c0e36df70379b5db8d4c695a" - "979a8e6173224065d7dc15132ef28cd8" - "22795163063b54c651141be86d36e367" - "35bc61f31fca574e5309f3a3bbdf91ef" - "f12b99e9cc1744f1ee9a1bd22c5bad96" - "ad481929251f0343fd36bcf0acde7f11" - "e5ad60977721202796fe061f9ada1fc4" - "c8e00d6022a8357585ffe9fdd59331a2" - "8c4aa3121588fb6cf68396d8ac054659" - "9500c9708500a5972bd54f72cf8db0c8"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.3 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_3) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "d02371ad7ee48bbfdb2763de7a843b94" - "08ce5eb5abf847ca3d735986df84e906" - "0bdbcdd3a55ba55dde20d4761e1a21d2" - "25c1a186f4ac4b3019d3adf78fe63346" - "67f56f70c901a0a2700c6f0d56add719" - "592dc88f6d2306c7009f6e7a635b4cb3" - "a502dfe68ddc58d03be10a1170004fe7" - "4dd3e46b82591ff75414f0c4a03e605e" - "20524f2416f12eca589f111b75d639c6" - "1baa80cafd05cf3500244a219ed9ced9" - "f0b10297182b653b526f400f2953ba21" - "4d5bcd47884132872ae90d4d6b1f4215" - "39f9f34662a56dc0e7b4b923b6231e30" - "d2676797817f7c337b5ac824ba93143b" - "3381fa3dce0e6aebd38e67735187b1eb" - "d95c02"); - vector signature = wvutil::a2b_hex( - "3bac63f86e3b70271203106b9c79aabd" - "9f477c56e4ee58a4fce5baf2cab4960f" - "88391c9c23698be75c99aedf9e1abf17" - "05be1dac33140adb48eb31f450bb9efe" - "83b7b90db7f1576d33f40c1cba4b8d6b" - "1d3323564b0f1774114fa7c08e6d1e20" - "dd8fbba9b6ac7ad41e26b4568f4a8aac" - "bfd178a8f8d2c9d5f5b88112935a8bc9" - "ae32cda40b8d20375510735096536818" - "ce2b2db71a9772c9b0dda09ae10152fa" - "11466218d091b53d92543061b7294a55" - "be82ff35d5c32fa233f05aaac7585030" - "7ecf81383c111674397b1a1b9d3bf761" - "2ccbe5bacd2b38f0a98397b24c83658f" - "b6c0b4140ef11970c4630d44344e76ea" - "ed74dcbee811dbf6575941f08a6523b8"); - TestSignature(kSign_PKCS1_Block1, message, signature); -}; - -// # PKCS#1 v1.5 Signature Example 15.4 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_4) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "29035584ab7e0226a9ec4b02e8dcf127" - "2dc9a41d73e2820007b0f6e21feccd5b" - "d9dbb9ef88cd6758769ee1f956da7ad1" - "8441de6fab8386dbc693"); - vector signature = wvutil::a2b_hex( - "28d8e3fcd5dddb21ffbd8df1630d7377" - "aa2651e14cad1c0e43ccc52f907f946d" - "66de7254e27a6c190eb022ee89ecf622" - "4b097b71068cd60728a1aed64b80e545" - "7bd3106dd91706c937c9795f2b36367f" - "f153dc2519a8db9bdf2c807430c451de" - "17bbcd0ce782b3e8f1024d90624dea7f" - "1eedc7420b7e7caa6577cef43141a726" - "4206580e44a167df5e41eea0e69a8054" - "54c40eefc13f48e423d7a32d02ed42c0" - "ab03d0a7cf70c5860ac92e03ee005b60" - "ff3503424b98cc894568c7c56a023355" - "1cebe588cf8b0167b7df13adcad82867" - "6810499c704da7ae23414d69e3c0d2db" - "5dcbc2613bc120421f9e3653c5a87672" - "97643c7e0740de016355453d6c95ae72"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.5 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_5) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex("bda3a1c79059eae598308d3df609"); - vector signature = wvutil::a2b_hex( - "a156176cb96777c7fb96105dbd913bc4" - "f74054f6807c6008a1a956ea92c1f81c" - "b897dc4b92ef9f4e40668dc7c556901a" - "cb6cf269fe615b0fb72b30a513386923" - "14b0e5878a88c2c7774bd16939b5abd8" - "2b4429d67bd7ac8e5ea7fe924e20a6ec" - "662291f2548d734f6634868b039aa5f9" - "d4d906b2d0cb8585bf428547afc91c6e" - "2052ddcd001c3ef8c8eefc3b6b2a82b6" - "f9c88c56f2e2c3cb0be4b80da95eba37" - "1d8b5f60f92538743ddbb5da2972c71f" - "e7b9f1b790268a0e770fc5eb4d5dd852" - "47d48ae2ec3f26255a3985520206a1f2" - "68e483e9dbb1d5cab190917606de31e7" - "c5182d8f151bf41dfeccaed7cde690b2" - "1647106b490c729d54a8fe2802a6d126"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.6 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_6) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "c187915e4e87da81c08ed4356a0cceac" - "1c4fb5c046b45281b387ec28f1abfd56" - "7e546b236b37d01ae71d3b2834365d3d" - "f380b75061b736b0130b070be58ae8a4" - "6d12166361b613dbc47dfaeb4ca74645" - "6c2e888385525cca9dd1c3c7a9ada76d" - "6c"); - vector signature = wvutil::a2b_hex( - "9cab74163608669f7555a333cf196fe3" - "a0e9e5eb1a32d34bb5c85ff689aaab0e" - "3e65668ed3b1153f94eb3d8be379b8ee" - "f007c4a02c7071ce30d8bb341e58c620" - "f73d37b4ecbf48be294f6c9e0ecb5e63" - "fec41f120e5553dfa0ebebbb72640a95" - "37badcb451330229d9f710f62e3ed8ec" - "784e50ee1d9262b42671340011d7d098" - "c6f2557b2131fa9bd0254636597e88ec" - "b35a240ef0fd85957124df8080fee1e1" - "49af939989e86b26c85a5881fae8673d" - "9fd40800dd134eb9bdb6410f420b0aa9" - "7b20efcf2eb0c807faeb83a3ccd9b51d" - "4553e41dfc0df6ca80a1e81dc234bb83" - "89dd195a38b42de4edc49d346478b9f1" - "1f0557205f5b0bd7ffe9c850f396d7c4"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.7 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_7) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "abfa2ecb7d29bd5bcb9931ce2bad2f74" - "383e95683cee11022f08e8e7d0b8fa05" - "8bf9eb7eb5f98868b5bb1fb5c31ceda3" - "a64f1a12cdf20fcd0e5a246d7a1773d8" - "dba0e3b277545babe58f2b96e3f4edc1" - "8eabf5cd2a560fca75fe96e07d859def" - "b2564f3a34f16f11e91b3a717b41af53" - "f6605323001aa406c6"); - vector signature = wvutil::a2b_hex( - "c4b437bcf703f352e1faf74eb9622039" - "426b5672caf2a7b381c6c4f0191e7e4a" - "98f0eebcd6f41784c2537ff0f99e7498" - "2c87201bfbc65eae832db71d16dacadb" - "0977e5c504679e40be0f9db06ffd848d" - "d2e5c38a7ec021e7f68c47dfd38cc354" - "493d5339b4595a5bf31e3f8f13816807" - "373df6ad0dc7e731e51ad19eb4754b13" - "4485842fe709d378444d8e36b1724a4f" - "da21cafee653ab80747f7952ee804dea" - "b1039d84139945bbf4be82008753f3c5" - "4c7821a1d241f42179c794ef7042bbf9" - "955656222e45c34369a384697b6ae742" - "e18fa5ca7abad27d9fe71052e3310d0f" - "52c8d12ea33bf053a300f4afc4f098df" - "4e6d886779d64594d369158fdbc1f694"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.8 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_8) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "df4044a89a83e9fcbf1262540ae3038b" - "bc90f2b2628bf2a4467ac67722d8546b" - "3a71cb0ea41669d5b4d61859c1b4e47c" - "ecc5933f757ec86db0644e311812d00f" - "b802f03400639c0e364dae5aebc5791b" - "c655762361bc43c53d3c7886768f7968" - "c1c544c6f79f7be820c7e2bd2f9d73e6" - "2ded6d2e937e6a6daef90ee37a1a52a5" - "4f00e31addd64894cf4c02e16099e29f" - "9eb7f1a7bb7f84c47a2b594813be02a1" - "7b7fc43b34c22c91925264126c89f86b" - "b4d87f3ef131296c53a308e0331dac8b" - "af3b63422266ecef2b90781535dbda41" - "cbd0cf22a8cbfb532ec68fc6afb2ac06"); - vector signature = wvutil::a2b_hex( - "1414b38567ae6d973ede4a06842dcc0e" - "0559b19e65a4889bdbabd0fd02806829" - "13bacd5dc2f01b30bb19eb810b7d9ded" - "32b284f147bbe771c930c6052aa73413" - "90a849f81da9cd11e5eccf246dbae95f" - "a95828e9ae0ca3550325326deef9f495" - "30ba441bed4ac29c029c9a2736b1a419" - "0b85084ad150426b46d7f85bd702f48d" - "ac5f71330bc423a766c65cc1dcab20d3" - "d3bba72b63b3ef8244d42f157cb7e3a8" - "ba5c05272c64cc1ad21a13493c3911f6" - "0b4e9f4ecc9900eb056ee59d6fe4b8ff" - "6e8048ccc0f38f2836fd3dfe91bf4a38" - "6e1ecc2c32839f0ca4d1b27a568fa940" - "dd64ad16bd0125d0348e383085f08894" - "861ca18987227d37b42b584a8357cb04"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.9 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_9) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "ea941ff06f86c226927fcf0e3b11b087" - "2676170c1bfc33bda8e265c77771f9d0" - "850164a5eecbcc5ce827fbfa07c85214" - "796d8127e8caa81894ea61ceb1449e72" - "fea0a4c943b2da6d9b105fe053b9039a" - "9cc53d420b7539fab2239c6b51d17e69" - "4c957d4b0f0984461879a0759c4401be" - "ecd4c606a0afbd7a076f50a2dfc2807f" - "24f1919baa7746d3a64e268ed3f5f8e6" - "da83a2a5c9152f837cb07812bd5ba7d3" - "a07985de88113c1796e9b466ec299c5a" - "c1059e27f09415"); - vector signature = wvutil::a2b_hex( - "ceeb84ccb4e9099265650721eea0e8ec" - "89ca25bd354d4f64564967be9d4b08b3" - "f1c018539c9d371cf8961f2291fbe0dc" - "2f2f95fea47b639f1e12f4bc381cef0c" - "2b7a7b95c3adf27605b7f63998c3cbad" - "542808c3822e064d4ad14093679e6e01" - "418a6d5c059684cd56e34ed65ab605b8" - "de4fcfa640474a54a8251bbb7326a42d" - "08585cfcfc956769b15b6d7fdf7da84f" - "81976eaa41d692380ff10eaecfe0a579" - "682909b5521fade854d797b8a0345b9a" - "864e0588f6caddbf65f177998e180d1f" - "102443e6dca53a94823caa9c3b35f322" - "583c703af67476159ec7ec93d1769b30" - "0af0e7157dc298c6cd2dee2262f8cddc" - "10f11e01741471bbfd6518a175734575"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.10 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_10) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "d8b81645c13cd7ecf5d00ed2c91b9acd" - "46c15568e5303c4a9775ede76b48403d" - "6be56c05b6b1cf77c6e75de096c5cb35" - "51cb6fa964f3c879cf589d28e1da2f9d" - "ec"); - vector signature = wvutil::a2b_hex( - "2745074ca97175d992e2b44791c323c5" - "7167165cdd8da579cdef4686b9bb404b" - "d36a56504eb1fd770f60bfa188a7b24b" - "0c91e881c24e35b04dc4dd4ce38566bc" - "c9ce54f49a175fc9d0b22522d9579047" - "f9ed42eca83f764a10163997947e7d2b" - "52ff08980e7e7c2257937b23f3d279d4" - "cd17d6f495546373d983d536efd7d1b6" - "7181ca2cb50ac616c5c7abfbb9260b91" - "b1a38e47242001ff452f8de10ca6eaea" - "dcaf9edc28956f28a711291fc9a80878" - "b8ba4cfe25b8281cb80bc9cd6d2bd182" - "5246eebe252d9957ef93707352084e6d" - "36d423551bf266a85340fb4a6af37088" - "0aab07153d01f48d086df0bfbec05e7b" - "443b97e71718970e2f4bf62023e95b67"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.11 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_11) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "e5739b6c14c92d510d95b826933337ff" - "0d24ef721ac4ef64c2bad264be8b44ef" - "a1516e08a27eb6b611d3301df0062dae" - "fc73a8c0d92e2c521facbc7b26473876" - "7ea6fc97d588a0baf6ce50adf79e600b" - "d29e345fcb1dba71ac5c0289023fe4a8" - "2b46a5407719197d2e958e3531fd54ae" - "f903aabb4355f88318994ed3c3dd62f4" - "20a7"); - vector signature = wvutil::a2b_hex( - "be40a5fb94f113e1b3eff6b6a33986f2" - "02e363f07483b792e68dfa5554df0466" - "cc32150950783b4d968b639a04fd2fb9" - "7f6eb967021f5adccb9fca95acc8f2cd" - "885a380b0a4e82bc760764dbab88c1e6" - "c0255caa94f232199d6f597cc9145b00" - "e3d4ba346b559a8833ad1516ad5163f0" - "16af6a59831c82ea13c8224d84d0765a" - "9d12384da460a8531b4c407e04f4f350" - "709eb9f08f5b220ffb45abf6b75d1579" - "fd3f1eb55fc75b00af8ba3b087827fe9" - "ae9fb4f6c5fa63031fe582852fe2834f" - "9c89bff53e2552216bc7c1d4a3d5dc2b" - "a6955cd9b17d1363e7fee8ed7629753f" - "f3125edd48521ae3b9b03217f4496d0d" - "8ede57acbc5bd4deae74a56f86671de2"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.12 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_12) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "7af42835917a88d6b3c6716ba2f5b0d5" - "b20bd4e2e6e574e06af1eef7c81131be" - "22bf8128b9cbc6ec00275ba80294a5d1" - "172d0824a79e8fdd830183e4c00b9678" - "2867b1227fea249aad32ffc5fe007bc5" - "1f21792f728deda8b5708aa99cabab20" - "a4aa783ed86f0f27b5d563f42e07158c" - "ea72d097aa6887ec411dd012912a5e03" - "2bbfa678507144bcc95f39b58be7bfd1" - "759adb9a91fa1d6d8226a8343a8b849d" - "ae76f7b98224d59e28f781f13ece605f" - "84f6c90bae5f8cf378816f4020a7dda1" - "bed90c92a23634d203fac3fcd86d68d3" - "182a7d9ccabe7b0795f5c655e9acc4e3" - "ec185140d10cef053464ab175c83bd83" - "935e3dabaf3462eebe63d15f573d269a"); - vector signature = wvutil::a2b_hex( - "4e78c5902b807914d12fa537ae6871c8" - "6db8021e55d1adb8eb0ccf1b8f36ab7d" - "ad1f682e947a627072f03e627371781d" - "33221d174abe460dbd88560c22f69011" - "6e2fbbe6e964363a3e5283bb5d946ef1" - "c0047eba038c756c40be7923055809b0" - "e9f34a03a58815ebdde767931f018f6f" - "1878f2ef4f47dd374051dd48685ded6e" - "fb3ea8021f44be1d7d149398f98ea9c0" - "8d62888ebb56192d17747b6b8e170954" - "31f125a8a8e9962aa31c285264e08fb2" - "1aac336ce6c38aa375e42bc92ab0ab91" - "038431e1f92c39d2af5ded7e43bc151e" - "6ebea4c3e2583af3437e82c43c5e3b5b" - "07cf0359683d2298e35948ed806c063c" - "606ea178150b1efc15856934c7255cfe"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.13 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_13) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "ebaef3f9f23bdfe5fa6b8af4c208c189" - "f2251bf32f5f137b9de4406378686b3f" - "0721f62d24cb8688d6fc41a27cbae21d" - "30e429feacc7111941c277"); - vector signature = wvutil::a2b_hex( - "c48dbef507114f03c95fafbeb4df1bfa" - "88e0184a33cc4f8a9a1035ff7f822a5e" - "38cda18723915ff078244429e0f6081c" - "14fd83331fa65c6ba7bb9a12dbf66223" - "74cd0ca57de3774e2bd7ae823677d061" - "d53ae9c4040d2da7ef7014f3bbdc95a3" - "61a43855c8ce9b97ecabce174d926285" - "142b534a3087f9f4ef74511ec742b0d5" - "685603faf403b5072b985df46adf2d25" - "29a02d40711e2190917052371b79b749" - "b83abf0ae29486c3f2f62477b2bd362b" - "039c013c0c5076ef520dbb405f42cee9" - "5425c373a975e1cdd032c49622c85079" - "b09e88dab2b13969ef7a723973781040" - "459f57d5013638483de2d91cb3c490da" - "81c46de6cd76ea8a0c8f6fe331712d24"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.14 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_14) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "c5a2711278761dfcdd4f0c99e6f5619d" - "6c48b5d4c1a80982faa6b4cf1cf7a60f" - "f327abef93c801429efde08640858146" - "1056acc33f3d04f5ada21216cacd5fd1" - "f9ed83203e0e2fe6138e3eae8424e591" - "5a083f3f7ab76052c8be55ae882d6ec1" - "482b1e45c5dae9f41015405327022ec3" - "2f0ea2429763b255043b1958ee3cf6d6" - "3983596eb385844f8528cc9a9865835d" - "c5113c02b80d0fca68aa25e72bcaaeb3" - "cf9d79d84f984fd417"); - vector signature = wvutil::a2b_hex( - "6bd5257aa06611fb4660087cb4bc4a9e" - "449159d31652bd980844daf3b1c7b353" - "f8e56142f7ea9857433b18573b4deede" - "818a93b0290297783f1a2f23cbc72797" - "a672537f01f62484cd4162c3214b9ac6" - "28224c5de01f32bb9b76b27354f2b151" - "d0e8c4213e4615ad0bc71f515e300d6a" - "64c6743411fffde8e5ff190e54923043" - "126ecfc4c4539022668fb675f25c07e2" - "0099ee315b98d6afec4b1a9a93dc3349" - "6a15bd6fde1663a7d49b9f1e639d3866" - "4b37a010b1f35e658682d9cd63e57de0" - "f15e8bdd096558f07ec0caa218a8c06f" - "4788453940287c9d34b6d40a3f09bf77" - "99fe98ae4eb49f3ff41c5040a50cefc9" - "bdf2394b749cf164480df1ab6880273b"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.15 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_15) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "9bf8aa253b872ea77a7e23476be26b23" - "29578cf6ac9ea2805b357f6fc3ad130d" - "baeb3d869a13cce7a808bbbbc969857e" - "03945c7bb61df1b5c2589b8e046c2a5d" - "7e4057b1a74f24c711216364288529ec" - "9570f25197213be1f5c2e596f8bf8b2c" - "f3cb38aa56ffe5e31df7395820e94ecf" - "3b1189a965dcf9a9cb4298d3c88b2923" - "c19fc6bc34aacecad4e0931a7c4e5d73" - "dc86dfa798a8476d82463eefaa90a8a9" - "192ab08b23088dd58e1280f7d72e4548" - "396baac112252dd5c5346adb2004a2f7" - "101ccc899cc7fafae8bbe295738896a5" - "b2012285014ef6"); - vector signature = wvutil::a2b_hex( - "27f7f4da9bd610106ef57d32383a448a" - "8a6245c83dc1309c6d770d357ba89e73" - "f2ad0832062eb0fe0ac915575bcd6b8b" - "cadb4e2ba6fa9da73a59175152b2d4fe" - "72b070c9b7379e50000e55e6c269f665" - "8c937972797d3add69f130e34b85bdec" - "9f3a9b392202d6f3e430d09caca82277" - "59ab825f7012d2ff4b5b62c8504dbad8" - "55c05edd5cab5a4cccdc67f01dd6517c" - "7d41c43e2a4957aff19db6f18b17859a" - "f0bc84ab67146ec1a4a60a17d7e05f8b" - "4f9ced6ad10908d8d78f7fc88b76adc8" - "290f87daf2a7be10ae408521395d54ed" - "2556fb7661854a730ce3d82c71a8d493" - "ec49a378ac8a3c74439f7cc555ba13f8" - "59070890ee18ff658fa4d741969d70a5"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.16 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_16) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "32474830e2203754c8bf0681dc4f842a" - "fe360930378616c108e833656e5640c8" - "6856885bb05d1eb9438efede679263de" - "07cb39553f6a25e006b0a52311a063ca" - "088266d2564ff6490c46b5609818548f" - "88764dad34a25e3a85d575023f0b9e66" - "5048a03c350579a9d32446c7bb96cc92" - "e065ab94d3c8952e8df68ef0d9fa456b" - "3a06bb80e3bbc4b28e6a94b6d0ff7696" - "a64efe05e735fea025d7bdbc4139f3a3" - "b546075cba7efa947374d3f0ac80a68d" - "765f5df6210bca069a2d88647af7ea04" - "2dac690cb57378ec0777614fb8b65ff4" - "53ca6b7dce6098451a2f8c0da9bfecf1" - "fdf391bbaa4e2a91ca18a1121a7523a2" - "abd42514f489e8"); - vector signature = wvutil::a2b_hex( - "6917437257c22ccb5403290c3dee82d9" - "cf7550b31bd31c51bd57bfd35d452ab4" - "db7c4be6b2e25ac9a59a1d2a7feb627f" - "0afd4976b3003cc9cffd8896505ec382" - "f265104d4cf8c932fa9fe86e00870795" - "9912389da4b2d6b369b36a5e72e29d24" - "c9a98c9d31a3ab44e643e6941266a47a" - "45e3446ce8776abe241a8f5fc6423b24" - "b1ff250dc2c3a8172353561077e850a7" - "69b25f0325dac88965a3b9b472c494e9" - "5f719b4eac332caa7a65c7dfe46d9aa7" - "e6e00f525f303dd63ab7919218901868" - "f9337f8cd26aafe6f33b7fb2c98810af" - "19f7fcb282ba1577912c1d368975fd5d" - "440b86e10c199715fa0b6f4250b53373" - "2d0befe1545150fc47b876de09b00a94"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.17 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_17) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "008e59505eafb550aae5e845584cebb0" - "0b6de1733e9f95d42c882a5bbeb5ce1c" - "57e119e7c0d4daca9f1ff7870217f7cf" - "d8a6b373977cac9cab8e71e420"); - vector signature = wvutil::a2b_hex( - "922503b673ee5f3e691e1ca85e9ff417" - "3cf72b05ac2c131da5603593e3bc259c" - "94c1f7d3a06a5b9891bf113fa39e59ff" - "7c1ed6465e908049cb89e4e125cd37d2" - "ffd9227a41b4a0a19c0a44fbbf3de55b" - "ab802087a3bb8d4ff668ee6bbb8ad89e" - "6857a79a9c72781990dfcf92cd519404" - "c950f13d1143c3184f1d250c90e17ac6" - "ce36163b9895627ad6ffec1422441f55" - "e4499dba9be89546ae8bc63cca01dd08" - "463ae7f1fce3d893996938778c1812e6" - "74ad9c309c5acca3fde44e7dd8695993" - "e9c1fa87acda99ece5c8499e468957ad" - "66359bf12a51adbe78d3a213b449bf0b" - "5f8d4d496acf03d3033b7ccd196bc22f" - "68fb7bef4f697c5ea2b35062f48a36dd"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.18 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_18) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "6abc54cf8d1dff1f53b17d8160368878" - "a8788cc6d22fa5c2258c88e660b09a89" - "33f9f2c0504ddadc21f6e75e0b833beb" - "555229dee656b9047b92f62e76b8ffcc" - "60dab06b80"); - vector signature = wvutil::a2b_hex( - "0b6daf42f7a862147e417493c2c401ef" - "ae32636ab4cbd44192bbf5f195b50ae0" - "96a475a1614f0a9fa8f7a026cb46c650" - "6e518e33d83e56477a875aca8c7e714c" - "e1bdbd61ef5d535239b33f2bfdd61771" - "bab62776d78171a1423cea8731f82e60" - "766d6454265620b15f5c5a584f55f95b" - "802fe78c574ed5dacfc831f3cf2b0502" - "c0b298f25ccf11f973b31f85e4744219" - "85f3cff702df3946ef0a6605682111b2" - "f55b1f8ab0d2ea3a683c69985ead93ed" - "449ea48f0358ddf70802cb41de2fd83f" - "3c808082d84936948e0c84a131b49278" - "27460527bb5cd24bfab7b48e071b2417" - "1930f99763272f9797bcb76f1d248157" - "5558fcf260b1f0e554ebb3df3cfcb958"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.19 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_19) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "af2d78152cf10efe01d274f217b177f6" - "b01b5e749f1567715da324859cd3dd88" - "db848ec79f48dbba7b6f1d33111ef31b" - "64899e7391c2bffd69f49025cf201fc5" - "85dbd1542c1c778a2ce7a7ee108a309f" - "eca26d133a5ffedc4e869dcd7656596a" - "c8427ea3ef6e3fd78fe99d8ddc71d839" - "f6786e0da6e786bd62b3a4f19b891a56" - "157a554ec2a2b39e25a1d7c7d37321c7" - "a1d946cf4fbe758d9276f08563449d67" - "414a2c030f4251cfe2213d04a5410637" - "87"); - vector signature = wvutil::a2b_hex( - "209c61157857387b71e24bf3dd564145" - "50503bec180ff53bdd9bac062a2d4995" - "09bf991281b79527df9136615b7a6d9d" - "b3a103b535e0202a2caca197a7b74e53" - "56f3dd595b49acfd9d30049a98ca88f6" - "25bca1d5f22a392d8a749efb6eed9b78" - "21d3110ac0d244199ecb4aa3d735a83a" - "2e8893c6bf8581383ccaee834635b7fa" - "1faffa45b13d15c1da33af71e89303d6" - "8090ff62ee615fdf5a84d120711da53c" - "2889198ab38317a9734ab27d67924cea" - "74156ff99bef9876bb5c339e93745283" - "e1b34e072226b88045e017e9f05b2a8c" - "416740258e223b2690027491732273f3" - "229d9ef2b1b3807e321018920ad3e53d" - "ae47e6d9395c184b93a374c671faa2ce"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -// # PKCS#1 v1.5 Signature Example 15.20 -TEST_F(OEMCryptoCastReceiverTest, TestSignaturePKCS1_15_20) { - BuildRSAKey(); - LoadWithAllowedSchemes(kSign_PKCS1_Block1, true); - vector message = wvutil::a2b_hex( - "40ee992458d6f61486d25676a96dd2cb" - "93a37f04b178482f2b186cf88215270d" - "ba29d786d774b0c5e78c7f6e56a956e7" - "f73950a2b0c0c10a08dbcd67e5b210bb" - "21c58e2767d44f7dd4014e3966143bf7" - "e3d66ff0c09be4c55f93b39994b8518d" - "9c1d76d5b47374dea08f157d57d70634" - "978f3856e0e5b481afbbdb5a3ac48d48" - "4be92c93de229178354c2de526e9c65a" - "31ede1ef68cb6398d7911684fec0babc" - "3a781a66660783506974d0e14825101c" - "3bfaea"); - vector signature = wvutil::a2b_hex( - "927502b824afc42513ca6570de338b8a" - "64c3a85eb828d3193624f27e8b1029c5" - "5c119c9733b18f5849b3500918bcc005" - "51d9a8fdf53a97749fa8dc480d6fe974" - "2a5871f973926528972a1af49e3925b0" - "adf14a842719b4a5a2d89fa9c0b6605d" - "212bed1e6723b93406ad30e86829a5c7" - "19b890b389306dc5506486ee2f36a8df" - "e0a96af678c9cbd6aff397ca200e3edc" - "1e36bd2f08b31d540c0cb282a9559e4a" - "dd4fc9e6492eed0ccbd3a6982e5faa2d" - "dd17be47417c80b4e5452d31f72401a0" - "42325109544d954c01939079d409a5c3" - "78d7512dfc2d2a71efcc3432a765d1c6" - "a52cfce899cd79b15b4fc3723641ef6b" - "d00acc10407e5df58dd1c3c5c559a506"); - TestSignature(kSign_PKCS1_Block1, message, signature); -} - -/// @} - -/// @addtogroup generic -/// @{ - -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyLoad) { EncryptAndLoadKeys(); } - -// Test that the Generic_Encrypt function works correctly. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncrypt) { - EncryptAndLoadKeys(); - unsigned int key_index = 0; - vector expected_encrypted; - EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector encrypted(clear_buffer_.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericEncrypt(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); - ASSERT_EQ(expected_encrypted, encrypted); -} - -// Test that the Generic_Encrypt function fails when not allowed. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadEncrypt) { - EncryptAndLoadKeys(); - BadEncrypt(0, OEMCrypto_HMAC_SHA256, buffer_size_); - // The buffer size must be a multiple of 16, so subtracting 10 is bad. - BadEncrypt(0, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_ - 10); - BadEncrypt(1, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); - BadEncrypt(2, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); - BadEncrypt(3, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); -} - -// Test that the Generic_Encrypt works if the input and output buffers are the -// same. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncryptSameBufferAPI12) { - EncryptAndLoadKeys(); - unsigned int key_index = 0; - vector expected_encrypted; - EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - // Input and output are same buffer: - vector buffer = clear_buffer_; - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericEncrypt(key_handle.data(), key_handle.size(), buffer.data(), - buffer.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, - buffer.data())); - ASSERT_EQ(expected_encrypted, buffer); -} - -TEST_P( - OEMCryptoGenericCryptoTest, - OEMCryptoMemoryGenericKeyEncryptForHugeBufferWithBufferLengthNotMultipleOf16) { - EncryptAndLoadKeys(); - unsigned int key_index = 0; - vector expected_encrypted; - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector buffer(17); - ASSERT_NO_FATAL_FAILURE(OEMCrypto_Generic_Encrypt( - key_handle.data(), key_handle.size(), buffer.data(), buffer.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, buffer.data())); -} - -// Test Generic_Decrypt works correctly. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecrypt) { - EncryptAndLoadKeys(); - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); - ASSERT_EQ(clear_buffer_, resultant); -} - -// Test that Generic_Decrypt works correctly when the input and output buffers -// are the same. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecryptSameBufferAPI12) { - EncryptAndLoadKeys(); - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector buffer = encrypted; - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), buffer.data(), - buffer.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, - buffer.data())); - ASSERT_EQ(clear_buffer_, buffer); -} - -// Test that Generic_Decrypt fails to decrypt to an insecure buffer if the key -// requires a secure data path. -TEST_P(OEMCryptoGenericCryptoTest, GenericSecureToClear) { - license_messages_.set_control(wvoec::kControlObserveDataPath | - wvoec::kControlDataPathSecure); - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_NE(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); - ASSERT_NE(clear_buffer_, resultant); -} - -// Test that the Generic_Decrypt function fails when not allowed. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadDecrypt) { - EncryptAndLoadKeys(); - BadDecrypt(1, OEMCrypto_HMAC_SHA256, buffer_size_); - // The buffer size must be a multiple of 16, so subtracting 10 is bad. - BadDecrypt(1, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_ - 10); - BadDecrypt(0, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); - BadDecrypt(2, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); - BadDecrypt(3, OEMCrypto_AES_CBC_128_NO_PADDING, buffer_size_); -} - -TEST_P(OEMCryptoGenericCryptoTest, GenericKeySign) { - EncryptAndLoadKeys(); - unsigned int key_index = 2; - vector expected_signature; - SignBuffer(key_index, clear_buffer_, &expected_signature); - - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - size_t gen_signature_length = 0; - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, - GenericSign(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), - OEMCrypto_HMAC_SHA256, nullptr, &gen_signature_length)); - ASSERT_EQ(static_cast(SHA256_DIGEST_LENGTH), gen_signature_length); - vector signature(SHA256_DIGEST_LENGTH); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - &gen_signature_length)); - ASSERT_EQ(expected_signature, signature); -} - -// Test that the Generic_Sign function fails when not allowed. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadSign) { - EncryptAndLoadKeys(); - BadSign(0, OEMCrypto_HMAC_SHA256); // Can't sign with encrypt key. - BadSign(1, OEMCrypto_HMAC_SHA256); // Can't sign with decrypt key. - BadSign(3, OEMCrypto_HMAC_SHA256); // Can't sign with verify key. - BadSign(2, OEMCrypto_AES_CBC_128_NO_PADDING); // Bad signing algorithm. -} - -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyVerify) { - EncryptAndLoadKeys(); - unsigned int key_index = 3; - vector signature; - SignBuffer(key_index, clear_buffer_, &signature); - - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, - signature.data(), signature.size())); -} - -// Test that the Generic_Verify function fails when not allowed. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyBadVerify) { - EncryptAndLoadKeys(); - BadVerify(0, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); - BadVerify(1, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); - BadVerify(2, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, false); - BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH, true); - BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH - 1, false); - BadVerify(3, OEMCrypto_HMAC_SHA256, SHA256_DIGEST_LENGTH + 1, false); - BadVerify(3, OEMCrypto_AES_CBC_128_NO_PADDING, SHA256_DIGEST_LENGTH, false); -} - -// Test Generic_Encrypt with the maximum buffer size. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyEncryptLargeBuffer) { - ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); - EncryptAndLoadKeys(); - unsigned int key_index = 0; - vector expected_encrypted; - EncryptBuffer(key_index, clear_buffer_, &expected_encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector encrypted(clear_buffer_.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericEncrypt(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); - ASSERT_EQ(expected_encrypted, encrypted); -} - -// Test Generic_Decrypt with the maximum buffer size. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyDecryptLargeBuffer) { - // Some applications are known to pass in a block that is almost 400k. - ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); - EncryptAndLoadKeys(); - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); - ASSERT_EQ(clear_buffer_, resultant); -} - -// Test Generic_Sign with the maximum buffer size. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeySignLargeBuffer) { - ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); - EncryptAndLoadKeys(); - unsigned int key_index = 2; - vector expected_signature; - SignBuffer(key_index, clear_buffer_, &expected_signature); - - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - size_t gen_signature_length = 0; - ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, - GenericSign(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), - OEMCrypto_HMAC_SHA256, nullptr, &gen_signature_length)); - ASSERT_EQ(static_cast(SHA256_DIGEST_LENGTH), gen_signature_length); - vector signature(SHA256_DIGEST_LENGTH); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - &gen_signature_length)); - ASSERT_EQ(expected_signature, signature); -} - -// Test Generic_Verify with the maximum buffer size. -TEST_P(OEMCryptoGenericCryptoTest, GenericKeyVerifyLargeBuffer) { - ResizeBuffer(GetResourceValue(kMaxGenericBuffer)); - EncryptAndLoadKeys(); - unsigned int key_index = 3; - vector signature; - SignBuffer(key_index, clear_buffer_, &signature); - - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, - signature.data(), signature.size())); -} - -// Test Generic_Encrypt when the key duration has expired. -TEST_P(OEMCryptoGenericCryptoTest, KeyDurationEncrypt) { - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - vector expected_encrypted; - EncryptBuffer(0, clear_buffer_, &expected_encrypted); - unsigned int key_index = 0; - vector encrypted(clear_buffer_.size()); - - vector key_handle; - // Should be valid key at the start. - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericEncrypt(key_handle.data(), key_handle.size(), - clear_buffer_.data(), clear_buffer_.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, encrypted.data())); - ASSERT_EQ(expected_encrypted, encrypted); - - wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. - encrypted.assign(clear_buffer_.size(), 0); - OEMCryptoResult status = OEMCrypto_Generic_Encrypt( - key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), iv_, OEMCrypto_AES_CBC_128_NO_PADDING, - encrypted.data()); - ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); - ASSERT_NE(encrypted, expected_encrypted); - ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); -} - -// Test Generic_Decrypt when the key duration has expired. -TEST_P(OEMCryptoGenericCryptoTest, KeyDurationDecrypt) { - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - - // Should be valid key at the start. - unsigned int key_index = 1; - vector encrypted; - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - GenericDecrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data())); - ASSERT_EQ(clear_buffer_, resultant); - - wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. - resultant.assign(encrypted.size(), 0); - OEMCryptoResult status = GenericDecrypt( - key_handle.data(), key_handle.size(), encrypted.data(), encrypted.size(), - iv_, OEMCrypto_AES_CBC_128_NO_PADDING, resultant.data()); - ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); - ASSERT_NE(clear_buffer_, resultant); - ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); -} - -// Test Generic_Sign when the key duration has expired. -TEST_P(OEMCryptoGenericCryptoTest, KeyDurationSign) { - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - - unsigned int key_index = 2; - vector expected_signature; - vector signature(SHA256_DIGEST_LENGTH); - size_t signature_length = signature.size(); - SignBuffer(key_index, clear_buffer_, &expected_signature); - - vector key_handle; - // Should be valid key at the start. - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - &signature_length)); - ASSERT_EQ(expected_signature, signature); - - wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. - signature.assign(SHA256_DIGEST_LENGTH, 0); - OEMCryptoResult status = - GenericSign(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - &signature_length); - ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); - ASSERT_NE(expected_signature, signature); - ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); -} - -// Test Generic_Verify when the key duration has expired. -TEST_P(OEMCryptoGenericCryptoTest, KeyDurationVerify) { - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - license_messages_.CreateResponseWithGenericCryptoKeys(); - EncryptAndLoadKeys(); - - unsigned int key_index = 3; - vector signature; - SignBuffer(key_index, clear_buffer_, &signature); - - vector key_handle; - // Should be valid key at the start. - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), - session_.license().keys[key_index].key_id, - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - ASSERT_EQ( - OEMCrypto_SUCCESS, - GenericVerify(key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, - signature.data(), signature.size())); - - wvutil::TestSleep::Sleep(kLongSleep + kShortSleep); // Should be expired key. - OEMCryptoResult status = OEMCrypto_Generic_Verify( - key_handle.data(), key_handle.size(), clear_buffer_.data(), - clear_buffer_.size(), OEMCrypto_HMAC_SHA256, signature.data(), - signature.size()); - ASSERT_EQ(OEMCrypto_ERROR_KEY_EXPIRED, status); - ASSERT_NO_FATAL_FAILURE(session_.TestGetKeyHandleExpired(key_index)); -} - -const unsigned int kLongKeyId = 2; - -// Test that short key ids are allowed. -class OEMCryptoGenericCryptoKeyIdLengthTest - : public OEMCryptoGenericCryptoTest { - protected: - void SetUp() override { - OEMCryptoGenericCryptoTest::SetUp(); - license_messages_.set_num_keys(5); - license_messages_.set_control(wvoec::kControlAllowDecrypt); - license_messages_.core_response() - .timer_limits.total_playback_duration_seconds = kDuration; - ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); - SetUniformKeyIdLength(16); // Start with all key ids being 16 bytes. - // But, we are testing that the key ids do not have to have the same length. - // 12 bytes (common key id length). - license_messages_.SetKeyId(0, "123456789012"); - license_messages_.SetKeyId(1, "12345"); // short key id. - // 16 byte key id. (default) - license_messages_.SetKeyId(2, "1234567890123456"); - license_messages_.SetKeyId(3, "12345678901234"); // 14 byte. (uncommon) - license_messages_.SetKeyId(4, "1"); // very short key id. - ASSERT_EQ(2u, kLongKeyId); - ASSERT_NO_FATAL_FAILURE(license_messages_.FillCoreResponseSubstrings()); - } - - // Make all four keys have the same length. - void SetUniformKeyIdLength(size_t key_id_length) { - for (size_t i = 0; i < license_messages_.num_keys(); i++) { - string key_id; - key_id.resize(key_id_length, i + 'a'); - license_messages_.SetKeyId(i, key_id); - } - ASSERT_NO_FATAL_FAILURE(license_messages_.FillCoreResponseSubstrings()); - } - - void TestWithKey(unsigned int key_index) { - ASSERT_LT(key_index, license_messages_.num_keys()); - EncryptAndLoadKeys(); - vector encrypted; - // To make sure OEMCrypto is not expecting the key_id to be zero padded, we - // will create a buffer that is padded with 'Z'. - // Then, we use fill the buffer with the longer of the three keys. If - // OEMCrypto is paying attention to the key id length, it should pick out - // the correct key. - vector key_id_buffer( - session_.license().keys[kLongKeyId].key_id_length + 5, - 'Z'); // Fill a bigger buffer with letter 'Z'. - memcpy(key_id_buffer.data(), session_.license().keys[kLongKeyId].key_id, - session_.license().keys[kLongKeyId].key_id_length); - EncryptBuffer(key_index, clear_buffer_, &encrypted); - vector key_handle; - ASSERT_EQ( - OEMCrypto_SUCCESS, - GetKeyHandleIntoVector(session_.session_id(), key_id_buffer.data(), - session_.license().keys[key_index].key_id_length, - OEMCrypto_CipherMode_CENC, key_handle)); - vector resultant(encrypted.size()); - ASSERT_EQ(OEMCrypto_SUCCESS, - OEMCrypto_Generic_Decrypt(key_handle.data(), key_handle.size(), - encrypted.data(), encrypted.size(), iv_, - OEMCrypto_AES_CBC_128_NO_PADDING, - resultant.data())); - ASSERT_EQ(clear_buffer_, resultant); - } -}; - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, MediumKeyId) { TestWithKey(0); } - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, ShortKeyId) { TestWithKey(1); } - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, LongKeyId) { TestWithKey(2); } - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, FourteenByteKeyId) { - TestWithKey(3); -} - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, VeryShortKeyId) { - TestWithKey(4); -} - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, UniformShortKeyId) { - SetUniformKeyIdLength(5); - TestWithKey(2); -} - -TEST_P(OEMCryptoGenericCryptoKeyIdLengthTest, UniformLongKeyId) { - SetUniformKeyIdLength(kTestKeyIdMaxLength); - TestWithKey(2); -} - -INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoGenericCryptoTest, - Range(kCoreMessagesAPI, kCurrentAPI + 1)); - -INSTANTIATE_TEST_SUITE_P(TestAll, OEMCryptoGenericCryptoKeyIdLengthTest, - Range(kCoreMessagesAPI, kCurrentAPI + 1)); /// @} } // namespace wvoec diff --git a/oemcrypto/test/oemcrypto_test_android.cpp b/oemcrypto/test/oemcrypto_test_android.cpp index 4e3ab9b..074eb4b 100644 --- a/oemcrypto/test/oemcrypto_test_android.cpp +++ b/oemcrypto/test/oemcrypto_test_android.cpp @@ -25,6 +25,9 @@ namespace wvoec { class OEMCryptoAndroidLMPTest : public ::testing::Test { protected: void SetUp() override { + if (OEMCrypto_GetProvisioningMethod() == OEMCrypto_BootCertificateChain) { + GTEST_SKIP() << "Test for non Prov 4.0 devices only."; + } OEMCrypto_SetSandbox(kTestSandbox, sizeof(kTestSandbox)); ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_Initialize()); OEMCrypto_SetMaxAPIVersion(kCurrentAPI); diff --git a/oemcrypto/test/oemcrypto_unittests.gypi b/oemcrypto/test/oemcrypto_unittests.gypi index 44d0984..3ccd422 100644 --- a/oemcrypto/test/oemcrypto_unittests.gypi +++ b/oemcrypto/test/oemcrypto_unittests.gypi @@ -18,7 +18,9 @@ 'oemcrypto_corpus_generator_helper.cpp', 'oemcrypto_session_tests_helper.cpp', 'oemcrypto_basic_test.cpp', + 'oemcrypto_cast_test.cpp', 'oemcrypto_decrypt_test.cpp', + 'oemcrypto_generic_crypto_test.cpp', 'oemcrypto_license_test.cpp', 'oemcrypto_provisioning_test.cpp', 'oemcrypto_usage_table_test.cpp', diff --git a/oemcrypto/test/oemcrypto_usage_table_test.cpp b/oemcrypto/test/oemcrypto_usage_table_test.cpp index 8b78b14..77c6240 100644 --- a/oemcrypto/test/oemcrypto_usage_table_test.cpp +++ b/oemcrypto/test/oemcrypto_usage_table_test.cpp @@ -10,9 +10,6 @@ using ::testing::Values; namespace wvoec { -/// @addtogroup usage_table -/// @{ - // Test that successive calls to PrepAndSignProvisioningRequest only increase // the provisioning count in the ODK message TEST_F(OEMCryptoSessionTests, Provisioning_IncrementCounterAPI18) { @@ -986,6 +983,39 @@ TEST_P(OEMCryptoUsageTableDefragTest, MoveUsageEntries) { FailReloadLicense(&entries[3], OEMCrypto_ERROR_UNKNOWN_FAILURE)); } +TEST_P(OEMCryptoUsageTableDefragTest, MakeAndMoveEntry) { + // 1. Make an entry then close. + LicenseWithUsageEntry entry; + ASSERT_NO_FATAL_FAILURE(entry.set_pst("pst 0")); + ASSERT_NO_FATAL_FAILURE(entry.MakeOfflineAndClose(this)); + ASSERT_NO_FATAL_FAILURE(entry.OpenAndReload(this)); + ASSERT_NO_FATAL_FAILURE(entry.session().close()); + + // 2. Make an entry then immediately move it into the previous slot. + // Not using helper functions because they shoehorn the session state into + // a limited set of possibilities. We want to create the specific case of + // immediately moving a newly created entry. + + // Like LicenseWithUsageEntry::MakeAndLoad() but stop after creating the new + // usage entry. + Session session; + ASSERT_NO_FATAL_FAILURE(session.open()); + ASSERT_NO_FATAL_FAILURE(InstallTestDrmKey(&session)); + LicenseRoundTrip license_messages_(&session); + license_messages_.set_control(wvoec::kControlNonceOrEntry); + ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); + ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); + ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); + OEMCryptoResult result; + ASSERT_NO_FATAL_FAILURE(session.CreateNewUsageEntry(&result)); + + // Not the same as Session::MoveUsageEntry, which opens and closes a session + // around the move operation. We just want to call MoveEntry on the current + // state. + ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_MoveEntry(session.session_id(), 0)); + ASSERT_NO_FATAL_FAILURE(session.close()); +} + // A usage table entry cannot be moved into an entry where an open session is // currently using the entry. TEST_P(OEMCryptoUsageTableDefragTest, MoveUsageEntriesToOpenSession) { @@ -1703,5 +1733,4 @@ INSTANTIATE_TEST_SUITE_P(TestAPI16, OEMCryptoUsageTableDefragTest, INSTANTIATE_TEST_SUITE_P(TestAPI16, OEMCryptoUsageTableTestWallClock, Values(kCurrentAPI)); -/// @} } // namespace wvoec \ No newline at end of file diff --git a/oemcrypto/test/oemcrypto_usage_table_test.h b/oemcrypto/test/oemcrypto_usage_table_test.h index 9ffd3fc..ce5d7ab 100644 --- a/oemcrypto/test/oemcrypto_usage_table_test.h +++ b/oemcrypto/test/oemcrypto_usage_table_test.h @@ -19,48 +19,6 @@ namespace wvoec { -class OEMCryptoRefreshTest : public OEMCryptoLicenseTest { - protected: - void SetUp() override { - OEMCryptoLicenseTest::SetUp(); - // These values allow us to run a few simple duration tests or just start - // playback right away. All times are in seconds since the license was - // signed. - // Soft expiry false means timers are strictly enforce. - timer_limits_.soft_enforce_rental_duration = true; - timer_limits_.soft_enforce_playback_duration = false; - // Playback may begin immediately. - timer_limits_.earliest_playback_start_seconds = 0; - // First playback may be within the first two seconds. - timer_limits_.rental_duration_seconds = kDuration; - // Once started, playback may last two seconds without a renewal. - timer_limits_.initial_renewal_duration_seconds = kDuration; - // Total playback is not limited. - timer_limits_.total_playback_duration_seconds = 0; - } - - void LoadLicense() { - license_messages_.core_response().timer_limits = timer_limits_; - ASSERT_NO_FATAL_FAILURE(license_messages_.SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(license_messages_.CreateDefaultResponse()); - ASSERT_NO_FATAL_FAILURE(license_messages_.EncryptAndSignResponse()); - ASSERT_EQ(OEMCrypto_SUCCESS, license_messages_.LoadResponse()); - } - - void MakeRenewalRequest(RenewalRoundTrip* renewal_messages) { - ASSERT_NO_FATAL_FAILURE(renewal_messages->SignAndVerifyRequest()); - ASSERT_NO_FATAL_FAILURE(renewal_messages->CreateDefaultResponse()); - } - - void LoadRenewal(RenewalRoundTrip* renewal_messages, - OEMCryptoResult expected_result) { - ASSERT_NO_FATAL_FAILURE(renewal_messages->EncryptAndSignResponse()); - ASSERT_EQ(expected_result, renewal_messages->LoadResponse()); - } - - ODK_TimerLimits timer_limits_; -}; - // This class is for testing the generic crypto functionality. class OEMCryptoGenericCryptoTest : public OEMCryptoRefreshTest { protected: diff --git a/oemcrypto/util/src/oemcrypto_oem_cert.cpp b/oemcrypto/util/src/oemcrypto_oem_cert.cpp index 1741d44..3f0bb69 100644 --- a/oemcrypto/util/src/oemcrypto_oem_cert.cpp +++ b/oemcrypto/util/src/oemcrypto_oem_cert.cpp @@ -207,7 +207,9 @@ OEMCryptoResult OemCertificate::GetPublicCertificate( return OEMCrypto_ERROR_SHORT_BUFFER; } *public_cert_length = cert_data.size(); - memcpy(public_cert, cert_data.data(), cert_data.size()); + if (public_cert != nullptr) { + memcpy(public_cert, cert_data.data(), cert_data.size()); + } return OEMCrypto_SUCCESS; } diff --git a/oemcrypto/util/src/oemcrypto_rsa_key.cpp b/oemcrypto/util/src/oemcrypto_rsa_key.cpp index 0c4ce06..b700a68 100644 --- a/oemcrypto/util/src/oemcrypto_rsa_key.cpp +++ b/oemcrypto/util/src/oemcrypto_rsa_key.cpp @@ -92,7 +92,7 @@ bool ParseRsaPrivateKeyInfo(const uint8_t* buffer, size_t length, } ScopedBio bio; // Check allowed scheme type. - if (!memcmp("SIGN", buffer, 4)) { + if (memcmp("SIGN", buffer, 4) == 0) { uint32_t allowed_schemes_bno; memcpy(&allowed_schemes_bno, reinterpret_cast(&buffer[4]), 4); @@ -811,7 +811,9 @@ OEMCryptoResult RsaPublicKey::EncryptOaep(const uint8_t* message, return OEMCrypto_ERROR_SHORT_BUFFER; } *enc_message_length = enc_size; - memcpy(enc_message, encrypt_buffer.data(), enc_size); + if (enc_message != nullptr) { + memcpy(enc_message, encrypt_buffer.data(), enc_size); + } return OEMCrypto_SUCCESS; } diff --git a/util/include/error_string_util.h b/util/include/error_string_util.h deleted file mode 100644 index 8be4eaa..0000000 --- a/util/include/error_string_util.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef ERROR_STRING_UTIL_H_ -#define ERROR_STRING_UTIL_H_ - -#include - -namespace wvutil { - -const std::string OEMCryptoResultToString(int oemcrypto_result); - -} // namespace wvutil -#endif // ERROR_STRING_UTIL_H_ diff --git a/util/include/file_store.h b/util/include/file_store.h index 6bb1773..9563b5e 100644 --- a/util/include/file_store.h +++ b/util/include/file_store.h @@ -58,6 +58,7 @@ class FileSystem { virtual std::unique_ptr Open(const std::string& file_path, int flags); virtual bool Exists(const std::string& file_path); + virtual bool Exists(const std::string& file_path, int* errno_value); virtual bool Remove(const std::string& file_path); virtual ssize_t FileSize(const std::string& file_path); diff --git a/util/include/string_format.h b/util/include/string_format.h index 62f9fd9..49ac381 100644 --- a/util/include/string_format.h +++ b/util/include/string_format.h @@ -13,6 +13,11 @@ namespace wvutil { #endif bool FormatString(std::string* out, const char* fmt, ...); +#ifdef __GNUC__ +[[gnu::format(printf, 2, 0)]] +#endif +bool VFormatString(std::string* out, const char* fmt, va_list vlist); + } // namespace wvutil #endif // WVCDM_UTIL_STRING_FORMAT_H_ diff --git a/util/src/error_string_util.cpp b/util/src/error_string_util.cpp deleted file mode 100644 index d70a6a8..0000000 --- a/util/src/error_string_util.cpp +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary -// source code may only be used and distributed under the Widevine License -// Agreement. -// - -#include "error_string_util.h" - -#include "OEMCryptoCENC.h" -#include "wv_cdm_types.h" - -namespace wvutil { -const std::string OEMCryptoResultToString(int oemcrypto_result) { - switch (oemcrypto_result) { - case OEMCrypto_SUCCESS: - return "SUCCESS"; - case OEMCrypto_ERROR_INIT_FAILED: - return "INIT_FAILED"; - case OEMCrypto_ERROR_TERMINATE_FAILED: - return "TERMINATE_FAILED"; - case OEMCrypto_ERROR_OPEN_FAILURE: - return "OPEN_FAILURE"; - case OEMCrypto_ERROR_CLOSE_FAILURE: - return "CLOSE_FAILURE"; - case OEMCrypto_ERROR_ENTER_SECURE_PLAYBACK_FAILED: - return "ENTER_SECURE_PLAYBACK_FAILED"; - case OEMCrypto_ERROR_EXIT_SECURE_PLAYBACK_FAILED: - return "EXIT_SECURE_PLAYBACK_FAILED"; - case OEMCrypto_ERROR_SHORT_BUFFER: - return "SHORT_BUFFER"; - case OEMCrypto_ERROR_NO_DEVICE_KEY: - return "NO_DEVICE_KEY"; - case OEMCrypto_ERROR_NO_ASSET_KEY: - return "NO_ASSET_KEY"; - case OEMCrypto_ERROR_KEYBOX_INVALID: - return "KEYBOX_INVALID"; - case OEMCrypto_ERROR_NO_KEYDATA: - return "NO_KEYDATA"; - case OEMCrypto_ERROR_NO_CW: - return "NO_CW"; - case OEMCrypto_ERROR_DECRYPT_FAILED: - return "DECRYPT_FAILED"; - case OEMCrypto_ERROR_WRITE_KEYBOX: - return "WRITE_KEYBOX"; - case OEMCrypto_ERROR_WRAP_KEYBOX: - return "WRAP_KEYBOX"; - case OEMCrypto_ERROR_BAD_MAGIC: - return "BAD_MAGIC"; - case OEMCrypto_ERROR_BAD_CRC: - return "BAD_CRC"; - case OEMCrypto_ERROR_NO_DEVICEID: - return "NO_DEVICEID"; - case OEMCrypto_ERROR_RNG_FAILED: - return "RNG_FAILED"; - case OEMCrypto_ERROR_RNG_NOT_SUPPORTED: - return "RNG_NOT_SUPPORTED"; - case OEMCrypto_ERROR_SETUP: - return "SETUP"; - case OEMCrypto_ERROR_OPEN_SESSION_FAILED: - return "OPEN_SESSION_FAILED"; - case OEMCrypto_ERROR_CLOSE_SESSION_FAILED: - return "CLOSE_SESSION_FAILED"; - case OEMCrypto_ERROR_INVALID_SESSION: - return "INVALID_SESSION"; - case OEMCrypto_ERROR_NOT_IMPLEMENTED: - return "NOT_IMPLEMENTED"; - case OEMCrypto_ERROR_NO_CONTENT_KEY: - return "NO_CONTENT_KEY"; - case OEMCrypto_ERROR_CONTROL_INVALID: - return "CONTROL_INVALID"; - case OEMCrypto_ERROR_UNKNOWN_FAILURE: - return "UNKNOWN_FAILURE"; - case OEMCrypto_ERROR_INVALID_CONTEXT: - return "INVALID_CONTEXT"; - case OEMCrypto_ERROR_SIGNATURE_FAILURE: - return "SIGNATURE_FAILURE"; - case OEMCrypto_ERROR_TOO_MANY_SESSIONS: - return "TOO_MANY_SESSIONS"; - case OEMCrypto_ERROR_INVALID_NONCE: - return "INVALID_NONCE"; - case OEMCrypto_ERROR_TOO_MANY_KEYS: - return "TOO_MANY_KEYS"; - case OEMCrypto_ERROR_DEVICE_NOT_RSA_PROVISIONED: - return "DEVICE_NOT_RSA_PROVISIONED"; - case OEMCrypto_ERROR_INVALID_RSA_KEY: - return "INVALID_RSA_KEY"; - case OEMCrypto_ERROR_KEY_EXPIRED: - return "KEY_EXPIRED"; - case OEMCrypto_ERROR_INSUFFICIENT_RESOURCES: - return "INSUFFICIENT_RESOURCES"; - case OEMCrypto_ERROR_INSUFFICIENT_HDCP: - return "INSUFFICIENT_HDCP"; - case OEMCrypto_ERROR_BUFFER_TOO_LARGE: - return "BUFFER_TOO_LARGE"; - case OEMCrypto_WARNING_GENERATION_SKEW: - return "OEMCrypto_WARNING_GENERATION_SKEW"; - case OEMCrypto_ERROR_GENERATION_SKEW: - return "GENERATION_SKEW"; - case OEMCrypto_LOCAL_DISPLAY_ONLY: - return "OEMCrypto_LOCAL_DISPLAY_ONLY"; - case OEMCrypto_ERROR_ANALOG_OUTPUT: - return "ANALOG_OUTPUT"; - case OEMCrypto_ERROR_WRONG_PST: - return "WRONG_PST"; - case OEMCrypto_ERROR_WRONG_KEYS: - return "WRONG_KEYS"; - case OEMCrypto_ERROR_MISSING_MASTER: - return "MISSING_MASTER"; - case OEMCrypto_ERROR_LICENSE_INACTIVE: - return "LICENSE_INACTIVE"; - case OEMCrypto_ERROR_ENTRY_NEEDS_UPDATE: - return "ENTRY_NEEDS_UPDATE"; - case OEMCrypto_ERROR_ENTRY_IN_USE: - return "ENTRY_IN_USE"; - case OEMCrypto_ERROR_USAGE_TABLE_UNRECOVERABLE: - return "USAGE_TABLE_UNRECOVERABLE"; - case OEMCrypto_KEY_NOT_LOADED: - return "OEMCrypto_KEY_NOT_LOADED"; - case OEMCrypto_KEY_NOT_ENTITLED: - return "OEMCrypto_KEY_NOT_ENTITLED"; - case OEMCrypto_ERROR_BAD_HASH: - return "BAD_HASH"; - case OEMCrypto_ERROR_OUTPUT_TOO_LARGE: - return "OUTPUT_TOO_LARGE"; - case OEMCrypto_ERROR_SESSION_LOST_STATE: - return "SESSION_LOST_STATE"; - case OEMCrypto_ERROR_SYSTEM_INVALIDATED: - return "SYSTEM_INVALIDATED"; - case OEMCrypto_ERROR_LICENSE_RELOAD: - return "LICENSE_RELOAD"; - case OEMCrypto_ERROR_MULTIPLE_USAGE_ENTRIES: - return "MULTIPLE_USAGE_ENTRIES"; - case OEMCrypto_WARNING_MIXED_OUTPUT_PROTECTION: - return "MIXED_OUTPUT_PROTECTION"; - case OEMCrypto_ERROR_INVALID_ENTITLED_KEY_SESSION: - return "INVALID_ENTITLED_KEY_SESSION"; - case OEMCrypto_ERROR_NEEDS_KEYBOX_PROVISIONING: - return "NEEDS_KEYBOX_PROVISIONING"; - case OEMCrypto_ERROR_UNSUPPORTED_CIPHER: - return "OEMCrypto_ERROR_UNSUPPORTED_CIPHER"; - case OEMCrypto_ERROR_DVR_FORBIDDEN: - return "OEMCrypto_ERROR_DVR_FORBIDDEN"; - case OEMCrypto_ERROR_INSUFFICIENT_PRIVILEGE: - return "OEMCrypto_ERROR_INSUFFICIENT_PRIVILEGE"; - case OEMCrypto_ERROR_INVALID_KEY: - return "INVALID_KEY"; - // ODK Values. - case ODK_ERROR_CORE_MESSAGE: - return "CORE_MESSAGE"; - case ODK_SET_TIMER: - return "SET_TIMER"; - case ODK_DISABLE_TIMER: - return "DISABLE_TIMER"; - case ODK_TIMER_EXPIRED: - return "TIMER_EXPIRED"; - case ODK_UNSUPPORTED_API: - return "UNSUPPORTED_API"; - case ODK_STALE_RENEWAL: - return "STALE_RENEWAL"; - // OPK Values. - case OPK_ERROR_INCOMPATIBLE_VERSION: - return "INCOMPATIBLE_VERSION"; - case OPK_ERROR_REMOTE_CALL: - return "REMOTE_CALL"; - case OPK_ERROR_NO_PERSISTENT_DATA: - return "NO_PERSISTENT_DATA"; - default: - return "Invalid OEMCrypto error."; - } -} - -} // namespace wvutil diff --git a/util/src/string_format.cpp b/util/src/string_format.cpp index 91cce37..3926fc4 100644 --- a/util/src/string_format.cpp +++ b/util/src/string_format.cpp @@ -16,20 +16,27 @@ namespace wvutil { bool FormatString(std::string* out, const char* fmt, ...) { if (out == nullptr || fmt == nullptr) return false; - va_list ap1; - va_start(ap1, fmt); - const int desired_size = vsnprintf(nullptr, 0, fmt, ap1); - va_end(ap1); + va_list vlist; + va_start(vlist, fmt); + const bool result = VFormatString(out, fmt, vlist); + va_end(vlist); + return result; +} + +bool VFormatString(std::string* out, const char* fmt, va_list vlist) { + if (out == nullptr || fmt == nullptr) return false; + + va_list vlist_copy; + va_copy(vlist_copy, vlist); + const int desired_size = vsnprintf(nullptr, 0, fmt, vlist_copy); + va_end(vlist_copy); if (desired_size < 0) return false; const size_t buffer_size = static_cast(desired_size) + 1; // +1 for null std::unique_ptr buffer(new char[buffer_size]); - va_list ap2; - va_start(ap2, fmt); - const int actual_size = vsnprintf(buffer.get(), buffer_size, fmt, ap2); - va_end(ap2); + const int actual_size = vsnprintf(buffer.get(), buffer_size, fmt, vlist); if (actual_size != desired_size) return false; diff --git a/util/test/file_store_unittest.cpp b/util/test/file_store_unittest.cpp index 340a621..a62bfc0 100644 --- a/util/test/file_store_unittest.cpp +++ b/util/test/file_store_unittest.cpp @@ -39,9 +39,17 @@ class FileTest : public testing::Test { }; TEST_F(FileTest, FileExists) { + int errno_value = -1; EXPECT_TRUE(file_system_.Exists(wvcdm::test_vectors::kExistentFile)); + EXPECT_TRUE( + file_system_.Exists(wvcdm::test_vectors::kExistentFile, &errno_value)); + EXPECT_EQ(0, errno_value); EXPECT_TRUE(file_system_.Exists(wvcdm::test_vectors::kExistentDir)); + EXPECT_FALSE(file_system_.Exists(wvcdm::test_vectors::kNonExistentFile)); + EXPECT_FALSE( + file_system_.Exists(wvcdm::test_vectors::kNonExistentFile, &errno_value)); + EXPECT_EQ(ENOENT, errno_value); EXPECT_FALSE(file_system_.Exists(wvcdm::test_vectors::kNonExistentDir)); } diff --git a/util/test/test_sleep.cpp b/util/test/test_sleep.cpp index 281e042..439a46d 100644 --- a/util/test/test_sleep.cpp +++ b/util/test/test_sleep.cpp @@ -14,6 +14,7 @@ #endif #include +#include #include #include @@ -53,6 +54,18 @@ void TestSleep::Sleep(unsigned int seconds) { if (callback_ != nullptr) callback_->ElapseTime(milliseconds); } +void TestSleep::SleepUntil(int64_t desired_time) { + SyncFakeClock(); + const int64_t now = Clock().GetCurrentTime(); + if (desired_time < now) { + LOGE("Test Clock skew sleeping from time %" PRId64 " to %" PRId64, now, + desired_time); + return; + } + const unsigned int sleep_time = static_cast(desired_time - now); + TestSleep::Sleep(sleep_time); +} + void TestSleep::SyncFakeClock() { // Syncing can be done by sleeping 0 seconds. Sleep(0); diff --git a/util/test/test_sleep.h b/util/test/test_sleep.h index 155b89d..f20e27a 100644 --- a/util/test/test_sleep.h +++ b/util/test/test_sleep.h @@ -13,7 +13,9 @@ namespace wvutil { class TestSleep { public: - // The callback is called when the clock should be advanced. + // The callback is called when the test clock should be advanced. If the + // system uses a real clock, it is used to sync the real and test + // clock. Otherwise it is used to simulate sleep in the test clock. class CallBack { public: virtual void ElapseTime(int64_t milliseconds) = 0; @@ -27,6 +29,9 @@ class TestSleep { // callback exists, this calls the callback. static void Sleep(unsigned int seconds); + // Like sleep, above, except it sleeps until the specified time. + static void SleepUntil(int64_t desired_time); + // If we are using a real clock and a fake clock, then the real clock advances // a little while we are doing work, but the fake one only advances when we // sleep. This function advances the fake clock to be in sync with the real