Use either spelling of AllocateSecureBuffer in dynamic adapter

Merge from Widevine repo of http://go/wvgerrit/121883

There was a problem in the v16.3 header that did not rename
OEMCrypto_AllocateSecureBuffer to _oecc109 or
OEMCrypto_FreeSecureBuffer to _oecc110. These functions are only used
in testing.

This changes the dynamic adapter to accept either name for those
functions.

Bug: 171121061
Change-Id: Ide5b3f959ee5ebc54cbf0caa07cbd7d5e85a6031
This commit is contained in:
Fred Gylys-Colwell
2021-04-10 10:54:02 -07:00
parent 985d0b5129
commit fa0c9c3123

View File

@@ -885,6 +885,16 @@ class Adapter {
LOOKUP_ALL(16, MinorAPIVersion, OEMCrypto_MinorAPIVersion);
// clang-format on
// There was a mistake in version 16.3 of the header that did not rename
// OEMCrypto_AllocateSecureBuffer or OEMCrypto_FreeSecureBuffer
if (level1_.AllocateSecureBuffer == NULL ||
level1_.FreeSecureBuffer == NULL) {
level1_.AllocateSecureBuffer = (L1_AllocateSecureBuffer_t)dlsym(
level1_library_, "OEMCrypto_AllocateSecureBuffer");
level1_.FreeSecureBuffer = (L1_FreeSecureBuffer_t)dlsym(
level1_library_, "OEMCrypto_FreeSecureBuffer");
}
// TODO(119830252): make the code below available to a static adapter.
// Check if the keybox or oem certificate is valid, if so, we are finished
// with initialization.