File util, generic crypto, and key query

This CL merges several CLs from the widevine repo:

http://go/wvgerrit/18012 Add support for querying allowed usage for key.
http://go/wvgerrit/17971 Add per-origin storage.
http://go/wvgerrit/18152 Add OEMCrypto's generic crypto operations to CDM.
http://go/wvgerrit/17911 QueryKeyControlInfo => QueryOemCryptoSessionId

Note: numbering in wv_cdm_types.h was added in this CL and will be
back ported to wvgerrit in a future CL.

Change-Id: Idb9e9a67e94f62f25dc16c5307f75a08b3430b64
This commit is contained in:
Fred Gylys-Colwell
2016-09-14 12:44:09 -07:00
parent 24124ea6e3
commit eb3f8b786a
56 changed files with 4632 additions and 2083 deletions

View File

@@ -111,7 +111,7 @@ status_t WVDrmPlugin::openSession(Vector<uint8_t>& sessionId) {
// Construct a CryptoSession
CdmQueryMap info;
res = mCDM->QueryKeyControlInfo(cdmSessionId, &info);
res = mCDM->QueryOemCryptoSessionId(cdmSessionId, &info);
if (isCdmResponseTypeSuccess(res) &&
info.count(QUERY_KEY_OEMCRYPTO_SESSION_ID)) {
@@ -688,7 +688,7 @@ status_t WVDrmPlugin::encrypt(const Vector<uint8_t>& sessionId,
const CryptoSession& cryptoSession = mCryptoSessions[cdmSessionId];
if (cryptoSession.cipherAlgorithm() == kInvalidCrytpoAlgorithm) {
if (cryptoSession.cipherAlgorithm() == kInvalidCryptoAlgorithm) {
return android::NO_INIT;
}
@@ -726,7 +726,7 @@ status_t WVDrmPlugin::decrypt(const Vector<uint8_t>& sessionId,
const CryptoSession& cryptoSession = mCryptoSessions[cdmSessionId];
if (cryptoSession.cipherAlgorithm() == kInvalidCrytpoAlgorithm) {
if (cryptoSession.cipherAlgorithm() == kInvalidCryptoAlgorithm) {
return android::NO_INIT;
}
@@ -763,7 +763,7 @@ status_t WVDrmPlugin::sign(const Vector<uint8_t>& sessionId,
const CryptoSession& cryptoSession = mCryptoSessions[cdmSessionId];
if (cryptoSession.macAlgorithm() == kInvalidCrytpoAlgorithm) {
if (cryptoSession.macAlgorithm() == kInvalidCryptoAlgorithm) {
return android::NO_INIT;
}
@@ -817,7 +817,7 @@ status_t WVDrmPlugin::verify(const Vector<uint8_t>& sessionId,
const CryptoSession& cryptoSession = mCryptoSessions[cdmSessionId];
if (cryptoSession.macAlgorithm() == kInvalidCrytpoAlgorithm) {
if (cryptoSession.macAlgorithm() == kInvalidCryptoAlgorithm) {
return android::NO_INIT;
}