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: I30121c7524e8db580ba85f3e686a7a7c429d80a9
This commit is contained in:
Fred Gylys-Colwell
2021-04-09 18:19:16 -07:00
parent 6a59fee30a
commit 504b05492b

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.