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

@@ -184,7 +184,9 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
break;
case KEY_REQUEST_ERROR_1: *os << "KEY_REQUEST_ERROR_1";
break;
case KEY_SIZE_ERROR: *os << "KEY_SIZE_ERROR";
case KEY_SIZE_ERROR_1: *os << "KEY_SIZE_ERROR_1";
break;
case KEY_SIZE_ERROR_2: *os << "KEY_SIZE_ERROR_2";
break;
case KEYSET_ID_NOT_FOUND_1: *os << "KEYSET_ID_NOT_FOUND_1";
break;