Commit Graph

768 Commits

Author SHA1 Message Date
Jeff Tinker
ccecfd7192 am 1c5ca642: NULL terminate device unique ID before use
* commit '1c5ca642cb2021ffcdd253d929e40c393cf3fe07':
  NULL terminate device unique ID before use
2013-12-27 12:54:33 -08:00
Jeff Tinker
1c5ca642cb NULL terminate device unique ID before use
bug: 12228689

If the device ID returned from OEMCrypto_GetDeviceUniqueId is
not NULL terminated in the OEM code, trailing garbage characters
may be included in the license request's client_identification
field, which could be rejected by the server's utf8 parser if
they are invalid characters, causing a license request failure.

The code for CryptoSession::GetDeviceUniqueId should use the
updated id_length from OEMCrypto_GetDeviceUniqueId to adjust
the length of the *device_id string before returning the result
to the caller.

Change-Id: I659866d4234d4f21ec051590fc7bc6367904a48a
2013-12-19 16:05:06 -08:00
Jeff Tinker
32579c9e07 am 78a9d5cd: Merge "Add tests for key sharing mode and decrypting without keys" into klp-dev
* commit '78a9d5cd9a33e72df173accb6ce5a4b9dd0ffd2a':
  Add tests for key sharing mode and decrypting without keys
2013-12-19 13:53:55 -08:00
Jeff Tinker
78a9d5cd9a Merge "Add tests for key sharing mode and decrypting without keys" into klp-dev 2013-12-19 21:51:56 +00:00
Jeff Tinker
61c77cd95d am 623920d8: Fix seg fault when playing WV video on Molly with the MediaShell
* commit '623920d83f55011b7ce59c1224cbe7e7f335b0e5':
  Fix seg fault when playing WV video on Molly with the MediaShell
2013-12-13 13:34:33 -08:00
Jeff Tinker
623920d83f Fix seg fault when playing WV video on Molly with the MediaShell
During session sharing, when a sample contains both clear and encrypted
subsamples, subsample flags would on occasion be set incorrectly. Clear
subsamples would be sent to the current session, while encrypted ones
would incur a key id to session lookup and be sent to the appropriate session.
The sessions would then receive decrypt calls with subsample flags
incorrectly set.

In order for this to work correctly all subsamples within a sample need to be
sent to the same session. This requires that key ids be specified and
checked if at least one of the subsamples is encrypted. If however none of
the subsamples are encrypted then a valid key id may not have been provided
to MediaCrypto, and the subsamples may be sent to any session.
In order to support this, the CDM decrypt will now allow the caller to
specify whether to validate the key Id.

Then a check is added to wvcrypto determine whether to ask the CDM to
validate the key ID based on the clear/encrypted states of the subsamples.
The list of subsamples is already being preprocessed, so this
additional check just determines if any subsamples are encrypted, and sets
the validation flag appropriately.

b/11967440

Merge of https://widevine-internal-review.googlesource.com/#/c/8510/3 and
https://widevine-internal-review.googlesource.com/#/c/8520/2 from the
widevine cdm repo.

Change-Id: If65c36a31e56b69f514f0cc547a0becf0c54c40a
2013-12-12 17:25:01 -08:00
Jeff Tinker
711a98164f Add tests for key sharing mode and decrypting without keys
Merge of https://widevine-internal-review.googlesource.com/#/c/8480/ from
widevine cdm repo.

Change-Id: Idb5ab83bceeb97016075c26c428aba692f017929
related-to-bug: 11967440
2013-12-12 16:23:19 -08:00
Jeff Tinker
da019f9556 am 5d5d1baf: Merge "Address unit test failures" into klp-dev
* commit '5d5d1baf7a12b200418342e48a3fb7c5547692da':
  Address unit test failures
2013-12-12 11:27:16 -08:00
Jeff Tinker
2dffd3db32 am 88063a8d: Merge "Add additional MediaDrm API tests" into klp-dev
* commit '88063a8d20505d276d0700e705ea868c66ca3268':
  Add additional MediaDrm API tests
2013-12-12 11:27:15 -08:00
Jeff Tinker
4b9f05c131 am 38cc7122: Improve unit test build script
* commit '38cc7122fd9359bbda7428777d03bb51020e0c54':
  Improve unit test build script
2013-12-12 11:27:15 -08:00
Jeff Tinker
5d5d1baf7a Merge "Address unit test failures" into klp-dev 2013-12-12 19:26:03 +00:00
Jeff Tinker
88063a8d20 Merge "Add additional MediaDrm API tests" into klp-dev 2013-12-12 19:25:48 +00:00
Jeff Tinker
38cc7122fd Improve unit test build script
Make the build_and_run_all_unit_tests script push individual tests
instead of doing a full sync, makes it easier to run unit tests
against release builds.

Merge of https://widevine-internal-review.googlesource.com/#/c/8405/
from the widevine cdm repo.

Change-Id: I8efda77be9ab863f616fab88c4782b7c9edb8858
2013-12-12 10:58:42 -08:00
Jeff Tinker
4ab8efc21d Add additional MediaDrm API tests
bug: 12033958

Merge of https://widevine-internal-review.googlesource.com/#/c/8402/
from the Widevine CDM repo.

Change-Id: I441eb816db69620feff0bd72c485bd3ad7ec8031
2013-12-12 10:56:51 -08:00
Jeff Tinker
78d44c3792 am 68e1e7c5: Merge "Generate a unique license request ID" into klp-dev
* commit '68e1e7c5784b8c189ff59c06517c7b5ae103631e':
  Generate a unique license request ID
2013-12-12 10:19:31 -08:00
Jeff Tinker
68e1e7c578 Merge "Generate a unique license request ID" into klp-dev 2013-12-12 18:17:34 +00:00
Rahul Frias
f32baf91b5 Address unit test failures
A number of failures were observed,
* GPlay dev license server is being worked on. This causes random
  failures when running unit tests. Switching to the staging
  server for now.
* Occasionally, the license server times out. Introducing a retry
  mechanism do deal with HTTP responses (merge from master #45e8ddd5f)
* Release license tests are now disabled. Tests were previously passing,
  even though they were not in fact supported by the GPlay license server.
  The response included just enough information to be a valid license and
  passed minimal verification that was taking place. Additional verification
  was not necessary because session is torndown and resources released as
  soon as the response has been received.
  A change at the GPlay server now causes the release license request to be
  flagged as an error and the tests to fail. Work is in progress to
  support release of licenses at the GPlay server.
* The wrong message test (from request license tests) fails. This is
  because GPlay behaviour changed from returning a HTTP 500, when
  processing an invalid PSSH, to returning a HTTP 200 without any included
  license.
* Security level path backward compatibility tests on L3 which failed and
  caused the succeeding license request tests to fail.

b/12000457

Change-Id: I8e6adc490504475d1039793ea555a17799cb78c4
2013-12-11 16:22:58 -08:00
Madan Ankapura
15c2973b43 am 3567597a: Merge "Add x86 Builds for Widevine Classic 4.5.0.10113 - DO NOT MERGE" into klp-dev
* commit '3567597ada615fe8e914732284212e1e6a2569f3':
  Add x86 Builds for Widevine Classic 4.5.0.10113 - DO NOT MERGE
2013-12-06 19:19:11 -08:00
Madan Ankapura
3567597ada Merge "Add x86 Builds for Widevine Classic 4.5.0.10113 - DO NOT MERGE" into klp-dev 2013-12-07 02:33:12 +00:00
Rahul Frias
1b22c80568 Generate a unique license request ID
The request ID was set to a fixed value, which caused license requests
to be rejected by the YT server with TOO_MANY_STREAMS_PER_VIDEO

The request ID is now a combination of a randomly generated value and
a rolling index. This is based off a fix by gmorgan@ on the eureka
branch #98fa6e5e.

Merge of https://widevine-internal-review.googlesource.com/#/c/8496/
from the widevine cdm repo.

b/12018697

Change-Id: I6c05fea885d46aea53a07235c3e5ac65a6971eaf
2013-12-06 12:26:55 -08:00
John "Juce" Bruce
33a223dcf1 Add x86 Builds for Widevine Classic 4.5.0.10113 - DO NOT MERGE
Adds L1 x86 build of Widevine Classic that has been verified by partners.

Change-Id: Id85fea0e0311d06f0875a4aaedebaa9b00d17efa
2013-12-03 19:03:47 -08:00
Fred Gylys-Colwell
5905e530c9 am c53e0c77: Correct SelectKey return value when no keys loaded
* commit 'c53e0c778c172ac3dc411726649a2e7de17b3d82':
  Correct SelectKey return value when no keys loaded
2013-11-20 18:32:58 -08:00
Fred Gylys-Colwell
c53e0c778c Correct SelectKey return value when no keys loaded
Previously, Level 3 SelectKey returned no error when called before
any keys were loaded.  After this CL, it will return
OEMCrypto_ERROR_NO_CONTENT_KEY.

Library version:
arm  - Level3 Library Nov 20 2013 18:09:31
mips - Level3 Library Nov 20 2013 17:58:56
x86  - Level3 Library Nov 20 2013 18:13:01

bug: 11769839
Change-Id: I1b3f057e3ae9f2f174cae91f6849080345f02003
2013-11-20 18:18:43 -08:00
Jeff Tinker
4028bba8a7 am 113d4d07: Add end-to-end generic encrypt/decrypt/sign/verify tests
* commit '113d4d0755dc47348db40ad5d9f73f13355f86c4':
  Add end-to-end generic encrypt/decrypt/sign/verify tests
2013-11-13 09:52:05 -08:00
Jeff Tinker
113d4d0755 Add end-to-end generic encrypt/decrypt/sign/verify tests
bug: 11534771

Merge of https://widevine-internal-review.googlesource.com/#/c/8291/
from the Widevine CDM repo.

Change-Id: I76110013838f91c8009fe710586226c96de890be
2013-11-12 14:19:58 -08:00
Jeff Tinker
40311d0c6c am 357e6c41: Merge "Haystack and Obfuscated OEMCrypto Level 3" into klp-dev
* commit '357e6c419c55a492c8f79845664af68c9b4e7127':
  Haystack and Obfuscated OEMCrypto Level 3
2013-11-07 17:57:45 -08:00
Jeff Tinker
357e6c419c Merge "Haystack and Obfuscated OEMCrypto Level 3" into klp-dev 2013-11-08 01:54:44 +00:00
Jeff Tinker
48742bba5b am 8e5bc02e: Merge "Allow license renewals after expiry" into klp-dev
* commit '8e5bc02e51304ff6d093fbe1b06678e7fd2261bb':
  Allow license renewals after expiry
2013-11-07 11:13:19 -08:00
Jeff Tinker
8e5bc02e51 Merge "Allow license renewals after expiry" into klp-dev 2013-11-07 19:09:50 +00:00
Jeff Tinker
98872de379 am 0553f411: Add ExoPlayerDemo.apk to vendor/widevine so partners can access it and use to verify integrations.
* commit '0553f411db17ce24e2376c23deb333042431fbd7':
  Add ExoPlayerDemo.apk to vendor/widevine so partners can access it and use to verify integrations.
2013-11-07 09:46:44 -08:00
Jeff Tinker
0553f411db Add ExoPlayerDemo.apk to vendor/widevine so partners can access
it and use to verify integrations.

bug: 11357407

Change-Id: Ie38cef1dfd2fe685721e7fb4f37e881326321727
2013-11-06 14:28:09 -08:00
John "Juce" Bruce
9461926017 am fd482527: L1 System Lowered to L3 Still Requires Secure Decoders
* commit 'fd482527e4b07c6664bd463785a3ec8ba554a788':
  L1 System Lowered to L3 Still Requires Secure Decoders
2013-11-06 13:58:56 -08:00
John "Juce" Bruce
fd482527e4 L1 System Lowered to L3 Still Requires Secure Decoders
Merge of https://widevine-internal-review.googlesource.com/#/c/8263
from the Widevine repo.

Changes the behavior of requiresSecureDecoderComponent() to query the
session for whether a lowered security level has been requested
before querying the system to see what its default security level is.

As part of this, we added a new QuerySessionStatus() method to the
CDM that gets status info on a session-specific level, such as the
effective security level of a session.

Bug: 11428937
Change-Id: I5549a2fdd400cc87f567d27fcf74c473451093d6
2013-11-06 19:31:24 +00:00
Jeff Tinker
a3d689d983 am 0a9f0b1d: Merge "Upgrade Widevine Classic to 4.5.0.10113 - DO NOT MERGE" into klp-dev
* commit '0a9f0b1dd86d23e8f24bd31077cb52b7a74d4dd6':
  Upgrade Widevine Classic to 4.5.0.10113 - DO NOT MERGE
2013-11-06 10:05:27 -08:00
Jeff Tinker
0a9f0b1dd8 Merge "Upgrade Widevine Classic to 4.5.0.10113 - DO NOT MERGE" into klp-dev 2013-11-06 18:00:53 +00:00
Jeff Tinker
7db580d6b9 am dd672f0c: Merge "Use renewal URL in license tests" into klp-dev
* commit 'dd672f0c68cd72dd957d0cbfe15207afccbd98e6':
  Use renewal URL in license tests
2013-11-06 09:24:58 -08:00
Jeff Tinker
cbcd885e7c am 30469021: Merge "Search for keys in shared sessions only when content is encrypted" into klp-dev
* commit '30469021715ae8747801cc7622deb1d2d608e78c':
  Search for keys in shared sessions only when content is encrypted
2013-11-06 09:24:58 -08:00
Jeff Tinker
dd672f0c68 Merge "Use renewal URL in license tests" into klp-dev 2013-11-06 17:24:07 +00:00
Jeff Tinker
3046902171 Merge "Search for keys in shared sessions only when content is encrypted" into klp-dev 2013-11-06 17:22:33 +00:00
Rahul Frias
774a078f1d Allow license renewals after expiry
Licenses could be renewed uptil the point of expiry. After that point
we expected that the session would have to be closed and a new one
opened with a new license loaded. Clank requested that we support
renewal of sessions past expiry.

In addition, the error returned on decryption, if OEMCrypto
determines that the KCB duration has expired, is NEED_KEY rather than
KEY_ERROR.

Merge of https://widevine-internal-review.googlesource.com/#/c/8240
from the widevine cdm repo.

b/11390539

Change-Id: I023320f3f25514cd07b368701a92100429ce1c04
2013-11-05 16:40:17 -08:00
Fred Gylys-Colwell
becb1bf0be Haystack and Obfuscated OEMCrypto Level 3
This CL contains working versions of the haystack tools and the
OEMCrypto Level 3 library for android ARM, MIPS and x86.

The version number of the level 3 library is:
android/level3/arm/libwvlevel3.a  Level3 Library Nov  4 2013 18:39:06
android/level3/mips/libwvlevel3.a Level3 Library Nov  4 2013 18:42:29
android/level3/x86/libwvlevel3.a  Level3 Library Nov  4 2013 18:41:07

bug: 9374954 MediaDrm haystack based L3 code hardening implementation.
Change-Id: Ifef13900a11e83e4257723d3c6fc7107550882a8
2013-11-05 10:32:11 -08:00
John "Juce" Bruce
84b79eccb6 Upgrade Widevine Classic to 4.5.0.10113 - DO NOT MERGE
Contains the following, BC-Triaged fixes:

Bug: 8767242
Media player error -1010 on playback

Bug: 8342523
Android Media player is able to play WVM content if license is
already acquired

Change-Id: I3ee7863a5bf214fb8c4e4aefdd05f5062d568617
2013-11-04 12:03:41 -08:00
Jeff Tinker
5d8a218d3a am 84e83f4a: Merge "Move OEMCrypto_Initialize earlier" into klp-dev
* commit '84e83f4a33d5a20b128bc201af2f6e9d6146947e':
  Move OEMCrypto_Initialize earlier
2013-10-31 15:44:48 -07:00
Jeff Tinker
84e83f4a33 Merge "Move OEMCrypto_Initialize earlier" into klp-dev 2013-10-31 22:40:43 +00:00
Jeff Tinker
48b1acac38 am 49e593d1: Stop policy timer before invoking session destructor
* commit '49e593d12702a3ffd671402e585dc271cc72d65b':
  Stop policy timer before invoking session destructor
2013-10-30 11:10:54 -07:00
Jeff Tinker
acb47e0f9a Move OEMCrypto_Initialize earlier
Some OEMCrypto calls are happening before OEMCrypto_Initialize.
This change moves initialization earlier so it occurs before
any other calls to OEMCrypto.

bug: 10582250
Change-Id: Ic8992e8f0738dbfeb10074a4e1543bb9931a49d5
2013-10-28 15:53:52 -07:00
Rahul Frias
64c3cb986a Use renewal URL in license tests
After a change to the GPlay license server, it no longer accepts heartbeats
at the license server URL ( https://jmt17.google.com/video-dev/license/ ).
The CDM correctly reports https://jmt17.google.com/video-dev/heartbeat/
as the renewal URL but the current test code ignores the reported URL.
The license server then rejects the request and send back an empty
license response.

This causes WvCdmRequestLicenseTest.StreamingLicenseRenewal
and WvCdmRequestLicenseTest.StreamingLicenseRenewal to fail. Request
license tests have been modified to respect the renewal URL.

Merge of https://widevine-internal-review.googlesource.com/#/c/8188
from the widevine cdm repo

b/11290339

Change-Id: I1dcf8277edce99633086fb3db8ffeb7a32a5500d
2013-10-25 13:15:56 -07:00
Rahul Frias
252a07316a Search for keys in shared sessions only when content is encrypted
Also return NEED_KEY rather than KEY_ERROR if keys are not found.

Merge of https://widevine-internal-review.googlesource.com/#/c/8250
from the widevine cdm repo.

b/11375092

Change-Id: Ibc629e8b4018f43f5f9528258563a2af79bdfb4b
2013-10-25 13:09:40 -07:00
Jeff Tinker
49e593d127 Stop policy timer before invoking session destructor
The CDM session was being destroyed before the policy timer was stopped
and before the session was removed from a list of active sessions. This
allowed race conditions, where the policy timer would try to evaluate
policy for a closed session. This led to segfaults.
b/11338324

Merge of https://widevine-internal-review.googlesource.com/#/c/8240/1
from the widevine cdm repo.

Change-Id: Ib159ccfdb763a47da573f5c06c0793c2c63886c4
2013-10-25 10:50:02 -07:00
Colin Cross
022f09fe9a am 6fc2ee33: set LOCAL_MODULE_OWNER for libwvdrmengine.so
* commit '6fc2ee33c3882e86eedba2004ddae150b6d0a09b':
  set LOCAL_MODULE_OWNER for libwvdrmengine.so
2013-10-24 13:28:59 -07:00