Commit Graph

2765 Commits

Author SHA1 Message Date
Fred Gylys-Colwell
b83fe36a09 Merge "Document Version Compatibility" into pi-dev
am: 67c140641e

Change-Id: Ic25046c30a641f4b21832b1f425b9ce813197184
2018-05-24 18:06:29 -07:00
John W. Bruce
f3b5d0408b Make Defensive Copies in CopyBufferInChunks
am: b305d99d3b

Change-Id: I6657bd3174202f061a003f0e8132075b807af2e9
2018-05-24 17:04:27 -07:00
TreeHugger Robot
67c140641e Merge "Document Version Compatibility" into pi-dev 2018-05-24 20:58:54 +00:00
Fred Gylys-Colwell
4192c3d04c Document Version Compatibility
Merge from Widevine repo of http://go/wvgerrit/49580

This document explains which version of OEMCrypto is compatible with
which version of CE CDM or Android.  The intent is to share this on
all Widevine partner repos.

bug: 77637828
Change-Id: Id7db8f9cb5f2a5c6bf35dfecd2ae3b3fabd09c56
testing: documentation only
2018-05-24 17:20:22 +00:00
Fred Gylys-Colwell
d3638335ec Update Android Integration Guide
Merge from Widevine repo of http://go/wvgerrit/51081

Clarifies the Level 3 OEMCrypto library, talks about build files, and data
migration.

test: documentation only
bug: 74242000
Change-Id: Id1c9f9cb44f0b3e5bc084458b1d934b9fea18ac8
2018-05-24 17:20:07 +00:00
Fred Gylys-Colwell
13e08cd7b8 Update Docs for OEMCrypto v14.1
Some documentation updates.

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

bug: 79940606 OEMCrypto_PST_Report are network byte order
bug: 79874942 [Documentation] PST_Report struct layout differs from documentation
bug: 74010869 CGMS Best Effort

test: documentation change only
Change-Id: I1e9149efcfa5d91c503b74e6776ebb8f25cda15c
2018-05-24 17:19:54 +00:00
John W. Bruce
b305d99d3b Make Defensive Copies in CopyBufferInChunks
(This is a merge of http://go/wvgerrit/51084)

Nominally, OEMCrypto probably shouldn't modify the buffer descriptor we
pass into OEMCrypto_DecryptCENC(), but in practice, we know some
platforms do this, so we make defensive copies in
CryptoSession::DecryptInChunks() just in case. Turns out, some devices
also behave like this in OEMCrypto_CopyBuffer(), so we should also be
doing defensive copies in CryptoSession::CopyBufferInChunks().

Bug: 79779554
Test: ExoPlayer Demo App, played "Secure Subsample UHD (WebM, VP9)"
Test: build_and_run_all_unit_tests.sh
Change-Id: Ib46043a6cc0aa42d1d1cc85f5adb477c566363e9
2018-05-23 18:04:01 -07:00
Fred Gylys-Colwell
0ed9c3150a Fix entry count in TwoHundredEntries am: b396f9a870
am: 7132c09585

Change-Id: Iab80e32b17311344b930ad1bfc8785dc4647eaf2
2018-05-17 14:08:25 -07:00
Fred Gylys-Colwell
7132c09585 Fix entry count in TwoHundredEntries
am: b396f9a870

Change-Id: Ib137096153be59111461e78886764d407ebbe352
2018-05-17 13:47:13 -07:00
Fred Gylys-Colwell
b396f9a870 Fix entry count in TwoHundredEntries
Merge from Widevine repo of http://go/wvgerrit/50600

The entry count was really 201 -- it should be 200.

test: This code is unit tests only -- no production code.
bug: 79875327
Change-Id: Ib81253ce9d51a7157ea0a64cddeb6cc266b3e25e
2018-05-16 15:08:35 -07:00
Rahul Frias
f9f46408c5 Merge changes I30a3ede3,I6008ddba,I869c22a2 into pi-dev am: d615d66cca
am: b9c3a6b81a

Change-Id: I1088358f88836dbd77543a532ef45bb907ed51a6
2018-05-15 17:23:34 -07:00
Fred Gylys-Colwell
01b7c91992 Unit test for kInactiveUnused usage reports am: bd6bbce86f
am: f3d8e21bff

Change-Id: Ib48a323581ce121e3c502d6379b58d3afcc59b4c
2018-05-15 17:17:38 -07:00
Rahul Frias
b9c3a6b81a Merge changes I30a3ede3,I6008ddba,I869c22a2 into pi-dev
am: d615d66cca

Change-Id: I0d991231a7a4b15d1f8f822e6f9ad136b7135a31
2018-05-15 17:04:35 -07:00
Rahul Frias
d615d66cca Merge changes I30a3ede3,I6008ddba,I869c22a2 into pi-dev
* changes:
  Protect sessions from concurrent access.
  Address concurrency failures between calls to decrypt and periodic timer
  Revert of "Prevent race conditions between decrypt and close session"
2018-05-15 23:21:04 +00:00
Fred Gylys-Colwell
f3d8e21bff Unit test for kInactiveUnused usage reports
am: bd6bbce86f

Change-Id: Ib669b04260a7298b4e223e7873e1603123e14125
2018-05-15 15:45:23 -07:00
Fred Gylys-Colwell
bd6bbce86f Unit test for kInactiveUnused usage reports
Merge from Widevine repo of http://go/wvgerrit/50422

This CL adds unit tests to verify that a usage report can have the status
kInactiveUnused.

bug: 79556142
test: unit test code only
Change-Id: I10f71ac2e585ef33727aa8f80d867d80fe156ab8
2018-05-15 13:23:30 -07:00
Rahul Frias
e8c3a4afac Protect sessions from concurrent access.
Locks in earlier releases controlled access to sessions and the list
of sessions for each CdmEngine instance. This guarded against
concurrent access between session management (OpenSession,
CloseSession, etc), periodic timer calls and calls to Decrypt.

The list of sessions and locking was moved to a separate class
CdmSessionMap. This left open the possibility that a session
might be destructed, while being called to decrypt or invoked through the
timer. An attempt was made to add per-session locks in b/73781703
but this was found insufficient.

Per-session locks will be introduced in a future changelist, but for
now the coarser locks will be reintroduced.

Bug: 73781703
Bug: 79158083
Bug: 79262108
Bug: 79436509

Test: WV unit/integration tests, GTS GtsMediaTestCases tests and
      24 hours of continuous Netflix playback.

Change-Id: I30a3ede340192370dfe5c92c01b1c76df16b7123
2018-05-15 11:51:17 -07:00
Rahul Frias
dcab2b1355 Address concurrency failures between calls to decrypt and periodic timer
[ http://go/wvgerrit/50341 ]

The shared_ptr implementation was taken from a google3 implementation.
Updates to the reference counter needed to be atomic and were
platform dependent in the original code. These were not carried
over to this codebase. Race conditions between calls to decrypt and
the periodic timer, led to incorrect reference count values.
CdmSession objects were then destructed while references to
them still existed. Segfaults occurred when they were referenced.

Bug: 79431096

Test: WV unit/integration tests, GTS GtsMediaTestCases tests and
      24 hours of continuous Netflix playback.

Change-Id: I6008ddba869efcc58972e5ea8644a204f91410ab
2018-05-14 16:38:38 -07:00
Rahul Frias
0163607fa3 Revert of "Prevent race conditions between decrypt and close session"
[ Original CL http://ag/3890635,
  Merge of http://go/wvgerrit/50340 ]

The original fix was not sufficient to address all race conditions.
A subsequent CL will address them.

Bug: 73781703
Bug: 79158083
Bug: 79262108
Test: WV unit/integration tests, GTS GtsMediaTestCases tests and
      24 hours of continuous Netflix playback.

Change-Id: I869c22a250e2467b3d49935815e4157dc012fff5
2018-05-14 15:45:54 -07:00
Rahul Frias
0747894a52 Merge "Address Cdm Extended Duration Test failures" into pi-dev am: aa536ec97f
am: 410f28186b

Change-Id: Iab78f1b96044629b73ee71278707dd4e5097fcab
2018-05-14 15:43:49 -07:00
Rahul Frias
410f28186b Merge "Address Cdm Extended Duration Test failures" into pi-dev
am: aa536ec97f

Change-Id: Iafc7887aa52174cd21d4fa7d4e80e24dd8211a21
2018-05-14 15:39:22 -07:00
Rahul Frias
aa536ec97f Merge "Address Cdm Extended Duration Test failures" into pi-dev 2018-05-14 22:30:40 +00:00
Rahul Frias
184e0d0559 Address Cdm Extended Duration Test failures
[ Merge of http://go/wvgerrit/49980 ]

This CL
* corrects some of the test expectations
* switches test content used to test streaming with provider session tokens.
  The policy of the earlier test content had changed.
* adds some more information to log messages

Bug: 63819720
Test: WV unit, integration tests, WvCdmExtendedDuraionTest,
      GtsMediaDrmTest

Change-Id: I8fdbc9c38d6018cc6e884e1b95b2e9d26e7aa536
2018-05-11 14:27:45 -07:00
Adam Stone
5c5ccc0f83 Merge "Fix API support for Widevine vendor metrics" into pi-dev am: a6ad2933fb
am: de1fca26e1

Change-Id: I18638b138f9719f7030c4ef0bce3d951049f3792
2018-05-10 10:23:15 -07:00
Adam Stone
de1fca26e1 Merge "Fix API support for Widevine vendor metrics" into pi-dev
am: a6ad2933fb

Change-Id: I24e081e92e57a216e7ccd568b73025ec9fbf5891
2018-05-10 10:12:26 -07:00
Adam Stone
a6ad2933fb Merge "Fix API support for Widevine vendor metrics" into pi-dev 2018-05-10 17:00:24 +00:00
Rahul Frias
4a72ac6afa Merge "Close CDM sessions only if opened" into pi-dev am: aa183af75b
am: 1a84f8eac9

Change-Id: Icb92dd93b0864631ee89f0856b2cf7f4ddac1336
2018-05-09 15:35:13 -07:00
Adam Stone
e7edb5d2e2 Fix API support for Widevine vendor metrics
This fixes Widevine's getMetrics call so that it will return vendor
metrics through the Drm plugin 1.1 interface.

Bug: 73724453
Test: New and existing unit tests. Updated and existing GTS. Google Play manual.

Change-Id: Ie35128dc80bd6eabf9e1f3b9c1800256af77bc51
2018-05-09 15:31:34 -07:00
Fred Gylys-Colwell
87689ed4d4 Merge "Use 128 bit AES for key control block" into pi-dev am: f29901e310
am: baa3ba92fb

Change-Id: Id2c7de8a36cec82e47be7c3a4f2147e2ffde4533
2018-05-09 15:30:43 -07:00
Rahul Frias
1a84f8eac9 Merge "Close CDM sessions only if opened" into pi-dev
am: aa183af75b

Change-Id: I1d89fe1f4d03e77534fb4cc9fb7b7d65ec38165c
2018-05-09 15:13:38 -07:00
Fred Gylys-Colwell
baa3ba92fb Merge "Use 128 bit AES for key control block" into pi-dev
am: f29901e310

Change-Id: Ic670f17249e8c601a1018c72437bbb7687c91558
2018-05-09 15:13:22 -07:00
Fred Gylys-Colwell
717f608e66 Add unit test for nonce sharing am: a313985174
am: 4440ad4d68

Change-Id: I44f6fd199542b8f311470dc9e66326d1da435651
2018-05-09 15:00:00 -07:00
Rahul Frias
aa183af75b Merge "Close CDM sessions only if opened" into pi-dev 2018-05-09 21:59:29 +00:00
TreeHugger Robot
f29901e310 Merge "Use 128 bit AES for key control block" into pi-dev 2018-05-09 21:57:29 +00:00
Fred Gylys-Colwell
4440ad4d68 Add unit test for nonce sharing
am: a313985174

Change-Id: I03b71ed4684555ea20059bbc90ea89cc6c54e8c7
2018-05-09 14:49:43 -07:00
Fred Gylys-Colwell
a313985174 Add unit test for nonce sharing
Merge from Widevine repo of http://go/wvgerrit/49302

This CL adds some unit tests to verify that several OEMCrypto sessions
do not share nonce tables.

bug: 64850992
test: unit tests run on sailfish, taimen, and walleye.
Change-Id: I06cf3fdafb84f8b09cf2f0e58c1866bac511a293
2018-05-08 14:30:37 -07:00
Fred Gylys-Colwell
98532d313b Use 128 bit AES for key control block
Merge from Widevine repo of http://go/wvgerrit/49805

This aligns the oemcrypto reference code and unit tests to match the
API design doc: http://go/oemcrypto

bug: 79375509
test: unit tests pass
Change-Id: I13761a7384a17e99d88e61aaf80b4a22941fd172
2018-05-08 14:01:45 -07:00
Rahul Frias
9c95aba4f5 Close CDM sessions only if opened
[ Merge of http://go/wvgerrit/49822 ]

This avoids logging an unnecessary error, when the session is not found.

Bug: 79210873
Test: Wv unit/integration test, GtsMediaDrmTest, playback with Play
      Movies and Netflix.

Change-Id: Ifef99d1380d763670ad0fa89c885fb5fd41567e2
2018-05-08 00:30:46 -07:00
Rahul Frias
cca2dc9cff Avoid race conditions between periodic timer and close sessions am: 5b169b1722
am: 934e0aeff8

Change-Id: I99d34d1038eca0ea567b985f65104b65f0fbce8e
2018-05-04 09:25:46 -07:00
Rahul Frias
934e0aeff8 Avoid race conditions between periodic timer and close sessions
am: 5b169b1722

Change-Id: Ibd7d1f58e4ba17dd29baee1a788193ffd17aa7c6
2018-05-04 09:19:43 -07:00
Rahul Frias
5b169b1722 Avoid race conditions between periodic timer and close sessions
[ Merge of http://go/wvgerrit/49402 ]

Bug: 78912546
Test: WV unit/integration tests, GtsMediaTestCases, Aupt tests
Change-Id: Ic2016e8b557cd2dd45d5d3bbaa28be16e58dab8b
2018-05-02 23:56:17 -07:00
Rahul Frias
377279169c Merge "Allow a service certificate to be specified for provisioning" into pi-dev am: 734b6b819e
am: bd52f22081

Change-Id: Ibcc3857f7588d658d8d1f18b2eb7a31d9714d721
2018-05-02 17:06:28 -07:00
Rahul Frias
bd52f22081 Merge "Allow a service certificate to be specified for provisioning" into pi-dev
am: 734b6b819e

Change-Id: I4c76246a836901ea6d7fa73fa8292a8ab8bfb7fc
2018-05-02 15:04:56 -07:00
Rahul Frias
734b6b819e Merge "Allow a service certificate to be specified for provisioning" into pi-dev 2018-05-02 21:51:54 +00:00
android-build-team Robot
1e5d40a74c Merge "Share Widevine DRM Device Provisioning Models doc" into pi-dev am: 81ce8b4601
am: af5e1bdce7

Change-Id: I8c669f10880c839cfb9b51546809ed548719ce25
2018-04-27 16:47:14 -07:00
android-build-team Robot
af5e1bdce7 Merge "Share Widevine DRM Device Provisioning Models doc" into pi-dev
am: 81ce8b4601

Change-Id: I9cb81adf8acc5261ea0b5f48a2cd253635457d42
2018-04-27 16:42:39 -07:00
android-build-team Robot
81ce8b4601 Merge "Share Widevine DRM Device Provisioning Models doc" into pi-dev 2018-04-27 23:38:05 +00:00
Fred Gylys-Colwell
530c77bffb Share Widevine DRM Device Provisioning Models doc
Merge from Widevine repo of http://go/wvgerrit/47760

This CL adds a pdf of the document Widevine DRM Device Provisioning
Models, which explains the difference between Provisioning 2.0 and
3.0.

bug: http://b/74242000 Update Integration Guide
test: documentation only.
Change-Id: I64026ab4e93931adaa168d99939ee71d760e5862
2018-04-27 13:30:22 -07:00
Rahul Frias
668f387ff6 Save usage information before closing a session am: 9ba6493e1b
am: 86a1b18c24

Change-Id: I021e8792da5051f3a7cde08a7af33409e2c81194
2018-04-26 17:13:03 -07:00
Rahul Frias
86a1b18c24 Save usage information before closing a session
am: 9ba6493e1b

Change-Id: If189b6bb2edc6e8b10f2274775cb8caaff89a412
2018-04-26 16:56:34 -07:00