Commit Graph

4208 Commits

Author SHA1 Message Date
Cong Lin
6514bde77e [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix am: 5ea6b86f79 -s ours am: 1fb5b4d68c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14283069

Change-Id: Ibe45158298b415d67de3132f598095d983d8af81
2021-05-06 22:13:27 +00:00
Cong Lin
1fb5b4d68c [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix am: 5ea6b86f79 -s ours
am skip reason: skipped by user conglin

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

Change-Id: Iab364aea4690819a484a8527e73dcc4e0da358d6
2021-05-06 21:56:03 +00:00
Cong Lin
5ea6b86f79 [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix
rvc-dev

Merge of [http://go/wvgerrit/123644]. Fix included:

http://go/wvgerrit/111603
Fix L3 block offset test and re-enable buffer overflow tests

http://go/wvgerrit/111784
Fix heap overflow test in L3 and OEMCrypto ref

Test: Ran L3 unit tests
Test:
gts-tradefed run gts --module GtsMediaTestCases
gts-tradefed run gts --module GtsExoPlayerTestCases
Bug: 182584472

Change-Id: I70bda559c4b5158c3461dcdfee72a8953f31a942
2021-04-27 09:21:59 -07:00
Edwin Wong
c3c05be7b6 [automerger skipped] Merge "[RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability." into qt-dev am: aabd91204a am: 389837df8c -s ours am: e2f3b13c78 am: 28d30a0af9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499846

Change-Id: I0cb9769784651c4a1b8c6267ccfea3b591a5eef1
2021-04-07 00:32:24 +00:00
Edwin Wong
6216c6e024 [automerger skipped] [RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability. am: 9c278174c8 am: 605ae2e217 -s ours am: a423695ea0 am: 94cf4a7137
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499846

Change-Id: Ia241a9673a9cf281763f268fe8ea9b5f1a4f2a9c
2021-04-07 00:32:23 +00:00
Edwin Wong
28d30a0af9 [automerger skipped] Merge "[RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability." into qt-dev am: aabd91204a am: 389837df8c -s ours am: e2f3b13c78
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499846

Change-Id: I893384792c4cf7677fff871433cf6228df7f0e7a
2021-04-06 23:47:33 +00:00
Edwin Wong
94cf4a7137 [automerger skipped] [RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability. am: 9c278174c8 am: 605ae2e217 -s ours am: a423695ea0
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499846

Change-Id: I14c7cdded7ca2e41298594ac7df706ecb75989f1
2021-04-06 23:47:32 +00:00
Edwin Wong
e2f3b13c78 [automerger skipped] Merge "[RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability." into qt-dev am: aabd91204a am: 389837df8c -s ours
am skip reason: subject contains skip directive

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

Change-Id: I57e1cda75c201ab7c722d077be6aa94b22ebb617
2021-04-06 23:27:20 +00:00
Edwin Wong
a423695ea0 [automerger skipped] [RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability. am: 9c278174c8 am: 605ae2e217 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Id2b6c02ef85c826ce7b74b0a95797082b0845f5a
2021-04-06 23:27:19 +00:00
Edwin Wong
389837df8c Merge "[RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability." into qt-dev am: aabd91204a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499846

Change-Id: I842a3b15c82a20085825bfda63ee023feed4a653
2021-04-06 23:06:29 +00:00
Edwin Wong
605ae2e217 [RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability. am: 9c278174c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499846

Change-Id: I1cb45d35088d149f02b0bb6c408e5fee3d79c1db
2021-04-06 23:06:28 +00:00
Edwin Wong
aabd91204a Merge "[RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability." into qt-dev 2021-04-06 22:27:14 +00:00
Edwin Wong
5a3544e7d2 Merge "[RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability." into rvc-dev am: a6cc3b79d2 am: 7b380179e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499847

Change-Id: Ia58ef580baab3ef4a5a2f07e9c51f13fce7ffc4c
2021-04-06 22:23:04 +00:00
Edwin Wong
79b4677c6e [RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability. am: 76f39ddb08 am: 2c59c30f1b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499847

Change-Id: I9d84f4bc553f9c665d418734a9cf032bb4460a0c
2021-04-06 22:23:03 +00:00
Edwin Wong
7b380179e8 Merge "[RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability." into rvc-dev am: a6cc3b79d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499847

Change-Id: Ifccf528b9a903082878f1492f03e3e232c797b96
2021-04-06 21:49:15 +00:00
Edwin Wong
2c59c30f1b [RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability. am: 76f39ddb08
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13499847

Change-Id: Id08136edb62c110de282e66106ca096b19a757bb
2021-04-06 21:49:14 +00:00
Edwin Wong
a6cc3b79d2 Merge "[RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability." into rvc-dev 2021-04-06 21:06:40 +00:00
Edwin Wong
34effc90d6 [automerger skipped] Merge "Fix potential decrypt destPtr overflow." into rvc-dev am: 92865466af -s ours am: eceedee2ea -s ours
am skip reason: skip tag Change-Id Id3aece61d46d548c304782d4e1dc3a4747795c01 with SHA-1 f3ad627bcb is already in history

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

Change-Id: I3ced57ad41a646610a4a1778d574ebb37935f338
2021-04-05 22:37:14 +00:00
Edwin Wong
eceedee2ea [automerger skipped] Merge "Fix potential decrypt destPtr overflow." into rvc-dev am: 92865466af -s ours
am skip reason: skip tag Change-Id Id3aece61d46d548c304782d4e1dc3a4747795c01 with SHA-1 f3ad627bcb is already in history

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

Change-Id: I14c9d120522d4b0cc681c66df516264960758d98
2021-04-05 21:56:38 +00:00
Edwin Wong
92865466af Merge "Fix potential decrypt destPtr overflow." into rvc-dev 2021-04-05 21:22:06 +00:00
Bob Badour
7f34e59ce6 [LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine
Added SPDX-license-identifier-Apache-2.0 legacy_by_exception_only to:
  Android.bp
  libwvdrmengine/Android.bp
  libwvdrmengine/vts/vendor_module/Android.bp

Added legacy_by_exception_only to:
  libwvdrmengine/cdm/Android.bp
  libwvdrmengine/cdm/core/src/Android.bp
  libwvdrmengine/cdm/core/test/Android.bp
  libwvdrmengine/cdm/metrics/src/Android.bp
  libwvdrmengine/cdm/test/integration-test.mk
  libwvdrmengine/cdm/test/unit-test.mk
  libwvdrmengine/level3/Android.bp
  libwvdrmengine/mediacrypto/Android.bp
  libwvdrmengine/mediacrypto/test/Android.mk
  libwvdrmengine/mediadrm/Android.bp
  libwvdrmengine/mediadrm/test/Android.mk
  libwvdrmengine/oemcrypto/odk/Android.bp
  libwvdrmengine/oemcrypto/odk/test/fuzzing/Android.bp
  libwvdrmengine/oemcrypto/odk/test/fuzzing/corpus_generator/Android.bp
  libwvdrmengine/oemcrypto/test/Android.mk
  libwvdrmengine/test/unit/Android.mk
  libwvdrmengine/tools/metrics_dump/Android.bp

Added SPDX-license-identifier-Apache-2.0 legacy_by_exception_only to:
  libwvdrmengine/Android.mk
  libwvdrmengine/vts/vendor_module/Android.mk

Added legacy_by_exception_only to:
  libwvdrmengine/level3/arm/Android.mk
  libwvdrmengine/level3/arm64/Android.mk
  libwvdrmengine/level3/mips/Android.mk
  libwvdrmengine/level3/mips64/Android.mk
  libwvdrmengine/level3/x86/Android.mk
  libwvdrmengine/level3/x86_64/Android.mk
  libwvdrmengine/mediacrypto/Android.mk
  libwvdrmengine/mediadrm/Android.mk
  libwvdrmengine/oemcrypto/test/XtsTest.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I41ef520b6e394a7708f453a706e6ef1a5f46c36a
Merged-in: I41ef520b6e394a7708f453a706e6ef1a5f46c36a
2021-03-30 09:26:30 -07:00
Cong Lin
6a08cd3890 Refresh L3 builds for buffer overflow fixes on rvc-qpr-dev am: ce607283c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13973686

Change-Id: I398d987ae78d5f438d89894a2e41f51b5db6f8ce
2021-03-30 01:36:38 +00:00
Cong Lin
ce607283c1 Refresh L3 builds for buffer overflow fixes on rvc-qpr-dev
Cherry-pick CL from wv master:
https://widevine-internal-review.git.corp.google.com/c/cdm/+/118363

Fixes included in this CL:
go/wvgerrit/111603
Fix L3 block offset test and re-enable buffer overflow tests

go/wvgerrit/111784
Fix heap overflow test in L3 and OEMCrypto ref

go/wvgerrit/113644
Check for buffer overflow when computing subsample size

go/wvgerrit/113946
Fix test failures caused by huge key length in L3

Bug: 180956067
Bug: 175001473
Bug: 175741683
Bug: 172866305
Bug: 175041667
Test: L3 unit test
Test: go/forrest https://android-build.googleplex.com/builds/tests/view?invocationId=I10900007766741431&testResultId=TR22818280880061022&redirect=http://sponge2/3c1fc176-f3bc-46e6-af7c-b2925ae3765b
Change-Id: Ied639d0639295aa6fade1d9ff3c6eab6a941b36d
2021-03-23 11:12:35 -07: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
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
Edwin Wong
76f39ddb08 [RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability.
The shared memory buffer used by srcPtr can be freed by another
thread because it is not protected by a mutex. Subsequently,
a use after free AIGABRT can occur in a race condition.

SafetyNet logging is not added to avoid log spamming. The
mutex lock is called to setup for decryption, which is
called frequently.

The crash was reproduced on the device before the fix.
Verified the test passes after the fix.

Test: sts
  sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176495665#testPocBug_176495665

Test: push to device with target_hwasan-userdebug build
  adb shell /data/local/tmp/Bug-176495665_sts64

Bug: 176495665
Bug: 176444161
Change-Id: Ie1aca0ceacb4b7a1b6e473b823541607a36d8cb4
Merged-In: If62b73a9c636048f942a2fc63a13b5bfd1e57b86
2021-03-09 17:10:54 +00:00
Edwin Wong
9c278174c8 [RESTRICT AUTOMERGE] Fix WVCryptoPlugin use after free vulnerability.
The shared memory buffer used by srcPtr can be freed by another
thread because it is not protected by a mutex. Subsequently,
a use after free AIGABRT can occur in a race condition.

SafetyNet logging is not added to avoid log spamming. The
mutex lock is called to setup for decryption, which is
called frequently.

The crash was reproduced on the device before the fix.
Verified the test passes after the fix.

Test: sts
  sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176495665#testPocBug_176495665

Test: push to device with target_hwasan-userdebug build
  adb shell /data/local/tmp/Bug-176495665_sts64

Bug: 176495665
Bug: 176444161
Change-Id: Ie1aca0ceacb4b7a1b6e473b823541607a36d8cb4
2021-03-08 15:54:00 -08:00
Edwin Wong
f3ad627bcb [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow.
There is a potential integer overflow to bypass the
destination base size check in decrypt. The destPtr
can then point to the outside of the destination buffer.

Test: sts-tradefed
  sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176444622#testPocBug_176444622

Test: push to device with target_hwasan-userdebug build
  adb shell /data/local/tmp/Bug-17644462264

Bug: 176444622
Bug: 176496353
Change-Id: Id3aece61d46d548c304782d4e1dc3a4747795c01
Merged-In: Id3aece61d46d548c304782d4e1dc3a4747795c01
2021-02-25 21:34:23 +00:00
Edwin Wong
0b18148b09 Fix potential decrypt destPtr overflow.
There is a potential integer overflow to bypass the
destination base size check in decrypt. The destPtr
can then point to the outside of the destination buffer.

Test: sts-tradefed
  sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176444622#testPocBug_176444622

Test: push to device with target_hwasan-userdebug build
  adb shell /data/local/tmp/Bug-17644462264

Bug: 176444622
Bug: 176496353
Change-Id: Id3aece61d46d548c304782d4e1dc3a4747795c01
Merged-In: Id3aece61d46d548c304782d4e1dc3a4747795c01
2021-02-25 17:56:53 +00:00
Edwin Wong
cd37425acb Fix potential decrypt src pointer overflow. am: c3a24e6c86 am: 25f89c373c am: 15ba854123 am: 0126cc541f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1644e541f8f21e85f58b600880537da9bd7d9301
2021-02-03 01:33:24 +00:00
Edwin Wong
0126cc541f Fix potential decrypt src pointer overflow. am: c3a24e6c86 am: 25f89c373c am: 15ba854123
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0ca1b56fb48691be44e302dc0acaecfdf14b7e5c
2021-02-03 01:11:50 +00:00
Edwin Wong
15ba854123 Fix potential decrypt src pointer overflow. am: c3a24e6c86 am: 25f89c373c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie5c32617a1ebbed4805aa0a048a2ab92ff958c11
2021-02-03 00:35:53 +00:00
Edwin Wong
25f89c373c Fix potential decrypt src pointer overflow. am: c3a24e6c86
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I243e7a6e4ea799af9759be2ee41f9d9ff7805f0e
2021-02-03 00:03:49 +00:00
Edwin Wong
c3a24e6c86 Fix potential decrypt src pointer overflow.
Merged from http://go/wvgerrit/114903

There is a potential integer overflow to bypass the
source base size check in decrypt. The source pointer
can then point to the outside of the source buffer,
which could potentially leak arbitrary memory content
to destination pointer.

Test: sts-tradefed
  sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176496160#testPocBug_176496160

Test: push to device with target_hwasan-userdebug build
  adb shell /data/local/tmp/Bug-17649616064

Bug: 176496160
Bug: 176444786
Change-Id: I208e0d5d949e8ef003fcf7d6f129eab66b9b3656
2021-01-28 17:59:08 +00:00
Rahul Frias
dd140c463c Reprovision on error 10085 [ DO NOT MERGE ] am: c5b65aa5ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13139811

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0251d7327a8c395fd79c0aaf52241a548d954713
2020-12-09 18:09:13 +00:00
Rahul Frias
c5b65aa5ed Reprovision on error 10085 [ DO NOT MERGE ]
[ Merge of http://go/wvgerrit/110603 and http://go/ag/13139808 ]

Qualcomm SoC may report 10085 (RSASSA-PSS signature error) when
OEMCrypto_PrepareAndSignLicenseRequest is called. The app needs to
reprovision (or the user needs to factory reset their device) in order
to recover.

If the 10085 error is returned, the app currently will get a
MediaDrmStateException. The app has no way to be able to tell
whether this is due to the 10085 error or some other error.

This change returns a NEED_PROVISIONING error at the CDM level, which
will result in the app receiving a NotProvisionedException when
MediaDrm.getKeyRequest is called.

Bug: 174375589
Test: GtsMediaTestCases, WV unit/integration tests
Change-Id: I4f2884c8a5fd88ab2e9bfbc0731a20e58cec0f36
2020-12-03 03:29:33 -08:00
Robert Shih
4e94dce40b x86 L3: use correct struct size [ DO NOT MERGE ] am: 44aea963d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13061527

Change-Id: I5556d22cebfb8f67ba5953444e712f4283c47aff
2020-11-17 03:15:10 +00:00
Robert Shih
44aea963d0 x86 L3: use correct struct size [ DO NOT MERGE ]
Bug: 139814713
Bug: 173331251
Test: GtsMediaTestCases
Change-Id: Ia2db4c1bd4e080a5c0ee4c7be742401494f251b9
2020-11-16 01:34:53 +00:00
Cong Lin
739ae08bb3 Upgrade L3 to v16 and update android makefiles [DO NOT MERGE] am: 2f08c48e94
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12868368

Change-Id: Iacd880e4efcb8bb15247407714b1f6f832b67e1a
2020-11-05 01:47:34 +00:00
Cong Lin
2f08c48e94 Upgrade L3 to v16 and update android makefiles [DO NOT MERGE]
Merging CL:
https://widevine-internal-review.googlesource.com/c/cdm/+/108203
and
https://widevine-internal-review.git.corp.google.com/c/cdm/+/103904 (changes to the L3 source files are excluded)

Generated L3 v16 for Android and added ODK dependency required by L3 v16.

Test: Unit tests on gLinux
    jenkins/linux_unit_tests
    jenkins/ce_cdm_tests
Test: Unit tests on Pixel 4(flame-userdebug, rvc-qpr-dev)
    vendor/widevine/libwvdrmengine/build_and_run_all_unit_tests.sh
Test: Manual ExoPlayer playback tests on Pixel 4(flame-userdebug) for L1 and L3
    WV: Secure HD/SD (cenc,MP4,H264)
    WV: Secure HD/SD (cbc1,MP4,H264)
    WV: Secure HD/SD (cbcs,MP4,H264)
Test: Widevine GTS tests(bramble-userdebug, rvc-qpr-dev)
    https://android-build.googleplex.com/builds/tests/view?invocationId=I35000006266076664&testResultId=TR45714199883476235
    (Note: the two failures are due to GTS/http issue and not related/specific to L3 and the change)
Bug: 136317881
Bug: 139814713
Change-Id: If3d4999ca3b725eab76c41588f202beec3873928
2020-11-04 18:53:04 +00:00
Baligh Uddin
2ccfaeac56 Cleanup references to system/core/base -> system/libbase am: 673ca3c689
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12917865

Change-Id: I6b48816ef96567b7c7f8aff643706f624b46a1b9
2020-10-26 23:12:52 +00:00
Baligh Uddin
673ca3c689 Cleanup references to system/core/base -> system/libbase
BUG: 157656545
Test: TH
Merged-In: I3412348b28b56b13702af14ce77238fac506efdd
Change-Id: I9398826834a360afdf973c94afb11edcd65a6779
2020-10-26 03:32:32 +00:00
Rahul Frias
9f2363e076 Delay license state evaluation for offline licenses am: 8543b4c903
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12646162

Change-Id: I7b0f8239720e3aab7324dce8e2956e8135d0a65c
2020-09-23 02:46:20 +00:00
Rahul Frias
8543b4c903 Delay license state evaluation for offline licenses
[ Merge of http://go/wvgerrit/106325 and http://go/ag/12644840 ]

When offline licenses are restored, licenses and any renewals are processed.
License state evaluation occurs and notifications are sent to listeners.
If the license is expired, which is likely if a renewal is present,
the license state will transition to expired. Transitions out of
expired state are not allowed and the renewal has no effect.

If we work around this by allowing transitions out of expired state,
listeners will get notifications that keys have expired and then that are
usable soon after. To avoid delivering erroneous notifications we delay
evaluation of license state while the license and renewal are being processed.
Evaluation occurs at the last stage of license restoration when playback
information from the usage table is being restored.

This only need to occur for when licenses are being restored. In other
cases when a license or renewal is received, license state evaluation
and event listener notification needs to occur immediately.

Bug: 166131956

Test: WV unit/integration tests, GtsMediaTestCases tests
Change-Id: Ic8ade25316c5e20cc88de9225c43c24b28f21ac4
2020-09-22 15:36:35 -07:00
Fred Gylys-Colwell
f5896158c1 Sign unused renewal so that offline renewal may be loaded am: 80667cbac3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12629547

Change-Id: Ic8a236e81d07bbc629cfa9a7a0e46513c2cbac1d
2020-09-22 21:31:43 +00:00
Fred Gylys-Colwell
80667cbac3 Sign unused renewal so that offline renewal may be loaded
Merge from Widevine repo of http://go/wvgerrit/105347

When reloading an offline license that has an offline renewal, we sign
a unused renewal so that the ODK library can update its clock values.

Test: WV unit/integration tests, GtsMediaTestCases tests
Bug: 166131956
Change-Id: Ib1445fd85222489f21221e00729d4989cb49a331
2020-09-22 02:44:05 +00:00
Alex Dale
601d910d17 DO NOT MERGE Handle unlimited usage table capacity. am: 99335a6aa8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12266132

Change-Id: I25cb6ad05f466357fa4e2485a093ae8598bd5b51
2020-08-17 19:19:36 +00:00
Alex Dale
99335a6aa8 DO NOT MERGE Handle unlimited usage table capacity.
[ Merge of http://go/wvgerrit/103684 ]
[ Cherry pick of http://ag/12221244 ]

The OEMCrypto method for usage table capacity can return zero to
indicate that the usage table size is not explicitly limited.  The
CDM must handle this case with regard to the CDM's usage table
management and information querying.

The usage table initialization tests are extended to include cases
where the table does not have a defined limit.

AddEntry() was missing call to update the usage table header after
creating a new usage entry.  This call is now included and required
additional changes to the usage table unit tests.

Bug: 160560364
Test: Android unit tests
Change-Id: Ica5d181092d2938d24deba5005a211ca883cb0f0
2020-07-29 17:45:21 -07:00