Allows sharing of keys between sessions

This change allows the app to specify that keys may be shared by sessions.
The app enables this by setting the session sharing properties in DRM Plugin.
Keys are shared only amoungst the specified group of sessions.

Merged from widevine CDM repo
 * https://widevine-internal-review.googlesource.com/#/c/8019/
 * https://widevine-internal-review.googlesource.com/#/c/8021/

Bug: 11013707
Change-Id: I52db41a53138b4fc563ebc6d38a623f23f7cdfb5
This commit is contained in:
Rahul Frias
2013-10-10 22:56:57 -07:00
parent 67c794bac3
commit 56bd5d5d82
14 changed files with 308 additions and 34 deletions

View File

@@ -392,6 +392,12 @@ status_t WVDrmPlugin::getPropertyString(const String8& name,
} else {
value = kDisable;
}
} else if (name == "sessionSharing") {
if (mPropertySet.is_session_sharing_enabled()) {
value = kEnable;
} else {
value = kDisable;
}
} else {
ALOGE("App requested unknown string property %s", name.string());
return android::ERROR_DRM_CANNOT_HANDLE;
@@ -475,6 +481,20 @@ status_t WVDrmPlugin::setPropertyString(const String8& name,
ALOGE("App requested unknown privacy mode %s", value.string());
return android::BAD_VALUE;
}
} else if (name == "sessionSharing") {
if (mCryptoSessions.size() == 0) {
if (value == kEnable) {
mPropertySet.set_is_session_sharing_enabled(true);
} else if (value == kDisable) {
mPropertySet.set_is_session_sharing_enabled(false);
} else {
ALOGE("App requested unknown sharing type %s", value.string());
return android::BAD_VALUE;
}
} else {
ALOGE("App tried to change key sharing while sessions are open.");
return kErrorSessionIsOpen;
}
} else {
ALOGE("App set unknown string property %s", name.string());
return android::ERROR_DRM_CANNOT_HANDLE;