Merge "Avoid calling DeleteUsageEntry for OEMCrypto v13" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0a02017009
@@ -1605,7 +1605,7 @@ extern "C" OEMCryptoResult OEMCrypto_DeleteUsageEntry(
|
|||||||
if (!kAdapter) return OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
if (!kAdapter) return OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
||||||
LevelSession pair = kAdapter->get(session);
|
LevelSession pair = kAdapter->get(session);
|
||||||
if (!pair.fcn) return OEMCrypto_ERROR_INVALID_SESSION;
|
if (!pair.fcn) return OEMCrypto_ERROR_INVALID_SESSION;
|
||||||
if (pair.fcn->version > 8) {
|
if (pair.fcn->version > 8 && pair.fcn->version < 13) {
|
||||||
return pair.fcn->DeleteUsageEntry(pair.session, pst, pst_length, message,
|
return pair.fcn->DeleteUsageEntry(pair.session, pst, pst_length, message,
|
||||||
message_length, signature,
|
message_length, signature,
|
||||||
signature_length);
|
signature_length);
|
||||||
@@ -1627,7 +1627,7 @@ extern "C" OEMCryptoResult OEMCrypto_ForceDeleteUsageEntry(const uint8_t* pst,
|
|||||||
if (fcn1 && fcn1 != fcn3 && (fcn1->version > 9) && (fcn1->version < 13) &&
|
if (fcn1 && fcn1 != fcn3 && (fcn1->version > 9) && (fcn1->version < 13) &&
|
||||||
(fcn1->ForceDeleteUsageEntry != NULL)) {
|
(fcn1->ForceDeleteUsageEntry != NULL)) {
|
||||||
OEMCryptoResult sts1 = fcn1->ForceDeleteUsageEntry(pst, pst_length);
|
OEMCryptoResult sts1 = fcn1->ForceDeleteUsageEntry(pst, pst_length);
|
||||||
if ((sts1 != OEMCrypto_SUCCESS) && (sts == OEMCrypto_SUCCESS)) {
|
if ((sts != OEMCrypto_SUCCESS) && (sts1 == OEMCrypto_SUCCESS)) {
|
||||||
sts = sts1;
|
sts = sts1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1655,7 +1655,7 @@ extern "C" bool OEMCrypto_IsSRMUpdateSupported() {
|
|||||||
const FunctionPointers* fcn = kAdapter->get(kLevelDefault);
|
const FunctionPointers* fcn = kAdapter->get(kLevelDefault);
|
||||||
if (!fcn) return false;
|
if (!fcn) return false;
|
||||||
if (fcn->version < 13) return false;
|
if (fcn->version < 13) return false;
|
||||||
if (fcn->IsSRMUpdateSupported == NULL) return OEMCrypto_ERROR_NOT_IMPLEMENTED;
|
if (fcn->IsSRMUpdateSupported == NULL) return false;
|
||||||
return fcn->IsSRMUpdateSupported();
|
return fcn->IsSRMUpdateSupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user