mirror of
https://gitee.com/openharmony/security_appverify
synced 2024-11-27 08:40:33 +00:00
commit
0abb3718c7
@ -84,6 +84,10 @@ if (os_level == "standard") {
|
||||
|
||||
subsystem_name = "security"
|
||||
defines += [ "OPENSSL_SUPPRESS_DEPRECATED" ]
|
||||
|
||||
if (is_emulator) {
|
||||
defines += [ "X86_EMULATOR_MODE" ]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
group("libhapverify") {
|
||||
|
@ -80,7 +80,9 @@ const string VALUE_DEVELOPMENT_MODE = "1";
|
||||
|
||||
const int32_t MAXIMUM_NUM_DEVICES = 100;
|
||||
const int32_t VERSION_CODE_TWO = 2;
|
||||
#ifndef X86_EMULATOR_MODE
|
||||
const int32_t DEVELOPMENT_MODE_LENGTH = 2;
|
||||
#endif
|
||||
|
||||
inline void GetStringIfExist(const json& obj, const string& key, string& out)
|
||||
{
|
||||
@ -349,6 +351,7 @@ AppProvisionVerifyResult ParseAndVerify(const string& appProvision, ProvisionInf
|
||||
if (ret != PROVISION_OK) {
|
||||
return ret;
|
||||
}
|
||||
#ifndef X86_EMULATOR_MODE
|
||||
const char *key = KEY_DEVELOPMENT_MODE.data();
|
||||
char developmentMode[DEVELOPMENT_MODE_LENGTH] = {0};
|
||||
GetParameter(key, nullptr, developmentMode, sizeof(developmentMode));
|
||||
@ -362,6 +365,7 @@ AppProvisionVerifyResult ParseAndVerify(const string& appProvision, ProvisionInf
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
HAPVERIFY_LOG_DEBUG(LABEL, "Leave HarmonyAppProvision Verify");
|
||||
return PROVISION_OK;
|
||||
}
|
||||
|
@ -174,8 +174,7 @@ bool HapCertVerifyOpensslUtils::GetPublickeyBase64(const X509* cert, std::string
|
||||
*/
|
||||
int32_t HapCertVerifyOpensslUtils::CalculateLenAfterBase64Encode(int32_t len)
|
||||
{
|
||||
return static_cast<int>(ceil(static_cast<long double>(len) / BASE64_ENCODE_PACKET_LEN) *
|
||||
BASE64_ENCODE_LEN_OF_EACH_GROUP_DATA + 1);
|
||||
return (len + BASE64_ENCODE_PACKET_LEN - 1) / BASE64_ENCODE_PACKET_LEN * BASE64_ENCODE_LEN_OF_EACH_GROUP_DATA + 1;
|
||||
}
|
||||
|
||||
bool HapCertVerifyOpensslUtils::CompareX509Cert(const X509* certA, const std::string& base64Cert)
|
||||
|
Loading…
Reference in New Issue
Block a user