Reject Embedded Keys Under 16 Bytes

(This is a merge of http://go/wvgerrit/60620)

The license code handles keys larger than 16 bytes correctly, but it
does not properly reject keys smaller than 16 bytes.

This patch adds unit tests not only for the new error case but also
the existing success cases which were not previously being tested. As
part of this, license_unittest was changed to use a Test Peer instead
of making the test fixture a friend class.

Bug: 111069024
Test: CE CDM unit tests
Test: Android unit tests
Change-Id: Idb2deb6fbe0aeb19b530f9818bebff480541f5c8
This commit is contained in:
John W. Bruce
2018-10-08 10:05:34 -07:00
parent 44fe62b0a6
commit 3d603eb12d
14 changed files with 158 additions and 32 deletions

View File

@@ -161,8 +161,10 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kInvalidSessionId;
case wvcdm::KEY_REQUEST_ERROR_1:
return kKeyRequestError1;
case wvcdm::KEY_SIZE_ERROR:
return kKeySizeError;
case wvcdm::KEY_SIZE_ERROR_1:
return kKeySizeError1;
case wvcdm::KEY_SIZE_ERROR_2:
return kKeySizeError2;
case wvcdm::KEYSET_ID_NOT_FOUND_1:
return kKeySetIdNotFound1;
case wvcdm::KEYSET_ID_NOT_FOUND_2: