Commit Graph

1111 Commits

Author SHA1 Message Date
Robert Sloan
02fb7421b9 Remove BoringSSL static targets in widevine.
Test: WidevineDashPolicyTests, MediaDrmTest, WidevineFailureTests, WidevineGenericOpsTests, WidevineH264PlaybackTests, WidevineHLSPlaybackTests, WidevineVP9WebMPlaybackTests, WidevineCodecStressTests

I saw (probably unrelated) in
com.google.android.media.gts.WidevineHEVCPlaybackTests#testL1WithUHD30
com.google.android.media.gts.WidevineH264PlaybackTests#testL1WithUHD30
com.google.android.media.gts.WidevineVP9WebMPlaybackTests#testVP9WebMCencSubSampleL1With240P30fps
com.google.android.media.gts.WidevineCodecStressTests#testVideoSecureH264
com.google.android.media.gts.WidevineCodecStressTests#testVideoSecureH265

BUG: 62945210
Change-Id: I5b5274d99ca5ad9299dc9cf9d83cb23fb6f6c13e
2017-07-18 21:44:52 +00:00
Edwin Wong
06f8504688 Merge "Add property to query SRM support and version." 2017-07-14 17:25:29 +00:00
Rahul Frias
a46a7182f9 Merge "Update error codes" 2017-07-14 01:18:42 +00:00
Edwin Wong
9f0adebb9f Add property to query SRM support and version.
Merge from http://go/wvgerrit/29800

Add QUERY_KEY_CURRENT_SRM_VERSION and
QUERY_KEY_SRM_UPDATE_SUPPORT.

Test: run unit test
  adb push $OUT/marlin/data/bin/libwvdrmdrmplugin_hidl_test
/vendor/bin/.
  adb shell LD_LIBRARY_PATH="/vendor/lib/mediadrm" \
    /vendor/bin/libwvdrmdrmplugin_hidl_test

bug: 63390310
Change-Id: Ie51056d22178565bd7b987aa901f7b7616d29328
2017-07-13 14:12:38 -07:00
Rahul Frias
346f8883c8 Update error codes
[ Merge from http://go/wvgerrit/29041 ]

This brings error codes up to date with wv master

b/62972441

Test: WV Unit/Integration tests on android

Change-Id: If676b35275bb992018b2b8bfcb76079a2fc2d1f9
2017-07-13 11:20:54 -07:00
Tom Cherry
fb0bbd740b remove extraneous using namespace android and deprecate utils/Log.h am: 6b2787121c
am: 6e8c82a416

Change-Id: Ic5c65fb6000a3a87feba28836d326618a347752f
2017-07-13 16:16:51 +00:00
Tom Cherry
6e8c82a416 remove extraneous using namespace android and deprecate utils/Log.h
am: 6b2787121c

Change-Id: I1c2e5311a126295a98650dde433c111b22d894b5
2017-07-13 16:13:55 +00:00
Tom Cherry
6b2787121c remove extraneous using namespace android and deprecate utils/Log.h
This namespace is not used by this file and its declaration is removed
in a separate CL from utils/Log.h, which is the only place it is
defined, so we must remove this extraneous line.

Also, since that separate CL is deprecating utils/Log.h in favor of
log/log.h, we make the switch to the new header.

Test: Build

Change-Id: Iac4bc8faffbd2d68dc4ccccaf569db0c5a13a7bc
2017-07-12 17:13:01 -07:00
Adam Stone
457aceb859 Fixes metrics collection during CdmEngine close.
This fixes a problem where a CdmEngine instance (and its sessions) could
be closed before its metrics could be collected. The change allows the
wv_content_decryption_module to extract metrics from instances about to
be closed. These are held until reported to the caller.

Test: Manually verified that collection is now occurring correctly. Also
added unit test: wv_cdm_metric_test.

This is a merge from wvgerrit/29069

Change-Id: If82bfd5cae3b72b9d14ab4741424a7ae7cc0a3a6
2017-07-12 13:07:15 -07:00
Jiyong Park
efad3eea21 Add missing dependency to liblog
Bug: 33241851
Test: BOARD_VNDK_VERSION=current m -j libwvdrmcryptoplugin
Test: BOARD_VNDK_VERSION=current m -j libwvdrmdrmplugin
Change-Id: If21f903cb3087bd26c0526686392e7686f5152c6
2017-07-07 16:27:32 +09:00
Jiyong Park
aa74124fc2 Build widevide modules with BOARD_VNDK_VERSION
Header libs are added since global include path is not provided when
building with BOARD_VNDK_VERSION. Also, some static libs are marked as
proprietary so that they can be linked against to the drm hal
service.

Bug: 33241851
Test: BOARD_VNDK_VERSION=current m -j
android.hardware.drm@1.0-service.widevine
Change-Id: Iab85869e21917ea212a09d6eaabdb6ba3ace9248
2017-07-06 17:13:48 -07:00
Rahul Frias
ccaa50b92e Merge "Correct openssl error logging" 2017-07-03 07:53:19 +00:00
John W. Bruce
d163479752 Add Bounds Check to initDataResemblesPSSH am: ce01000c1b
am: c48711d0ff

Change-Id: Ief842a2fa6ff75d1a4ef19a786a906ca7d56ebfb
2017-06-30 01:14:42 +00:00
John W. Bruce
ce01000c1b Add Bounds Check to initDataResemblesPSSH
(Merge from http://go/wvgerrit/29180)

initDataResemblesPSSH was not checking if the buffer was large enough to
contain the PSSH markers that it was looking for. Consequently, it could
read data past the end of the buffer.

Bug: 63076692
Test: Unit Tests
Test: Google Play Movies
Change-Id: I6a4a3fa4b05d98554645f3c3149569702c96fd66
2017-06-28 19:26:37 -07:00
Adam Stone
db365d4c16 Merge "Add template type checking for EventMetric." 2017-06-28 01:16:01 +00:00
Adam Stone
cce6dffe92 Merge "Renames a few metrics for consistency." 2017-06-27 01:10:05 +00:00
Adam Stone
0963400d57 Add template type checking for EventMetric.
Add template var arg type checking for EventMetric.

This change adds some type checking for the variable argument
EventMetric which assures that there are no mismatches between
the definition of an EventMetric instance and the overloaded
constructor.

This is a merge from wvgerrit/28424.

BUG: 34846989
Test: Manually verified appropriate compile time errors.
Change-Id: I3e501abf76b78211f9cef19960ef11c179a0ff93
2017-06-26 20:54:43 +00:00
Adam Stone
80a95a1b64 Renames a few metrics for consistency.
Renames a few metrics for consistency with the logs processing module.

This CL changes the names of several metrics to be consistent with what
we use for the logs parsing module. E.g. for metrics consistency,
CdmSecurityLevel is referred to as "security_level" and SecurityLevel
is referred to as "requested_security_level".

The GetSecurityLevel method was modified to use CdmSecurityLevel instead
of the previous string type.

This CL is a merge from wvgerrit/28423

BUG: 37627621
BUG: 37627483
Test: Updated and ran unit tests to verify no regressions.
Change-Id: Ia4a8b202325386f2e02dcda4f58010dd7957a048
2017-06-26 20:49:39 +00:00
Adam Stone
d3758e9ce4 Merge changes I2618c2be,Ie8b9d8b9,I2f39f99c
* changes:
  Support GetPropertyByteArray for getting metrics.
  CDM Metrics Protocol buffer serialization.
  Refactored metrics to support pull model.
2017-06-26 20:32:15 +00:00
Steven Moreland
b0154ffe3d Use vendor variant of libstagefright_foundation. am: 6af84a8821
am: ee41ad8b01

Change-Id: I48c255046dd9fa23136adb1cc580ce59801fbb79
2017-06-26 18:05:07 +00:00
Rahul Frias
0dbc087eab Correct openssl error logging
[ Merge of http://go/wvgerrit/29041/ ]

Releasing allocated BIO buffers before logging failure causes the
openssl error to be erased.

b/62486203

Test: Ran WV unit, integration tests on angler

Change-Id: I3315edae2d3bd34887569ab88817f9591c12f409
2017-06-24 17:13:32 -07:00
Steven Moreland
6af84a8821 Use vendor variant of libstagefright_foundation.
Rather than having a lib called libstagefright_foundation and one
called libstagefright_foundation_vendor, we now just have one library
and the build system keeps track of the vendor APIs that are exposed.

Test: (sanity) boot device, watch (part of) DRM protected movie.
Change-Id: I38d5391475432ba9597e0bf20f669042b6265859
2017-06-22 17:11:30 -07:00
Jiyong Park
a6bc2c61e1 Merge "Use libstagefright_foundation_vendor" into oc-dr1-dev am: 5fb6323de8
am: 56102aedaf

Change-Id: I36c0ab87259211dff17af78227c7fd7e51da9bda
2017-06-20 05:48:56 +00:00
TreeHugger Robot
5fb6323de8 Merge "Use libstagefright_foundation_vendor" into oc-dr1-dev 2017-06-20 05:40:13 +00:00
Adam Stone
a0da1f067b Support GetPropertyByteArray for getting metrics.
Adds support for GetPropertyByteArray to return a serialized set of metrics
to the caller. This should be the last part of the widevine plugin
changes that fix the referenced bug.  More changes are coming on the
MediaDrm side.

This is a merge of wvgerrit/28422

I intend to submit 2048751, 2048750, and 2048509 together.

Bug: 36217927
Test: Added additional unit tests for affected code.
Change-Id: I2618c2be48d7d780127e35f237e2276efd080879
2017-06-20 03:09:59 +00:00
Adam Stone
b851dd8cfd CDM Metrics Protocol buffer serialization.
An implementation that serializes metrics to a protocol buffer.

This is a merge from wvgerrit/28440.

I intend to submit 2048751, 2048750, and 2048509 together.

Bug: 36217927
Bug: 36220975
Test: Added unit tests to cover modified code.
Change-Id: Ie8b9d8b91d2602b015f5568890a16c0419c126df
2017-06-20 02:39:25 +00:00
Adam Stone
a34e279d0f Refactored metrics to support pull model.
MetricsGroup split into 3 groups, session, engine, and crypto.
MetricsFrontEnd and Report removed.

This is a merge from wvgerrit/28420

Bug: 36217927
Test: Added unit tests to cover modified code.
Change-Id: I2f39f99ce88cc2229d6d1aa9459c67c5b86ccef4
2017-06-19 19:37:37 -07:00
John W. Bruce
3459020b00 Pass CdmIdentifier to UsageInfo Methods am: 43b8522b70 am: ed50683f80
am: 6db464ca54

Change-Id: I4dd629161df7a1f1e07b1913d8cf422ef58e8c6d
2017-06-20 00:15:50 +00:00
John W. Bruce
32b6cb55e7 Pass CdmIdentifier to UsageInfo Methods
am: 43b8522b70

Change-Id: Idff718d6a370fd927f4cc9019a482698313175a0
2017-06-19 23:34:21 +00:00
John W. Bruce
ed50683f80 Pass CdmIdentifier to UsageInfo Methods
am: 43b8522b70

Change-Id: Ida417b7043115f54c9b8daaa75d417dea39aafe6
2017-06-19 23:32:23 +00:00
John W. Bruce
43b8522b70 Pass CdmIdentifier to UsageInfo Methods
The methods on WvContentDecryptionModule related to UsageInfo (Secure
Stops) do not work if kDefaultCdmIdentifier has not been provisioned.
This can occur if an app provisions and uses an origin without any app
on that device ever provisioning the default origin. More concerningly,
this will happen 100% of the time on SPOID-using devices, as there is no
way to provision the default identifier on these devices.

The fix is to pass the current identifier to these methods so that they
do not have to use kDefaultCdmIdentifier.

Test: build_and_run_all_unit_tests.sh
Test: WV GTS Tests
Bug: 62431478
Change-Id: I92a8b4acb69c964abe8129bccf2ff48a66c4a9e0
2017-06-16 17:59:24 -07:00
Jiyong Park
a632dd3bb4 Use libstagefright_foundation_vendor
libwvdrmengine is a library in vendor. When BOARD_VNDK_VERSION is turned
on, any lib in vendor partition can only link against to other vendoor
libs or libs marked as vendor_available:true. This lib is using
libstagefright_foundation and the lib is not available to vendors.
Instead, libstagefright_foundation_vendor is provided as a
vendor-variant of the foundation library. Thus switching to the vendor
variant.

Bug: 37462569
Test: m libwvdrmengine
Change-Id: I1f83eb71a3ba496889f1fa5771029cd8b603f258
2017-06-15 11:02:17 +09:00
Rahul Frias
5e6e6737f1 Merge "Usage license handling corrections" into oc-dev am: c3cdb531d4 am: 1073526555
am: 93f5f43107

Change-Id: I1398ae005403d3a502da2163cee428a8a53b7deb
2017-06-14 00:07:47 +00:00
Kyle Alexander
f7ef98b60a Merge "Update unit tests to build into /data/bin" into oc-dev am: b683d2be57 am: fc7e636bdf
am: b13900af37

Change-Id: I46970986c1c1b7188226b2df0a7626aae55762e7
2017-06-14 00:07:21 +00:00
Rahul Frias
93f5f43107 Merge "Usage license handling corrections" into oc-dev am: c3cdb531d4
am: 1073526555

Change-Id: Ib7f14ce42b9aba16025c5396e32b6427f92b759c
2017-06-13 22:52:23 +00:00
Rahul Frias
ab0cb541d0 Merge "Usage license handling corrections" into oc-dev
am: c3cdb531d4

Change-Id: Ideb1ee0c9735fc83c28ac3064f804650ab98c99e
2017-06-13 22:46:07 +00:00
Rahul Frias
1073526555 Merge "Usage license handling corrections" into oc-dev
am: c3cdb531d4

Change-Id: Ib7a6b14cd009abf2247bad28939c06938c07db0a
2017-06-13 22:45:53 +00:00
Rahul Frias
c3cdb531d4 Merge "Usage license handling corrections" into oc-dev 2017-06-13 22:40:54 +00:00
Kyle Alexander
b13900af37 Merge "Update unit tests to build into /data/bin" into oc-dev am: b683d2be57
am: fc7e636bdf

Change-Id: I311feb5f5f0c060bf776780de4cca3395d023239
2017-06-13 22:21:39 +00:00
Kyle Alexander
15cfe0abfa Merge "Update unit tests to build into /data/bin" into oc-dev
am: b683d2be57

Change-Id: I6c5cc5924b0a8eb52c235eef24cbd08efaf298dc
2017-06-13 22:18:18 +00:00
Kyle Alexander
fc7e636bdf Merge "Update unit tests to build into /data/bin" into oc-dev
am: b683d2be57

Change-Id: I1a88eb1d4f9a8d1df6fc66f6277c5afc5ead9c07
2017-06-13 22:18:14 +00:00
TreeHugger Robot
b683d2be57 Merge "Update unit tests to build into /data/bin" into oc-dev 2017-06-13 22:10:13 +00:00
Kyle Alexander
038580c6c9 Update unit tests to build into /data/bin
Tradefed needs these tests to be in the /DATA directory.

Test: cd vendor/widevine && ./build_and_run_all_unit_tests
      All tests should build and pass.
      make tests
      unzip android-tests.zip and verify all tests located in DATA/bin

Bug: 62055647
Change-Id: I35925e29558561c4726bb2249499bfee4e54cf45
2017-06-12 23:48:15 -07:00
Rahul Frias
db05f1e01c Usage license handling corrections
[ Merge of http://go/wvgerrit/28460 ]

Validate that offline licenses that do not contain a provider session
token are not handled by the TEE.

b/38490468

Test: WV Unit/integration tests, GtsMediaTestCases,
      WvCdmRequestLicenseTest.ReleaseRetryL3OfflineKeySessionUsageDisabledTest

Change-Id: Idaf62f2a882ae933c1a3e108d791943034780a46
2017-06-12 20:03:57 -07:00
Rahul Frias
0e920107f9 Recreate usage tables on error am: 4228e2327e am: fcc1c1a54d
am: 9eaf7cf958

Change-Id: I8e37c97a0a0b0a020bb3f3046682b5982ad6b9d1
2017-06-10 00:01:39 +00:00
Rahul Frias
fcc1c1a54d Recreate usage tables on error
am: 4228e2327e

Change-Id: I66140b35d3b992aaedb15c8e2dd2167127183eb3
2017-06-09 23:47:01 +00:00
Rahul Frias
61f0de0e7d Recreate usage tables on error
am: 4228e2327e

Change-Id: I249dc9ee4c01dc24eb68a2ee876b800449ac7e3c
2017-06-09 23:47:01 +00:00
Rahul Frias
4228e2327e Recreate usage tables on error
[ Merge of http://go/wvgerrit/28265 ]

A vendor specific error (10008) in response to OEMCrypto_LoadKeys
indicates that usage table corruption has occurred and that
the only way to recover is to regenerate usage tables.
Recreating usage tables will result in loss of offline licenses
and usage information. To make the app aware that this information
will be lost, a provisioning exception is generated when this error
is detected. The app can then choose to reprovision and in turn
delete and recreate usage tables.

A new OEMCrypto error has been added whose use has been reserved.
Rather than correct OEMCrypto behaviour to use the new error code,
we choose to handle this within the CDM. The fix can then be ported
to prior android releases. Also this error will not be generated
with OEMCrypto V13+.

b/33817629

Test: WV Unit, integration and GTS tests.
Change-Id: I936fc234d101b6a92d86f5735d035d19ddcf19e3
2017-06-08 23:46:04 -07:00
Rahul Frias
7f3578aaab Correct offline license handling am: 1857da2c8c am: 4c8af4872d
am: ce54031351

Change-Id: I6ffef72ad17a2e9a56b7738da8c800af1dd8bda9
2017-06-08 16:13:42 +00:00
Rahul Frias
ce54031351 Correct offline license handling am: 1857da2c8c
am: 4c8af4872d

Change-Id: Ic6225dc3013b19183b00135f8694e02839df7939
2017-06-08 09:54:01 +00:00