code sync

Signed-off-by: zhangyaomaggie <zhangyao128@huawei.com>
This commit is contained in:
zhangyaomaggie 2024-07-29 10:23:57 +08:00
parent 0cdaaae8ae
commit d80973ca40
6 changed files with 8 additions and 7 deletions

View File

@ -58,7 +58,6 @@
"safwk",
"samgr",
"selinux_adapter",
"app_file_service",
"os_account",
"openssl",
"user_auth_framework"

View File

@ -127,7 +127,7 @@ int32_t AncoKeyManager::CreatePolicyDir(const AncoDirInfo &ancoDirInfo,
if (ancoDirInfo.policy == ANCO_TYPE_NONE && type == ANCO_TYPE_SYS_EL1) {
if (!PrepareDir(ancoDirInfo.path, mode, uid, gid)) {
LOGE("Prepare dir failed, path = %{public}s", ancoDirInfo.path.c_str());
LOGE("Prepare dir failed");
return E_PREPARE_DIR;
}
}
@ -139,7 +139,7 @@ int32_t AncoKeyManager::CreatePolicyDir(const AncoDirInfo &ancoDirInfo,
vec.push_back(fileList);
}
if (!PrepareDir(ancoDirInfo.path, mode, uid, gid)) {
LOGE("Prepare dir failed, path = %{public}s", ancoDirInfo.path.c_str());
LOGE("Prepare dir failed");
return E_PREPARE_DIR;
}
}

View File

@ -545,7 +545,7 @@ int KeyManager::GenerateUserKeyByType(unsigned int user, KeyType type,
uint64_t secureUid = { 0 };
if (!secret.empty() && !token.empty()) {
IamClient::GetInstance().GetSecureUid(user, secureUid);
LOGE("token is exist, get secure uid.");
LOGE("token is exist, get secure uid");
}
UserAuth auth = {.token = token, .secret = secret, .secureUid = 0};
int ret = GenerateAndInstallUserKey(user, elUserKeyPath, auth, type);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -59,7 +59,7 @@ public:
bool DecryptKeyBlob(const UserAuth &auth, const std::string &keyPath, KeyBlob &planKey, KeyBlob &decryptedKey);
bool RenameKeyPath(const std::string &keyPath);
virtual bool GenerateAppkey(uint32_t userId, uint32_t appUid, std::string &keyId) = 0;
virtual bool DeleteAppkey(const std::string KeyId) = 0;
virtual bool DeleteAppkey(const std::string keyId) = 0;
bool ClearKey(const std::string &mnt = MNT_DATA);
void ClearMemoryKeyCtx();
void WipingActionDir(std::string &path);

View File

@ -63,7 +63,9 @@ key_serial_t KeyCtrlAddAppAsdpKey(const char *type,
struct EncryptAsdpKey *fsKey,
const key_serial_t ringId)
{
return syscall(__NR_add_key, type, description, (void *)(fsKey), sizeof(struct EncryptAsdpKey), ringId);
return syscall(__NR_add_key, type, description,
(void *)(fsKey), sizeof(struct EncryptAsdpKey),
ringId);
}
long KeyCtrlSearch(key_serial_t ringId, const char *type, const char *description,