mirror of
https://gitee.com/openharmony/security_huks
synced 2024-12-13 17:46:02 +00:00
commit
985266900b
@ -19,7 +19,7 @@
|
||||
],
|
||||
"module_list": [
|
||||
"//base/security/huks/frameworks/huks_standard/main:huks_standard_frameworks",
|
||||
"//base/security/huks/services/huks_standard:libhukssrv",
|
||||
"//base/security/huks/services/huks_standard:huks_service",
|
||||
"//base/security/huks/services/huks_standard/huks_service/main/os_dependency/sa/sa_profile:huks_sa_profile"
|
||||
],
|
||||
"test_list": [
|
||||
|
16
services/huks_standard/BUILD.gn
Normal file → Executable file
16
services/huks_standard/BUILD.gn
Normal file → Executable file
@ -13,7 +13,14 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
|
||||
ohos_shared_library("libhukssrv") {
|
||||
ohos_prebuilt_etc("huks_service.rc") {
|
||||
source = "huks_service.rc"
|
||||
relative_install_dir = "init"
|
||||
subsystem_name = "security"
|
||||
part_name = "huks_standard"
|
||||
}
|
||||
|
||||
ohos_shared_library("huks_service") {
|
||||
subsystem_name = "security"
|
||||
part_name = "huks_standard"
|
||||
defines = [
|
||||
@ -22,9 +29,16 @@ ohos_shared_library("libhukssrv") {
|
||||
"_HUKS_LOG_ENABLE_",
|
||||
]
|
||||
deps = [
|
||||
":huks_service.rc",
|
||||
"//base/security/huks/services/huks_standard/huks_engine/main:libhuks_engine_standard_static",
|
||||
"//base/security/huks/services/huks_standard/huks_service/main:libhuks_service_standard_static",
|
||||
]
|
||||
external_deps = [
|
||||
"hiviewdfx_hilog_native:libhilog",
|
||||
"ipc:ipc_core",
|
||||
"safwk:system_ability_fwk",
|
||||
"samgr_L2:samgr_proxy",
|
||||
]
|
||||
}
|
||||
|
||||
group("libhuks_service_engine_standard_group") {
|
||||
|
@ -178,14 +178,7 @@ static int32_t GetDeriveKey(const struct HksParamSet *paramSet, const struct Hks
|
||||
HKS_LOG_E("get keyblob derived key failed!");
|
||||
HKS_FREE_PTR(derivedKey->data);
|
||||
}
|
||||
#ifdef L2_STANDARD
|
||||
/* This is a temporary passthrough version for deriving key, which will be fixed soon */
|
||||
if ((derivedKey->data == NULL) ||
|
||||
memcpy_s(derivedKey->data, derivedKey->size, encryptKey.data, encryptKey.size) != EOK) {
|
||||
HKS_LOG_E("Hks memcpy derived key failed!");
|
||||
ret = HKS_ERROR_BAD_STATE;
|
||||
}
|
||||
#endif
|
||||
|
||||
(void)memset_s(encryptKeyData, HKS_KEY_BLOB_MAIN_KEY_SIZE, 0, HKS_KEY_BLOB_MAIN_KEY_SIZE);
|
||||
HKS_FREE_BLOB(salt);
|
||||
|
||||
|
21
services/huks_standard/huks_service.rc
Executable file
21
services/huks_standard/huks_service.rc
Executable file
@ -0,0 +1,21 @@
|
||||
# Copyright (C) 2021 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
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
on post-fs-data
|
||||
start huks_service
|
||||
|
||||
service huks_service /system/bin/sa_main /system/profile/huks_service.xml
|
||||
class z_core
|
||||
user system
|
||||
group system shell
|
||||
seclabel u:r:deviceauth_service:s0
|
@ -16,5 +16,5 @@ import("//build/ohos/sa_profile/sa_profile.gni")
|
||||
ohos_sa_profile("huks_sa_profile") {
|
||||
part_name = "huks_standard"
|
||||
|
||||
sources = [ "3510.xml" ]
|
||||
sources = [ "huks_service.xml" ]
|
||||
}
|
||||
|
@ -13,10 +13,10 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<info>
|
||||
<process>foundation</process>
|
||||
<process>huks_service</process>
|
||||
<systemability> <!-- Declare a system ability and its profile -->
|
||||
<name>3510</name> <!-- Declare the name of system ability -->
|
||||
<libpath>/system/lib/libhukssrv.z.so</libpath> <!-- Declare the path of .so file which includes the system ability; Note: 1 .so file can have 1 to N system abilities. -->
|
||||
<libpath>/system/lib/libhuks_service.z.so</libpath> <!-- Declare the path of .so file which includes the system ability; Note: 1 .so file can have 1 to N system abilities. -->
|
||||
<run-on-create>true</run-on-create> <!-- "true" means the system ability would start immediately, "false" means the system ability would start on demand. -->
|
||||
<distributed>false</distributed> <!-- "true" means the system ability supports distributed scheduling while "false" is not. -->
|
||||
<dump-level>1</dump-level> <!-- Declare the dump level. 1-high; 2-media; 3-low -->
|
Loading…
Reference in New Issue
Block a user