!1546 单框架适应双框架安全加固修改

Merge pull request !1546 from zhaoshuyuan/master
This commit is contained in:
openharmony_ci 2024-11-22 14:15:43 +00:00 committed by Gitee
commit e3647cd62d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -46,6 +46,7 @@ namespace OHOS {
namespace StorageDaemon {
const UserAuth NULL_KEY_AUTH = {};
const std::string DEFAULT_NEED_RESTORE_VERSION = "1";
const std::string DEFAULT_NEED_RESTORE_UPDATE_VERSION = "3";
constexpr const char *UECE_PATH = "/dev/fbex_uece";
std::shared_ptr<BaseKey> KeyManager::GetBaseKey(const std::string& dir)
@ -352,7 +353,7 @@ bool KeyManager::IsNeedClearKeyFile(std::string file)
return false;
}
if (version != DEFAULT_NEED_RESTORE_VERSION) {
if (version != DEFAULT_NEED_RESTORE_VERSION && version != DEFAULT_NEED_RESTORE_UPDATE_VERSION) {
LOGE("need to clear, file is %{private}s, version is %{public}s.", file.c_str(), version.c_str());
return true;
}