From 1a405a11a69da239ce9a83ce67d82aaa492fd5f9 Mon Sep 17 00:00:00 2001 From: Alex Dale Date: Wed, 20 Jul 2022 13:53:47 -0700 Subject: [PATCH] adding OEM_ENTITLEMENT key container type. [ Merge of http://go/wvgerrit/148691 ] This is a followup to OEM_CONTENT, a custom key container that was added to Widevine server. Bug: 193006094 Bug: 236317198 Change-Id: I82285e4e50f981e0cedf2adac5910643f34f8e46 --- .../oemcrypto/odk/include/core_message_features.h | 6 +++--- libwvdrmengine/oemcrypto/odk/include/odk_message.h | 6 +++--- libwvdrmengine/oemcrypto/odk/include/odk_structs.h | 2 +- libwvdrmengine/oemcrypto/odk/src/core_message_features.cpp | 6 +++--- .../oemcrypto/odk/src/core_message_serialize_proto.cpp | 5 ++++- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/libwvdrmengine/oemcrypto/odk/include/core_message_features.h b/libwvdrmengine/oemcrypto/odk/include/core_message_features.h index 07113e6e..16289c6b 100644 --- a/libwvdrmengine/oemcrypto/odk/include/core_message_features.h +++ b/libwvdrmengine/oemcrypto/odk/include/core_message_features.h @@ -30,13 +30,13 @@ struct CoreMessageFeatures { uint32_t maximum_major_version = 17; uint32_t maximum_minor_version = 0; - bool operator==(const CoreMessageFeatures& other) const; - bool operator!=(const CoreMessageFeatures& other) const { + bool operator==(const CoreMessageFeatures &other) const; + bool operator!=(const CoreMessageFeatures &other) const { return !(*this == other); } }; -std::ostream& operator<<(std::ostream& os, const CoreMessageFeatures& features); +std::ostream &operator<<(std::ostream &os, const CoreMessageFeatures &features); } // namespace features } // namespace oemcrypto_core_message diff --git a/libwvdrmengine/oemcrypto/odk/include/odk_message.h b/libwvdrmengine/oemcrypto/odk/include/odk_message.h index e4f135f6..94ce2ae7 100644 --- a/libwvdrmengine/oemcrypto/odk/include/odk_message.h +++ b/libwvdrmengine/oemcrypto/odk/include/odk_message.h @@ -35,10 +35,10 @@ extern "C" { */ #if defined(__GNUC__) || defined(__clang__) -# define ALIGNED __attribute__((aligned)) +#define ALIGNED __attribute__((aligned)) #else -# define ALIGNED -# error ODK_Message must be aligned to the maximum useful alignment of the \ +#define ALIGNED +#error ODK_Message must be aligned to the maximum useful alignment of the \ machine you are compiling for. Define the ALIGNED macro accordingly. #endif diff --git a/libwvdrmengine/oemcrypto/odk/include/odk_structs.h b/libwvdrmengine/oemcrypto/odk/include/odk_structs.h index 72be13bd..2799732e 100644 --- a/libwvdrmengine/oemcrypto/odk/include/odk_structs.h +++ b/libwvdrmengine/oemcrypto/odk/include/odk_structs.h @@ -19,7 +19,7 @@ extern "C" { #define ODK_MINOR_VERSION 0 /* ODK Version string. Date changed automatically on each release. */ -#define ODK_RELEASE_DATE "ODK v17.0 2022-02-15" +#define ODK_RELEASE_DATE "ODK v17.0 2022-03-25" /* The lowest version number for an ODK message. */ #define ODK_FIRST_VERSION 16 diff --git a/libwvdrmengine/oemcrypto/odk/src/core_message_features.cpp b/libwvdrmengine/oemcrypto/odk/src/core_message_features.cpp index 9dbbecbd..c28622c0 100644 --- a/libwvdrmengine/oemcrypto/odk/src/core_message_features.cpp +++ b/libwvdrmengine/oemcrypto/odk/src/core_message_features.cpp @@ -8,7 +8,7 @@ namespace oemcrypto_core_message { namespace features { const CoreMessageFeatures CoreMessageFeatures::kDefaultFeatures; -bool CoreMessageFeatures::operator==(const CoreMessageFeatures& other) const { +bool CoreMessageFeatures::operator==(const CoreMessageFeatures &other) const { return maximum_major_version == other.maximum_major_version && maximum_minor_version == other.maximum_minor_version; } @@ -31,8 +31,8 @@ CoreMessageFeatures CoreMessageFeatures::DefaultFeatures( return features; } -std::ostream& operator<<(std::ostream& os, - const CoreMessageFeatures& features) { +std::ostream &operator<<(std::ostream &os, + const CoreMessageFeatures &features) { return os << "v" << features.maximum_major_version << "." << features.maximum_minor_version; } diff --git a/libwvdrmengine/oemcrypto/odk/src/core_message_serialize_proto.cpp b/libwvdrmengine/oemcrypto/odk/src/core_message_serialize_proto.cpp index 860ea267..5132bda2 100644 --- a/libwvdrmengine/oemcrypto/odk/src/core_message_serialize_proto.cpp +++ b/libwvdrmengine/oemcrypto/odk/src/core_message_serialize_proto.cpp @@ -101,8 +101,11 @@ bool CreateCoreLicenseResponseFromProto(const CoreMessageFeatures& features, } case video_widevine::License_KeyContainer::CONTENT: case video_widevine::License_KeyContainer::OPERATOR_SESSION: + case video_widevine::License_KeyContainer::OEM_CONTENT: + case video_widevine::License_KeyContainer::OEM_ENTITLEMENT: case video_widevine::License_KeyContainer::ENTITLEMENT: { - if (k.type() == video_widevine::License_KeyContainer::ENTITLEMENT) { + if (k.type() == video_widevine::License_KeyContainer::ENTITLEMENT || + k.type() == video_widevine::License_KeyContainer::OEM_ENTITLEMENT) { any_entitlement = true; } else { any_content = true;