Add unit test for clear KCB in LS SDK 16.4 response

This is a merge from:
https://widevine-internal-review.googlesource.com/c/cdm/+/152897
and http://go/wvgerrit/153709

Adding a new OEMCrypto unit test will allow partners to correct a
problem earlier in their integration.

Verifies current oemcrypto implementation handles clear KCB in a
mocked 16.4 license response.

Unit test release date updated to 2022-06-17.

Test: run_x86_64_tests; opk_ta
Bug: 235870170
Bug: 234645065
Change-Id: I59fef2c25f5c007624447d4f46147d96adeddad9
This commit is contained in:
Cong Lin
2022-06-17 14:30:19 -07:00
committed by Fred Gylys-Colwell
parent cd593979e9
commit 8c4c238324
3 changed files with 74 additions and 9 deletions

View File

@@ -16,6 +16,7 @@
#include <vector>
#include "core_message_deserialize.h"
#include "core_message_features.h"
#include "core_message_serialize.h"
#include "odk.h"
#include "oec_device_features.h"
@@ -342,6 +343,18 @@ class LicenseRoundTrip
// Fill the |core_response| substrings.
virtual void FillCoreResponseSubstrings();
void EncryptAndSignResponse() override;
// Encrypt and sign license response created from a specific odk version.
void EncryptAndSignResponseWithCoreMessageFeatures(
const oemcrypto_core_message::features::CoreMessageFeatures& features,
bool force_clear_kcb);
// Encrypt license response. This is used in EncryptAndSignResponse().
void EncryptResponse(bool force_clear_kcb = false);
// Create core license response with a specific ODK version. This is used in
// EncryptAndSignResponse().
void CreateCoreLicenseResponseWithFeatures(
const oemcrypto_core_message::features::CoreMessageFeatures& features);
// Sign license response. This is used in EncryptAndSignResponse().
void SignEncryptedResponse();
OEMCryptoResult LoadResponse() override { return LoadResponse(session_); }
OEMCryptoResult LoadResponse(Session* session) override;
OEMCryptoResult LoadResponse(Session* session, bool verify_keys);