Commit Graph

4873 Commits

Author SHA1 Message Date
Alex Dale
f20e2b1ee9 Merge "Added unittests for WV CRC-32 implementation." into sc-dev am: 3050d95f6f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13625374

Change-Id: Id6b5ee10dd30188ee72c9f4114d86899c216bee8
2021-03-19 23:43:14 +00:00
Alex Dale
3050d95f6f Merge "Added unittests for WV CRC-32 implementation." into sc-dev 2021-03-19 23:14:00 +00:00
Rahul Frias
6439635420 Merge changes from topic "b169740403_2" into sc-dev am: c586f7e62b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13865723

Change-Id: I4592a697e97fbee9068e8a7407601e73834390f6
2021-03-19 21:50:20 +00:00
Rahul Frias
c586f7e62b Merge changes from topic "b169740403_2" into sc-dev
* changes:
  Verify DRM certificate validity
  Extract creation and expiration times from DRM cert
  Allow two DRM certificates for each identifier
2021-03-19 21:26:33 +00:00
Rahul Frias
b21be96b1b Verify DRM certificate validity
[ Merge of http://go/wvgerrit/120123 ]

DRM certificate creation and expiration times are now validated.

* New DRM (default) certificates will have an expiration time specified
by the provisioning service.

When stored, the client will include the time the certificate was
received. This allows for expiration calculation to occur when client
and provisioning service clocks are out of sync.

When read out, creation, expiration and acquisition times are
validated. The certificate is checked for expiry by making sure
that the time at the client since the license was acquired is not
greater than the expiration period. The time information stored at the
client may be tampered with. The license service will perform an
expiration check and reject the license request if tampered with.
The expiration time may be set to never expires/unlimited. This is not
a valid value for creation or acquisition time.

* Pre-existing (legacy) certificates from upgrading devices will not
have an expiration time set by the provisioning service. Instead
the client will calculate an expiration time 6 months with + or -
a random two month period in the future. This is stored along with the
certificate.

When read out, if no expiration time has been set by the client, one
will be calculated and written out. The certificate will be declared as
valid. If a client calculated expiration time is present, the
certificate will be validated. In case of tampering, the license service
can reject license requests and force reprovisioning when appropriate.

* ATSC certificates will continue to not have an expiration time.
No additional validation is required.

Other changes for non-ATSC licenses involve managing both default and
legacy certificate co-existance. When checking for DRM certificates,
the default certificate is attempted first. This is followed by a check
for the legacy certificate, if the default certificate is not present.

Bug: 169740403
Test: WV unit/integration tests
      DeviceFilesTest.StoreCertificateInvalidParams
      DeviceFilesTest.RetrieveAtscCertificate
      DeviceFilesTest.RetrieveAtscCertificateNotFound
      DeviceFilesTest.RetrieveCertificateInvalidParams
      DeviceFilesTest.RetrieveLegacyCertificateWithoutExpirationTime
      DeviceFilesTest.RetrieveLegacyCertificateWithClientExpirationTime
      DeviceFilesTest.RetrieveLegacyExpiredCertificateByClientExpirationTime
      DeviceFilesTest.RetrieveLegacyCertificateInvalidClientExpirationTime
      DeviceFilesTest.RetrieveCertificateWithoutKeyType
      DeviceFilesTest.RetrieveDefaultCertificate
      DeviceFilesTest.RetrieveDefaultCertificateNeverExpires
      DeviceFilesTest.HasCertificateAtsc
      DeviceFilesTest.HasCertificateDefault
      DeviceFilesTest.HasCertificateLegacy
      DeviceFilesTest.HasCertificateNone
      CertificateTest.StoreCertificateTest.DefaultAndLegacy/*
      CertificateTest.RetrieveLegacyCertificateTest.ErrorScenarios/*
      CertificateTest.RetrieveDefaultCertificateTest.ErrorScenarios/*

Change-Id: I7dbec7555fbd493c1ec61c6bb5d9428a2405b1fd
2021-03-19 02:49:20 -07:00
TreeHugger Robot
7fb07d23dc Merge "Annotate fallthrough in OEC Testbed" into sc-dev am: 640e8727dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13849252

Change-Id: Ie9a0becbd3052bf8e5296cfbec00ebc0f03746a0
2021-03-19 08:23:21 +00:00
TreeHugger Robot
640e8727dc Merge "Annotate fallthrough in OEC Testbed" into sc-dev 2021-03-19 07:41:24 +00:00
Rahul Frias
9a350eddbd Extract creation and expiration times from DRM cert
[ Merge of http://go/wvgerrit/119843 ]

Creation and expiration times are extracted from the device DRM
certificate. They are reported as
 * -1 if not set in the proto
 * 0 if unlimited
 * positive number otherwise

Bug: 169740403
Test: WV unit, integraiton tests
Change-Id: I9463954dfeb82b6a88ff5d608ed74d20f2424e83
2021-03-18 23:59:21 -07:00
Rahul Frias
3b15087627 Allow two DRM certificates for each identifier
[ Merge of http://go/wvgerrit/119684 ]

This allows for a default DRM certificate that includes an expiration
time and a legacy one without for each app+origin specific identifier.
Existing offline licenses/secure stops are not associated with a
certificate, and so we cannot delete legacy certificates even after
fetching a new one. New offline licenses/secure stops will be associated
with certificate information, so we will not have this problem going
forward.

Bug: 169740403
Test: WV unit/integration tests
Change-Id: I0f08f6bf98775fd43927243dc4a9f75f21bfbbcc
2021-03-18 23:58:46 -07:00
Alex Dale
aeefea26d7 Merge "Added unittests for OEM Certificates." into sc-dev am: 2cf17c34fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13625373

Change-Id: I7f6ebd9c7e999a79fb840e84ea07b757b784b7d9
2021-03-19 02:05:32 +00:00
Alex Dale
2cf17c34fe Merge "Added unittests for OEM Certificates." into sc-dev 2021-03-19 01:29:23 +00:00
TreeHugger Robot
a99a6146c4 Merge "Release crypto resources when provisioning fails" into sc-dev am: d1db6df88b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13678765

Change-Id: I8ef19d25ad6712a3856b53edd9ee4941bd6e4844
2021-03-19 00:09:03 +00:00
TreeHugger Robot
aa8c74c041 Merge "Log license request and response" into sc-dev am: 9f574be636
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13740255

Change-Id: I0a88f852cf9841dc06f4ff4bdf61a41460ba9816
2021-03-19 00:08:48 +00:00
TreeHugger Robot
d1db6df88b Merge "Release crypto resources when provisioning fails" into sc-dev 2021-03-18 23:27:57 +00:00
TreeHugger Robot
9f574be636 Merge "Log license request and response" into sc-dev 2021-03-18 23:27:33 +00:00
Alex Dale
d9f39ebfa7 Merge "Wrapped OEM Certificate." into sc-dev am: 6c58348bb8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13623728

Change-Id: Ic7b7a0c65c5e11da53649d31ac0d94ed1badf3c0
2021-03-18 22:08:04 +00:00
Alex Dale
6c58348bb8 Merge "Wrapped OEM Certificate." into sc-dev 2021-03-18 21:15:32 +00:00
Rahul Frias
f38479024f Correct test data member name am: edf9ad5b90
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13796843

Change-Id: I29d9b52b3e563a6296ec068f7788f0b8cd06aec2
2021-03-18 00:04:29 +00:00
Rahul Frias
b295a1d3af device_files proto changes for Expiring DRM certificates am: dbb1671e39
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13785063

Change-Id: I796dce0d2f1b164a4f426037856f49765ec8820e
2021-03-18 00:04:28 +00:00
Rahul Frias
edf9ad5b90 Correct test data member name
[ Merge of http://go/wvgerrit/119645 ]

Bug: 169740403
Test: WV unit/integration tests
Change-Id: I2a3e82869e3a45112e8b15eea4ac668980c3eb4d
2021-03-16 13:29:30 -07:00
Rahul Frias
dbb1671e39 device_files proto changes for Expiring DRM certificates
[ Merge of http://go/wvgerrit/119644 ]

This change includes additional fields in DeviceCertificate, License and
UsageInfo.

New DRM certificate will include a creation and expiration time.
In addition acquisition_time_seconds will allow the client to calulate
expiration time even when client and provisioning service clocks
are not in sync.

expiration_time_seconds will allow clients to expire DRM certificates
that do include an expiration time. A random value within a window
(4-8 months after update) will be calculated to avoid
a provisioning storm.

Drm certificate will be added to offline licenses. In a future release,
licenses will be removed on expiry and the certification information
that needs to be sent to the license service will be reduced.
This should reduce space overhead.

UsageInfo will use a certificate cache in case multiple usage info
entries use the same DRM certificate.

Bug: 169740403
Test: WV unit/integration tests
Change-Id: I2f34a1df526fa8168162a1b1ea930a2f257b87cd
2021-03-16 13:10:53 -07:00
TreeHugger Robot
bab2a08a61 Merge "Address compilation warnings" into sc-dev am: 6ee9f49e5c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13818826

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9be5b0d7c8fdd6986f725bb8aa1377d8419ef38b
2021-03-13 03:44:38 +00:00
Alex Dale
d1fa77bb3e Android tests call exit() when complete. am: 16c704fa09
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13845281

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifa7e194f128b305ec90534d51a4bd9226a7ca91b
2021-03-13 03:44:19 +00:00
TreeHugger Robot
6ee9f49e5c Merge "Address compilation warnings" into sc-dev 2021-03-13 02:43:45 +00:00
Alex Dale
16c704fa09 Android tests call exit() when complete.
[ Merge of http://go/wvgerrit/119804 ]

The coverage framework used by Android requires the process to call
exit() for coverage information to be dumped after the tests.

Android unit tests have been adapted to use the a new main module.
The core test_main.cpp used by integration tests has been updated to
call exit().

Bug: 138941105
Test: Linux and Android unittests
Change-Id: Ifffc7b8290c50dffe527738a36547c1d2fb90bd3
2021-03-12 16:22:20 -08:00
Rahul Frias
a828bf5f58 Annotate fallthrough in OEC Testbed
[ Merge of http://go/wvgerrit/119230 ]

This patch adds an annotation to the one place in the codebase where we
intentionally fall through between switch statement cases, in order to
appease stricter compilers.

Bug: 182058081
Test: compile, WV unit/integration tests
Change-Id: I004a6a6e61681fcf22c6bf25d9b0284b8b64e776
2021-03-12 00:58:52 -08:00
Rahul Frias
1c9fdeef0e Merge "Update drm_certificate.proto" into sc-dev am: 9f918bc16b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13744352

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I84631264b30cdb80fb5229450ed130bb95a65ab9
2021-03-11 19:25:36 +00:00
Rahul Frias
9f918bc16b Merge "Update drm_certificate.proto" into sc-dev 2021-03-11 18:57:36 +00:00
Rahul Frias
094fabed5a Address compilation warnings
[ Merge of http://go/wvgerrit/119523 ]

Bug: 182299187
Test: compile vendor/widevine/libwvdrmengine
Change-Id: I39d1b62a3237bfb9163a7e157b871f22e3fec394
2021-03-10 18:49:57 -08:00
Rahul Frias
83a85430e3 Release crypto resources when provisioning fails
[ Merge of http://go/wvgerrit/119564 ]

This closes a crypto session when the provisioning request fails. We
cannot be as eager when handling the response as the app may have
multiple simultaneous provisioning attempts in flight. In this case
all provisioning responses except the one associated with the last
request will fail. If we close the session on error, even the one
associated with the last request may fail.

Bug: 180986725
Test: WV unit/integration tests
Change-Id: Ic3d33a374e442b5bf040e345bed829d91c4ef1dc
2021-03-10 18:12:09 -08:00
Rahul Frias
b8049e1f20 Log license request and response
[ Merge of http://go/wvgerrit/119563 ]

This also increases the max log size from 1024 to 5120

Bug: 181642154
Test: WV unit/integration tests
Change-Id: Ifae90354dad1165f4d9fa3c9fe33a4dc14df1270
2021-03-10 17:58:15 -08:00
Edwin Wong
e51316bf10 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow. am: f3ad627bcb am: 18065ce373 -s ours am: 49279fb200 am: 45dc1d106a am: d6226efa60 -s ours am: 4310a64a48 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13462543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I85940e14c1e1b0b6b80734e2fc3e2c05a227e4c7
2021-03-10 22:39:53 +00:00
Edwin Wong
4310a64a48 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow. am: f3ad627bcb am: 18065ce373 -s ours am: 49279fb200 am: 45dc1d106a am: d6226efa60 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13462543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id7a7aeb5963e74c3a263340bbab089aa42e49a2c
2021-03-10 22:37:39 +00:00
Edwin Wong
6ac8f599d8 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow. am: f3ad627bcb am: 18065ce373 -s ours am: 49279fb200 am: 242713098f -s ours am: 08a80add55 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13462543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6b6bff385ed32a3b9821ad3b791876377f184737
2021-03-10 22:12:49 +00:00
Edwin Wong
08a80add55 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow. am: f3ad627bcb am: 18065ce373 -s ours am: 49279fb200 am: 242713098f -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13462543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7a37930fc220495957e017e204d95e32ade6d282
2021-03-10 21:57:10 +00:00
Edwin Wong
d6226efa60 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow. am: f3ad627bcb am: 18065ce373 -s ours am: 49279fb200 am: 45dc1d106a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13462543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I88ba0b965d2d546ba090e1b138846b997744dece
2021-03-10 21:53:38 +00:00
Edwin Wong
242713098f [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow. am: f3ad627bcb am: 18065ce373 -s ours am: 49279fb200
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13462543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I75d982f8a96803bfdf6ff9bd5807d802d80e04c6
2021-03-10 21:36:27 +00:00
Edwin Wong
45dc1d106a [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow. am: f3ad627bcb am: 18065ce373 -s ours am: 49279fb200
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13462543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0a8f36599fe984fedf236f6240fd1f08bf99f36d
2021-03-10 21:13:54 +00:00
Edwin Wong
49279fb200 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow. am: f3ad627bcb am: 18065ce373 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13462543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia1bce0f38c0ab07f1028e9ecd0f38b78b8de0d77
2021-03-10 20:56:24 +00:00
Edwin Wong
18065ce373 [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow. am: f3ad627bcb
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13462543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I36fb97d8855ef97a15c7d9d553efa874a2df7c84
2021-03-10 20:12:35 +00:00
Rahul Frias
0cf99f685f Update drm_certificate.proto
[ Merge of http://go/wvgerrit/118563 ]

Sync with the latest version of drm_certificate.proto to add in
certificate expiry time. Add in signed_drm_certificate.proto and remove
messages from device_certificate.proto.

SignedDrmDeviceCertificate and DrmDeviceCertificate are now named
SignedDrmCertificate and DrmCertificate. This necessitated non-proto
changes.

Bug: 169740403
Test: WV unit/integration tests
Change-Id: Ie5969ac7217a25eb075a41df59b77da2becd4545
2021-03-09 14:57:47 -08:00
Alex Dale
0c87234d45 Merge "Added unittests for reference RSA implementation." into sc-dev am: d40302f3e3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13619898

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I719e6345e6bb71025de575ce8c946d852ec397cd
2021-03-09 22:47:25 +00:00
Alex Dale
d40302f3e3 Merge "Added unittests for reference RSA implementation." into sc-dev 2021-03-09 22:19:51 +00:00
Rahul Frias
540b264995 Integration test for license duration with renewal am: 9ab837c78a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13807335

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9d480046e482dbf783f988a7c45d992b45511fb0
2021-03-09 19:57:40 +00:00
Rahul Frias
b722948671 An integration test for secure buffers am: 3176f5f66f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13805574

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I013db55c8e7cc88736e5156eb15fcf9c18f2716c
2021-03-09 19:57:38 +00:00
Rahul Frias
b7c82b1f59 Add Duration Use Case integration tests am: 0831e575ba
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13805072

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I71d4d9ab5bd9e2badfe5c62782ecd79db3811d91
2021-03-09 19:57:37 +00:00
Rahul Frias
870162db98 Fix test sleep on iOS. am: a9f051faac
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13805070

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I31ecfb95fb38161e88923743b86a42c609f4b010
2021-03-09 19:57:35 +00:00
Rahul Frias
0275dc360f Restrict a2b_hex to 2000 bytes. am: 9a659e31c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13805068

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibdaaf80a067aff3764062ec1f698b68ff9e8e6fa
2021-03-09 19:57:33 +00:00
Rahul Frias
c5f308ac9f Return error when test initialization fails am: 616a9b38dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13798630

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I28c4774387c120a0b6e55379510e2b34b3c8d621
2021-03-09 19:57:31 +00:00
Rahul Frias
7cae719e46 Set renewal server on command line for tests am: 50efa73e34
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13798629

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I175b7b4343ced8563410d1cd5e6b59a27c493b97
2021-03-09 19:57:30 +00:00