Commit Graph

3646 Commits

Author SHA1 Message Date
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
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
Fred Gylys-Colwell
dadf69783a am 5905e530: am c53e0c77: Correct SelectKey return value when no keys loaded
* commit '5905e530c91b01ec43ed99752067c5431da12469':
  Correct SelectKey return value when no keys loaded
2013-11-20 18:40:23 -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
ff77c24030 am 4028bba8: am 113d4d07: Add end-to-end generic encrypt/decrypt/sign/verify tests
* commit '4028bba8a777d977f3bd0d28c5bc17a0ff2d8919':
  Add end-to-end generic encrypt/decrypt/sign/verify tests
2013-11-13 09:58:15 -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
235fb36f8a am 40311d0c: am 357e6c41: Merge "Haystack and Obfuscated OEMCrypto Level 3" into klp-dev
* commit '40311d0c6c44a3d876ce843534cd98c58f65ca4d':
  Haystack and Obfuscated OEMCrypto Level 3
2013-11-07 21:30:28 -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
ad51a53db4 am 48742bba: am 8e5bc02e: Merge "Allow license renewals after expiry" into klp-dev
* commit '48742bba5bd9b4c39fb41359a62e15a6503f1a5e':
  Allow license renewals after expiry
2013-11-07 15:13:05 -08:00
Jeff Tinker
8e5bc02e51 Merge "Allow license renewals after expiry" into klp-dev 2013-11-07 19:09:50 +00:00
Jeff Tinker
83b22d3030 am 98872de3: am 0553f411: Add ExoPlayerDemo.apk to vendor/widevine so partners can access it and use to verify integrations.
* commit '98872de379decad058bee872a37bf880144644e2':
  Add ExoPlayerDemo.apk to vendor/widevine so partners can access it and use to verify integrations.
2013-11-07 09:52:15 -08:00
Andy Hung
1fda9bd213 Merge "Revert "Add "throws IOException" to MediaCodec constructors (8)"" 2013-11-07 05:06:01 +00:00
Andy Hung
b0c5ecc86d Revert "Add "throws IOException" to MediaCodec constructors (8)"
This reverts commit 35133e2bc5.

Change-Id: Iba6767447262ae092e4d38cccf9a4caf5aa75adb
2013-11-07 05:05:08 +00: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
e1bbb87b38 am 94619260: am fd482527: L1 System Lowered to L3 Still Requires Secure Decoders
* commit '94619260179626fca69f1b65bda6683f9c561b7b':
  L1 System Lowered to L3 Still Requires Secure Decoders
2013-11-06 14:04:35 -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
Andy Hung
d4a49382a7 Merge "Add "throws IOException" to MediaCodec constructors (8)" 2013-11-06 19:23:26 +00:00
Jeff Tinker
6b51eee87c am 7db580d6: am dd672f0c: Merge "Use renewal URL in license tests" into klp-dev
* commit '7db580d6b9a96fff5567a6fc5d5db460872b76c2':
  Use renewal URL in license tests
2013-11-06 09:46:52 -08:00
Jeff Tinker
6308988a4a am cbcd885e: am 30469021: Merge "Search for keys in shared sessions only when content is encrypted" into klp-dev
* commit 'cbcd885e7cd0d7a34bd2128bdf8033b0751b3e97':
  Search for keys in shared sessions only when content is encrypted
2013-11-06 09:46:52 -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
Andy Hung
35133e2bc5 Add "throws IOException" to MediaCodec constructors (8)
Change to add "throws IOException" to android.media.MediaCodec
(createByCodecName|createDecoderByType|createEncoderByType).  The exception was
previously thrown through the native JNI, but not explicitly declared.

Requires changes to existing code for declaration compatibility.

Bug: 11364276
Change-Id: I6487408709342b390bac2b935f4642d4aaf36102
Signed-off-by: Andy Hung <hunga@google.com>
2013-11-05 14:25:52 -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
Jeff Tinker
85ae0abcaf am 48b1acac: am 49e593d1: Stop policy timer before invoking session destructor
* commit '48b1acac38b6c79baeb221247fa68a1a3cbe0ab6':
  Stop policy timer before invoking session destructor
2013-10-30 11:14:17 -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
b9197a9ee6 am 022f09fe: am 6fc2ee33: set LOCAL_MODULE_OWNER for libwvdrmengine.so
* commit '022f09fe9abe1ec2e374bcbc448acae0c7b3e1a7':
  set LOCAL_MODULE_OWNER for libwvdrmengine.so
2013-10-24 13:32:55 -07:00
Colin Cross
6fc2ee33c3 set LOCAL_MODULE_OWNER for libwvdrmengine.so
Change-Id: I10d63ef381a612a0177ce5a3ddd24f44b6ae05a0
2013-10-24 12:40:19 -07:00
Rahul Frias
43bda9deb5 am d5522d90: am e385ff3a: Do not close CDM session on removeKeys
* commit 'd5522d903e35f14c66cf355cc30d681ef6e5ede6':
  Do not close CDM session on removeKeys
2013-10-14 10:48:38 -07:00
Rahul Frias
e385ff3a7f Do not close CDM session on removeKeys
A change was introduced between jb-mr2 and klp-dev that closed
the CDM session when the removeKeys mediaDrm APIs was called.
This was introduced because there is no way of unloading keys from
an OEMCrypto session.

This caused problems for Netflix, as an exception occurred when they
tried to close a session after calling removeKeys.

Reverting to jb-mr2 behaviour for now. b/11188818 has been opened to
track a longer term resolution.

b/11185042

Change-Id: I03bc736d2bc5bdabc86cfb7b75ae8bcbc03ffc7c
2013-10-11 14:42:37 -07:00
Jeff Tinker
81b43b3055 am 6141ac4b: am 9b1d8119: Merge "Allows sharing of keys between sessions" into klp-dev
* commit '6141ac4bc6983b140c1f29171552e1f2aa11dea0':
  Allows sharing of keys between sessions
2013-10-11 10:07:30 -07:00
Jeff Tinker
9b1d8119e5 Merge "Allows sharing of keys between sessions" into klp-dev 2013-10-11 17:02:00 +00:00
Rahul Frias
a0d55ac77a am b2cea8cd: am a74980b2: Address key selection and decryption concurrency issues
* commit 'b2cea8cdd388997d7dc09cc2e5682ab041f7bf74':
  Address key selection and decryption concurrency issues
2013-10-11 08:48:27 -07:00
Rahul Frias
56bd5d5d82 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
2013-10-10 23:23:39 -07:00
Rahul Frias
a74980b2f1 Address key selection and decryption concurrency issues
Decryption calls though multiple threads may result in race conditions
between the setting of the key and the actual call to decryption.
This results in OEMCrypto errors when the buffer type used in
decryption did not match the key selected. This is addressed by
having the the two calls be in the same critical section.

b/11009857

Change-Id: I74f1a0689ca17114f3cdd029022013b05c415acd
2013-10-02 15:44:39 -07:00
Fred Gylys-Colwell
391c8abf65 am 5a4134e8: am 67c794ba: Add unit test for empty mac key
* commit '5a4134e85231bccaa3dcf2bffae1d1d5eb2e0501':
  Add unit test for empty mac key
2013-10-02 14:38:13 -07:00
Fred Gylys-Colwell
67c794bac3 Add unit test for empty mac key
Merge of change https://widevine-internal-review.googlesource.com/7950.

In the OEMCrypto library, it is valid to call LoadKeys with an empty
mac key.  The library should not update the mac and enc keys and
should not throw an error.

Since we have seen this behavior in several implementations, a unit
test should be added that verifies the correct behavior.

bug: 11032674
Change-Id: I011ba39c8abc47547226a722143e92dac3f63dc5
2013-10-01 19:02:16 -07:00
Jeff Tinker
a041a25e4d am c28be299: Avoid multiple loads of Device RSA private key
* commit 'c28be299dc6579f29eb6c3872699232cc14bcf8c':
  Avoid multiple loads of Device RSA private key
2013-09-20 11:21:51 -07:00
Jeff Tinker
c28be299dc Avoid multiple loads of Device RSA private key
Molly reports OEMCrypto errors when Device RSA private key is
loaded a second time in the same session. This occurs in privacy
mode when a service certificate is request and later a key request is
generated.

bug: 10815492

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

Change-Id: I98999fb0e77597109b68c379eaaa4838d3f6dde4
2013-09-19 17:23:58 -07:00
Kenny Root
069b9b5efe Use canonical UniquePtr.h file
Change-Id: I2beb5107cd8842fa2f1fa8e8b482783e79bb05cb
2013-09-11 23:33:25 -07:00
Kenny Root
c9e3cb4c00 Use canonical UniquePtr.h header
Change-Id: Ic3ae70021a83128fcb57f8835f3ba66081ff2ed3
2013-09-11 15:06:07 -07:00
Fred Gylys-Colwell
d475d0282a Added locking to session table in oemcrypto_adapter_dynamic.
This change the merge from the android tree of:
https://widevine-internal-review.googlesource.com/7353

bug: 10447846

Change-Id: I0a2496fc6f225e0f3b23731c24087ddc6068c9cc
2013-09-04 11:06:37 -07:00
Jeff Tinker
d3a8d10868 Merge "Do Not Return an Error When AddKey Says it Needs a Key" into klp-dev 2013-09-04 17:26:33 +00:00
John "Juce" Bruce
259927efc5 Do Not Return an Error When AddKey Says it Needs a Key
Swallows the error NEED_KEY if it comes back from AddKey(), as this
is expected behavior. (It means privacy mode is on and the key that
was just added was the privacy certificate, ergo the real decryption
key is still absent.) Note that this carefully does not squelch the
notification that comes from NEED_KEY, which is still necessary in
order for the app to make a second key request.

Also streamlines a test case that I noticed was overcomplicated for
what it did while poaching code from it for new test cases.

Also removes a .gyp file that was erroneously being copied to the
Android tree.  Android does not use GYP.

Bug: 10495563
Change-Id: Ife3ff0270a0d09dac1b0eb0d84bddffd811e1eef
2013-09-03 16:29:08 -07:00
Rahul Frias
a233ac2084 Replace staging with production Root CA public key
A staging Root CA public key was used in earlier releases to verify
service certificates. These were in turn used to encrypt the
client identification. This met our needs for an end-to-end verification.
Now that the production Root CA and service certs are available
this change replaces staging certs with production ones.

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

b/10329328

Change-Id: Id02649201d9a8ba4d08acc4166503341a5bbdd23
2013-09-03 10:53:53 -07:00
Jeff Tinker
0ef6550593 Merge "Rename Unit Test" into klp-dev 2013-08-30 22:30:57 +00:00
Fred Gylys-Colwell
0ab663d8a5 Rename Unit Test
In order to run all disabled OEMCrypto unit tests with one gtest
filter, one of them needs to be renamed so it matches the others.

These tests are disabled by default because they install a test
keybox, which would be dangerous on a production device.

Merged from CDM change
https://widevine-internal-review.googlesource.com/7440

bug: 10508973
Change-Id: I9508b133c6500ec28ce8890a4af89f016344b842
2013-08-30 12:51:11 -07:00
Jeff Tinker
0faf26ba2d Merge "Turn off verbose logging" into klp-dev 2013-08-30 18:43:53 +00:00