Commit Graph

1080 Commits

Author SHA1 Message Date
Edwin Wong
a69baa961a resolve merge conflicts of c0b8030851 to jb-mr1.1-dev. am: f78b0e780e am: 9617db4d71 am: 5754438dc1 am: d5a1d5d58d am: 2ee45a97b0 am: ac1854b989 am: fc1240bdc2
am: 4c2eb98d09

* commit '4c2eb98d0991c8f3b0002bf13d350a8ce6b8a278':
  Update Widevine Classic Library to 4.5.0.10109 **** DO NOT MERGE ****
2015-10-20 04:30:09 +00:00
Edwin Wong
4c2eb98d09 resolve merge conflicts of c0b8030851 to jb-mr1.1-dev. am: f78b0e780e am: 9617db4d71 am: 5754438dc1 am: d5a1d5d58d am: 2ee45a97b0 am: ac1854b989
am: fc1240bdc2

* commit 'fc1240bdc2008ce28aca3f1f2f2c13ed1a8bab4c':
  Update Widevine Classic Library to 4.5.0.10109 **** DO NOT MERGE ****
2015-10-20 04:26:43 +00:00
Edwin Wong
fc1240bdc2 resolve merge conflicts of c0b8030851 to jb-mr1.1-dev. am: f78b0e780e am: 9617db4d71 am: 5754438dc1 am: d5a1d5d58d am: 2ee45a97b0
am: ac1854b989

* commit 'ac1854b9899a099d83dd2f2eecd7e0cc5ae285be':
  Update Widevine Classic Library to 4.5.0.10109 **** DO NOT MERGE ****
2015-10-20 04:24:53 +00:00
Edwin Wong
ac1854b989 resolve merge conflicts of c0b8030851 to jb-mr1.1-dev. am: f78b0e780e am: 9617db4d71 am: 5754438dc1 am: d5a1d5d58d
am: 2ee45a97b0

* commit '2ee45a97b06ba41ffc663b69ecb6b22547577258':
  Update Widevine Classic Library to 4.5.0.10109 **** DO NOT MERGE ****
2015-10-20 04:23:06 +00:00
Edwin Wong
2ee45a97b0 resolve merge conflicts of c0b8030851 to jb-mr1.1-dev. am: f78b0e780e am: 9617db4d71 am: 5754438dc1
am: d5a1d5d58d

* commit 'd5a1d5d58deaf2a226ec6981db5b3be79dc6e2e6':
  Update Widevine Classic Library to 4.5.0.10109 **** DO NOT MERGE ****
2015-10-20 04:21:24 +00:00
Edwin Wong
d5a1d5d58d resolve merge conflicts of c0b8030851 to jb-mr1.1-dev. am: f78b0e780e am: 9617db4d71
am: 5754438dc1

* commit '5754438dc1ce01849b9faa910dec7a32b5b8e086':
  Update Widevine Classic Library to 4.5.0.10109 **** DO NOT MERGE ****
2015-10-20 04:13:17 +00:00
Edwin Wong
5754438dc1 resolve merge conflicts of c0b8030851 to jb-mr1.1-dev. am: f78b0e780e
am: 9617db4d71

* commit '9617db4d71ed795f0733c4e02d56d625b576f158':
  Update Widevine Classic Library to 4.5.0.10109 **** DO NOT MERGE ****
2015-10-20 04:11:35 +00:00
Edwin Wong
9617db4d71 resolve merge conflicts of c0b8030851 to jb-mr1.1-dev.
am: f78b0e780e

* commit 'f78b0e780e470d460d18dd65a576931760629aec':
  Update Widevine Classic Library to 4.5.0.10109 **** DO NOT MERGE ****
2015-10-20 04:08:23 +00:00
Edwin Wong
f78b0e780e resolve merge conflicts of c0b8030851 to jb-mr1.1-dev.
Change-Id: I3a89161de0bf84fc6257338a3e932b90feba3f82
2015-10-19 20:59:36 -07:00
Edwin Wong
c0b8030851 resolve merge conflicts of 769288d009 to jb-mr1.1-docs.
Change-Id: I26df84f2907bcd18a2646bec0fbe53d9624e5a9b
2015-10-19 18:32:07 -07:00
Fred Gylys-Colwell
4d34e02b86 Clarify HDCP Type (lmp-mr1-dev branch) DO NOT MERGE
This is a documentation change only.

Merged from widevine repo of http://go/wvgerrit/15737

This CL updates the docs for OEMCrypto to clarify that HDCP v2.2
should be type 1.  The document version number is rolled to 9.1.

See Version 9 copy of original document for version history:
https://docs.google.com/document/d/1hiZ7wsZ_IkL5GvmjaUx3wffs8mI0xsfHZ6f9J-BOaC8/edit#

bug: 24098055
Change-Id: I084d86e44c60a5810fa448364003f7464e30bfb2
2015-10-01 20:27:10 +00:00
Jeff Tinker
af90b037a4 am 1827f14b: am c1447241: (-s ours) am 693f0813: am 87922237: DO NOT MERGE Part of fix for libmedia OOB write anywhere
* commit '1827f14b689c909973d8e859c8a7a00db7044bd7':
  DO NOT MERGE Part of fix for libmedia OOB write anywhere
2015-08-21 16:40:47 +00:00
Jeff Tinker
1827f14b68 am c1447241: (-s ours) am 693f0813: am 87922237: DO NOT MERGE Part of fix for libmedia OOB write anywhere
* commit 'c14472413260a6b233282a6ff3acb58b6571ab5c':
  DO NOT MERGE Part of fix for libmedia OOB write anywhere
2015-08-21 16:27:34 +00:00
Jeff Tinker
c144724132 am 693f0813: am 87922237: DO NOT MERGE Part of fix for libmedia OOB write anywhere
* commit '693f0813814b10bfd23bea578fa258255477b207':
  DO NOT MERGE Part of fix for libmedia OOB write anywhere
2015-08-21 15:36:22 +00:00
Jeff Tinker
bcf3a11f0f am e5d4a0be: DO NOT MERGE Part of fix for libmedia OOB write anywhere
* commit 'e5d4a0be30bac8fdba7194841084dcf61be6e8a2':
  DO NOT MERGE Part of fix for libmedia OOB write anywhere
2015-08-21 15:34:51 +00:00
Jeff Tinker
693f081381 am 87922237: DO NOT MERGE Part of fix for libmedia OOB write anywhere
* commit '87922237de893b92c7b4d252999dd91d04470bd0':
  DO NOT MERGE Part of fix for libmedia OOB write anywhere
2015-08-21 15:28:57 +00:00
Jeff Tinker
e5d4a0be30 DO NOT MERGE Part of fix for libmedia OOB write anywhere
Prevent usage of client provided address on
non-secure devices spoofed as being secure.

b/23223325

merge of go/wvgerrit/15420 from widevine repo

Change-Id: I1d4f3a652b3d5e78fca508f92005cfa8df5ec6db
2015-08-20 21:56:50 +00:00
Jeff Tinker
87922237de DO NOT MERGE Part of fix for libmedia OOB write anywhere
Prevent usage of client provided address on
non-secure devices spoofed as being secure.

b/23223325

merge of go/wvgerrit/15420 from widevine repo

Change-Id: I1d4f3a652b3d5e78fca508f92005cfa8df5ec6db
2015-08-20 14:49:43 -07:00
Fred Gylys-Colwell
802fe3b35c Lock session list in CdmEngine OnTimerEvent
This is a copy of the widevine CL:
https://widevine-internal-review.googlesource.com/#/c/12742/

If a session is closed at the same time as an OnTimerEvent is
processing an event, there could be a race condition between the two
threads.  This CL adds a lock that prevents a session from being
removed from the list while the timer is currently processing an
event.

If CloseSession is called while the OnTimerEvent method is active, the
session will be added to a dead list, and deleted when the timer event
has finished.

This CL does not address the main problem in bug 19252886, but
one bugreport, netflix_log_3.txt, indicates there may have been
a problem with the CDM timer.
bug: 19252886

Change-Id: I17190edaeb3eef1295d4d204232cc4262cb5fa9b
2015-02-10 20:11:57 -08:00
Fred Gylys-Colwell
6408ce05d4 am 1514ae0d: Terminate Level 1 OEMCrypto on Initialization Error
* commit '1514ae0dfb1f2e5fdfea2ef022f727f76d43e68f':
  Terminate Level 1 OEMCrypto on Initialization Error
2015-01-23 02:11:59 +00:00
Jeff Tinker
8961cd2404 Fix for zero-sized corrupted license files
Netflix reported that after pulling power while their app is active,
the app isn't able to restart.  This is because the license file for
session keys isn't getting synched to disk, so the data is still in
the buffer cache when the device shuts down.  Calling fflush and fsync
on the file ensures the data is persisted to disk.  fclose alone
doesn't do fsync.

In testing, I also noticed that the license file was being rewritten
every second which is hard on the flash filesystem.  The timer thread
was modified to avoid these frequent writes.

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

bug: 19108207
Change-Id: Ibe81e40a3c1f5d25563523da43fefdccdaa6ddcf
2015-01-22 16:20:31 -08:00
Fred Gylys-Colwell
1514ae0dfb Terminate Level 1 OEMCrypto on Initialization Error
Cherry pick of the widevine change
https://widevine-internal-review.googlesource.com/#/c/12082/

If the level 1 oemcrypto library loads and initializes, but has the
wrong version or does not have a valid keybox, then the level 3
fallback is used.   However, in those cases, the level 1 was not
terminated properly.  This caused a resource leak on some platforms.

With this CL, in OEMCrypto_Initialize, the level 1 library Terminate
is called if its Initialize was called and the level 1 library will
not be used.

bug: 18755226
Change-Id: I56e7d3349eeebd94f3fa8c4a1f4b21781cc7428b
(cherry picked from commit 62a9cf3cbe)
2015-01-23 00:08:10 +00:00
Rahul Frias
6e4896e8ba Merge "Corrections to license policy handling and reporting" into lmp-mr1-dev 2015-01-17 11:35:22 +00:00
Rahul Frias
db1382e0a3 Corrections to license policy handling and reporting
If a key query occurred before a license was received an UNKNOWN_ERROR was
returned. This now succeeds but returns no information (an empty container).

Also licenses that were already expired when received were not marked as such.
This did not cause violations in playback rules but caused an exception when
they were queried.

[ Merge of https://widevine-internal-review.googlesource.com/#/c/12300
  from wv git repo ]

b/18843625

Change-Id: I6990765c15e519ddf203a2fd8f0a130306f090a6
2015-01-16 14:48:57 -08:00
Jeff Tinker
d7907f03b4 am 1a5103c7: Include WV classic L3 libraries for x86 in Lollipop branches
* commit '1a5103c739ebcac21799406a721cff2974a9852a':
  Include WV classic L3 libraries for x86 in Lollipop branches
2015-01-15 00:45:12 +00:00
Jeff Tinker
1a5103c739 Include WV classic L3 libraries for x86 in Lollipop branches
bug: 18985145
Change-Id: I659c10b33dc79bf44a6da907d168e1ef61df2172
2015-01-14 12:21:51 -08:00
Edwin Wong
61db592610 Update Widevine Classic Library to 4.5.0.10128.
Fix "cannot play pinned movie after upgrade bug".
https://widevine-internal-review.googlesource.com/#/c/12160/

bug: 18136076
Change-Id: If14273fcb74e234618a2b450cc0affbbeca0d28f
2014-12-22 11:18:47 -08:00
Fred Gylys-Colwell
62a9cf3cbe Terminate Level 1 OEMCrypto on Initialization Error
Cherry pick of the widevine change
https://widevine-internal-review.googlesource.com/#/c/12082/

If the level 1 oemcrypto library loads and initializes, but has the
wrong version or does not have a valid keybox, then the level 3
fallback is used.   However, in those cases, the level 1 was not
terminated properly.  This caused a resource leak on some platforms.

With this CL, in OEMCrypto_Initialize, the level 1 library Terminate
is called if its Initialize was called and the level 1 library will
not be used.

bug: 18755226
Change-Id: I56e7d3349eeebd94f3fa8c4a1f4b21781cc7428b
2014-12-17 11:29:14 -08:00
Jeff Tinker
07478a67cb Ensure terminate is called in all error cases
bug: 18203007
Change-Id: I0d74b348982992075ec126a324dabbff8fab9125
2014-12-11 19:27:50 -08:00
Jeff Tinker
4dd748597a Fix illegal instruction fault in libwvdrmengine.so
Merge of https://widevine-internal-review.googlesource.com/#/c/12020/
from the widevine CDM repo.

bug: 18606686
Change-Id: Iafc27f51c8d486065620c9140ce88b285fc0067c
2014-12-12 00:56:19 +00:00
Chong Zhang
0c7525090f Merge "widevine: return -EAGAIN sooner in non-blocking mode" into lmp-mr1-dev 2014-12-05 23:31:39 +00:00
Chong Zhang
35b42afd0f widevine: return -EAGAIN sooner in non-blocking mode
Bug: 18536934

Change-Id: Ib9344851fceb418a2e614e966c981a997c32c466
2014-12-05 11:33:00 -08:00
Fred Gylys-Colwell
d2ca9d448e Merge "Level 3 OEMCrypto library for mips" into lmp-mr1-dev 2014-12-05 02:57:26 +00:00
Fred Gylys-Colwell
cb9360fb65 Level 3 OEMCrypto library for mips
This CL is a merge of the widevine change
https://widevine-internal-review.googlesource.com/#/c/11881

The function rand() was not available on the mips build used to
generate the level 3 oemcrypto fallback library.  This function has
been replaced by the openssl RAND_bytes(), so that compilation may
complete.

New version of library:
libwvdrmengine/level3/mips/libwvlevel3.a  NONOB Level3 Library Dec  3 2014 17:11:00

bug: 17288466
Change-Id: Ibe2ae3add4f5830ddc1cce501d76aeb4be5ce926
2014-12-03 17:39:50 -08:00
Fred Gylys-Colwell
1811a8ac12 Level 3 OEMCrypto library for x86
This is a merge of the Widevine change:
https://widevine-internal-review.googlesource.com/#/c/11871

The level 3 oemcrypto fall back now compiles cleanly on a Fugu, and
passes all unit tests.

New version of library:
libwvdrmengine/level3/x86/libwvlevel3.a  Level3 Library Dec  3 2014 13:06:03

bug: 17289103

Change-Id: I677888536dd2ca12e27b5985737e080b69d81477
2014-12-03 13:28:57 -08:00
Rahul Frias
3a586ab27b Report HDCP status of no HDCP device attached
OEMCrypto may report an HDCP status of "No HDCP device attached/using
local display with secure path". This is not propagated upto
the server as an appropriate HDCP value did not exist in the
license protocol. This has now been added. Netflix has requested that
this be reported.

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

b/18377309

Change-Id: I3db88c7ab5e79a3c12dbc8a398c4770e14e5ee5c
2014-11-22 01:46:13 -08:00
Fred Gylys-Colwell
5acf3cdc3d Save and load usage table in level 3 OEMCrypto
This is a merge of the widevine change:
https://widevine-internal-review.googlesource.com/#/c/11781

The OEMCrypto did not save the usage table correctly after a key was
loaded and not used.

Also, oemcrypto uses the keybox to verify and sign the usage table.
On library initialization, the usage table was being loaded before the
keybox, so the signature was not verified correctly.

Both these problems have been corrected.

Current Library Version:
arm:  Level3 Library Nov 19 2014 16:53:43

bug: 17328418 Can't play pinned content
Change-Id: Ia753e2f47b36433931fbe8dba78939581e647222
2014-11-19 17:02:33 -08:00
Rahul Frias
dffa3ca991 Merge "MediaDrm throws an exception when Secure Stops are requested" into lmp-mr1-dev 2014-11-14 17:34:14 +00:00
Rahul Frias
aa7ad630d7 MediaDrm throws an exception when Secure Stops are requested
Our recommendation to OEMs is that they support a table of at least 50
usage entries in OEMCrypto. If more usage entries are stored, the PSTs get
added to the CDM but are LRU'ed out of the OEMCrypto usage table. When the
CDM queries those usage entries, OEMCrypto will return a
OEMCrypto_ERROR_INVALID_CONTEXT. Rather than return an error and have
MediaDrm throw an exception, CDM should delete this PST and return the
next usage entry, when queried.

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

b/17994711

Change-Id: I00e3f93000096fb434d94333e22958de795a4bb5
2014-11-13 12:56:26 -08:00
Fred Gylys-Colwell
9810ff8925 Merge "Accept new signing keys for no renewal license" into lmp-mr1-dev 2014-11-13 17:13:23 +00:00
Fred Gylys-Colwell
3b1a3e47d8 Merge "Adjust CDM engine and request license unit tests" into lmp-mr1-dev 2014-11-13 01:12:22 +00:00
Fred Gylys-Colwell
c325b3aec3 Accept new signing keys for no renewal license
Merge of widevine change
https://widevine-internal-review.googlesource.com/#/c/11501/

A license response can have new signing (mac) keys attached whether
the license can be renewed or not.  Previously, the new keys were
ignored if the license could not be renewed.

bug: 18009750 Secure stop release generation failing for Netflix

Change-Id: I06dd76b0ab9f459021f46eecc938aa43d8d29689
2014-11-12 16:29:42 -08:00
Fred Gylys-Colwell
9ff5125867 Adjust CDM engine and request license unit tests
Merge of the widevine change:
https://widevine-internal-review.googlesource.com/#/c/11632

Several unit tests in cdm_engine_test.cpp and request_license_test.cpp
were failing regularly. These were caused by either:
1) The device was not provisioned.
  This has been fixed by adding a certificate provisioning step in the
  test setup for the cdm engine tests and changing the existing
  provision steop in the request license tests to provision for both
  security levels.
2) The device was hitting a flaky server.
  This has been fixed by switching from the GooglePlayServer to the
  Widevine server.
3) A null pointer introduced when testing secure stops with an app
  id.  This has been fixed by directly injecting the app id in the unit
  tests.
4) Flaky network connections.  The unit tests were requesting data
  from the server and were timing out after 3 seconds.  I changed that
  to 12 seconds.
5) The tests were searching for an end-of-line marker to find the GLS
  header in the license response message.  The end-of-line marker was
  present in a valid DRM message for almost 1% of the test cases.  This
  code  has been replaced by searching for the string "GLS/1" at the
  begining of the HTML body.

I also added test_printers.cpp that defines functions used by GTest to
print error codes by name instead of numeric value.

This CL changes unit tests only. It does not change any production
code.

bug: 18316036

Change-Id: I3398580059a03114e782ac7ac59e6b0944012df4
2014-11-12 13:57:03 -08:00
John "Juce" Bruce
abbef3d002 Merge "Fix Typos in License.cpp" into lmp-mr1-dev 2014-11-07 21:33:24 +00:00
John "Juce" Bruce
4d695de2b0 Fix Typos in License.cpp
(This is a merge of http://go/wvgerrit/11626 in the Widevine CDM
repo.)

Change-Id: Iad48e76a77c285c0e0738b22436dc60cb3704740
2014-11-07 13:21:40 -08:00
John "Juce" Bruce
039b984a75 Merge "Add OS Version to Properties" into lmp-mr1-dev 2014-11-07 20:04:55 +00:00
John "Juce" Bruce
31f87bc19e Add OS Version to Properties
(This is a merge of http://go/wvgerrit/11613 from the Widevine CDM
repo.)

Adds a property for the OS version, implements it on Android, and
adds it to the license request property bag so that Netflix may
use it to discern the supported capabilities of the CDM.

Bug: 18230738
Change-Id: If5174a108093855314f3e0102b83691e20bb247b
2014-11-07 11:47:51 -08:00
Fred Gylys-Colwell
def3c4d5b8 Merge "Adjust PreventNonceFlood tests" into lmp-mr1-dev 2014-11-07 19:27:22 +00:00
Fred Gylys-Colwell
2ca704e5c0 Adjust PreventNonceFlood tests
The OEMCrypto library should prevent too many nonces from occuring in
a row. Previously, we tested that GenerateNonce generated an error if
there were too many nonce requests.

This CL makes it possible for OEMCrypto to delay the return from
GenerateNonce if there are too many requests.  This is an equally
valid solution to the nonce flood attack.

This is a unit test change only.  No production code is affected.

This is a merge from the widevine repository of:
https://widevine-internal-review.googlesource.com/#/c/11604/

bug: 17630253
Change-Id: Ie97f712d70230cd8e7ea7089da0aa18039673bb4
2014-11-06 22:12:51 -08:00
Edwin Wong
59da418883 Remove corrupted license file from storage.
(This is a port of http://go/wvgerrit/11614 from the
 Widevine repo.)

CDM does not recover if a license file has invalid size
or the hash is incorrect. Remove the corrupted license
file in such cases.

bug: 18002606

Change-Id: I46dec853ce6b2e7c7430297d50df5d30488cde3b
2014-11-06 17:07:48 -08:00