Commit Graph

2543 Commits

Author SHA1 Message Date
Srujan Gaddam
a4e7e3fd80 Merge "Fix dead code in dynamic adapter" 2018-02-13 03:47:18 +00:00
Srujan Gaddam
c616bfcd51 Fix dead code in dynamic adapter
b/73254535

Test: unit/integration tests

Merge of http://go/wvgerrit/43100
2018-02-12 17:06:53 -08:00
Fred Gylys-Colwell
6562488d0f Fix key size when decrypting KCB with entitlement keys.
Merge from Widevine repo of http://go/wvgerrit/42942

This CL changes test code only.

Bug: 73132054
test: unit tests

Change-Id: Ic9ca1879a942b0cad8ea15a98ed263a5fd170b4c
2018-02-09 11:44:11 -08:00
Rahul Frias
928ae5639e Merge "Changes to support new MediaDrm methods" 2018-02-09 03:36:39 +00:00
Rahul Frias
8d27f791e6 Merge "Detect when unable to meet policy requirements" 2018-02-09 03:36:12 +00:00
Rahul Frias
dc25029fc4 Changes to support new MediaDrm methods
[ Merge from http://go/wvgerrit/42602 ]

Renamed HDCP related query names to better reflect their purpose.

Bug: 69674645
Test: wv unit/integration tests
Change-Id: If4da45ff676da0e812852bf34f209d99e59c059b
2018-02-08 16:29:34 -08:00
Srujan Gaddam
3bbd0584a8 Fix cipher mode assignment in adapter
b/73127061

Merge of http://go/wvgerrit/42923

Test: Unit tests/playback
2018-02-08 15:08:09 -08:00
Rahul Frias
0bc2cf66bc Merge "Add tests for Cenc 3.0 cipher and sample modes" 2018-02-08 14:58:41 +00:00
Rahul Frias
c78ce178d4 Detect when unable to meet policy requirements
[ Merged of http://go/wvgerrit/39766 ]

The security level (software/hardware, decryption/decode)
in the policy that specified how the key was to be used was
not being respected for L3. Playback would either continue or
a vendor specific error would be thrown.

If the device cannot use the key as permitted by the policy
CryptoException#ERROR_INSUFFICIENT_OUTPUT_PROTECTION will be thrown.

Bug: 31913737
Bug: 31913439

Test: WV unit/integration tests
Test: Playback using playmovies and netflix. Cast playback using
      playmovies.

Change-Id: If25735ab0f789108431115623cb236687c5ef818
2018-02-07 21:47:52 -08:00
Rahul Frias
91efb844a1 Merge "Correct request_license_test failures" 2018-02-07 17:06:57 +00:00
TreeHugger Robot
3bad5757d7 Merge "Fix backwards compatibility" 2018-02-06 23:12:12 +00:00
TreeHugger Robot
eb8d77d8f1 Merge "Correct AES bit size for generic crypto" 2018-02-06 22:50:43 +00:00
Fred Gylys-Colwell
a682329684 Fix backwards compatibility
Merge from Widevine repo of http://go/wvgerrit/42403

This CL changes the names of some unit tests so that they don't run
when testing an older version of oemcrypto.

bug: 68275290
test: ran unit tests against v8-v14 oemcrypto.
Change-Id: I773350adf4df3f3b310478400cd4d4e85789fc37
2018-02-06 21:23:42 +00:00
Fred Gylys-Colwell
8ae3759a7d Correct AES bit size for generic crypto
Merge from Widevine repo of http://go/wvgerrit/42402

This changes the AES key size back to 128 for keys that are not
entitlment keys.

bug: 72904259
test: unit tests
Change-Id: I07cc56050cafb82c65b67c56df3f18d375047eb8
2018-02-06 12:10:49 -08:00
Rahul Frias
92eaccb3c7 Add tests for Cenc 3.0 cipher and sample modes
[ Merge of http://go/wvgerrit/42444 ]

This covers cenc, cens, cbc1 and cbcs. This also covers
HLS v2 format.

b/70684636

Test: Verified using WV unit/integration tests

Change-Id: I3e85b496d29b91c514f0bb806712cdf0cee12903
2018-02-06 09:47:02 -08:00
Rahul Frias
d9d53dee3b Correct request_license_test failures
[ Merge of http://go/wvgerrit/42103 ]

* While deprecating keyboxes as identification, some code to
  restore a license was mistakenly removed in http:://go/wvgerrit/36740,
  http://ag/3442777

* Corrections to keep track of cipher mode, call SelectKeys when cipher
  mode changes and to use the backward compatible LoadKeys call in case
  OEMCrypto is v13.

Bug: 70160032

Test: Ran WV unit/integration tests. Request license test failures
      have been addressed.

Change-Id: Id03c50874085af6d9985d10c19a74a02efb7a1f5
2018-02-06 09:46:36 -08:00
TreeHugger Robot
4e5599d4ff Merge "Use real system id in GetProvisioningTokenValidMetrics" 2018-02-06 04:20:17 +00:00
Fred Gylys-Colwell
ee43f9b411 Clean symbol export on mod mock
Merge from Widevine repo of http://go/wvgerrit/42281

This cleans up some of the oemcrypto mock code.  This code is only
used for testing.

bug: 72831885
bug: 69271232
Change-Id: I8add162839d6febe56a89df84e8ae0cf0b97a2d9
2018-02-05 11:53:27 -08:00
TreeHugger Robot
51212b1505 Merge "Test Carmicahel RSA Keys" 2018-02-02 23:44:01 +00:00
Fred Gylys-Colwell
a6cd7c501b Use real system id in GetProvisioningTokenValidMetrics
Merge from Widevine repo of http://go/wvgerrit/42102

The unit test should use the real system id if it is using a real
oemcrypto.

test: ran unit tests on sailfish.
bug: 72718962

Change-Id: Ib58a47976f85b840c6f34d379b1c020e7e85d59a
2018-02-01 13:54:00 -08:00
TreeHugger Robot
eead89c86c Merge "Remove finalized concept from media.metrics" 2018-01-31 22:37:49 +00:00
Fred Gylys-Colwell
dfe6489ca2 Test Carmicahel RSA Keys
Merge from Widevine repo of http://go/wvgerrit/42064

This adds a unit test to verify that OEMCrypto can load a certificate
with an RSA private key generated using the Carmichael Totient.

bug: 67309725
test: No new failures. This code is part of unit tests only.

Change-Id: I492cf6bcff0ac2d1a838e7aa334c4b2b580ac5c7
2018-01-31 01:07:56 +00:00
Fred Gylys-Colwell
78f933d6ae Correct capitalization of OEMCrypto_LoadKeys_V13
Merge from Widevine repo of http://go/wvgerrit/42063

The dynamic adapter could not load old LoadKeys functions because the
spelling was wrong.

bug: 72646612
Change-Id: Ia6d917a17a95c48925496c5959ddb2bdff771241
2018-01-30 14:48:49 -08:00
Fred Gylys-Colwell
c45384bf00 Merge changes from topic "entitlement_license"
* changes:
  Fix some unit tests
  Add basic handling for entitlement keys in a license.
  Refactor key sessions to move them out of crypto session.
  Fix entitlement keys encryption and content key loading.
2018-01-30 20:17:32 +00:00
Fred Gylys-Colwell
8230484de2 Fix some unit tests
Merge from Widevine repo of http://go/wvgerrit/42020

This CL fixes the OEMCrypto unit tests for refresh license.

Test: ran unit tests

bug: 64851667
bug: 72497813
Change-Id: Ice1661fd832793358b725be9016d85465f6b8d14
2018-01-30 00:48:11 -08:00
Fred Gylys-Colwell
9ae7489938 Add basic handling for entitlement keys in a license.
Merge from Widevine repo of http://go/wvgerrit/41834

Key rotation is not yet supported.

The key statuses are updated from a license. The
mechanism expects content keys tro come in a license.
For entitlement licenses, the content keys come in the
init_data.

This code does not yet support the key rotation event.
(A new pssh with wrapped keys is a passed to the cdm)
The policy engine/key status mechanism needs to be
updated to handle updated from the init_data.

For now, the cdm builds a license with a key container
with the content keys and used that to call
PolicyEngine::SetLicense to setup the policy engine
and key statuses.

Bug: 64003606
Bug: 70334840

Test: In child CL
Change-Id: Ibf46a18f5321cab4ff6f1778ba30527942c8021f
2018-01-30 00:11:04 -08:00
Fred Gylys-Colwell
8251aab9f6 Refactor key sessions to move them out of crypto session.
Merge from Widevine repo of http://go/wvgerrit/41833

Bug: 64003606
Test: in child CL

Change-Id: I3e1d36d0b0944dce0fb1515257bc15243d76f397
2018-01-30 00:04:36 -08:00
Fred Gylys-Colwell
8de7caf788 Fix entitlement keys encryption and content key loading.
Merge from Widevine repo of http://go/wvgerrit/41831

Bug: 72418096 OEMCrypto14 entitlement keys failed decryption testing
Test: in child CL

Change-Id: Ie92c34edb6162fb1e4553c5364f478de189ab793
2018-01-30 00:03:29 -08:00
Ray Essick
69b839e86c Remove finalized concept from media.metrics
the 'finalized' concept didn't pan out -- remove references to it. Purged some
uses of generateSessionID().  Simplifies the code flow.

Bug: 71874686
Test: logcat/dumpsys
2018-01-29 12:08:34 -08:00
Rahul Frias
f6c12c465c Report analog output capabilities
[ Merge of http://go/wvgerrit/41840 ]

Bug: 69867619
Test: WV unit/integration tests
      Playback using netflix and play movies on Taimen

Change-Id: I49d0dd9ae12322eecc80efb8cb744419c85e8ae5
2018-01-28 23:44:33 -08:00
Adam Stone
795cf8a624 Revise a few metrics and add unit tests.
This is a merge of Widevine cl 39040.

A few of the metrics were not implemented, or implemented incorrectly in
O MR1. This cleans them up

Bug: 64001676

Test: Re-ran unit tests and added some additional tests. GPlay Movies check.

Change-Id: I1e8bcc36fecd76e72d853306075bc46d82f45161
2018-01-25 21:03:07 +00:00
Fred Gylys-Colwell
7bbe8e3bf1 Add Level3 changes for v14 adapters
Merge from Widevine repo of http://go/wvgerrit/41680

These changes change the signature of LoadKeys to LoadKeys_V13 for the
Level 3. This change will be reverted once we update Level 3 to v14.

level3/x86/libl3oemcrypto.cpp  Level3 Library 4464 Jan 23 2018 13:22:20
level3/arm/libl3oemcrypto.cpp  Level3 Library 4445 Jan 23 2018 12:12:32
level3/mips64/libl3oemcrypto.cpp Level3 Library 7285 Jan 23 2018 15:48:51
level3/arm64/libl3oemcrypto.cpp Level3 Library 7283 Jan 23 2018 12:47:26
level3/mips/libl3oemcrypto.cpp Level3 Library 4465 Jan 23 2018 15:13:13
level3/x86_64/libl3oemcrypto.cpp Level3 Library 7284 Jan 23 2018 13:50:10

test: Play Movies plays on sailfish.

Change-Id: Ia492463cd15178b12908faa24af7fbbcfef22e77
2018-01-24 21:54:35 -08:00
Fred Gylys-Colwell
d72f49e31a Update LoadTestKeybox
Merge from Widevine repo of http://go/wvgerrit/41662

This CL updates oemcrypto unit tests to use the new test keybox.

bug: 69552641 Update OEMCrypto_LoadTestKeybox

test: Unit tests compile and run -- many tests won't pass until merged
with vendor code

Change-Id: I73bdca3958b2c985d4c61801aa95807a2e6d4299
2018-01-24 21:54:34 -08:00
Fred Gylys-Colwell
19cb1792a4 OEMCrypto v14 Unit tests and reference code
Merge from Widevine repo of http://go/wvgerrit/41661

bug: 64001862 OEMCrypto V14 for Android P

test: Unit tests pass
Change-Id: I3314a881357c12ef63d7b257d83f6f0d07e4725a
2018-01-24 21:54:34 -08:00
Fred Gylys-Colwell
979ed70c7b Add Entitlement License to OEMCrypto
This CL adds entitlement license features and moves cipher mode from
LoadKeys to SelectKeys.

Merge from Widevine repo of http://go/wvgerrit/41660

bug: 70334840 Entitlement License - cdm layer
bug: 70334345 Entitlement License - reference code and unit tests

test: Entitlement license unit tests pass.
Change-Id: Ic7d7f42c15e6d83ef7fcfd8a866c778adc4c8095
2018-01-24 21:53:15 -08:00
Fred Gylys-Colwell
95fa4ffca9 OEMCrypto v14 adapter and plugin changes
Merge from Widevine repo of http://go/wvgerrit/41621

This updates the dynamic adapter and some plugins to work with the new
OEMCrypto v14 API.

bug: 70334345 Entitlement License - reference code and unit tests
bug: 34103646 Encryption Scheme Propagation
bug: 69552641 Update OEMCrypto_LoadTestKeybox
bug: 69867568 OEMCrypto - Report Analog

test: In child CL.
Change-Id: I51349d15b779d52d245bd234867bbd2bbe7b9ae7
2018-01-24 21:53:15 -08:00
Fred Gylys-Colwell
aff3e81a2c OEMCrypto v14 docs and headers
Merge from Widevine repo of http://go/wvgerrit/41641

test: In child CL.

bug: 64001862 OEMCrypto V14 for Android P
Change-Id: I707c4dc24aa534c92b099cd310b9afd09168d456
2018-01-24 21:53:15 -08:00
Fred Gylys-Colwell
df389c1417 Convert oemcrypto tests to BoringSSL
Merge from Widevine repo of http://go/wvgerrit/41620

bug: 62739406
test: unit tests
Change-Id: I72a64623912305965ff625a45041e2932a41f69b
2018-01-24 21:53:15 -08:00
Fred Gylys-Colwell
80a70c2dfb Quit test WithClientId early
Merge from Widevine repo of http://go/wvgerrit/41784

To avoid a seg fault, WithClientId will quit as soon as we find
usage_info is empty.

test: run unit tests (with no wifi to force failure)
bug: 72457799

Change-Id: I250538e750e14ed5780572a69360c8ec304e2554
2018-01-25 01:05:18 +00:00
Rahul Frias
e008a1e5d8 Merge "Allow use of cached initialization data" 2018-01-23 18:54:17 +00:00
Rahul Frias
fbd6d9c5d3 Merge "Update CDM version number for android Pi" 2018-01-23 17:15:13 +00:00
TreeHugger Robot
9876af2f96 Merge "Fix compile errors related to adding new MediaDrm methods" 2018-01-23 17:07:39 +00:00
Srujan Gaddam
c58a0c62fe Make OEMCrypto test error-order agnostic
Bug: b/72320670
Test: Verified by unit/integration tests on sailfish

Merge from Widevine master of http://go/wvgerrit/41240

Previously, OEMCertForbiddenPaddingScheme checks to see if the OEMCrypto
returns a short buffer error on GenerateRSASignature and then resizes it
accordingly if so. If the OEMCrypto does not return this error first
(and instead complains about the padding scheme), the assertion will
return false since the signature has size 1. This CL changes that so it
doesn't matter which error the OEMCrypto returns first.

Change-Id: I2fd3a3814ff3722fd40ae6a3bcbd65293c9baed7
2018-01-22 14:01:43 -08:00
Rahul Frias
0fc6e5a9b3 Update CDM version number for android Pi
[ Merge of http://go/wvgerrit/41360 ]

Bug: 72239183
Test: wv unit/integration tests on taimen.
Change-Id: I7b093fbef6493e336e04f2b4eb162d5333636692
2018-01-21 11:47:40 -08:00
Rahul Frias
bd45d4f0fa Allow use of cached initialization data
[ Merge of http://go/wvgerrit/41340 ]

An initial license request may actually result in a service certificate
request. Once the service certificate has been successfully handled,
an app may make a license request without needing to provide
the initialization data again. This behavior was broken in a recent
merge. Correcting the test as well.

b/72182032
Test: Ran wv unit/integration tests

Change-Id: I82401b9a3bf38140706dad859b4ae241b7ddac12
2018-01-19 17:10:33 -08:00
Fred Gylys-Colwell
f8d114ad11 Merge "Don't try to open non-existant file" 2018-01-19 19:33:06 +00:00
Jeff Tinker
87d58f85c1 Fix compile errors related to adding new MediaDrm methods
bug:64001680
bug:33657579
Change-Id: I67cabf96b03c2217df6772fed18ce2cab3d9f625
2018-01-18 23:47:53 -08:00
Rahul Frias
07ce4f5a55 Address x86 OEMCrypto compilation failures
b/71650075
Test: Verified by wv unit/integration tests on taimen, compilation on
      aosp_x86, sdk_gphone_x86

Change-Id: I62c132f1a904e613ce5ea2734822f2d9580d22ef
2018-01-18 14:41:41 -08:00
Fred Gylys-Colwell
4c7e6ca78b Don't try to open non-existant file
Merge from Widevine repo of http://go/wvgerrit/40883

The oemcrypto dynamic adapter will try to load a keybox from the
filesystem if oemcrypto reports it doesn't have one.  Previously, it
would check the size of the file, and then open the file before
responding to errors.  Opening a non-existant file would result in a
segfault.

With this CL, we do not try to open the file if the size is not
positive.

Test: unit tests
Bug: 72129404
Change-Id: I243b5d49837455c0ce07802e32e4d7e809286cfd
2018-01-17 19:24:31 -08:00
Rahul Frias
674a748f39 Compilation errors on taimen
This adds an include path to system core properties.h to
OEMCrypto L3 makefiles.

Bug: 72004865
Test: Verified by unit/integration tests on taimen.
      Verified playback using Play Movies (streaming/offline)
            and Netflix.

Change-Id: I73c21f2751b34b6b58d92ed5177951a6397b5bf7
2018-01-17 00:11:18 -08:00