Reject session clobbering and namespace fixes

* Reject session clobbering.

  [ Merge of http://go/wvgerrit/14634 ]

  This fixes a bug in I17de92b3e682c9c731f755e69466bdae7f560393 in which
  sessions can be clobbered by a forced session ID.  This bug manifested
  in subtle test failures which involved repeatedly creating sessions.
  This was traced to OEMCrypto not being terminated, then upward to a
  leaked CryptoSession and CdmSession, and then finally to clobbered
  session IDs.

  To avoid the bug in future, first, reject duplicate session IDs.
  Second, change the OpenSession API to make forced IDs explicit.

* Fix unit test namespaces.

  [ Merge of http://go/wvgerrit/14622 ]

  This fixes some odd errors that occur when linking multiple test
  suites into one executable.  When two object files both contain
  a definition of wvcdm::MockCryptoSession, for example, one will win
  silently and cause the other's tests to misbehave and/or crash.

  The solution is to put all mocks into an anonymous namespace, since
  each wvcdm::(anonymous)::MockCryptoSession is separate.

  In order to avoid lots of repetitions of wvcdm:: in the anonymous
  namespaces, all anonymous namespaces in unit tests now live inside
  or the wvcdm namespace.  This has been done even for tests which
  are not currently using mocks.

* Move timer and timer_unittest to Android.

  [ Merge of http://go/wvgerrit/14619 ]

  These are not used anywhere else.

Change-Id: I234f31e9b5c79061205728783596ebaff65e0aff
This commit is contained in:
Rahul Frias
2015-09-28 15:18:12 -07:00
parent 39f2fa2ab0
commit cdf309b9f4
25 changed files with 191 additions and 174 deletions

View File

@@ -341,6 +341,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kLicenseRequestSigningError;
case wvcdm::EMPTY_LICENSE_REQUEST:
return kEmptyLicenseRequest;
case wvcdm::DUPLICATE_SESSION_ID_SPECIFIED:
return kDuplicateSessionIdSpecified;
case wvcdm::LICENSE_RENEWAL_PROHIBITED:
return kLicenseRenewalProhibited;
case wvcdm::UNKNOWN_ERROR: