diff --git a/cert_manager.gni b/cert_manager.gni index f3bbf722fd246c984aaa002349c71cfa74aee625..4ae13f894343978e81de37e50004e573dfe70748 100644 --- a/cert_manager.gni +++ b/cert_manager.gni @@ -25,3 +25,10 @@ if (!defined(global_parts_info) || } else { has_os_account_part = false } + +if (!defined(global_parts_info) || + defined(global_parts_info.security_security_guard)) { + support_security_guard = true +} else { + support_security_guard = false +} diff --git a/services/cert_manager_standard/cert_manager_service/main/os_dependency/idl/BUILD.gn b/services/cert_manager_standard/cert_manager_service/main/os_dependency/idl/BUILD.gn index 9fa2a27355bdb372a9be0700cc9040c8368bd6fc..8e1eefc9a38a7d27f4fad07a82eb4558ea2e69cc 100644 --- a/services/cert_manager_standard/cert_manager_service/main/os_dependency/idl/BUILD.gn +++ b/services/cert_manager_standard/cert_manager_service/main/os_dependency/idl/BUILD.gn @@ -49,6 +49,7 @@ ohos_static_library("libcm_service_idl_standard_static") { "../../../../../../frameworks/cert_manager_standard/main/common:libcert_manager_common_standard_static", "../../../../../../frameworks/cert_manager_standard/main/os_dependency:libcert_manager_log_mem_static", "../../hisysevent_wrapper:libcert_manager_hisysevent_wrapper_static", + "../../security_guard_report:libcert_manager_sg_report_static", "//third_party/openssl:libcrypto_shared", ] external_deps = [ diff --git a/services/cert_manager_standard/cert_manager_service/main/os_dependency/idl/cm_ipc/cm_ipc_service.c b/services/cert_manager_standard/cert_manager_service/main/os_dependency/idl/cm_ipc/cm_ipc_service.c index 654aa9950ec94b84dfb606d92002d9702186f4f5..9a4576211694fba475ded65a34ed0b679c9691eb 100644 --- a/services/cert_manager_standard/cert_manager_service/main/os_dependency/idl/cm_ipc/cm_ipc_service.c +++ b/services/cert_manager_standard/cert_manager_service/main/os_dependency/idl/cm_ipc/cm_ipc_service.c @@ -23,6 +23,7 @@ #include "cm_pfx.h" #include "cm_report_wrapper.h" #include "cm_response.h" +#include "cm_security_guard_info.h" #include "cm_type.h" #include "cert_manager.h" @@ -35,6 +36,7 @@ #include "cert_manager_uri.h" #define MAX_LEN_CERTIFICATE 8196 +#define INIT_INVALID_VALUE 0xFFFFFFFF static int32_t GetInputParams(const struct CmBlob *paramSetBlob, struct CmParamSet **paramSet, struct CmContext *cmContext, struct CmParamOut *params, uint32_t paramsCount) @@ -165,8 +167,8 @@ void CmIpcServiceSetCertStatus(const struct CmBlob *paramSetBlob, struct CmBlob const struct CmContext *context) { int32_t ret; - uint32_t store; - uint32_t status = 0; + uint32_t store = CM_SYSTEM_TRUSTED_STORE; + uint32_t status = INIT_INVALID_VALUE; struct CmContext cmContext = {0}; struct CmBlob certUri = { 0, NULL }; struct CmParamSet *paramSet = NULL; @@ -195,7 +197,9 @@ void CmIpcServiceSetCertStatus(const struct CmBlob *paramSetBlob, struct CmBlob break; } } while (0); + CmSendResponse(context, ret, NULL); + CmReportSGSetCertStatus(&certUri, store, status, ret); CmFreeParamSet(¶mSet); CM_LOG_I("CmIpcServiceSetCertStatus end:%d", ret); } @@ -206,11 +210,11 @@ void CmIpcServiceInstallAppCert(const struct CmBlob *paramSetBlob, struct CmBlob struct CmContext cmContext = {0}; struct CmParamSet *paramSet = NULL; int32_t ret; + struct CmBlob certAlias = { 0, NULL }; + uint32_t store = CM_CREDENTIAL_STORE; do { struct CmAppCertInfo appCertInfo = { { 0, NULL }, { 0, NULL } }; - struct CmBlob certAlias = { 0, NULL }; - uint32_t store; struct CmParamOut params[] = { { .tag = CM_TAG_PARAM0_BUFFER, .blob = &appCertInfo.appCert }, { .tag = CM_TAG_PARAM1_BUFFER, .blob = &appCertInfo.appCertPwd }, @@ -234,6 +238,7 @@ void CmIpcServiceInstallAppCert(const struct CmBlob *paramSetBlob, struct CmBlob CmReport(__func__, &cmContext, &tempBlob, ret); CmSendResponse(context, ret, outData); + CmReportSGInstallAppCert(&certAlias, store, ret); CmFreeParamSet(¶mSet); CM_LOG_I("CmIpcServiceInstallAppCert end:%d", ret); } @@ -243,7 +248,7 @@ void CmIpcServiceUninstallAppCert(const struct CmBlob *paramSetBlob, struct CmBl { int32_t ret; (void)outData; - uint32_t store; + uint32_t store = CM_CREDENTIAL_STORE; struct CmParamSet *paramSet = NULL; struct CmBlob keyUri = { 0, NULL }; struct CmContext cmContext = {0}; @@ -278,6 +283,7 @@ void CmIpcServiceUninstallAppCert(const struct CmBlob *paramSetBlob, struct CmBl } while (0); CmSendResponse(context, ret, NULL); + CmReportSGUninstallAppCert(&keyUri, store, false, ret); CmFreeParamSet(¶mSet); CM_LOG_I("CmIpcServiceUninstallAppCert end:%d", ret); } @@ -301,6 +307,7 @@ void CmIpcServiceUninstallAllAppCert(const struct CmBlob *paramSetBlob, struct C } CmSendResponse(context, ret, NULL); + CmReportSGUninstallAppCert(NULL, INIT_INVALID_VALUE, true, ret); CM_LOG_I("CmIpcServiceUninstallAllAppCert end:%d", ret); } @@ -665,9 +672,9 @@ void CmIpcServiceGrantAppCertificate(const struct CmBlob *paramSetBlob, struct C struct CmContext cmContext = { 0, 0, {0} }; struct CmParamSet *paramSet = NULL; struct CmBlob keyUri = { 0, NULL }; + uint32_t grantUid = INIT_INVALID_VALUE; int32_t ret; do { - uint32_t grantUid = 0; struct CmParamOut params[] = { { .tag = CM_TAG_PARAM0_BUFFER, .blob = &keyUri }, { .tag = CM_TAG_PARAM1_UINT32, .uint32Param = &grantUid }, @@ -689,6 +696,7 @@ void CmIpcServiceGrantAppCertificate(const struct CmBlob *paramSetBlob, struct C CM_LOG_I("CmIpcServiceGrantAppCertificate end:%d", ret); CmSendResponse(context, ret, outData); + CmReportSGGrantAppCert(&keyUri, grantUid, false, ret); CmFreeParamSet(¶mSet); } @@ -762,10 +770,9 @@ void CmIpcServiceRemoveGrantedApp(const struct CmBlob *paramSetBlob, struct CmBl struct CmParamSet *paramSet = NULL; (void)outData; struct CmBlob keyUri = { 0, NULL }; - + uint32_t appUid = INIT_INVALID_VALUE; int32_t ret; do { - uint32_t appUid = 0; struct CmParamOut params[] = { { .tag = CM_TAG_PARAM0_BUFFER, .blob = &keyUri }, { .tag = CM_TAG_PARAM1_UINT32, .uint32Param = &appUid }, @@ -786,6 +793,7 @@ void CmIpcServiceRemoveGrantedApp(const struct CmBlob *paramSetBlob, struct CmBl CM_LOG_I("CmIpcServiceRemoveGrantedApp end:%d", ret); CmSendResponse(context, ret, NULL); + CmReportSGGrantAppCert(&keyUri, appUid, true, ret); CmFreeParamSet(¶mSet); } @@ -982,8 +990,8 @@ void CmIpcServiceGetUserCertInfo(const struct CmBlob *paramSetBlob, struct CmBlo const struct CmContext *context) { int32_t ret = CM_SUCCESS; - uint32_t store; - uint32_t status = 0; + uint32_t store = 0; + uint32_t status; struct CmBlob certUri = { 0, NULL }; struct CmBlob certificateData = { 0, NULL }; struct CmContext cmContext = {0}; @@ -1031,8 +1039,8 @@ void CmIpcServiceSetUserCertStatus(const struct CmBlob *paramSetBlob, struct CmB const struct CmContext *context) { int32_t ret = CM_SUCCESS; - uint32_t store; - uint32_t status; + uint32_t store = CM_USER_TRUSTED_STORE; + uint32_t status = INIT_INVALID_VALUE; struct CmBlob certUri = { 0, NULL }; struct CmContext cmContext = {0}; struct CmParamSet *paramSet = NULL; @@ -1066,7 +1074,9 @@ void CmIpcServiceSetUserCertStatus(const struct CmBlob *paramSetBlob, struct CmB break; } } while (0); + CmSendResponse(context, ret, NULL); + CmReportSGSetCertStatus(&certUri, store, status, ret); CmFreeParamSet(¶mSet); } @@ -1116,6 +1126,7 @@ void CmIpcServiceInstallUserCert(const struct CmBlob *paramSetBlob, struct CmBlo if (ret != CM_SUCCESS) { CmSendResponse(context, ret, NULL); } + CmReportSGInstallUserCert(&certAlias, ret); CmFreeParamSet(¶mSet); } @@ -1155,8 +1166,10 @@ void CmIpcServiceUninstallUserCert(const struct CmBlob *paramSetBlob, struct CmB break; } } while (0); + CmReport(__func__, &cmContext, &certUri, ret); CmSendResponse(context, ret, NULL); + CmReportSGUninstallUserCert(&certUri, false, ret); CmFreeParamSet(¶mSet); } @@ -1192,5 +1205,6 @@ void CmIpcServiceUninstallAllUserCert(const struct CmBlob *paramSetBlob, struct } } while (0); CmSendResponse(context, ret, NULL); + CmReportSGUninstallUserCert(NULL, true, ret); } diff --git a/services/cert_manager_standard/cert_manager_service/main/security_guard_report/BUILD.gn b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..d0006580c618c111ecebe2c89f89ec2df348a81f --- /dev/null +++ b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/BUILD.gn @@ -0,0 +1,55 @@ +# Copyright (c) 2023 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. + +import("//build/ohos.gni") +import("../../../../../cert_manager.gni") + +config("cert_manager_config") { + include_dirs = [ "include" ] +} + +ohos_static_library("libcert_manager_sg_report_static") { + subsystem_name = "security" + part_name = "certificate_manager" + public_configs = [ ":cert_manager_config" ] + stack_protector_ret = true + sanitize = { + cfi = true + cfi_cross_dso = true + boundary_sanitize = true + debug = false + integer_overflow = true + ubsan = true + } + include_dirs = [ + "../../../../../frameworks/cert_manager_standard/main/common/include", + "../../../../../interfaces/innerkits/cert_manager_standard/main/include", + ] + deps = [ "../../../../../frameworks/cert_manager_standard/main/os_dependency:libcert_manager_log_mem_static" ] + sources = [ + "src/cm_security_guard_info.c", + "src/cm_security_guard_report.cpp", + ] + cflags = [ + "-Wall", + "-Werror", + ] + defines = [ "_CM_LOG_ENABLE_" ] + + external_deps = [ "ipc:ipc_core" ] + if (support_security_guard) { + cflags += [ "-DSUPPORT_SECURITY_GUARD" ] + cflags_cc = [ "-DSUPPORT_SECURITY_GUARD" ] + } + complete_static_lib = true +} diff --git a/services/cert_manager_standard/cert_manager_service/main/security_guard_report/include/cm_security_guard_info.h b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/include/cm_security_guard_info.h new file mode 100644 index 0000000000000000000000000000000000000000..b45318b32b9eabcdabdc9b2f4223792e42ebcdfa --- /dev/null +++ b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/include/cm_security_guard_info.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023 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. + */ + +#ifndef CM_SECURITY_GUARD_INFO_H +#define CM_SECURITY_GUARD_INFO_H + +#include "cm_type_inner.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void CmReportSGSetCertStatus(const struct CmBlob *certUri, uint32_t store, uint32_t status, int32_t result); + +void CmReportSGInstallUserCert(const struct CmBlob *certAlias, int32_t result); + +void CmReportSGUninstallUserCert(const struct CmBlob *certUri, bool isUninstallAll, int32_t result); + +void CmReportSGInstallAppCert(const struct CmBlob *certAlias, uint32_t store, int32_t result); + +void CmReportSGUninstallAppCert(const struct CmBlob *keyUri, uint32_t store, bool isUninstallAll, int32_t result); + +void CmReportSGGrantAppCert(const struct CmBlob *keyUri, uint32_t appUid, bool isRemove, int32_t result); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/services/cert_manager_standard/cert_manager_service/main/security_guard_report/include/cm_security_guard_report.h b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/include/cm_security_guard_report.h new file mode 100644 index 0000000000000000000000000000000000000000..baa46194037fa27e6a4679aada66043d4af5ec74 --- /dev/null +++ b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/include/cm_security_guard_report.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 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. + */ + +#ifndef CM_SECURITY_GUARD_REPORT_H +#define CM_SECURITY_GUARD_REPORT_H + +#include "cm_type_inner.h" + +#define CM_MAX_ACTION_LEN 100 + +struct CmReportSGInfo { + char action[CM_MAX_ACTION_LEN]; + uint32_t uid; + int32_t result; + char *name; + bool isSetGrantUid; + uint32_t grantUid; + bool isSetStatus; + bool status; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +uint32_t CmGetCallingUid(void); + +void CmReportSGRecord(const struct CmReportSGInfo *info); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/services/cert_manager_standard/cert_manager_service/main/security_guard_report/src/cm_security_guard_info.c b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/src/cm_security_guard_info.c new file mode 100644 index 0000000000000000000000000000000000000000..a26a1375c626dd4f56336392e963a30131487d1a --- /dev/null +++ b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/src/cm_security_guard_info.c @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2023 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. + */ + +#include "cm_security_guard_info.h" + +#include "cm_log.h" +#include "cm_security_guard_report.h" + +#ifdef SUPPORT_SECURITY_GUARD +#define CM_INVALID_NAME "nameInvalid" +#define CM_DELETE_ALL_NAME "deleteAll" +#define CM_REPORT_MAX_NAME_LEN 256 + +static bool IsNameValid(const struct CmBlob *name) +{ + if ((CmCheckBlob(name) != CM_SUCCESS) || (name->size > CM_REPORT_MAX_NAME_LEN)) { + return false; + } + + for (uint32_t i = 1; i < name->size; ++i) { /* from index 1 has '\0' */ + if (name->data[i] == 0) { + return true; + } + } + return false; +} +#endif + +void CmReportSGSetCertStatus(const struct CmBlob *certUri, uint32_t store, uint32_t status, int32_t result) +{ +#ifdef SUPPORT_SECURITY_GUARD + struct CmReportSGInfo info; + (void)memset_s(&info, sizeof(info), 0, sizeof(info)); + + info.result = result; + info.uid = CmGetCallingUid(); + info.isSetGrantUid = false; + info.isSetStatus = true; + info.status = (status == 0) ? true : false; /* 0 indicates the certificate enabled status */ + + char *action = (store == CM_SYSTEM_TRUSTED_STORE) ? "CmSetSystemCertStatus" : "CmSetUserCertStatus"; + if (strcpy_s(info.action, sizeof(info.action), action) != EOK) { + return; + } + + if (IsNameValid(certUri)) { + info.name = (char *)certUri->data; + } else { + info.name = CM_INVALID_NAME; + } + + CmReportSGRecord(&info); +#else + (void)certUri; + (void)store; + (void)status; + (void)result; +#endif +} + +void CmReportSGInstallUserCert(const struct CmBlob *certAlias, int32_t result) +{ +#ifdef SUPPORT_SECURITY_GUARD + struct CmReportSGInfo info; + (void)memset_s(&info, sizeof(info), 0, sizeof(info)); + + info.result = result; + info.uid = CmGetCallingUid(); + info.isSetGrantUid = false; + info.isSetStatus = false; + + if (strcpy_s(info.action, sizeof(info.action), "CmInstallUserCert") != EOK) { + return; + } + + if (IsNameValid(certAlias)) { + info.name = (char *)certAlias->data; + } else { + info.name = CM_INVALID_NAME; + } + + CmReportSGRecord(&info); +#else + (void)certAlias; + (void)result; +#endif +} + +void CmReportSGUninstallUserCert(const struct CmBlob *certUri, bool isUninstallAll, int32_t result) +{ +#ifdef SUPPORT_SECURITY_GUARD + struct CmReportSGInfo info; + (void)memset_s(&info, sizeof(info), 0, sizeof(info)); + + info.result = result; + info.uid = CmGetCallingUid(); + info.isSetGrantUid = false; + info.isSetStatus = false; + + if (isUninstallAll) { + if (strcpy_s(info.action, sizeof(info.action), "CmUninstallAllUserCert") != EOK) { + return; + } + info.name = CM_DELETE_ALL_NAME; + return CmReportSGRecord(&info); + } + + if (strcpy_s(info.action, sizeof(info.action), "CmUninstallUserCert") != EOK) { + return; + } + if (IsNameValid(certUri)) { + info.name = (char *)certUri->data; + } else { + info.name = CM_INVALID_NAME; + } + CmReportSGRecord(&info); +#else + (void)certUri; + (void)isUninstallAll; + (void)result; +#endif +} + +void CmReportSGInstallAppCert(const struct CmBlob *certAlias, uint32_t store, int32_t result) +{ +#ifdef SUPPORT_SECURITY_GUARD + struct CmReportSGInfo info; + (void)memset_s(&info, sizeof(info), 0, sizeof(info)); + + info.result = result; + info.uid = CmGetCallingUid(); + info.isSetGrantUid = false; + info.isSetStatus = false; + + char *action = (store == CM_CREDENTIAL_STORE) ? "CmInstallAppCert" : "CmInstallPriAppCert"; + if (strcpy_s(info.action, sizeof(info.action), action) != EOK) { + return; + } + if (IsNameValid(certAlias)) { + info.name = (char *)certAlias->data; + } else { + info.name = CM_INVALID_NAME; + } + + CmReportSGRecord(&info); +#else + (void)certAlias; + (void)store; + (void)result; +#endif +} + +void CmReportSGUninstallAppCert(const struct CmBlob *keyUri, uint32_t store, bool isUninstallAll, int32_t result) +{ +#ifdef SUPPORT_SECURITY_GUARD + struct CmReportSGInfo info; + (void)memset_s(&info, sizeof(info), 0, sizeof(info)); + + info.result = result; + info.uid = CmGetCallingUid(); + info.isSetGrantUid = false; + info.isSetStatus = false; + + if (isUninstallAll) { + if (strcpy_s(info.action, sizeof(info.action), "CmUninstallAllAppCert") != EOK) { + return; + } + info.name = CM_DELETE_ALL_NAME; + return CmReportSGRecord(&info); + } + + char *action = (store == CM_CREDENTIAL_STORE) ? "CmUninstallAppCert" : "CmUninstallPriAppCert"; + if (strcpy_s(info.action, sizeof(info.action), action) != EOK) { + return; + } + if (IsNameValid(keyUri)) { + info.name = (char *)keyUri->data; + } else { + info.name = CM_INVALID_NAME; + } + CmReportSGRecord(&info); +#else + (void)keyUri; + (void)store; + (void)isUninstallAll; + (void)result; +#endif +} + +void CmReportSGGrantAppCert(const struct CmBlob *keyUri, uint32_t appUid, bool isRemove, int32_t result) +{ +#ifdef SUPPORT_SECURITY_GUARD + struct CmReportSGInfo info; + (void)memset_s(&info, sizeof(info), 0, sizeof(info)); + + info.result = result; + info.uid = CmGetCallingUid(); + info.isSetStatus = false; + info.isSetGrantUid = true; + info.grantUid = appUid; + + char *action = isRemove ? "CmRemoveGrantedAppUid" : "CmGrantAppCert"; + if (strcpy_s(info.action, sizeof(info.action), action) != EOK) { + return; + } + if (IsNameValid(keyUri)) { + info.name = (char *)keyUri->data; + } else { + info.name = CM_INVALID_NAME; + } + CmReportSGRecord(&info); +#else + (void)keyUri; + (void)appUid; + (void)isRemove; + (void)result; +#endif +} \ No newline at end of file diff --git a/services/cert_manager_standard/cert_manager_service/main/security_guard_report/src/cm_security_guard_report.cpp b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/src/cm_security_guard_report.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ce5f5399704b8992e8b679bb9590f7541fd6a93a --- /dev/null +++ b/services/cert_manager_standard/cert_manager_service/main/security_guard_report/src/cm_security_guard_report.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 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. + */ + +#include "cm_security_guard_report.h" + +#include "cm_log.h" + +#include "ipc_skeleton.h" + +#ifdef SUPPORT_SECURITY_GUARD +uint32_t CmGetCallingUid(void) +{ + return OHOS::IPCSkeleton::GetCallingUid(); +} + +void CmReportSGRecord(const struct CmReportSGInfo *info) +{ + (void)info; + CM_LOG_E("whx CmReportSGRecord, action[%s], uid[%u], result[%d], name[%s], isSetGrantUid[%d], grantUid[%u], \ + isSetStatus[%d], status[%d]", info->action, info->uid, info->result, info->name, info->isSetGrantUid, + info->grantUid, info->isSetStatus, info->status); + return; +} +#endif \ No newline at end of file