Add OEMCrypto tests for Cast prov 4 flow

Expected flow, which begins with a device that has already been
provisioned with Prov 4 stage 1:
1. OEMCrypto_InstallOEMPrivateKey()
2. OEMCrypto_GenerateCertificateKeyPair() -> wrapped_csr_priv
3. OEMCrypto_LoadDRMPrivateKey(wrapped_csr_priv)
4. OEMCrypto_PrepAndSignProvisioningRequest() to create a Prov 4
   provisioning request message type with a CAST request in the
   message body
5. Server sends a Prov 2 response. Server side derivation uses CSR keys
   to derive session key, mac keys, and encryption keys.
6. OEMCrypto_DeriveKeysFromSessionKey(), same derivation as server side
7. OEMCrypto_LoadProvisioning(), use derived keys to verify + decrypt

The OEMCrypto_LoadDRMPrivateKey() step can happen before or after the
PrepAndSignProvisioningRequest() call.

Test: tests fail
Bug: 259452440

Merged from https://widevine-internal-review.googlesource.com/172310

Change-Id: Id5e6737b187339ec93e3d0d03c28e2b379d60747
This commit is contained in:
Matt Feddersen
2023-04-25 23:21:33 +00:00
committed by Robert Shih
parent 5a17d8ebd9
commit 27421a9161
6 changed files with 297 additions and 0 deletions

View File

@@ -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<uint8_t> encoded_rsa_key_;
std::vector<uint8_t> wrapped_drm_key_;