!1441 锁位置切换外移

Merge pull request !1441 from 邓任琦/1028
This commit is contained in:
openharmony_ci 2024-10-28 07:49:05 +00:00 committed by Gitee
commit 03b2e99b8c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -740,6 +740,7 @@ int KeyManager::UpdateUserAuth(unsigned int user, struct UserTokenSecret &userTo
int KeyManager::UpdateUserAuth(unsigned int user, struct UserTokenSecret &userTokenSecret)
#endif
{
std::lock_guard<std::mutex> lock(keyMutex_);
#ifdef USER_CRYPTO_MIGRATE_KEY
int ret = UpdateCeEceSeceUserAuth(user, userTokenSecret, EL2_KEY, needGenerateShield);
if (ret != 0) {
@ -892,7 +893,6 @@ int KeyManager::UpdateCeEceSeceUserAuth(unsigned int user,
if (!KeyCtrlHasFscryptSyspara()) {
return 0;
}
std::lock_guard<std::mutex> lock(keyMutex_);
std::shared_ptr<BaseKey> item = GetUserElKey(user, type);
if (item == nullptr) {
LOGE("Have not found user %{public}u el key", user);