Commit Graph

1141 Commits

Author SHA1 Message Date
Alex Dale
6a247ab924 INSUFFICIENT_RESOURCE errors are mapped consistently.
[ Merge of http://go/wvgerrit/102109 ]

The CDM was using unique CDM error codes for the various cases
where OEMCrypto would return INSUFFICIENT_RESOURCE.  However, these
error codes were being incorrectly mapped at the Android level,
resulting in incorrect errors in the MediaDRM layer.

At no point does the CDM handle different INSUFFICIENT_RESOURCE_x
within the same case, as such the use of unique codes are limited.
This CL removes the unique codes, and unifies them under the same
CDM error code.

This CL also extends SelectKey to handle error codes returned by
LoadEntitledContentKeys.

Bug: 154682842
Test: Unit tests
Change-Id: I319fabf6cac60b0dc19ea891609689daeeaeb435
2020-06-22 16:27:25 -07:00
Rahul Frias
992d54d912 Merge "Handle SPOID calculation for L3" into rvc-dev am: 25d1646138 am: dffadd204c am: 61f64a00c6 am: 1b6f50a467
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11736137

Change-Id: Iba9cfe403e14249910d5ba19a3ec4c238d7c09cd
2020-06-22 18:46:13 +00:00
Rahul Frias
7e689a1828 Handle SPOID calculation for L3
[ Merge of http://go/wvgerrit/101443 ]

The WVDrmPlugin has a single CdmIdentifier. The CdmIdentifier contains
a SPOID that is calculated from the device ID (keybox or OEM cert),
an application reverse domain name and possibly an origin.

The CdmIdentifier is set and SPOID calculated on certain calls into
WVDrmPlugin. Once it is set, it will not be recalculated. We prevent
certain operations such as modifying the origin once the CdmIdentifier
has been set as this will require recalculating the SPOID.
Recalculating the SPOID may affect open sessions or calls in progress.

In a similar way, modifying the security level, will affect the
Device ID value and in turn the SPOID. The security level cannot be modified
if any sessions are open. This does leave open the possibility that the
SPOID may be calculated at one security level, sessions are then closed,
and the security level is then changed without an error being flagged.

The provisioning certificate file name is based on the SPOID. When
the SPOID does not match the security level, either the provisioning
information may not be found even though that security level has
been provisionined or the provisioning information may be stored
in an incorrect location if provisioning occurs.

The correct solution is to prevent modifications to the security level
once the CdmIdentifier is set. This is a behavior change and might
impact apps. We will reevaluate this for the next release.

For now, we will work around this. When the CdmIdentifier is set for L3,
we will calculate SPOIDs with both L1 and L3 device IDs and check if
provisioning previously occurred with SPOIDs calculated for that level.
If so, use that level, otherwise use L3.

Bug: 147703382
Test: Android unit/integration tests, GtsMediaDrmTests
Change-Id: Ia64adfc5848e431ee3876af03eebdb4b6eb83116
2020-06-17 00:50:14 -07:00
Rahul Frias
7589364dc6 Merge changes I295f66f9,I142f286c into rvc-dev am: 05fbb3dd87 am: 0db9b974c2 am: 1c6633d408 am: 7b0fe07c8a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11620164

Change-Id: If47d215914fbb11d2d33cd01b635d4fe16112957
2020-06-16 09:22:07 +00:00
Rahul Frias
8da1145012 Add ATSC support - part 2
[ Merge of http://go/wvgerrit/100905 and http://go/ag/10708438 ]

Add support for ATSC certificate and licenses handling. ATSC
files are distinguished from the apps DRM certificate and licenses
by file naming conventions.

Bug: 139730600
Test: WV unit/integration test, GtsMediaTestCases
Change-Id: I295f66f92fe01d7716978deac9dc360d74addedd
2020-06-12 03:48:58 -07:00
Rahul Frias
bbe9f6afc4 Add ATSC support - part 1
[ Merge of http://go/wvgerrit/100864 and http://go/ag/10704773 ]

ATSC 3.0 allows for licenses to be downloaded OTA and are tied to
a DRM certificate that may be shared across apps. The provisioning
process for ATSC may happen at the factory or during an OS update.

This contrasts from the regular OTT model, which requires that
provisioning and license download have an uplink as well as a
downlink connection.

This adds support for the ATSC mode property. ATSC mode can only be
set (or unset) before sessions are opened. Once the CDM identifier is
set/sealed, requests to modify the ATSC mode will be rejected.

If one needs to open sessions with both ATSC mode and regular (non-ATSC)
mode, separate MediaDrm objects will need to be created. The default
mode is to not use ATSC.

Enable ATSC mode by calling
  mediaDrm.setPropertyString("atscMode", "enable")

Disable ATSC mode by calling
  mediaDrm.setPropertyString("atscMode", "disable")

Provisioning and unprovisioning requests for ATSC will be rejected as
certificates will be retrieved by the ATSC service.

Bug: 139730600
Test: WV unit/integration test, GtsMediaTestCases
Change-Id: I142f286c711fe007ff42125c3c8cdc6450b6ea36
2020-06-08 14:56:48 -07:00
John W. Bruce
e47233ecf6 Add <algorithm> to device_files.cpp
(This is a merge of http://go/wvgerrit/101423 to Android.)

This header was missing. On the STL used inside Google, it gets included
transitively, but this is not guaranteed and broke in a partner's STL.

Bug: 154185251
Test: Android Build
Test: CE CDM Build and Unit Tests
Change-Id: If8df7e288073e69250f98d67f732804a955bbaa3
2020-06-03 16:21:57 -07:00
Fred Gylys-Colwell
2c8ead459e Check for null pointers in oemcrypto adapter am: 42eb79a3ff am: 7a4313483c am: 2643b76731 am: fcf75fec0d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677946

Change-Id: I7140851ef02ea0ee3f07ba2825b7330f661a1265
2020-06-02 22:26:50 +00:00
Fred Gylys-Colwell
42eb79a3ff Check for null pointers in oemcrypto adapter
Merge from Widevine repo of http://go/wvgerrit/100963

Test: unit tests on taimen
Bug: 156967805
Change-Id: Ic8ba7461ffcaa371a5239dca84e8a3007b0df517
2020-06-02 08:30:34 -07:00
Alex Dale
94314def43 Rolled expected version number for R. am: dd70d63b76 am: 9329bf331c am: 7eb1c2b619 am: 32f70b0464
Change-Id: I4f6d3d744869708d538b5d0881044ab0d605e0a8
2020-05-27 22:11:40 +00:00
Alex Dale
dd70d63b76 Rolled expected version number for R.
[ Merge of http://go/wvgerrit/100403 ]

VersionNumberTest.VersionNumberChangeCanary was expecting a version
string of "R".  However, Android rvc branch is now far enough into
development to use a numbered version: version "11".

Bug: 156853733
Test: Android license request test
Change-Id: I63d33f742c849b672b2d2402ab8423fdf2450f6f
2020-05-27 17:27:46 +00:00
TreeHugger Robot
a34288e1fe Merge "Start playback timer in integration tests" into rvc-dev am: 7534d9795b am: 208a088e8e am: 3889252bfc am: 2379c7664a
Change-Id: I47ac491d8c5097d7372bcab1ca6667a48a8f01d8
2020-05-27 04:58:58 +00:00
TreeHugger Robot
7534d9795b Merge "Start playback timer in integration tests" into rvc-dev 2020-05-27 03:43:30 +00:00
John Bruce
93217d4228 Merge "Allow CDM to Build With Recent GCC" 2020-05-26 20:12:10 +00:00
Fred Gylys-Colwell
cd4d4f564a Update TimeRollbackPrevention unit test am: 75575418d0 am: 7cd14be01d am: 51cf7e4668 am: 40e2e7fa08
Change-Id: I21b29668ed8a9b39e8a7679ed65281d14587bba3
2020-05-21 23:05:32 +00:00
Fred Gylys-Colwell
75575418d0 Update TimeRollbackPrevention unit test
Merge from Widevine repo of http://go/wvgerrit/100110

The unit test TimeRollbackPrevention was broken for several
reasons. This CL reduces the test to its most basic functionality and
updates it to be compatible with a v16 oemcrypto.

This CL also adjusts the fake clock used by the buildbot to fake
sleeping backwards, so that the TimeRollbackPrevention test can also
be run on the buildbot.

Bug: 155773482
Bug: 79422351
Test: unit tests on buildbot, and on flame w/v16 modmock
Change-Id: I3027018b17b738281989e63ae6b0729757217d05
2020-05-20 13:47:28 -07:00
Fred Gylys-Colwell
f6229788b0 Start playback timer in integration tests
Merge from Widevine repo of http://go/wvgerrit/100328

Several integration tests in WvCdmRequestLicenseRollbackTest had been
testing the duration of a license. However, the license they request
sets the playback duration and not the rental duration. That means the
timer we are checking does not start until the first playback. To fix
the tests, we simply add a decrypt operation right after the license
is received.

Test: integration tests w/v16 mod mock.
Bug: 156854660
Change-Id: Ie4f017c82db8aaf084ad050de3fcb7f51987c97e
2020-05-18 20:57:41 +00:00
John W. Bruce
bdd7b9d89f Allow CDM to Build With Recent GCC
(This is a merge of http://go/wvgerrit/100051. However, only one part of
that change affects the Android code, so I have filtered this
description.)

By default, the CDM builds with Clang on Android and on developers' dev
boxes. The buildbot builds most of the code with an old version of GCC.
However, recent versions of GCC were refusing to build our code for a
variety of reasons. This patch fixes the codebase up so that the
version of GCC 9 included on gLinux workstations can compile the CDM.

The only change that affects Android is that a variable was being set
but never read in one place.

Test: Android Unit Tests
Bug: 145245240
Bug: 152449437
Change-Id: Iaeb0531652bb8e7bd69f850fc6b4bba1efa3271b
2020-05-15 12:58:24 -07:00
Fred Gylys-Colwell
80f0967670 License release does not use core message am: 760bf71908 am: 98ca694dcd am: fa074ccc04 am: 0d792297b5
Change-Id: Id11a9c55a032d71e6a067d8bb1817b9076194d29
2020-05-15 00:03:58 +00:00
Fred Gylys-Colwell
760bf71908 License release does not use core message
Merge from Widevine repo of http://go/wvgerrit/99843

When processing a license release, the license is not loaded, so
OEMCrypto does not know nonce version information for the core
message. It assumes that all license releases are v15, so it is not an
error for a license release to not have a core message.

This CL also adds some extra logging to tests so that we can track
content id and the pssh. This CL also updates some of the test content
policies when running the local license server. The local license
server is only used for debugging problems.

Bug: 152648172 Integration test WvCdmEngineTest.LicenseRenewal failing
Bug: 156259697 License release does not need core message
Test: Unit tests with v16 mod mock
Change-Id: I04c896adadfb17877ce1115345d2419e0d2489f0
2020-05-13 21:22:43 +00:00
Alex Dale
373103998b Update AddEntry() for usage table changes. am: 66e3d69300 am: 4c97abd57a am: c15d453a9d am: 7c56669a4f
Change-Id: Ic2cb6b4ead661ec1be3aabcf82c28cad2f7d37a5
2020-05-01 02:13:30 +00:00
Alex Dale
7f0d79407c Added a few edge case unittests for InvalidateEntry(). am: 1e5e221909 am: 51f5315a62 am: 069de13b94 am: a2dace6651
Change-Id: I1d8f84baa78a9a21b86de3e88bc48b42e4c94f46
2020-05-01 02:13:21 +00:00
Alex Dale
aef81bd383 Reworked DeleteEntry() into InvalidateEntry(). am: da48461ba2 am: 44cc2500b3 am: 5558f13d57 am: 770e8a929f
Change-Id: I5749c58374f93ad5d6b28b0b97321924bb5cb2ac
2020-05-01 02:13:19 +00:00
Alex Dale
66e3d69300 Update AddEntry() for usage table changes.
[ Merge of http://go/wvgerrit/96071 ]

Changes to how the usage table method InvalidateEntry() behaves
required additional changes to CDM code that uses this method.

This involved some refactoring to AddEntry(), moving the LRU
related code to its own function.

A few unittests had to be changed / removed as the moving
multiple entries changes expectations of several existing tests.

Several additional helper methods have been created to improve
readability.  These include getters for information about the
usage table, a method for releasing stale entries, and a method of
recording LRU metrics.

Bug: 150890014
Bug: 150887808
Bug: 154269671
Test: Linux unit tests and Android unit tests
Change-Id: I11a98f9a2dea9b2ae57b37d7d4483a37be721763
2020-04-30 18:00:25 -07:00
Alex Dale
1e5e221909 Added a few edge case unittests for InvalidateEntry().
[ Merge of http://go/wvgerrit/95365 ]

The changes made to how DeleteEntry (now InvalidateEntry) works
introduced a few additional edge cases which were not covered from the
previous set of unit tests.

Bug: 150887808
Bug: 149100568
Test: Linux unit tests and Android unit tests
Change-Id: I263b72fb708c6546294af23ae5ddbd2e82da34df
2020-04-30 18:00:25 -07:00
Alex Dale
da48461ba2 Reworked DeleteEntry() into InvalidateEntry().
[ Merge of http://go/wvgerrit/95406 ]

There was an issue with DeleteEntry() where it would result in an
invalid table state if shrinking the usage table when the number of
sessions is at its max.

This required changing how the usage table invalidates entries.  Now,
after invalidating an entry (marking an entry as kStorageTypeUnknown)
the table is defragmented if specified to.

Defragmentation involves:
1)  Move valid entries near the end of the table to the position of
    invalid entries near the front of the table.
2)  Shrinking the table to cut off trailing invalid entries.

This change updates the existing tests to pass, but still needs new
tests for some of the edge cases.

Bug: 150887808
Bug: 149100568
Test: Linux unit tests and Android unit tests
Change-Id: I70c7b296e5e4b367746fcdaabbf0f12dcfb39230
2020-04-30 18:00:25 -07:00
Alex Dale
7ebcda2cb0 Merge "Suppress error for removing lingering offline licenses." into rvc-dev am: 792e17a8c4 am: d7f5a74ea3 am: f85508f4b3 am: 81f27573e1
Change-Id: Ia8d51da6c8b9e737c87b7ef3ee5a37cd6554c45a
2020-05-01 00:51:32 +00:00
Alex Dale
792e17a8c4 Merge "Suppress error for removing lingering offline licenses." into rvc-dev 2020-04-30 23:53:44 +00:00
Rahul Frias
4040951907 Merge "Do not log nonces" into rvc-dev am: d627fdfdd4 am: d39e5f3ad3 am: 96a3893440 am: ee902bc63f
Change-Id: I4f77136607465c1af9ff70d489bf76e4d89dea4e
2020-04-30 21:47:44 +00:00
Rahul Frias
d627fdfdd4 Merge "Do not log nonces" into rvc-dev 2020-04-30 20:40:42 +00:00
Rahul Frias
6ea6723462 Do not log nonces
[ Merge of http://go/wvgerrit/99063 ]

Bug: 155329753
Test: wv unit/integration tests
Change-Id: I642b19f817ce69cb0838512cb8922a2e9c51cef2
2020-04-30 00:34:44 -07:00
Alex Dale
2a16d70a06 Suppress error for removing lingering offline licenses.
[ Merge of http://go/wvgerrit/97963 ]

There are situations where an offline license file will remain on the
system after it's usage entry has been deleted.  This would result in
its key set ID being reported as present by the CDM, but any
operations acting upon it will result in an error.

The app should be able to remove the license without error, so long
as the license file exists and no other OEMCrypto operations fail.

This change introduces a new error code LICENSE_USAGE_ENTRY_MISSING,
which indicates that a license's usage entry cannot be found.

A new integration test checks that the CDM can handle the calls to
removeOfflineLicense().

Bug: 137034719
Test: Android unit and integration tests
Change-Id: Ibdbe963b7f7e3ac97b446300d8e3896cdee7abc5
2020-04-29 17:48:26 -07:00
Rahul Frias
e27bc4ba6a Accept a security level to be specified during provisioning
[ Merge of http://go/wvgerrit/97267 ]

In earlier releases, provisioning would occur based on a cached
security level. If an open session call returned a NotProvisionedException
the security level would be cached for use with any future provisioning
call.

An app would have to set the security level, then call openSession,
have it fail and then request provisioning. This fits the normal flow of
most apps. Still on occasion, an app might change requested security level
after an openSession call failed. Using the cached security level
would result in unexpected behavior.

This change allows provisioning to occur at the last security level that
was set.

Bug: 129356527
Test: wv unit/integration tests, GTS tests (GtsMediaTestCases)
Merged-In: I8d9234eec2b23a9c913e77a709943b431e25e43e
Change-Id: I8d9234eec2b23a9c913e77a709943b431e25e43e
2020-04-28 11:58:59 -07:00
Rahul Frias
3c8acc3d56 Accept a security level to be specified during provisioning
[ Merge of http://go/wvgerrit/98694 and http://go/ag/11052323 ]

In earlier releases, provisioning would occur based on a cached
security level. If an open session call returned a NotProvisionedException
the security level would be cached for use with any future provisioning
call.

An app would have to set the security level, then call openSession,
have it fail and then request provisioning. This fits the normal flow of
most apps. Still on occasion, an app might change requested security level
after an openSession call failed. Using the cached security level
would result in unexpected behavior.

This change allows provisioning to occur at the last security level that
was set.

Bug: 129356527
Test: wv unit/integration tests, GTS tests (GtsMediaTestCases)
Change-Id: I8d9234eec2b23a9c913e77a709943b431e25e43e
2020-04-27 23:20:40 -07:00
Alex Dale
bebedce81f Removed provisioning loop in unittests.
[ Merge of http://go/wvgerrit/98467 ]

The issue with intermediate provisioning request failures with the
development provisioning server has been resolved in b/139206968.

This change removes the provisioning retry loop which was a workaround
for the CDM unit tests.  Should the issue re-arise, it would be useful
to detect it in our unit tests.

Bug: 139361531
Test: Linux unit tests
Change-Id: Ib44c56c740efea562803d3f8f93ffd62bd95e485
2020-04-22 15:23:35 -07:00
John W. Bruce
04d362df9e Fix Entitlement Licenses am: 4444ba3b47 am: c9caa507b3 am: f810732cdb am: 507267f3fe
Change-Id: Iaf651f37d1c858db5fbe73c8bf700eb7b1414bb3
2020-04-04 00:00:28 +00:00
John W. Bruce
4444ba3b47 Fix Entitlement Licenses
(This is a merge of http://go/wvgerrit/97083.)

The switch from LoadKeys to LoadLicense broke entitlement licenses
entirely because the LoadLicense path in CryptoSession didn't include
any affordances for updating the KeySession, unlike the LoadKeys path.
This patch adds code to handle this.

Bug: 152814106
Test: CE CDM Unit Tests
Test: Android Unit Tests
Change-Id: Id0c33a566e17e6be8da04e12be4b0fc87559aa8f
2020-04-03 22:33:40 +00:00
TreeHugger Robot
09121feb52 Merge "CryptoSession: Propagate err from GetSystemIdInternal in Open" into rvc-dev am: 4fe638a779 am: 5775aff942 am: d251cea528 am: b196554f90
Change-Id: Ie324f4fc78d93efef42889cffdc98f9dfd34dc27
2020-04-02 00:34:58 +00:00
TreeHugger Robot
4fe638a779 Merge "CryptoSession: Propagate err from GetSystemIdInternal in Open" into rvc-dev 2020-04-01 22:52:21 +00:00
Robert Shih
07f40d1bed CryptoSession: Propagate err from GetSystemIdInternal in Open
Merge of http://go/wvgerrit/96509

Bug: 151231204
Test: GtsMediaTestCases
Change-Id: Ib29691fcea1c9d5fcfa981caf3e5bdab00cbb0bf
2020-04-01 07:01:24 +00:00
TreeHugger Robot
a9ada96c6e Merge "CryptoSession: handle 0-length buffer in DecryptSample" into rvc-dev am: e59339ed6d am: 94108cdbe8 am: 08eb9a7fae am: 29b6a916c9
Change-Id: I912abc7d15b847fc116d15b9ff919db557a4d7c0
2020-04-01 06:15:15 +00:00
TreeHugger Robot
e59339ed6d Merge "CryptoSession: handle 0-length buffer in DecryptSample" into rvc-dev 2020-04-01 05:12:53 +00:00
Robert Shih
dc9809f7c3 CryptoSession: handle 0-length buffer in DecryptSample
In `Combine Decrypt Calls to OEMCrypto`,
OEMCrypto_ERROR_BUFFER_TOO_LARGE is used as the default error code to
signal fallback to legacy decrypt (sending subsamples separately).
The error code would not be updated if no calls to OEMCrypto were
made (e.g. 0-length buffers).

This change resets error code to OEMCrypto_SUCCESS after fall back to
legacy decrypt. Consequently, buffers that do no require OEMCrypto
calls would return OEMCrypto_SUCCESS.

Merge of http://go/wvgerrit/96743

Bug: 150188155
Test: GtsMediaTestCases
Test: DashTest#testWidevineH264AdaptiveWithRendererDisabling
Change-Id: Ib23803c51f16bc809bda5c2720e628e81f1df1dc
2020-04-01 02:47:13 +00:00
Fred Gylys-Colwell
efb0452042 Replace OEMCrypto_LoadDeviceRSAKey with OEMCrypto_LoadDRMPrivateKey am: 56b836bda3 am: bb42e9bd41 am: 6b56c1c5ec am: b3657d0a6e
Change-Id: I0dc2f37ce34771592cdd0af4ce905a896a88fccd
2020-03-29 20:13:22 +00:00
Fred Gylys-Colwell
56b836bda3 Replace OEMCrypto_LoadDeviceRSAKey with OEMCrypto_LoadDRMPrivateKey
Merge from Widevine repo of http://go/wvgerrit/96783

This CL updates the reference code, unit tests, and adapter to use the
new v16 function OEMCrypto_LoadDRMPrivateKey. This is just an API
change to allow ECC support in the future. The reference code does not
yet support ECC certificates, and the CDM code assumes that all
certificates have an RSA key.

Bug: 152558018
Test: unit tests on taimen and w/v16 mod mock.
Change-Id: I0793b416513b81b3d74849f0b58dbdc91f075ac6
2020-03-29 10:43:54 -07:00
Rahul Frias
f3889b69e6 Merge "Reject partial clear subsamples when keys are not loaded" into rvc-dev am: 3560247878 am: c79babac4c am: 93bb315c8e am: ce55664f89
Change-Id: I1df6038bf84ee6191b0d96e21cd55c47cd15b447
2020-03-28 19:47:16 +00:00
Rahul Frias
3560247878 Merge "Reject partial clear subsamples when keys are not loaded" into rvc-dev 2020-03-28 18:24:15 +00:00
Rahul Frias
734aea940b Reject partial clear subsamples when keys are not loaded
[ Merge of http://go/wvgerrit/96514 ]

The combined decryption call feature was introduced in android R.
In earlier releases, subsamples were passed one at a time for
decryption within the plugin. A decryption request that consists
entirely of clear data should be passed on to OEMCrypto even if
no keys are loaded.

A sample might consist of subsamples of clear and protected data.
In legacy mode, this proved to be an issue for OEMCrypto if the clear
subsamples were passed on but the protected ones were rejected (b/110251447).

For legacy mode and in the absence of keys being loaded, the subsample will
be passed to OEMCrypto only if the clear lead/frame is in a single subsample
and not broken up across multiple subsamples.

Bug: 150316417
Test: WV android unit/integration tests
Change-Id: Iff8ae8f58530cb9c5d31ce388742443ae807c16f
2020-03-27 15:07:29 -07:00
John W. Bruce
d21d70f533 Restore OpenSSL Compatibility
(This is a merge of http://go/wvgerrit/96226.)

This patch does a number of different things in order to re-enable the
CDM to use OpenSSL 1.1.0+ out of the box, instead of just BoringSSL:

* To support https://cryptography.io/, BoringSSL has reimplemented just
  enough of the OpenSSL PKCS7 API that we can fulfill our purposes with
  code that works on either library. This patch replaces code in
  privacy_crypto_boringssl.cpp and oec_session_util.cpp that was only
  compatible with BoringSSL with code that also works in OpenSSL.

* Replaces code in oec_session_util.cpp that used the deprecated OpenSSL
  1.0.0 API with OpenSSL 1.1.0-compatible code. This code previously
  worked on BoringSSL because they have not yet removed the OpenSSL
  1.0.0 functions, even though they also implemented the 1.1.0 API.

* Replaces openssl/mem.h (which does not work in OpenSSL 1.1.0 and
  higher) with openssl/crypto.h. (which works in all OpenSSL and
  BoringSSL releases) This does not require any function code changes.

* The OID-comparison code in privacy_crypto_boringssl.cpp was using
  BoringSSL-exclusive functions to convert OBJ-format OIDs to text.
  Conversion functions that work on either library exist. However, the
  new code uses a different technique instead, pre-converting the
  passed-in OID to OBJ format. This allows it to be compared to the
  certificate directly, avoiding converting every certificate extension
  OID to text.

* Allows the selection of "openssl" as the privacy_crypto_impl and adds
  a variable to configure OpenSSL. More will follow in future patches
  as more configurations of OpenSSL are supported.

Bug: 140053043
Test: CE CDM Unit Tests
Test: CE CDM Unit Tests w/ the x86-64 Platform Reconfigured to OpenSSL
Test: Android Unit Tests
Change-Id: I57cebbbfb59e0bcab85b589b98fb9ffd18885415
2020-03-26 13:20:15 -07:00
Alex Dale
193d5c384d Usage table header operations no longer need an open session.
[ Merge of http://go/wvgerrit/95405 ]

There are several OEMCrypto functions that do not require an open
session to be called.  This change updates the OEMCrypto functions
related to the Usage Table Header.

Bug: 150888316
Test: Linux unit tests and Android build
Change-Id: Ic879876dd190fb3e058bbe8e0cce37273030b105
2020-03-23 12:56:41 -07:00