!1487 【公钥日志打印优化,仅打印前1/2部分】

Merge pull request !1487 from bchen90/master
This commit is contained in:
openharmony_ci 2024-08-24 11:34:38 +00:00 committed by Gitee
commit 69d8ffab18
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -336,7 +336,8 @@ bool HdcDaemon::GetHostPubkeyInfo(const string& buf, string& hostname, string& p
hostname = buf.substr(0, buf.find(separator));
pubkey = buf.substr(buf.find(separator) + 1);
WRITE_LOG(LOG_INFO, "hostname is [%s], pubkey is [%s]", hostname.c_str(), pubkey.c_str());
WRITE_LOG(LOG_INFO, "hostname is [%s], pubkey is [%s]", hostname.c_str(),
pubkey.substr(0, pubkey.size() / 2).c_str());
return (!hostname.empty() && !pubkey.empty());
}
@ -392,7 +393,7 @@ void HdcDaemon::UpdateKnownHosts(const string& key)
keyofs.flush();
keyofs.close();
WRITE_LOG(LOG_FATAL, "save new key [%s] into keyfile %s over", key.c_str(), keyfile);
WRITE_LOG(LOG_FATAL, "save new key [%s] into keyfile %s over", key.substr(0, key.size() / 2).c_str(), keyfile);
return;
}
@ -413,7 +414,7 @@ bool HdcDaemon::AlreadyInKnownHosts(const string& key)
return true;
}
WRITE_LOG(LOG_FATAL, "key [%s] not in keyfile %s", key.c_str(), keyfile);
WRITE_LOG(LOG_FATAL, "key [%s] not in keyfile %s", key.substr(0, key.size() / 2).c_str(), keyfile);
keyifs.close();
return false;