Source release 19.1.0
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "OEMCryptoCENCCommon.h"
|
||||
#include "core_message_types.h"
|
||||
#include "odk_message.h"
|
||||
#include "odk_serialize.h"
|
||||
#include "odk_structs.h"
|
||||
@@ -147,6 +148,14 @@ bool CoreLicenseRequestFromMessage(const std::string& oemcrypto_core_message,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CoreReleaseRequestFromMessage(const std::string& oemcrypto_core_message,
|
||||
ODK_ReleaseRequest* core_release_request) {
|
||||
ODK_PreparedReleaseRequest prepared_release = {};
|
||||
return ParseRequest(ODK_Release_Request_Type, oemcrypto_core_message,
|
||||
core_release_request, &prepared_release,
|
||||
Unpack_ODK_PreparedReleaseRequest);
|
||||
}
|
||||
|
||||
bool CoreRenewalRequestFromMessage(const std::string& oemcrypto_core_message,
|
||||
ODK_RenewalRequest* core_renewal_request) {
|
||||
const auto unpacker = Unpack_ODK_PreparedRenewalRequest;
|
||||
@@ -167,11 +176,12 @@ bool CoreProvisioningRequestFromMessage(
|
||||
ODK_NonceValues nonce;
|
||||
if (!GetNonceFromMessage(oemcrypto_core_message, &nonce)) return false;
|
||||
|
||||
if (nonce.api_major_version == 18) {
|
||||
if (nonce.api_major_version >= 18) {
|
||||
// Use special case unpacker for v18.0
|
||||
const auto unpacker = nonce.api_minor_version == 0
|
||||
? Unpack_ODK_PreparedProvisioningRequestV180
|
||||
: Unpack_ODK_PreparedProvisioningRequest;
|
||||
const auto unpacker =
|
||||
nonce.api_minor_version == 0 && nonce.api_major_version == 18
|
||||
? Unpack_ODK_PreparedProvisioningRequestV180
|
||||
: Unpack_ODK_PreparedProvisioningRequest;
|
||||
ODK_PreparedProvisioningRequest prepared_provision = {};
|
||||
|
||||
if (!ParseRequest(ODK_Provisioning_Request_Type, oemcrypto_core_message,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2021 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2021 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
@@ -30,7 +30,10 @@ CoreMessageFeatures CoreMessageFeatures::DefaultFeatures(
|
||||
features.maximum_minor_version = 2; // 17.2
|
||||
break;
|
||||
case 18:
|
||||
features.maximum_minor_version = 5; // 18.5
|
||||
features.maximum_minor_version = 4; // 18.4
|
||||
break;
|
||||
case 19:
|
||||
features.maximum_minor_version = 1; // 19.1
|
||||
break;
|
||||
default:
|
||||
features.maximum_minor_version = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "core_message_types.h"
|
||||
#include "odk_serialize.h"
|
||||
#include "odk_structs.h"
|
||||
#include "odk_structs_priv.h"
|
||||
@@ -137,6 +138,23 @@ bool CreateCoreLicenseResponse(const CoreMessageFeatures& features,
|
||||
Pack_ODK_LicenseResponse);
|
||||
}
|
||||
|
||||
bool CreateCoreReleaseResponse(const CoreMessageFeatures& features,
|
||||
const ODK_ReleaseRequest& core_request,
|
||||
int64_t seconds_since_license_requested,
|
||||
int64_t seconds_since_first_decrypt,
|
||||
std::string* oemcrypto_core_message) {
|
||||
(void)seconds_since_license_requested;
|
||||
(void)seconds_since_first_decrypt;
|
||||
ODK_ReleaseResponse release_response{};
|
||||
if (!CreateResponseHeader(features, ODK_Release_Response_Type,
|
||||
&release_response.core_message, core_request)) {
|
||||
return false;
|
||||
}
|
||||
return CreateResponse(ODK_Release_Response_Type, oemcrypto_core_message,
|
||||
&release_response.core_message, release_response,
|
||||
Pack_ODK_ReleaseResponse);
|
||||
}
|
||||
|
||||
bool CreateCoreRenewalResponse(const CoreMessageFeatures& features,
|
||||
const ODK_RenewalRequest& core_request,
|
||||
uint64_t renewal_duration_seconds,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "OEMCryptoCENCCommon.h"
|
||||
#include "core_message_serialize.h"
|
||||
#include "license_protocol.pb.h"
|
||||
#include "odk_serialize.h"
|
||||
@@ -32,8 +34,8 @@ using oemcrypto_core_message::features::CoreMessageFeatures;
|
||||
* message: serialized license protobuf
|
||||
* field: substring value
|
||||
*/
|
||||
OEMCrypto_Substring GetOecSubstring(const std::string& message,
|
||||
const std::string& field) {
|
||||
OEMCrypto_Substring GetOecSubstring(std::string_view message,
|
||||
std::string_view field) {
|
||||
OEMCrypto_Substring substring = {};
|
||||
size_t pos = message.find(field);
|
||||
if (pos != std::string::npos) {
|
||||
@@ -167,9 +169,14 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features,
|
||||
timer_limits.rental_duration_seconds = policy.rental_duration_seconds();
|
||||
timer_limits.total_playback_duration_seconds =
|
||||
policy.playback_duration_seconds();
|
||||
// On devices these seconds are tracking time so should not be negative.
|
||||
if (policy.renewal_delay_seconds() < 0 ||
|
||||
policy.renewal_recovery_duration_seconds() < 0) {
|
||||
return false;
|
||||
}
|
||||
timer_limits.initial_renewal_duration_seconds =
|
||||
policy.renewal_delay_seconds() +
|
||||
policy.renewal_recovery_duration_seconds();
|
||||
static_cast<uint64_t>(policy.renewal_delay_seconds()) +
|
||||
static_cast<uint64_t>(policy.renewal_recovery_duration_seconds());
|
||||
|
||||
parsed_lic.key_array = key_array.data();
|
||||
parsed_lic.key_array_length = static_cast<uint32_t>(key_array.size());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
# Copyright 2019 Google LLC. This file and proprietary
|
||||
# source code may only be used and distributed under the Widevine License
|
||||
# Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "OEMCryptoCENCCommon.h"
|
||||
#include "odk_message.h"
|
||||
#include "odk_overflow.h"
|
||||
#include "odk_serialize.h"
|
||||
@@ -65,6 +66,15 @@ static OEMCryptoResult ODK_PrepareRequest(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ODK_Release_Request_Type: {
|
||||
core_message->message_length = ODK_RELEASE_REQUEST_SIZE;
|
||||
if (sizeof(ODK_PreparedReleaseRequest) > prepared_request_buffer_length) {
|
||||
return ODK_ERROR_CORE_MESSAGE;
|
||||
}
|
||||
Pack_ODK_PreparedReleaseRequest(
|
||||
&msg, (ODK_PreparedReleaseRequest*)prepared_request_buffer);
|
||||
break;
|
||||
}
|
||||
case ODK_Renewal_Request_Type: {
|
||||
core_message->message_length = ODK_RENEWAL_REQUEST_SIZE;
|
||||
if (sizeof(ODK_PreparedRenewalRequest) > prepared_request_buffer_length) {
|
||||
@@ -223,6 +233,34 @@ OEMCryptoResult ODK_PrepareCoreLicenseRequest(
|
||||
}
|
||||
}
|
||||
|
||||
OEMCryptoResult ODK_PrepareCoreReleaseRequest(
|
||||
uint8_t* message, size_t message_length, size_t* core_message_size,
|
||||
ODK_NonceValues* nonce_values, uint32_t status,
|
||||
uint32_t clock_security_level, int64_t seconds_since_license_requested,
|
||||
int64_t seconds_since_first_decrypt, ODK_ClockValues* clock_values,
|
||||
uint64_t system_time_seconds) {
|
||||
(void)status;
|
||||
(void)clock_security_level;
|
||||
(void)seconds_since_license_requested;
|
||||
(void)seconds_since_first_decrypt;
|
||||
if (core_message_size == NULL || nonce_values == NULL ||
|
||||
clock_values == NULL) {
|
||||
return ODK_ERROR_CORE_MESSAGE;
|
||||
}
|
||||
if (nonce_values->api_major_version >= 19) {
|
||||
ODK_PreparedReleaseRequest release_request = {0};
|
||||
return ODK_PrepareRequest(
|
||||
message, message_length, core_message_size, ODK_Release_Request_Type,
|
||||
nonce_values, &release_request, sizeof(ODK_PreparedReleaseRequest));
|
||||
} else {
|
||||
// If the version is pre 19 when license release isn't supported, create a
|
||||
// license request.
|
||||
return ODK_PrepareCoreRenewalRequest(message, message_length,
|
||||
core_message_size, nonce_values,
|
||||
clock_values, system_time_seconds);
|
||||
}
|
||||
}
|
||||
|
||||
OEMCryptoResult ODK_PrepareCoreRenewalRequest(uint8_t* message,
|
||||
size_t message_length,
|
||||
size_t* core_message_size,
|
||||
@@ -423,7 +461,7 @@ OEMCryptoResult ODK_ParseLicense(
|
||||
*timer_limits = parsed_license->timer_limits;
|
||||
/* And update the clock values state. */
|
||||
clock_values->timer_status = ODK_CLOCK_TIMER_STATUS_LICENSE_LOADED;
|
||||
if (nonce_values->api_major_version == 18 && license_load) {
|
||||
if (nonce_values->api_major_version >= 18 && license_load) {
|
||||
err = ODK_AttemptFirstPlayback(system_time_seconds, timer_limits,
|
||||
clock_values, timer_value);
|
||||
return err;
|
||||
@@ -488,6 +526,33 @@ OEMCryptoResult ODK_ParseRenewal(const uint8_t* message, size_t message_length,
|
||||
timer_value);
|
||||
}
|
||||
|
||||
OEMCryptoResult ODK_ParseRelease(const uint8_t* message, size_t message_length,
|
||||
size_t core_message_length,
|
||||
ODK_NonceValues* nonce_values) {
|
||||
if (message == NULL || nonce_values == NULL) {
|
||||
return ODK_ERROR_CORE_MESSAGE;
|
||||
}
|
||||
|
||||
const OEMCryptoResult err =
|
||||
ODK_ParseCoreHeader(message, message_length, core_message_length,
|
||||
ODK_Release_Response_Type, nonce_values);
|
||||
if (err != OEMCrypto_SUCCESS) {
|
||||
return err;
|
||||
}
|
||||
|
||||
ODK_ReleaseResponse release_response = {0};
|
||||
ODK_Message msg = ODK_Message_Create((uint8_t*)message, message_length);
|
||||
ODK_Message_SetSize(&msg, core_message_length);
|
||||
Unpack_ODK_ReleaseResponse(&msg, &release_response);
|
||||
|
||||
if (ODK_Message_GetStatus(&msg) != MESSAGE_STATUS_OK ||
|
||||
ODK_Message_GetOffset(&msg) != core_message_length) {
|
||||
return ODK_ERROR_CORE_MESSAGE;
|
||||
}
|
||||
|
||||
return OEMCrypto_SUCCESS;
|
||||
}
|
||||
|
||||
OEMCryptoResult ODK_ParseProvisioning(
|
||||
const uint8_t* message, size_t message_length, size_t core_message_length,
|
||||
ODK_NonceValues* nonce_values, const uint8_t* device_id,
|
||||
@@ -589,3 +654,69 @@ bool CheckApiVersionAtMost(const ODK_NonceValues* nonce_values,
|
||||
(nonce_values->api_major_version == major_version &&
|
||||
nonce_values->api_minor_version <= minor_version);
|
||||
}
|
||||
|
||||
const uint8_t ODK_MacKeyLabelWithZero[] = "AUTHENTICATION";
|
||||
const size_t ODK_MacKeyLabelWithZeroLength = sizeof(ODK_MacKeyLabelWithZero);
|
||||
// This is the key size (512) in network byte order.
|
||||
const uint8_t ODK_MacKeySuffix[] = {0x00, 0x00, 0x02, 0x00};
|
||||
const size_t ODK_MacKeySuffixLength = sizeof(ODK_MacKeySuffix);
|
||||
|
||||
const uint8_t ODK_EncKeyLabelWithZero[] = "ENCRYPTION";
|
||||
const size_t ODK_EncKeyLabelWithZeroLength = sizeof(ODK_EncKeyLabelWithZero);
|
||||
// This is the key size (128) in network byte order.
|
||||
const uint8_t ODK_EncKeySuffix[] = {0x00, 0x00, 0x00, 0x80};
|
||||
const size_t ODK_EncKeySuffixLength = sizeof(ODK_EncKeySuffix);
|
||||
|
||||
OEMCryptoResult ODK_GenerateKeyContexts(const uint8_t* context,
|
||||
size_t context_length,
|
||||
uint8_t* mac_key_context,
|
||||
size_t* mac_key_context_length,
|
||||
uint8_t* enc_key_context,
|
||||
size_t* enc_key_context_length) {
|
||||
size_t real_mac_length;
|
||||
size_t real_enc_length;
|
||||
if (odk_add_overflow_ux(
|
||||
context_length,
|
||||
ODK_MacKeyLabelWithZeroLength + ODK_MacKeySuffixLength,
|
||||
&real_mac_length) ||
|
||||
real_mac_length > 0xffffffff ||
|
||||
odk_add_overflow_ux(
|
||||
context_length,
|
||||
ODK_EncKeyLabelWithZeroLength + ODK_EncKeySuffixLength,
|
||||
&real_enc_length) ||
|
||||
real_enc_length > 0xffffffff) {
|
||||
return OEMCrypto_ERROR_INVALID_CONTEXT;
|
||||
}
|
||||
bool short_buffer = false;
|
||||
if (mac_key_context_length) {
|
||||
short_buffer = real_mac_length > *mac_key_context_length;
|
||||
*mac_key_context_length = real_mac_length;
|
||||
}
|
||||
if (enc_key_context_length) {
|
||||
short_buffer = short_buffer || real_enc_length > *enc_key_context_length;
|
||||
*enc_key_context_length = real_enc_length;
|
||||
}
|
||||
if (short_buffer || !mac_key_context || !enc_key_context) {
|
||||
return OEMCrypto_ERROR_SHORT_BUFFER;
|
||||
}
|
||||
|
||||
if (!context || !mac_key_context_length || !enc_key_context_length) {
|
||||
return OEMCrypto_ERROR_INVALID_CONTEXT;
|
||||
}
|
||||
|
||||
memcpy(mac_key_context, ODK_MacKeyLabelWithZero,
|
||||
ODK_MacKeyLabelWithZeroLength);
|
||||
memcpy(mac_key_context + ODK_MacKeyLabelWithZeroLength, context,
|
||||
context_length);
|
||||
memcpy(mac_key_context + ODK_MacKeyLabelWithZeroLength + context_length,
|
||||
ODK_MacKeySuffix, ODK_MacKeySuffixLength);
|
||||
|
||||
memcpy(enc_key_context, ODK_EncKeyLabelWithZero,
|
||||
ODK_EncKeyLabelWithZeroLength);
|
||||
memcpy(enc_key_context + ODK_EncKeyLabelWithZeroLength, context,
|
||||
context_length);
|
||||
memcpy(enc_key_context + ODK_EncKeyLabelWithZeroLength + context_length,
|
||||
ODK_EncKeySuffix, ODK_EncKeySuffixLength);
|
||||
|
||||
return OEMCrypto_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
# Copyright 2019 Google LLC. This file and proprietary
|
||||
# source code may only be used and distributed under the Widevine License
|
||||
# Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
# Copyright 2019 Google LLC. This file and proprietary
|
||||
# source code may only be used and distributed under the Widevine License
|
||||
# Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
@@ -50,10 +50,6 @@ static void Pack_ODK_ParsedLicense(ODK_Message* msg,
|
||||
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);
|
||||
return;
|
||||
}
|
||||
Pack_OEMCrypto_Substring(msg, &obj->enc_mac_keys_iv);
|
||||
Pack_OEMCrypto_Substring(msg, &obj->enc_mac_keys);
|
||||
Pack_OEMCrypto_Substring(msg, &obj->pst);
|
||||
@@ -128,6 +124,11 @@ void Pack_ODK_PreparedLicenseRequestV17(
|
||||
Pack_ODK_CoreMessage(msg, &obj->core_message);
|
||||
}
|
||||
|
||||
void Pack_ODK_PreparedReleaseRequest(ODK_Message* msg,
|
||||
const ODK_PreparedReleaseRequest* obj) {
|
||||
Pack_ODK_CoreMessage(msg, &obj->core_message);
|
||||
}
|
||||
|
||||
void Pack_ODK_PreparedRenewalRequest(ODK_Message* msg,
|
||||
ODK_PreparedRenewalRequest const* obj) {
|
||||
Pack_ODK_CoreMessage(msg, &obj->core_message);
|
||||
@@ -182,6 +183,11 @@ void Pack_ODK_LicenseResponse(ODK_Message* msg,
|
||||
}
|
||||
}
|
||||
|
||||
void Pack_ODK_ReleaseResponse(ODK_Message* msg,
|
||||
ODK_ReleaseResponse const* obj) {
|
||||
Pack_ODK_CoreMessage(msg, &obj->core_message);
|
||||
}
|
||||
|
||||
void Pack_ODK_RenewalResponse(ODK_Message* msg,
|
||||
ODK_RenewalResponse const* obj) {
|
||||
Pack_ODK_PreparedRenewalRequest(msg, &obj->request);
|
||||
@@ -322,6 +328,11 @@ void Unpack_ODK_PreparedLicenseRequestV17(ODK_Message* msg,
|
||||
Unpack_ODK_CoreMessage(msg, &obj->core_message);
|
||||
}
|
||||
|
||||
void Unpack_ODK_PreparedReleaseRequest(ODK_Message* msg,
|
||||
ODK_PreparedReleaseRequest* obj) {
|
||||
Unpack_ODK_CoreMessage(msg, &obj->core_message);
|
||||
}
|
||||
|
||||
void Unpack_ODK_PreparedRenewalRequest(ODK_Message* msg,
|
||||
ODK_PreparedRenewalRequest* obj) {
|
||||
Unpack_ODK_CoreMessage(msg, &obj->core_message);
|
||||
@@ -384,6 +395,10 @@ void Unpack_ODK_LicenseResponse(ODK_Message* msg, ODK_LicenseResponse* obj) {
|
||||
}
|
||||
}
|
||||
|
||||
void Unpack_ODK_ReleaseResponse(ODK_Message* msg, ODK_ReleaseResponse* obj) {
|
||||
Unpack_ODK_CoreMessage(msg, &obj->core_message);
|
||||
}
|
||||
|
||||
void Unpack_ODK_RenewalResponse(ODK_Message* msg, ODK_RenewalResponse* obj) {
|
||||
Unpack_ODK_PreparedRenewalRequest(msg, &obj->request);
|
||||
Unpack_uint64_t(msg, &obj->renewal_duration_seconds);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
@@ -20,6 +20,8 @@ void Pack_ODK_PreparedLicenseRequest(ODK_Message* msg,
|
||||
const ODK_PreparedLicenseRequest* obj);
|
||||
void Pack_ODK_PreparedLicenseRequestV17(
|
||||
ODK_Message* msg, const ODK_PreparedLicenseRequestV17* obj);
|
||||
void Pack_ODK_PreparedReleaseRequest(ODK_Message* msg,
|
||||
const ODK_PreparedReleaseRequest* obj);
|
||||
void Pack_ODK_PreparedRenewalRequest(ODK_Message* msg,
|
||||
const ODK_PreparedRenewalRequest* obj);
|
||||
void Pack_ODK_PreparedProvisioningRequest(
|
||||
@@ -34,6 +36,7 @@ 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_ReleaseResponse(ODK_Message* msg, ODK_ReleaseResponse* obj);
|
||||
void Unpack_ODK_RenewalResponse(ODK_Message* msg, ODK_RenewalResponse* obj);
|
||||
void Unpack_ODK_ProvisioningResponse(ODK_Message* msg,
|
||||
ODK_ProvisioningResponse* obj);
|
||||
@@ -45,6 +48,7 @@ void Unpack_ODK_Provisioning40Response(ODK_Message* msg,
|
||||
/* kdo pack */
|
||||
void Pack_ODK_LicenseResponse(ODK_Message* msg,
|
||||
const ODK_Packing_LicenseResponse* obj);
|
||||
void Pack_ODK_ReleaseResponse(ODK_Message* msg, const ODK_ReleaseResponse* obj);
|
||||
void Pack_ODK_RenewalResponse(ODK_Message* msg, const ODK_RenewalResponse* obj);
|
||||
void Pack_ODK_ProvisioningResponse(ODK_Message* msg,
|
||||
const ODK_ProvisioningResponse* obj);
|
||||
@@ -58,6 +62,8 @@ void Unpack_ODK_PreparedLicenseRequest(ODK_Message* msg,
|
||||
ODK_PreparedLicenseRequest* obj);
|
||||
void Unpack_ODK_PreparedLicenseRequestV17(ODK_Message* msg,
|
||||
ODK_PreparedLicenseRequestV17* obj);
|
||||
void Unpack_ODK_PreparedReleaseRequest(ODK_Message* msg,
|
||||
ODK_PreparedReleaseRequest* obj);
|
||||
void Unpack_ODK_PreparedRenewalRequest(ODK_Message* msg,
|
||||
ODK_PreparedRenewalRequest* obj);
|
||||
void Unpack_ODK_PreparedProvisioningRequest(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
@@ -24,13 +24,13 @@ typedef uint32_t ODK_MessageType;
|
||||
#define ODK_Renewal_Response_Type ((ODK_MessageType)4u)
|
||||
#define ODK_Provisioning_Request_Type ((ODK_MessageType)5u)
|
||||
#define ODK_Provisioning_Response_Type ((ODK_MessageType)6u)
|
||||
#define ODK_Release_Request_Type ((ODK_MessageType)7u)
|
||||
#define ODK_Release_Response_Type ((ODK_MessageType)8u)
|
||||
#define ODK_Renewed_Provisioning_Request_Type ((ODK_MessageType)11u)
|
||||
#define ODK_Provisioning40_Request_Type ((ODK_MessageType)12u)
|
||||
|
||||
// TODO(b/244580447): Reserve future message types to support
|
||||
// forward compatibility.
|
||||
#define ODK_Release_Request_Type ((ODK_MessageType)7u)
|
||||
#define ODK_Release_Response_Type ((ODK_MessageType)8u)
|
||||
#define ODK_Common_Request_Type ((ODK_MessageType)9u)
|
||||
#define ODK_Common_Response_Type ((ODK_MessageType)10u)
|
||||
|
||||
@@ -49,6 +49,10 @@ typedef struct {
|
||||
ODK_CoreMessage core_message;
|
||||
} ODK_PreparedLicenseRequestV17;
|
||||
|
||||
typedef struct {
|
||||
ODK_CoreMessage core_message;
|
||||
} ODK_PreparedReleaseRequest;
|
||||
|
||||
typedef struct {
|
||||
ODK_CoreMessage core_message;
|
||||
uint64_t playback_time;
|
||||
@@ -97,6 +101,10 @@ typedef struct {
|
||||
uint8_t request_hash[ODK_SHA256_HASH_SIZE];
|
||||
} ODK_Packing_LicenseResponse;
|
||||
|
||||
typedef struct {
|
||||
ODK_CoreMessage core_message;
|
||||
} ODK_ReleaseResponse;
|
||||
|
||||
typedef struct {
|
||||
ODK_PreparedRenewalRequest request;
|
||||
uint64_t renewal_duration_seconds;
|
||||
@@ -124,6 +132,7 @@ typedef struct {
|
||||
#define ODK_CORE_MESSAGE_SIZE 20u
|
||||
#define ODK_LICENSE_REQUEST_SIZE 90u
|
||||
#define ODK_LICENSE_REQUEST_SIZE_V17 20u
|
||||
#define ODK_RELEASE_REQUEST_SIZE 20u
|
||||
#define ODK_RENEWAL_REQUEST_SIZE 28u
|
||||
#define ODK_PROVISIONING_REQUEST_SIZE 94u
|
||||
#define ODK_PROVISIONING_REQUEST_SIZE_V17 88u
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
@@ -274,7 +274,10 @@ OEMCryptoResult ODK_InitializeSessionValues(ODK_TimerLimits* timer_limits,
|
||||
nonce_values->api_minor_version = 2;
|
||||
break;
|
||||
case 18:
|
||||
nonce_values->api_minor_version = 5;
|
||||
nonce_values->api_minor_version = 4;
|
||||
break;
|
||||
case 19:
|
||||
nonce_values->api_minor_version = 1;
|
||||
break;
|
||||
default:
|
||||
nonce_values->api_minor_version = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
||||
// Copyright 2019 Google LLC. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user