Add header functions for GetBCCType

Add new OEMCrypto_GetBCCType() function in v19.
Re-generate serialization and test files.

Test: opk_ta, opk_linux_ipc_ta, run_fake_l1_tests
Bug: 297918188
Change-Id: Id5f422776cd50c71ab483c06bbe3ac399461fb31
This commit is contained in:
Cong Lin
2023-10-13 12:06:35 -07:00
committed by Robert Shih
parent 417a9c7b77
commit df6d73f021
2 changed files with 54 additions and 2 deletions

View File

@@ -193,6 +193,7 @@ typedef OEMCryptoResult (*L1_GetUsageEntryInfo_t)(
int64_t* seconds_since_license_received,
int64_t* seconds_since_first_decrypt);
typedef OEMCrypto_ProvisioningMethod (*L1_GetProvisioningMethod_t)();
typedef OEMCryptoResult (*L1_GetBCCType_t)(OEMCrypto_BCCType* bcc_type);
typedef OEMCryptoResult (*L1_GetOEMPublicCertificate_t)(
uint8_t* public_cert, size_t* public_cert_length);
typedef OEMCryptoResult (*L1_LoadOEMPrivateKey_t)(OEMCrypto_SESSION session);
@@ -398,6 +399,7 @@ struct FunctionPointers {
L1_ReportUsage_t ReportUsage;
L1_GetUsageEntryInfo_t GetUsageEntryInfo;
L1_GetProvisioningMethod_t GetProvisioningMethod;
L1_GetBCCType_t GetBCCType;
L1_GetOEMPublicCertificate_t GetOEMPublicCertificate;
L1_LoadOEMPrivateKey_t LoadOEMPrivateKey;
L1_SupportedCertificates_t SupportedCertificates;
@@ -1004,6 +1006,7 @@ class Adapter {
LOOKUP_ALL(16, GetOEMPublicCertificate, OEMCrypto_GetOEMPublicCertificate);
LOOKUP_ALL(16, LoadOEMPrivateKey, OEMCrypto_LoadOEMPrivateKey);
LOOKUP_ALL(12, GetProvisioningMethod, OEMCrypto_GetProvisioningMethod);
LOOKUP_ALL(19, GetBCCType, OEMCrypto_GetBCCType);
LOOKUP_ALL( 8, GetRandom, OEMCrypto_GetRandom);
LOOKUP_ALL( 8, InstallKeyboxOrOEMCert, OEMCrypto_InstallKeyboxOrOEMCert);
LOOKUP_ALL(18, FactoryInstallBCCSignature, OEMCrypto_FactoryInstallBCCSignature);
@@ -1558,6 +1561,14 @@ OEMCrypto_ProvisioningMethod OEMCrypto_GetProvisioningMethod(
return fcn->GetProvisioningMethod();
}
OEMCryptoResult OEMCrypto_GetBCCType(OEMCrypto_GetBCCType* bcc_type) {
if (!gAdapter) return OEMCrypto_ERROR_UNKNOWN_FAILURE;
const FunctionPointers* fcn = gAdapter->GetFunctionPointers(kLevelDefault);
if (!fcn) return OEMCrypto_ERROR_INVALID_SESSION;
if (fcn->GetBCCType == nullptr) return OEMCrypto_ERROR_NOT_IMPLEMENTED;
return fcn->GetBCCType(bcc_type);
}
OEMCryptoResult OEMCrypto_GetDeviceID(uint8_t* deviceID, size_t* idLength,
wvcdm::RequestedSecurityLevel level) {
if (!gAdapter) return OEMCrypto_ERROR_UNKNOWN_FAILURE;