Support CAST V2 authentication

bug: 12702350

Squashed commit of these CLs from the widevine cdm repo:

Cast V2 cdm support
https://widevine-internal-review.googlesource.com/#/c/9190/

Add CASTv2 Support to DrmPlugin
https://widevine-internal-review.googlesource.com/#/c/9228/

Test for CastV2 authentication APIs
https://widevine-internal-review.googlesource.com/9550

Change-Id: I6d66bc1bbd653db5542c68687b30b441dd20617f
This commit is contained in:
Jeff Tinker
2014-03-10 12:41:14 -07:00
parent f111bea1b1
commit 3db90f54c1
26 changed files with 864 additions and 44 deletions

View File

@@ -72,10 +72,14 @@ class WVDrmPlugin : public android::DrmPlugin,
const Vector<uint8_t>& sessionId,
KeyedVector<String8, String8>& infoMap) const;
virtual status_t getProvisionRequest(Vector<uint8_t>& request,
virtual status_t getProvisionRequest(const String8& cert_type,
const String8& cert_authority,
Vector<uint8_t>& request,
String8& defaultUrl);
virtual status_t provideProvisionResponse(const Vector<uint8_t>& response);
virtual status_t provideProvisionResponse(const Vector<uint8_t>& response,
Vector<uint8_t>& certificate,
Vector<uint8_t>& wrapped_key);
virtual status_t getSecureStops(List<Vector<uint8_t> >& secureStops);
@@ -120,6 +124,12 @@ class WVDrmPlugin : public android::DrmPlugin,
const Vector<uint8_t>& signature,
bool& match);
virtual status_t signRSA(const Vector<uint8_t>& sessionId,
const String8& algorithm,
const Vector<uint8_t>& message,
const Vector<uint8_t>& wrappedKey,
Vector<uint8_t>& signature);
virtual void onEvent(const CdmSessionId& cdmSessionId,
CdmEventType cdmEventType);
@@ -224,6 +234,8 @@ class WVDrmPlugin : public android::DrmPlugin,
status_t mapAndNotifyOfOEMCryptoResult(const Vector<uint8_t>& sessionId,
OEMCryptoResult res);
status_t mapOEMCryptoResult(OEMCryptoResult res);
};
} // namespace wvdrm

View File

@@ -57,6 +57,33 @@ class WVGenericCryptoInterface {
algorithm, signature, signature_length);
}
virtual OEMCryptoResult openSession(OEMCrypto_SESSION *session) {
return OEMCrypto_OpenSession(session);
}
virtual OEMCryptoResult closeSession(OEMCrypto_SESSION session) {
return OEMCrypto_CloseSession(session);
}
virtual OEMCryptoResult loadDeviceRSAKey(OEMCrypto_SESSION session,
const uint8_t* wrapped_rsa_key,
size_t wrapped_rsa_key_length) {
return OEMCrypto_LoadDeviceRSAKey(session, wrapped_rsa_key,
wrapped_rsa_key_length);
}
virtual OEMCryptoResult generateRSASignature(
OEMCrypto_SESSION session,
const uint8_t* message,
size_t message_length,
uint8_t* signature,
size_t* signature_length,
RSA_Padding_Scheme padding_scheme) {
return OEMCrypto_GenerateRSASignature(session, message, message_length,
signature, signature_length,
padding_scheme);
}
private:
DISALLOW_EVIL_CONSTRUCTORS(WVGenericCryptoInterface);
};