am 62a9cf3c: Terminate Level 1 OEMCrypto on Initialization Error
* commit '62a9cf3cbea34f2d04c50809703d31efd78514d9': Terminate Level 1 OEMCrypto on Initialization Error
This commit is contained in:
@@ -280,6 +280,7 @@ class Adapter {
|
|||||||
if (level1_.version < minimum_version) {
|
if (level1_.version < minimum_version) {
|
||||||
LOGW("liboemcrypto.so is version %d, not %d. Falling Back to L3.",
|
LOGW("liboemcrypto.so is version %d, not %d. Falling Back to L3.",
|
||||||
level1_.version, minimum_version);
|
level1_.version, minimum_version);
|
||||||
|
level1_.Terminate();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if( level1_.version == 8 ) {
|
if( level1_.version == 8 ) {
|
||||||
@@ -303,11 +304,13 @@ class Adapter {
|
|||||||
std::string filename;
|
std::string filename;
|
||||||
if (!wvcdm::Properties::GetFactoryKeyboxPath(&filename)) {
|
if (!wvcdm::Properties::GetFactoryKeyboxPath(&filename)) {
|
||||||
LOGW("Bad Level 1 Keybox. Falling Back to L3.");
|
LOGW("Bad Level 1 Keybox. Falling Back to L3.");
|
||||||
|
level1_.Terminate();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ssize_t size = file.FileSize(filename);
|
ssize_t size = file.FileSize(filename);
|
||||||
if (size <= 0 || !file.Open(filename, file.kBinary | file.kReadOnly)) {
|
if (size <= 0 || !file.Open(filename, file.kBinary | file.kReadOnly)) {
|
||||||
LOGW("Could not open %s. Falling Back to L3.", filename.c_str());
|
LOGW("Could not open %s. Falling Back to L3.", filename.c_str());
|
||||||
|
level1_.Terminate();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
uint8_t keybox[size];
|
uint8_t keybox[size];
|
||||||
@@ -315,6 +318,7 @@ class Adapter {
|
|||||||
if (level1_.InstallKeybox(keybox, size) != OEMCrypto_SUCCESS) {
|
if (level1_.InstallKeybox(keybox, size) != OEMCrypto_SUCCESS) {
|
||||||
LOGE("Could NOT install keybox from %s. Falling Back to L3.",
|
LOGE("Could NOT install keybox from %s. Falling Back to L3.",
|
||||||
filename.c_str());
|
filename.c_str());
|
||||||
|
level1_.Terminate();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LOGI("Installed keybox from %s", filename.c_str());
|
LOGI("Installed keybox from %s", filename.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user