!1484 feat:密钥位置调整到el1

Merge pull request !1484 from maliang/master
This commit is contained in:
openharmony_ci 2024-08-29 10:26:39 +00:00 committed by Gitee
commit d1d46e1a99
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 9 additions and 9 deletions

View File

@ -330,7 +330,7 @@ pub const ENV_FILE_CONTROL: &str = "persist.hdc.control.file";
pub const ENV_FPORT_CONTROL: &str = "persist.hdc.control.fport";
pub const RSA_BIT_NUM: usize = 3072;
pub const RSA_PUBKEY_PATH: &str = "/data/service/el0/hdc";
pub const RSA_PUBKEY_PATH: &str = "/data/service/el1/public/hdc";
pub const RSA_PUBKEY_NAME: &str = "hdc_keys";
pub const RSA_PRIKEY_PATH: &str = ".harmony";
pub const RSA_PRIKEY_NAME: &str = "hdckey";

View File

@ -441,7 +441,7 @@ void LoadDaemonKey(list<void *> *listPublicKey)
#ifdef HDC_PCDEBUG
char keyPaths[][BUF_SIZE_SMALL] = { "/root/.harmony/hdckey.pub" };
#else
char keyPaths[][BUF_SIZE_SMALL] = { "/data/service/el0/hdc/hdc_keys" };
char keyPaths[][BUF_SIZE_SMALL] = { "/data/service/el1/public/hdc/hdc_keys" };
#endif
int num = sizeof(keyPaths) / sizeof(keyPaths[0]);
struct stat buf;

View File

@ -344,7 +344,7 @@ bool HdcDaemon::GetHostPubkeyInfo(const string& buf, string& hostname, string& p
void HdcDaemon::ClearKnownHosts()
{
char const *keyfile = "/data/service/el0/hdc/hdc_keys";
char const *keyfile = "/data/service/el1/public/hdc/hdc_keys";
if (!enableSecure || HandDaemonAuthBypass()) {
WRITE_LOG(LOG_INFO, "not enable secure, noneed clear keyfile");
@ -380,7 +380,7 @@ void HdcDaemon::ClearKnownHosts()
void HdcDaemon::UpdateKnownHosts(const string& key)
{
char const *keyfile = "/data/service/el0/hdc/hdc_keys";
char const *keyfile = "/data/service/el1/public/hdc/hdc_keys";
std::ofstream keyofs(keyfile, std::ios::app);
if (!keyofs.is_open()) {
@ -400,7 +400,7 @@ void HdcDaemon::UpdateKnownHosts(const string& key)
bool HdcDaemon::AlreadyInKnownHosts(const string& key)
{
char const *keyfile = "/data/service/el0/hdc/hdc_keys";
char const *keyfile = "/data/service/el1/public/hdc/hdc_keys";
std::ifstream keyifs(keyfile);
if (!keyifs.is_open()) {

View File

@ -2,8 +2,8 @@
"jobs" : [{
"name" : "post-fs-data",
"cmds" : [
"mkdir /data/service/el0/hdc 0775 root shell",
"restorecon /data/service/el0/hdc"
"mkdir /data/service/el1/public/hdc 0775 root shell",
"restorecon /data/service/el1/public/hdc"
]
},{
"name" : "param:persist.hdc.control=false",

View File

@ -2,8 +2,8 @@
"jobs" : [{
"name" : "post-fs-data",
"cmds" : [
"mkdir /data/service/el0/hdc 0775 root shell",
"restorecon /data/service/el0/hdc"
"mkdir /data/service/el1/public/hdc 0775 root shell",
"restorecon /data/service/el1/public/hdc"
]
},{
"name" : "param:persist.hdc.control=false",