Commit Graph

3658 Commits

Author SHA1 Message Date
Fred Gylys-Colwell
4e6fd5d2d8 Merge "Lock session list in CdmEngine OnTimerEvent (master)" 2015-03-10 20:48:13 +00:00
John Bruce
7c9d1224d2 Merge "Cleanup namespace ending comment" 2015-03-10 18:48:52 +00:00
KongQun Yang
c495694601 Merge "Merge MaxNumberOfSessions changes from CDM" 2015-03-10 00:31:05 +00:00
John "Juce" Bruce
da10592386 Merge "Drop google3 BUILD and OWNERS files for stringencoders." 2015-03-09 21:16:33 +00:00
John "Juce" Bruce
2667effe19 Drop google3 BUILD and OWNERS files for stringencoders.
This is a merge of http://go/wvgerrit/12740 from the Widevine CDM
repository.

Change-Id: I1dc40b464d6ea6edf9d62e0a04e18da99d0ae05e
2015-03-09 13:43:00 -07:00
KongQun Yang
0a564039ca Cleanup namespace ending comment
(This is a merge of http://go/wvgerrit/13400 from the Widevine CDM
repository.)

Replace "};  // namespace" with "}  // namespace":
ag -l --ignore-dir third_party "};  //" | \
while read f; do sed -r -i 's/\};  \/\//}  \/\//' $f ; done

Replace "// unnamed namespace" with "// namespace":
ag -l --ignore-dir third_party "unnamed namespace" | \
while read f; do sed -r -i 's/unnamed namespace/namespace/' $f ; done

Change-Id: I50ece9a127ce669f15cd532dfae1dd741338a075
2015-03-09 13:05:25 -07:00
KongQun Yang
23c95a1251 Merge MaxNumberOfSessions changes from CDM
Bug: 18377675

Implement new OEMCrypto function to get max number of sessions
https://widevine-internal-review.googlesource.com/#/c/12980/

Add oemcrypto static adapter for v9
https://widevine-internal-review.googlesource.com/#/c/13022/

Support new property to query MaxNumberOfSessions in CDM
https://widevine-internal-review.googlesource.com/#/c/13020/

Fix GetHdcpCapabilities incorrect return if not initialized
https://widevine-internal-review.googlesource.com/#/c/13210/

Change-Id: I02738c543cedd6e38d8826f845fec6cb2b1ede3c
2015-03-09 13:05:21 -07:00
KongQun Yang
ec0b7aae14 Merge "Exit on error when build and run Android unit tests" 2015-03-09 20:02:28 +00:00
KongQun Yang
891bd057f4 Merge "Fix race condition in CDM policy timer" 2015-03-09 19:04:04 +00:00
John "Juce" Bruce
978f530e8b Merge "Fix C++11 Narrowing Errors in WVDrmPlugin" 2015-03-09 19:03:12 +00:00
John "Juce" Bruce
625d8ed99a Merge "Generate New Obfuscated L3 Libraries for Android" 2015-03-09 19:02:22 +00:00
KongQun Yang
e3f668785e Exit on error when build and run Android unit tests
Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13200/

Change-Id: Ifd785a9b30293746f0ae0262b37f03bc905a5e09
2015-03-06 16:57:01 -08:00
KongQun Yang
87f179307f Fix race condition in CDM policy timer
Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13345/

Bug: 19592752
Change-Id: I73a215f9e67330caaced0110262448973aaae0a7
2015-03-06 16:41:35 -08:00
John "Juce" Bruce
854a47981a Generate New Obfuscated L3 Libraries for Android
(This is a merge of http://go/wvgerrit/13420 from the Widevine
repository.)

Generates new obfuscated libraries that include @kqyang's recent
changes to add OEMCrypto_GetMaxNumberOfSessions().

libwvdrmengine/level3/arm/libwvlevel3.a  Level3 Library Mar  6 2015 15:16:17
libwvdrmengine/level3/x86/libwvlevel3.a  Level3 Library Mar  6 2015 15:20:30

Change-Id: Ibea299a372617f98c0f24861c673f56a97845ad8
2015-03-06 16:14:18 -08:00
Fred Gylys-Colwell
6444332cd7 Lock session list in CdmEngine OnTimerEvent (master)
Cherry pick of
https://widevine-internal-review.googlesource.com/#/c/12935/

Change-Id: I029d36b2b6d092ae938fca2a7f6d893814c25a8a
2015-03-06 16:00:37 -08:00
John "Juce" Bruce
b331822558 Fix C++11 Narrowing Errors in WVDrmPlugin
(This contains a merge of http://go/wvgerrit/13382 from the Widevine
repository.)

This undoes the previous change to silence harmless C++11 narrowing
warnings and instead changes the code to no longer trigger them. The
fix was to delcare the type of our PSSH prefix constant to be uint8_t*
and then convert it to char* at usage-time rather than defining the
not-technically-char* data as a char* to start.

Change-Id: I68ff8c3ed0859096863b49c61cd60ae8461b5b29
2015-03-06 15:57:40 -08:00
John "Juce" Bruce
2c809b62ca Replace Uses of .compare() in Device Files
(This is a merge of http://go/wvgerrit/13390 from the Widevine CDM
repository.)

Change-Id: I5b3595d5ef52b670e5ba5019746f03d934ae9625
2015-03-06 12:06:47 -08:00
John "Juce" Bruce
a3b0d83d19 Run clang-format on Core
This copies over formatting changes from the Widevine CDM repository
that resulted from running clang-format with Google style on the
shared core/ directory. It also copies over some rewordings of log
messages that were made at the same time.

Aside from the changed log messages, this should not affect behavior
or functionality.

Change-Id: I69c57c188f7a79f30fa3517afeed17365929b6b6
2015-03-05 16:46:01 -08:00
John "Juce" Bruce
dff91b48c1 Merge "Generate Key Set IDs at Key Request Generation Time" 2015-03-05 20:05:13 +00:00
John "Juce" Bruce
f66fd68caa Merge "Make PSSH parser more robust." 2015-03-05 20:04:53 +00:00
John "Juce" Bruce
614abba6c2 Merge "Remove OEMCrypto v8 adapter" 2015-03-05 20:04:43 +00:00
John "Juce" Bruce
cba04ecddf Merge "Merge Widevine CDM-Side Core Changes" 2015-03-05 20:04:14 +00:00
John "Juce" Bruce
9340b3e869 Merge "Merge Widevine CDM-Side Test Changes" 2015-03-05 20:04:05 +00:00
John "Juce" Bruce
6d1ceb2e18 Merge "Rename CancelKeyRequest" 2015-03-05 20:03:40 +00:00
Chih-Hung Hsieh
991b0eded5 Merge "Ignore benign clang/llvm warnings." 2015-03-05 19:46:19 +00:00
KongQun Yang
dc0ecfea7c Merge "Update usage table when session is closed" 2015-03-05 02:11:04 +00:00
Chih-Hung Hsieh
a15abbe428 Ignore benign clang/llvm warnings.
Change-Id: Ibb8d60c6e238504dfe6a15425a65405bcf083358
2015-03-04 15:37:31 -08:00
John "Juce" Bruce
620b05dba0 Generate Key Set IDs at Key Request Generation Time
(This is a merge of http://go/wvgerrit/11285 from the Widevine CDM
repository.)

The key set ID is now available earlier, in order to support the CE
CDM 4.5 interface, which needs it at key request generation time, not
later at key response receipt time. It is still possible to receive
the key set ID at key response time, for Android's purposes. Either
API may now be passed a pointer to store the ID in, which may also be
left NULL if this is not needed.

Change-Id: I47e80ea4005c80282e36cfae92cb91142208f624
2015-03-04 15:02:01 -08:00
John "Juce" Bruce
4252a4b790 Make PSSH parser more robust.
(This is a merge of http://go/wvgerrit/12700 from the Widevine CDM
repository.)

Adds unit tests which cover several cases, including five which are
fixed in this patch:

* Find a Widevine PSSH after a PSSH with non-zero flags.
  (We have no control over another provider's abuse of the flags field,
   so we should not give up if such a PSSH appears before ours.)
* Find a Widevine PSSH after a v1 PSSH.
  (CENC now specifies a general v1 format.  We don't have to support it
   directly in the CDM, but we do have to skip it gracefully.)
* Find a Widevine PSSH after a non-PSSH box.
  (This would be unusual input, but we can easily recover from it.)
* Parse a PSSH box with a size field of 0, which means "the rest of the
  buffer."
  (This would be unusual input, too, but is technically allowed for any
   MP4 box.)
* Parse a v1 Widevine PSSH box, ignoring the new fields we don't need.

Bug: 19288007
Change-Id: I355df9e34ba4d53cc02e8501de965a0d193ee554
2015-03-04 15:00:57 -08:00
John "Juce" Bruce
d5fdd89071 Remove OEMCrypto v8 adapter
Android has never used the static adapters. This code is and has
always been dead in the Android codebase.

Change-Id: Ia6bb12a3fafb2c9b08349b0aca31fde45a58dada
2015-03-04 15:00:57 -08:00
John "Juce" Bruce
7639e0297f Merge Widevine CDM-Side Core Changes
This is a combined merge of several small changes to the core in the
Widevine CDM repository:

http://go/wvgerrit/10941
  Rename privacy_crypto to allow more variants.

http://go/wvgerrit/11530
  Add Missing Header to properties.h

http://go/wvgerrit/11531
  More Loosely Couple CdmEngine and CdmSession

Change-Id: I5b3f738ae495ab267da1440421dd7aa6f7860194
2015-03-04 13:25:54 -08:00
John "Juce" Bruce
33ddce2298 Merge Widevine CDM-Side Test Changes
This is a combined merge of several small test changes in the
Widevine CDM repository:

http://go/wvgerrit/11252
  Chain CreateSession() Helpers in CDM Session Unit Test

http://go/wvgerrit/10931
  Increase URLRequest timeouts and tolerate 502's.

http://go/wvgerrit/10695
  Remove dead CHROMIUM_BUILD code in engine test.

Change-Id: I75a6c9509880a20c85e54cbd2fcbf34b101ce70e
2015-03-04 12:39:06 -08:00
John "Juce" Bruce
2ae1f717f3 Rename CancelKeyRequest
(This is a merge of http://go/wvgerrit/10674 from the Widevine CDM
repository.)

Now that the CE CDM has CloseSession to handle closing sessions, we
can rename CancelKeyRequest on the CDM Engine & CDM Session to better
resemble its purpose and the name it is known by on Android.

Change-Id: I68d55b3be733579e5875ab33d8e94a62fe1f651d
2015-03-04 12:24:57 -08:00
KongQun Yang
a0b016ecf6 Update usage table when session is closed
Merge from the widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13310/

Bug: 19003762
Change-Id: Icaa1978c16437d36c99b0b0dabbbfa15fe469bc3
2015-03-03 17:43:52 +00:00
Fred Gylys-Colwell
87ea4f6ad4 Merge OEMCrypto changes from CDM to android repository
This is a merge of the following CLs:

Style clean up in oemcrypto/mock
https://widevine-internal-review.googlesource.com/#/c/10660

Split off default keybox.
https://widevine-internal-review.googlesource.com/#/c/10661/

Split off several properties from CryptoEngine.
https://widevine-internal-review.googlesource.com/#/c/10662/

Split off Keybox installation.
https://widevine-internal-review.googlesource.com/#/c/10680/

Wii-U build compatibility fixes.
https://widevine-internal-review.googlesource.com/#/c/10720/

Fix style issues in oemcrypto_logging_test.
https://widevine-internal-review.googlesource.com/#/c/10824/

Correct OEMCrypto error codes in the mock.
https://widevine-internal-review.googlesource.com/#/c/10821/

Enable logging during OEMCrypto unit tests.
https://widevine-internal-review.googlesource.com/#/c/10833/

Wait to create usage table path until needed.
https://widevine-internal-review.googlesource.com/#/c/10831/

Allow keybox installation to be unimplemented.
https://widevine-internal-review.googlesource.com/#/c/10850/

Minor clean up in the OEMCrypto header.
https://widevine-internal-review.googlesource.com/#/c/10921/

Add usage table device property to the mock oemcrypto
https://widevine-internal-review.googlesource.com/#/c/11092/

Change-Id: I02a818a620bcd4bd2291f1b3c0ac9308ae444319
2015-03-02 16:45:43 -08:00
Dan Albert
723d67c88f Remove Widevine CDM Dependency on STLPort
* Replace an stlport static assert with a C++11 static_assert.
 * Move some libraries that were being built with the NDK but
   statically included into platform code off the NDK.
 * Rebuild the obfuscated binaries to use the new STL.
 * Remove MIPS support temporarily due to an inability to generate
   obfuscated binaries for it. (To be fixed in b/19482469.)

Bug: 15193147
Change-Id: Icc166583b0c6af68550baf17ab8c33076a1179d3
2015-02-25 15:53:36 -08:00
Kyle Alexander
8e31c7f445 Makefile to support building XtsOEMCryptoTestCases module
This makefile will be linked to from the vendor/xts project,
and defines how to build the oemcrypto_unittest executable into
an xts compatible native test.

Bug: 18952052
Change-Id: I8158cad703b558b88070cc46dafcf109699ecc77
2015-02-20 14:48:34 -08:00
Fred Gylys-Colwell
17e3e434d8 am 74167954: am 802fe3b3: Lock session list in CdmEngine OnTimerEvent
* commit '7416795401c6c06b69fcfdf11fae6c195941d383':
  Lock session list in CdmEngine OnTimerEvent
2015-02-11 20:12:14 +00:00
Fred Gylys-Colwell
7416795401 am 802fe3b3: Lock session list in CdmEngine OnTimerEvent
* commit '802fe3b35c42975cad30b947903e002500f2a6c7':
  Lock session list in CdmEngine OnTimerEvent
2015-02-11 20:04:44 +00: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
Narayan Kamath
fc2b694b4f Declare explicit dependency org.apache.http.legacy.
This is required because these makefiles contain a module that's
building agains the "current" SDK and will need to add an explicit
compile time dependency on the apache API.

Note that no runtime dependency is needed because the app targets
SDK version 12 (?!!).

bug: 18027885
Change-Id: I37587b91f9c52f88a8becce0449ac9b24a77fdad
2015-02-05 12:50:05 +00:00
Jeff Tinker
173e6031f3 am 8961cd24: Fix for zero-sized corrupted license files
* commit '8961cd2404b7064d69288b5572ffd0d454004280':
  Fix for zero-sized corrupted license files
2015-01-23 08:45:27 +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
Rahul Frias
ab3ffa9a55 am 6e4896e8: Merge "Corrections to license policy handling and reporting" into lmp-mr1-dev
* commit '6e4896e8ba52192a731eab19f454a1f51544dbab':
  Corrections to license policy handling and reporting
2015-01-17 11:46:40 +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 Davidson
6eb74fe6a0 Remove references to protobuf 2.3.0.
Change-Id: I08b9e6441e26083cf182402916288ae073425f9c
(cherry picked from commit dfab729fd7)
2015-01-15 23:32:02 +00:00
Fred Gylys-Colwell
f9add54545 am 62a9cf3c: Terminate Level 1 OEMCrypto on Initialization Error
* commit '62a9cf3cbea34f2d04c50809703d31efd78514d9':
  Terminate Level 1 OEMCrypto on Initialization Error
2014-12-18 22:03:47 +00: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
d5b04d6430 am 4dd74859: Fix illegal instruction fault in libwvdrmengine.so
* commit '4dd748597a26bdff6138fc20ed17baa32bf89ab8':
  Fix illegal instruction fault in libwvdrmengine.so
2014-12-12 14:42:27 +00: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