Commit Graph

1631 Commits

Author SHA1 Message Date
Rahul Frias
ae99bb6d11 Verify cipher block mode during decryption
[ Merge from http://go/wvgerrit/16498 ]

The CDM now supports AES CTR and CBC block cipher modes. The license
specifies the mode to be used in the key container. The mode is
also specified in mediaCrypto when calling decrypt. This adds
verification for the cipher block mode.

Change-Id: I2587fc1e4b6d77161f2f8653f8516024c73dd8ac
2016-01-19 16:23:40 -08:00
Rahul Frias
f07494fce9 Merge "Consolidate proto parsing into DeviceFiles::RetrieveHashedFile" 2016-01-19 22:58:06 +00:00
Rahul Frias
8ceea06476 Merge "Generate key set ID on initialization and interface clean up" 2016-01-19 22:57:54 +00:00
Rahul Frias
8f4834856c Merge "Store key set ID with usage info" 2016-01-19 22:32:16 +00:00
Rahul Frias
02751bcc91 Consolidate proto parsing into DeviceFiles::RetrieveHashedFile
[ Merge of http://go/wvgerrit/16251 ]

Change-Id: I7aa849ccf0271c862d9b6a7c639da88cb0deff7d
2016-01-15 17:15:52 -08:00
Rahul Frias
84a14f2561 Generate key set ID on initialization and interface clean up
This is a merge of squashed CLs.

* Cdm Session and Engine interface clean up

[ Merge of http://go/wvgerrit/16387 ]

Key Set Ids have been removed from the CdmSession interface
(GenerateKeyRequest, Addkey) as they can be queried by an accessor.

The CdmEngine interface now allows one to specify or retrieve a session ID,
since both were not being used in a single call. Key set IDs are no longer
returned though GenerateKeyRequest as they was not being used.

* Generate key set ID when session is initialized

[ Merge of http://go/wvgerrit/16370 ]

Key set IDs are currently generated at different times in the
CdmSession lifecycle. Android generates key set IDs when the license
is received, while the CE CDM generates (or overrides them)
when the session is constructed.

The key set IDs are now generated when the session is initialized.
Key set generation cannot occur earlier as it has a dependency on
security level and in turn on crypto session initialization which
occurs when the session is initialized.

Depenencies on Session ID has caused other activities, construction of
PolicyEngine, CdmLicense, setting property CDM client sets to be
deferred from CdmSession constructor to Init().

Android will still retrieve the key set IDs after the offline license is
processed. For streaming requests, the key set will be
unreserved and discarded when the session is terminated.

Change-Id: Ib802d1c043742d62efa9a2c901fcd113e836c33d
2016-01-15 17:09:09 -08:00
John "Juce" Bruce
1a6f22da71 Warn on Verity
(This is a merge of http://go/wvgerrit/16496 )

run_all_unit_tests.sh now aborts and alerts the user if they have
Verity on, as opposed to its current behavior of failing later when
the tests don't copy over successfully.

Bug: 23420350
Change-Id: Ib01d32caaac462974b051f5d019888f7c47bc745
2016-01-15 15:06:19 -08:00
Rahul Frias
d2dc2e3670 Store key set ID with usage info
[ Merge of http://go/wvgerrit/16241 and http://go/wvgerrit/16364 ]

This will allow a usage session to be loaded later by key set ID.
This is needed for EME-style secure stop in the new CE CDM API.

b/25816911

Change-Id: I916340047492fbc0556d0e90bd2eac0f3eafe597
2016-01-15 12:59:40 -08:00
Rahul Frias
72a85eb747 Merge "Add cipher mode and pattern encryption support" 2016-01-15 19:17:52 +00:00
Fred Gylys-Colwell
f89a0efe7d Merge "Remove gtest and boringssl from android unit test build script" 2016-01-14 20:12:39 +00:00
Fred Gylys-Colwell
34dfb112f1 Remove gtest and boringssl from android unit test build script
Merge of http://go/wvgerrit/16300

This CL removes gtest and boringssl from
build_and_run_all_unit_tests.sh.  Instead, we change each "mm"
to "mm || mma".  Thus, if mm fails, we assume it is because of a
missing dependency and try mma which builds all dependencies.

bug: 25297287

Change-Id: Ief76fa4077e4cd8653da9306cc92ed14cf080564
2016-01-13 18:14:12 -08:00
Fred Gylys-Colwell
1a536310fc Merge "Remove unused functions from mips stub" 2016-01-13 21:01:28 +00:00
Jeff Tinker
8858333d9b Merge "Clean up wvdrm log spam during movie playback" 2016-01-13 20:02:33 +00:00
Jeff Tinker
d36ddf661e Clean up wvdrm log spam during movie playback
Change-Id: I398742e7a68c00f09fe54b0beb93a69e4f75cfb7
2016-01-13 12:01:55 -08:00
Rahul Frias
97e826412d Add cipher mode and pattern encryption support
[ Merge of http://go/wvgerrit/16364 ]

http://go/wvgerrit/16249 changed the name of the encryption pattern
structure from OEMCrypto_PatternDesc to OEMCrypto_CENCEncryptPatternDesc
to remove ambiguity. These are matching changes to CDM core.

[ Merge of http://go/wvgerrit/16340 ]

This CL passes the cipher mode in the license to OEMCrypto when
keys are loaded and specifies the pattern encryption scheme to
OEMCrypto_DecryptCENC.

b/20630275

Change-Id: I86b82bbdc891fd0100beb9fad385ca2082176271
2016-01-13 10:28:43 -08:00
Rahul Frias
aaed45dedf Merge "Modify initialization data to support HLS" 2016-01-12 20:51:12 +00:00
Jeff Tinker
4aedea8512 Support AES-CBC sample encryption in MediaDrm
bug:23719082
Change-Id: I1842bab291d6c86a87e46abbb98827c87f7f1d53
2016-01-11 17:16:08 -08:00
Rahul Frias
355471c408 Modify initialization data to support HLS
[ Merge of http://go/wvgerrit/16290 ]

HLS uses an EXT-X-KEY tag and attribute list in the media playlist to
identify the key and method used to encrypt media segments. This allows
for the attributes to be parsed and extracted.

b/20630275

Change-Id: I2c4a419022f933b7b34b64dc48930f167abe65c6
2016-01-07 13:06:42 -08:00
Rahul Frias
53463f292d Merge "Remove unused code from test methods" 2016-01-07 18:36:13 +00:00
Rahul Frias
0adf6e7b53 Remove unused code from test methods
[ Merge from http://go/wvgerrit/16406 ]

This was detected by static analysis tool cppcheck.

b/26348775

Change-Id: Icc6a55b9b4a1ffe882488ac069e3c3df2e796e91
2016-01-04 19:05:01 -08:00
Rahul Frias
42d96c362d Remove unused methods
[ Merge of http://go/wvgerrit/16405/ ]

Methods in string conversion and license request tests were not being used.
This was detected by static analysis cppcheck reports.

b/26349052

Change-Id: I44779abf6b6fdc01b5391bff7d47be1d20ef84d2
2016-01-04 18:40:58 -08:00
Fred Gylys-Colwell
3e8d137656 Remove unused functions from mips stub
Merge of http://go/wvgerrit/16410

b/26346491

Change-Id: I335a8595a1a713cc6bdfba62f4783d7ae4048aa7
2016-01-04 13:26:33 -08:00
Fred Gylys-Colwell
3c5acad498 Merge "Level 3 OEMCrypto library" 2016-01-04 19:49:09 +00:00
Kyle Alexander
0ba6383126 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours am: 4d84216089 -s ours am: 62c9688118 -s ours am: 0c660f33ef -s ours am: b7be833e68 -s ours am: 168c9bec9b -s ours am: 7a7b7e1192 -s ours am: 143637f463 -s ours am: 0b450d7114 -s ours am: 69d90c3c07 -s ours
am: d0e006f7b5  -s ours

* commit 'd0e006f7b5e796e582acd54ea49eff700c2471d9':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 21:35:38 +00:00
Kyle Alexander
d0e006f7b5 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours am: 4d84216089 -s ours am: 62c9688118 -s ours am: 0c660f33ef -s ours am: b7be833e68 -s ours am: 168c9bec9b -s ours am: 7a7b7e1192 -s ours am: 143637f463 -s ours am: 0b450d7114 -s ours
am: 69d90c3c07  -s ours

* commit '69d90c3c07530dd22361e890633098707d4892c0':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 21:31:34 +00:00
Kyle Alexander
69d90c3c07 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours am: 4d84216089 -s ours am: 62c9688118 -s ours am: 0c660f33ef -s ours am: b7be833e68 -s ours am: 168c9bec9b -s ours am: 7a7b7e1192 -s ours am: 143637f463 -s ours
am: 0b450d7114  -s ours

* commit '0b450d7114ba7c7b0aeaa9fb09ba536fc84e385a':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 21:09:15 +00:00
Kyle Alexander
0b450d7114 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours am: 4d84216089 -s ours am: 62c9688118 -s ours am: 0c660f33ef -s ours am: b7be833e68 -s ours am: 168c9bec9b -s ours am: 7a7b7e1192 -s ours
am: 143637f463  -s ours

* commit '143637f463bd691ff830db5a28342cf377eeb2bf':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 21:07:19 +00:00
Kyle Alexander
143637f463 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours am: 4d84216089 -s ours am: 62c9688118 -s ours am: 0c660f33ef -s ours am: b7be833e68 -s ours am: 168c9bec9b -s ours
am: 7a7b7e1192  -s ours

* commit '7a7b7e1192632fce356948600ed38599cc77d728':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 21:04:39 +00:00
Kyle Alexander
7a7b7e1192 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours am: 4d84216089 -s ours am: 62c9688118 -s ours am: 0c660f33ef -s ours am: b7be833e68 -s ours
am: 168c9bec9b  -s ours

* commit '168c9bec9ba8dc8a955f4bef56fc51f6a54b54e6':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 21:01:44 +00:00
Kyle Alexander
168c9bec9b DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours am: 4d84216089 -s ours am: 62c9688118 -s ours am: 0c660f33ef -s ours
am: b7be833e68  -s ours

* commit 'b7be833e68e55470f8af317a856d6714e10de547':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 20:59:05 +00:00
Kyle Alexander
b7be833e68 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours am: 4d84216089 -s ours am: 62c9688118 -s ours
am: 0c660f33ef  -s ours

* commit '0c660f33efe62765253b783357defad1a1f11b55':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 20:56:56 +00:00
Kyle Alexander
0c660f33ef DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours am: 4d84216089 -s ours
am: 62c9688118  -s ours

* commit '62c9688118d22f868d8792b772bffc8f6b19b661':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 20:54:33 +00:00
Kyle Alexander
62c9688118 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours am: 12c6b681e5 -s ours
am: 4d84216089  -s ours

* commit '4d84216089f43d544d8f645566008cbe2773dc9e':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 20:46:30 +00:00
Kyle Alexander
4d84216089 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours am: b58de75756 -s ours
am: 12c6b681e5  -s ours

* commit '12c6b681e54493ab27388dee09b0925abdc2cd40':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 20:44:32 +00:00
Kyle Alexander
12c6b681e5 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours am: e525aad042 -s ours
am: b58de75756  -s ours

* commit 'b58de757563fca92eb1e610abb345beab44c62de':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 20:42:43 +00:00
Kyle Alexander
b58de75756 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service am: 99941b86b6 -s ours
am: e525aad042  -s ours

* commit 'e525aad0429d7c3af4e700c59974212d99473d98':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 20:40:32 +00:00
Kyle Alexander
e525aad042 DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
am: 99941b86b6  -s ours

* commit '99941b86b6c413a21d7850423a1d83105aa0e471':
  DO NOT MERGE ANYWHERE Update license tests to use Widevine license service
2015-12-18 20:38:36 +00:00
Fred Gylys-Colwell
1735b367f3 Level 3 OEMCrypto library
This CL contains the level 3 oemcrypto library built for android.  I
used the toolchain from the mnc-emu-release branch because I'm having
problems with the toolchain on master.

This includes the security patch API, and several bug fixes to the library.

Current versions:
mips/libwvlevel3.a  Level3 Library Dec 17 2015 21:26:57
arm/libwvlevel3.a  Level3 Library Dec 17 2015 21:09:47
x86/libwvlevel3.a  Level3 Library Dec 17 2015 21:19:15

http://go/wvgerrit/16371 Level 3 OEMCrypto library
http://go/wvgerrit/16315 Security Patch Level - haystack version
http://go/wvgerrit/16282 Correctly handle null pointer in GetKeyData
http://go/wvgerrit/16294 Initialize data for generation number
http://go/wvgerrit/16280 Correctly handle bad RSA key

bug: 26089773
bug: 26092100
bug: 26086944
Change-Id: I3ea1b5d219dae0c88deafa742f61d67e97297902
2015-12-18 11:18:16 -08:00
Fred Gylys-Colwell
a235a61e28 Merge "Close session before terminate" 2015-12-17 19:41:38 +00:00
Edwin Wong
cc8af7b82b Merge "Replace deprecated APIs." 2015-12-17 19:14:31 +00:00
Fred Gylys-Colwell
1744b5a779 Update stub file for mips 64 build
Merge from widevine of http://go/wvgerrit/16363

Add temporary OEMCrypto API to the stub file used by android mips 64
devices.

bug: 26213020
Change-Id: I4b71fd21c5cf5dbb14645f606586af54d03ccaea
2015-12-16 19:35:10 -08:00
Fred Gylys-Colwell
8bf6a6f2d0 Merge changes I518ef46b,I2c2c1c1d
* changes:
  Unit Tests for Security Patch Level
  Fail early in oemcrypto unit tests
2015-12-17 02:37:24 +00:00
Edwin Wong
d173791ccc Replace deprecated APIs.
The min SDK target is now 21 because of getDrawable change,
so this app will not install on KitKat.

Also, MediaCodecView is obsolete, so there is no need to change
getInput/OutputBiffers and INFO_OUTPUT_BUFFERS_CHANGED, which requires
additional refactoring effort.

bug: 26185358
Change-Id: If83a5fa0eefebb4932fcd4c03162ba2dd94a755e
2015-12-16 17:49:57 -08:00
Fred Gylys-Colwell
4a37b21a22 Close session before terminate
Merge from the widevine repo of http://go/wvgerrit/16362

A test class holds a default session that it expects to be able to
close in the tear down.  This was not true in the TimingTest because
it calls OEMCrypto_Terminate which closes all open sessions.

This CL closes the default session, and then reopens it again after
OEMCrypto_Initialize.

Change-Id: Ib4128ec3c0a33794c03aa934174cb6fff448483e
2015-12-16 17:26:26 -08:00
Fred Gylys-Colwell
ce6d392041 Unit Tests for Security Patch Level
Merge of widevine change http://go/wvgerrit/16249

This CL adds unit tests and reference code for the security patch
level, which is a new feature in OEMCrypto v11.  This CL also adjusts
the dynamic and static adapters to still run with devices that have a
v10 OEMCrypto.

The level 3 haystack code will be updated in a future CL.

bug: 26188985

Change-Id: I518ef46b4098cf3718fe0c0390bfb6825db4fb6b
2015-12-16 16:11:13 -08:00
Aaron Vaage
8e4ad69cf0 Updating asset names link in sample player readme DO NOT MERGE am: ba25949152 am: 032652fa0f -s ours am: 83ac4b052f am: 20cec67597 am: e55e341dd0
am: 220d45baa0  -s ours

* commit '220d45baa038a767805bbe90c974473a0d55a5b0':
  Updating asset names link in sample player readme DO NOT MERGE
2015-12-16 23:44:44 +00:00
Aaron Vaage
5cfb0a7477 Updating asset names link in sample player readme DO NOT MERGE am: 62c80f89ba am: 72618085fc am: 313f07a1b9
am: d7d30f75bd  -s ours

* commit 'd7d30f75bdf9c5c906df5812fc7f0e2fc3446323':
  Updating asset names link in sample player readme DO NOT MERGE
2015-12-16 23:44:38 +00:00
Aaron Vaage
220d45baa0 Updating asset names link in sample player readme DO NOT MERGE am: ba25949152 am: 032652fa0f -s ours am: 83ac4b052f am: 20cec67597
am: e55e341dd0

* commit 'e55e341dd025011b7072c93eae5cbd80c8ba1677':
  Updating asset names link in sample player readme DO NOT MERGE
2015-12-16 22:53:46 +00:00
Aaron Vaage
e55e341dd0 Updating asset names link in sample player readme DO NOT MERGE am: ba25949152 am: 032652fa0f -s ours am: 83ac4b052f
am: 20cec67597

* commit '20cec675979ed7584d0fb0f117aef0ab262041ac':
  Updating asset names link in sample player readme DO NOT MERGE
2015-12-16 22:36:31 +00:00
Aaron Vaage
d7d30f75bd Updating asset names link in sample player readme DO NOT MERGE am: 62c80f89ba am: 72618085fc
am: 313f07a1b9

* commit '313f07a1b9ab54114ea54c4efea31e9dd311adf9':
  Updating asset names link in sample player readme DO NOT MERGE
2015-12-16 14:32:41 -08:00