Source release 19.6.0
GitOrigin-RevId: 13a33e34413c19da1bfe76abcc66be519c9ac9d1
This commit is contained in:
@@ -73,6 +73,28 @@ class CertificateProvisioning {
|
||||
// |default_url| by GetProvisioningRequest().
|
||||
static void GetProvisioningServerUrl(std::string* default_url);
|
||||
|
||||
enum State {
|
||||
// Freshly created, not yet initialized.
|
||||
kUninitialized,
|
||||
// A successful call to Init() has been made.
|
||||
kInitialized,
|
||||
// Has generated a DRM request; apps are allowed generate
|
||||
// another one even if a response has not been received.
|
||||
kDrmRequestSent,
|
||||
// Has received (and successfully loaded) a DRM response.
|
||||
kDrmResponseReceived,
|
||||
// Has generated an OEM (Prov 4.0) request; apps are allowed
|
||||
// generate another one even if a response has not been
|
||||
// received.
|
||||
kOemRequestSent,
|
||||
// Has received (and successfully loaded) an OEM response.
|
||||
kOemResponseReceived,
|
||||
};
|
||||
static const char* StateToString(State state);
|
||||
|
||||
// State setter for testing only.
|
||||
void SetStateForTesting(State state) { state_ = state; }
|
||||
|
||||
private:
|
||||
#if defined(UNIT_TEST)
|
||||
friend class CertificateProvisioningTest;
|
||||
@@ -123,18 +145,29 @@ class CertificateProvisioning {
|
||||
CdmResponseType CloseSessionOnError(CdmResponseType status);
|
||||
void CloseSession();
|
||||
|
||||
// Tracks the state of CertificateProvisioning.
|
||||
State state_ = kUninitialized;
|
||||
|
||||
std::unique_ptr<CryptoSession> crypto_session_;
|
||||
CdmCertificateType cert_type_;
|
||||
std::unique_ptr<ServiceCertificate> service_certificate_;
|
||||
std::string request_;
|
||||
|
||||
// == Provisioning 4.0 Variables ==
|
||||
// The wrapped private key in provisioning 4 generated by calling
|
||||
// GenerateCertificateKeyPair. It will be saved to file system if a valid
|
||||
// response is received.
|
||||
std::string provisioning_40_wrapped_private_key_;
|
||||
// Key type of the generated key pair in provisioning 4.
|
||||
CryptoWrappedKey::Type provisioning_40_key_type_;
|
||||
// Store the last provisioning request message
|
||||
std::string provisioning_request_message_;
|
||||
CryptoWrappedKey prov40_wrapped_private_key_;
|
||||
// Cache of the most recently sent OEM/DRM public key sent. Used
|
||||
// to match the response with the request.
|
||||
// This MUST be matched with the current |prov40_wrapped_private_key_|.
|
||||
std::string prov40_public_key_;
|
||||
|
||||
// Store the last provisioning request message.
|
||||
// This is the serialized ProvisioningRequest.
|
||||
// Used for X.509 responses which require the original
|
||||
// request to verify the signature of the response.
|
||||
std::string prov40_request_;
|
||||
}; // class CertificateProvisioning
|
||||
} // namespace wvcdm
|
||||
#endif // WVCDM_CORE_CERTIFICATE_PROVISIONING_H_
|
||||
|
||||
Reference in New Issue
Block a user