Commit Graph

3455 Commits

Author SHA1 Message Date
Alex Dale
906dc12c5d Formatted WV utils/include files.
[ Merge of http://go/wvgerrit/80943 ]

Ran `git clang-format` on files in utils/include.
Used the new .clang-format config.

Bug: 134365840
Test: WV unit tests
Change-Id: Ifc0950236ecd610792e9add11ac07c63485f3f0c
2019-06-27 13:42:10 -07:00
John W. Bruce
435f839f7e Support CE CDM in OEMCrypto Testbed
(This is a merge of http://go/wvgerrit/81628. Although it is primarily
to support a CE CDM feature, this patch touched shared code and so must
be merged.)

The problem that has long stopped the OEMCrypto Testbed from working
with the CE CDM build is that the OEMCrypto Testbed sometimes accesses
the storage via the normal filesystem APIs rather than the FileSystem
abstraction. Furthermore, when doing this, it assumes that FileSystem
abstraction is just a wrapper around direct filesystem access and thus
it should use the same paths in both kinds of filesystem access.
However, this is not true on the CE CDM where FileSystem wraps an opaque
key/value store.

This patch adds a property that allows a platform to indicate if its
FileSystem base path represents a real file system path and sets it
appropriately. ("true" for all platforms except CE CDM) It also adds
code to the OEMCrypto Testbed that makes use of this property to modify
its behavior. When running on a device where the FileSystem base path is
not a real file system path, it will instead use the directory of the
current executable as its base path when accessing the filesystem
directly.

Bug: 129311942
Test: CE CDM Build with Fake L1
Test: Android Build
Change-Id: Iadb3cc57d3bbc8ce0d49224b7df31c46bd5ea56c
2019-06-24 11:52:23 -07:00
Alex Dale
cbc1fba713 Log cleanup and reformatting for core/ (part 1)
Merge from Widevine repo of http://go/wvgerrit/81265

Types of cleanup:
  - Removed function / class prefixes from the logs.
  - Fixed log string format options to match the types passed
  - Added static_cast conversion on enumerations
  - _Tried_ to make the log format more consistent (open to feedback)
  - Corrected small spelling mistakes

This set of changes is very large, splitting change across several
submissions.  This change:
  - core/src/buffer_reader.cpp
  - core/src/cdm_engine.cpp
  - core/src/cdm_session.cpp

Test: WV linux unittests
Bug: 134460638
Change-Id: I16c3297b8e94a99c2b8650b129d0f9e8d96b177f
2019-06-21 17:23:58 -07:00
Fred Gylys-Colwell
8223d0e8b7 Clean OEMCrypto unit tests
Merge from Widevine repo of http://go/wvgerrit/79243
Modify failures for LoadKeyWithSuspiciousIV and SelectKeyNotThereAPI15
This turns on some unit tests that were disabled for Q release.

Merge from Widevine repo of http://go/wvgerrit/77948
Mod Mock: Dump entitlement keys - this allows some logging when
running in a test environment.

Merge from Widevine repo of http://go/wvgerrit/75763
Refactor OEMCrypto Decrypt Tests

This CL refactors the oemcyrpto decryption tests.  A bunch of boiler
plate code was moved to a common test setup.  Also, buffer handling
was streamlined so that it will be easier to use these test with
secure output buffers.

Bug: 131281966
Bug: 129432708
Test: unit tests
Change-Id: Iebf62611a16e0a4def9c4daed1c6cdf12686ba74
2019-06-20 23:07:02 +00:00
Rahul Frias
6004c2a945 Ref count WvCdmDecryptionModule in cdm_extended_duration_tests
[ Merge of http://go/wvgerrit/79884 ]

WvCdmDecryptionModule needs to be refcounted since it inherits
from RefBase. The test code instantiates it as a member variable.

Bug: 133188706
Test: WV unit/integration tests
Change-Id: I8ae3d92ae148677ea9a8290a6c0553c1a43e3454
2019-06-19 11:02:28 -07:00
Alex Dale
96c36fa25e Merge "Replace typedef with using statement in cdm/core/ files." 2019-06-10 15:44:00 +00:00
Alex Dale
ce0ea7b20b Replace typedef with using statement in cdm/core/ files.
[ Merge of http://go/wvgerrit/80805 ]

This change was used only where `typedef` was used for type aliasing,
and not for defining a new type (such as enums, structs, or function
pointer types).

Clang-format was used on the changed files.

Test: WV unit tests
Bug: 134437705
Change-Id: I730b9709a5ac773b3036daa79024caab665b3daa
2019-06-07 11:17:45 -07:00
Srujan Gaddam
6d196d8496 Change prov retry test to use prov models
Bug: b/133641240
Tests: ProvisioningInterspersedRetryTest L3 & modmock
Merge of http://go/wvgerrit/80164

The ProvisioningInterspersedRetryTest tests that the response tied to
the provisioning request before the latest fails to be handled. This is
only true for provisioning 2.0 where we use derived keys. In
provisioning 3.0, the number of requests allowed to be handled is tied
to the number of nonces, which from OEMCrypto v15.2 onwards, is exactly
4. This CL modifies the test to handle that behavior.

Change-Id: I9f4e555acab145487d6e409779afe7b9b63fd4af
2019-06-07 09:43:15 -07:00
Srujan Gaddam
dcf3f21289 Add query to CDM to get provisioning model
Bug: b/133855570
Tests: Android tests/CE CDM tests/Linux tests
Merge of http://go/wvgerrit/80163

Adds a query option to QueryStatus to get the provisioning model of the
OEMCrypto.

Change-Id: I1896984be6294a5ada9a97b63e6d9080297e92b0
2019-06-07 09:40:59 -07:00
Rahul Frias
a178eed57d Reformat wv core/src files
[ Merge of http://go/wvgerrit/80484 ]

Clang-format has been run on files in core/src. clang-format has been turned
off for some blocks but otherwise no other changes have been made.

Bug: 134365840
Test: WV unit/integration tests
Change-Id: I6e509f25136f84d37de3d920084302f0f2c23dc4
2019-06-04 11:26:18 -07:00
Rahul Frias
47c2068d6a Reformat wv core/include files
[ Merge of http://go/wvgerrit/80483 ]

Clang-format has been run on files in core/include

Bug: 134365840
Test: WV unit/integration tests
Change-Id: I890127f23f30f0e63f826d3638521b4cc12fb995
2019-06-03 13:53:31 -07:00
John Bruce
01fbaac6ad Merge "Take a Global Write Lock Before Calling OEMCrypto_GenerateNonce()" 2019-06-03 17:35:11 +00:00
Rahul Frias
d8f86965e3 [automerger skipped] Merge "Merge "Address request license test failures [ DO NOT MERGE ]" into qt-dev am: 367befa3b7 am: ba5a1aac05" into qt-r1-dev-plus-aosp
am: b280f8c717 -s ours
am skip reason: subject contains skip directive

Change-Id: I93125b792cabe4dfbca9a122ffc0da48ce5d2dd1
2019-06-01 18:20:46 -07:00
Rahul Frias
15f5c99494 [automerger skipped] Merge "Address request license test failures [ DO NOT MERGE ]" into qt-dev am: 367befa3b7 am: 3a92c08fa2
am: 1a7a1b8df8 -s ours
am skip reason: subject contains skip directive

Change-Id: I8d6d4c23e5dff6b3b8871a5f069da0c688aa6369
2019-06-01 18:20:32 -07:00
Rahul Frias
78ac369748 [automerger skipped] Merge "Address request license test failures [ DO NOT MERGE ] am: b7c6f9b52c am: 11bc2924ab" into qt-r1-dev-plus-aosp
am: a998158cd2 -s ours
am skip reason: subject contains skip directive

Change-Id: I65ee3aceeadf2b1f3cb1af09ca5e2efa79c6ecf1
2019-06-01 18:20:15 -07:00
Rahul Frias
e5f7001bff [automerger skipped] Address request license test failures [ DO NOT MERGE ] am: b7c6f9b52c am: 1d05cf8e0d
am: 74d7819374 -s ours
am skip reason: subject contains skip directive

Change-Id: I1a61159696d649f90e2775a6669ca7aadb6a8033
2019-06-01 18:19:57 -07:00
Android Build Merger (Role)
b280f8c717 Merge "Merge "Address request license test failures [ DO NOT MERGE ]" into qt-dev am: 367befa3b7 am: ba5a1aac05" into qt-r1-dev-plus-aosp 2019-06-02 01:14:16 +00:00
Rahul Frias
33b056663b Merge "Address request license test failures [ DO NOT MERGE ]" into qt-dev am: 367befa3b7
am: ba5a1aac05

Change-Id: I3502e69a3afa5f47354a1537dbacb5787607d2d1
2019-06-01 18:14:02 -07:00
Rahul Frias
1a7a1b8df8 Merge "Address request license test failures [ DO NOT MERGE ]" into qt-dev am: 367befa3b7
am: 3a92c08fa2

Change-Id: I58109d2c39b28f98e643dc5c35096ca93c363292
2019-06-01 18:14:00 -07:00
Android Build Merger (Role)
a998158cd2 Merge "Address request license test failures [ DO NOT MERGE ] am: b7c6f9b52c am: 11bc2924ab" into qt-r1-dev-plus-aosp 2019-06-02 01:13:56 +00:00
Rahul Frias
74d7819374 Address request license test failures [ DO NOT MERGE ] am: b7c6f9b52c
am: 1d05cf8e0d

Change-Id: Ia534ee9e981f2d6ea4acb23a41e433baed071c8f
2019-06-01 18:13:45 -07:00
Rahul Frias
d91d17e538 Address request license test failures [ DO NOT MERGE ] am: b7c6f9b52c
am: 11bc2924ab

Change-Id: Id2d0f8e4e394b1a8fbe602258a410647f491431b
2019-06-01 18:13:45 -07:00
Rahul Frias
3a92c08fa2 Merge "Address request license test failures [ DO NOT MERGE ]" into qt-dev
am: 367befa3b7

Change-Id: I9b249c267aaaeb0272e1952415f85b00f68532cc
2019-06-01 17:56:56 -07:00
Rahul Frias
ba5a1aac05 Merge "Address request license test failures [ DO NOT MERGE ]" into qt-dev
am: 367befa3b7

Change-Id: Ie2171e229bcf73a2672377f43d4d0f4c5ca7bb59
2019-06-01 17:56:56 -07:00
Rahul Frias
1d05cf8e0d Address request license test failures [ DO NOT MERGE ]
am: b7c6f9b52c

Change-Id: Id3616ea5bae789c2cdb2135cfdb92495c69536e0
2019-06-01 17:56:55 -07:00
Rahul Frias
11bc2924ab Address request license test failures [ DO NOT MERGE ]
am: b7c6f9b52c

Change-Id: Ica7bf215979ae75b5ebdec4ba881ac6cba13a9bd
2019-06-01 17:56:55 -07:00
Rahul Frias
367befa3b7 Merge "Address request license test failures [ DO NOT MERGE ]" into qt-dev 2019-06-02 00:44:31 +00:00
John W. Bruce
1d5b7cc8fe Take a Global Write Lock Before Calling OEMCrypto_GenerateNonce()
(This is a merge of http://go/wvgerrit/77803)

In OEMCrypto 15.2, OEMCrypto_GenerateNonce() is a Session Initialization
Function, which means the global OEMCrypto lock must be held before
calling it. There's no harm updating our code to behave this way now,
even before OEMCrypto 15.2 implementations are ready, since it's a
stricter guarantee than the current behavior.

Bug: 131327826
Test: CE CDM Unit Tests
Test: Android Unit Tests
Change-Id: Icb6a86dea7298c99596fa9e3d90cec721ebcb8a6
2019-05-31 19:02:29 -07:00
Rahul Frias
643c574775 Merge "Return key request type none after key rotation" into qt-dev am: 999a466275 am: 4c5cba3597
am: d65500fe7f

Change-Id: Id153ac8c57873ccdc60fe76e6ade470c289a2a11
2019-05-31 09:59:15 -07:00
Rahul Frias
6c9c4697f0 Merge "Return key request type none after key rotation" into qt-dev am: 999a466275 am: 4690da2bcb
am: 4c9a3a6f02

Change-Id: Iddcac699401f64d920fcb8ff73053410019ec028
2019-05-31 09:55:31 -07:00
Rahul Frias
d65500fe7f Merge "Return key request type none after key rotation" into qt-dev am: 999a466275
am: 4c5cba3597

Change-Id: I0d5a4042154e42e40595fdb3b1d17448e56c3e52
2019-05-31 09:38:25 -07:00
Rahul Frias
4c9a3a6f02 Merge "Return key request type none after key rotation" into qt-dev am: 999a466275
am: 4690da2bcb

Change-Id: I45387edbb83f05dcadec53e4514cb97c68eae6c7
2019-05-31 09:33:36 -07:00
Rahul Frias
4c5cba3597 Merge "Return key request type none after key rotation" into qt-dev
am: 999a466275

Change-Id: Ic1546795d145988181e2a8eb6663a0b906b2617d
2019-05-31 09:17:27 -07:00
Rahul Frias
4690da2bcb Merge "Return key request type none after key rotation" into qt-dev
am: 999a466275

Change-Id: Ia0a19cf34deac3714ae35ff698dffce4d00ef616
2019-05-31 09:16:52 -07:00
Rahul Frias
999a466275 Merge "Return key request type none after key rotation" into qt-dev 2019-05-31 15:55:05 +00:00
Rahul Frias
ecf8a96970 Merge "Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev am: e4d432806a am: bb4ffe8bdb" into qt-r1-dev-plus-aosp
am: 22c06c5773

Change-Id: I925c6255010718e586410d50493b071326aaf005
2019-05-29 19:31:15 -07:00
Rahul Frias
b271da5139 Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev am: e4d432806a am: 785cd12f3c
am: 09e2b6dfa6

Change-Id: I5b1757fee7311a2d34ea5299ec900421dc160634
2019-05-29 19:30:56 -07:00
Android Build Merger (Role)
22c06c5773 Merge "Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev am: e4d432806a am: bb4ffe8bdb" into qt-r1-dev-plus-aosp 2019-05-30 02:24:43 +00:00
Rahul Frias
09e2b6dfa6 Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev am: e4d432806a
am: 785cd12f3c

Change-Id: Ic2853252157390f93d2c6cc9406361feb7696d99
2019-05-29 19:24:33 -07:00
Rahul Frias
fa5aa2f616 Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev am: e4d432806a
am: bb4ffe8bdb

Change-Id: Idabc26501d3cbe249bff63bb1123163e20022027
2019-05-29 19:24:32 -07:00
Rahul Frias
bb4ffe8bdb Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev
am: e4d432806a

Change-Id: I8a14eb075baba43f330e683c2acd021a304662de
2019-05-29 19:19:33 -07:00
Rahul Frias
785cd12f3c Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev
am: e4d432806a

Change-Id: Ic326baeba34037e4c34e3c06717fc5fd901e01f1
2019-05-29 19:19:33 -07:00
Rahul Frias
e4d432806a Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev 2019-05-30 02:06:42 +00:00
Rahul Frias
b7c6f9b52c Address request license test failures [ DO NOT MERGE ]
[ Merge of http://go/wvgerrit/79883 ]

This corrects test code and undoes CE CDM changes in b/113167010 which
will be resolved in a future release.

The tests failures addressed are
* ProvisioningTestWithServiceCertificate
* ReleaseRetryOfflineKeyTest
* ReleaseRetryL3OfflineKeyTest
* ReleaseRetryL3OfflineKeySessionUsageDisable

ProvisioningInterspersedRetryTest has been disabled and will be
addressed in a post 15.2 OEMCrypto release in 133641240

Bug: 119428680
Test: WV unit/integration tests
Change-Id: I7961b4556a0ac749e4f38d43f1bea8f520d67f20
2019-05-29 19:04:52 -07:00
Rahul Frias
3c9175fec5 Return key request type none after key rotation
[ Merge of http://go/wvgerrit/80084 ]

Corrected the key type being returned after entitled keys from
init data are loaded. Made test changes to validate.

Bug: 133903028
Test: WV unit/integration tests
Change-Id: Icb44587f5c3aba3b0facae6d83dc9344d6b60833
2019-05-29 19:03:43 -07:00
Srujan Gaddam
1479632fa7 Merge "Change move_widevine_data.sh to move L3 files" into qt-dev am: f246f028b2 am: 5f5cc2b634
am: 670804fb8b

Change-Id: I72e1c3e113b6470711ae99b0cfa928f2c1b53387
2019-05-25 11:15:00 -07:00
Srujan Gaddam
1423b9261f Merge "Change move_widevine_data.sh to move L3 files" into qt-dev am: f246f028b2 am: c9ba0981ba
am: b4396d0e6e

Change-Id: I2549d67295dc4bb9599a951ea6ed9d8f99048d67
2019-05-25 10:58:02 -07:00
Srujan Gaddam
18e3cf144a Reverse LD_LIBRARY_PATH order based on liboemcrypto.so am: 45d02c545c am: 4f63000ad7
am: e7ed590fe2

Change-Id: Iee0fcdd19542b0068707928530131c686ac57859
2019-05-25 10:40:17 -07:00
Srujan Gaddam
670804fb8b Merge "Change move_widevine_data.sh to move L3 files" into qt-dev am: f246f028b2
am: 5f5cc2b634

Change-Id: Ib88a498287b245c059d1a89f0b9823705ce0bcb9
2019-05-25 10:35:07 -07:00
Srujan Gaddam
28696a2125 Reverse LD_LIBRARY_PATH order based on liboemcrypto.so am: 45d02c545c am: 61510bbc8a
am: 971aa7d2d4

Change-Id: I96e5f4358ef37ec1dce634b021fd64f24ed7a77e
2019-05-25 10:34:07 -07:00