diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000000000000000000000000000000000000..ef162ee600147c60a5ca55cda65f6f306aabf67a --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,18 @@ +/* + * 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. + */ + + # any change to frameworks/cert_manager_standard/main/common/include/cert_manager_ipc_interface_code.h + # needs to be reviewed by @leonchan5 +frameworks/cert_manager_standard/main/common/include/cert_manager_ipc_interface_code.h @leonchan5 diff --git a/frameworks/cert_manager_standard/main/common/include/cm_ipc_msg_code.h b/frameworks/cert_manager_standard/main/common/include/cert_manager_ipc_interface_code.h similarity index 77% rename from frameworks/cert_manager_standard/main/common/include/cm_ipc_msg_code.h rename to frameworks/cert_manager_standard/main/common/include/cert_manager_ipc_interface_code.h index 7587efb1c76fed5855460d3187202f6226d4ed3e..343c28906b1ff771b8650ecda97d358e9c18c6e5 100644 --- a/frameworks/cert_manager_standard/main/common/include/cm_ipc_msg_code.h +++ b/frameworks/cert_manager_standard/main/common/include/cert_manager_ipc_interface_code.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -17,11 +17,21 @@ #define CM_IPC_MSG_CODE_H #ifdef __cplusplus +namespace OHOS { +namespace Security { +namespace CertManager { extern "C" { #endif -enum CmMessage { - CM_MSG_BASE = 0x3a400, +#ifdef __cplusplus +#define INTERFACECODETYPE enum class +#else +#define INTERFACECODETYPE enum +#endif + +/* SAID: 3512 */ +INTERFACECODETYPE CertManagerInterfaceCode { + CM_MSG_BASE = 0, CM_MSG_GEN_KEY = CM_MSG_BASE, CM_MSG_GET_CERTIFICATE_LIST, @@ -53,5 +63,8 @@ enum CmMessage { #ifdef __cplusplus } +} // namespace CertManager +} // namespace Security +} // namespace OHOS +#endif #endif -#endif \ No newline at end of file diff --git a/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/include/cm_ipc_client.h b/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/include/cm_ipc_client.h index 33d45bb017428509ebfda8c032a8045a384258cb..1b5a6a7630725709a0fea31efe907ee2e8884b61 100755 --- a/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/include/cm_ipc_client.h +++ b/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/include/cm_ipc_client.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -37,7 +37,7 @@ int32_t CmClientInstallAppCert(const struct CmBlob *appCert, const struct CmBlob int32_t CmClientUninstallAppCert(const struct CmBlob *keyUri, const uint32_t store); -int32_t CmClientUninstallAllAppCert(enum CmMessage type); +int32_t CmClientUninstallAllAppCert(enum CertManagerInterfaceCode type); int32_t CmClientGetAppCertList(const uint32_t store, struct CredentialList *certificateList); diff --git a/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/include/cm_request.h b/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/include/cm_request.h index e0cc2cf7ead814eccef08194ed47871fd8ff0acd..bfb944c74cd85eae8d8415e20815476535b64bcd 100644 --- a/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/include/cm_request.h +++ b/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/include/cm_request.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -16,13 +16,19 @@ #ifndef CM_REQUEST_H #define CM_REQUEST_H -#include "cm_ipc_msg_code.h" +#include "cert_manager_ipc_interface_code.h" #include "cm_type_inner.h" #ifdef __cplusplus extern "C" { #endif +#ifdef __cplusplus +typedef OHOS::Security::CertManager::CertManagerInterfaceCode CMINTERFACECODE; +#else +typedef enum CertManagerInterfaceCode CMINTERFACECODE; +#endif + /* * SendRequest - Send the request message to target module by function call or ipc or other ways. * @type: the request message type. @@ -30,7 +36,7 @@ extern "C" { * @outBlob: the output serialized data blob, can be null. */ -int32_t SendRequest(enum CmMessage type, const struct CmBlob *inBlob, +int32_t SendRequest(CMINTERFACECODE type, const struct CmBlob *inBlob, struct CmBlob *outBlob); #ifdef __cplusplus diff --git a/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/src/cm_ipc_client.c b/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/src/cm_ipc_client.c index 277255f3a649e3a26edc2f17bc4bcfa9432934ad..5074582be1a7a53d7dcf05a704d75b4b908fe889 100644 --- a/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/src/cm_ipc_client.c +++ b/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/src/cm_ipc_client.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -51,7 +51,7 @@ static int32_t GetCertListInitOutData(struct CmBlob *outListBlob) return CM_SUCCESS; } -static int32_t GetCertificateList(enum CmMessage type, const uint32_t store, +static int32_t GetCertificateList(enum CertManagerInterfaceCode type, const uint32_t store, struct CertList *certificateList) { int32_t ret; @@ -108,7 +108,7 @@ static int32_t GetCertInfoInitOutData(struct CmBlob *outInfoBlob) return CM_SUCCESS; } -static int32_t GetCertificateInfo(enum CmMessage type, const struct CmBlob *certUri, +static int32_t GetCertificateInfo(enum CertManagerInterfaceCode type, const struct CmBlob *certUri, const uint32_t store, struct CertInfo *certificateInfo) { int32_t ret = CM_SUCCESS; @@ -156,7 +156,7 @@ int32_t CmClientGetCertInfo(const struct CmBlob *certUri, const uint32_t store, return GetCertificateInfo(CM_MSG_GET_CERTIFICATE_INFO, certUri, store, certificateInfo); } -static int32_t SetCertificateStatus(enum CmMessage type, const struct CmBlob *certUri, +static int32_t SetCertificateStatus(enum CertManagerInterfaceCode type, const struct CmBlob *certUri, const uint32_t store, const uint32_t status) { int32_t ret = CM_SUCCESS; @@ -235,7 +235,8 @@ int32_t CmClientInstallAppCert(const struct CmBlob *appCert, const struct CmBlob return InstallAppCert(appCert, appCertPwd, certAlias, store, keyUri); } -static int32_t UninstallAppCert(enum CmMessage type, const struct CmBlob *keyUri, const uint32_t store) +static int32_t UninstallAppCert(enum CertManagerInterfaceCode type, const struct CmBlob *keyUri, + const uint32_t store) { int32_t ret; struct CmParamSet *sendParamSet = NULL; @@ -275,7 +276,7 @@ int32_t CmClientUninstallAppCert(const struct CmBlob *keyUri, const uint32_t sto return UninstallAppCert(CM_MSG_UNINSTALL_APP_CERTIFICATE, keyUri, store); } -int32_t CmClientUninstallAllAppCert(enum CmMessage type) +int32_t CmClientUninstallAllAppCert(enum CertManagerInterfaceCode type) { int32_t ret; char tempBuff[] = "uninstall all app cert"; @@ -379,7 +380,8 @@ static int32_t CmAppCertListUnpackFromService(const struct CmBlob *outData, return CM_SUCCESS; } -static int32_t GetAppCertList(enum CmMessage type, const uint32_t store, struct CredentialList *certificateList) +static int32_t GetAppCertList(enum CertManagerInterfaceCode type, const uint32_t store, + struct CredentialList *certificateList) { int32_t ret; struct CmBlob outBlob = { 0, NULL }; @@ -533,7 +535,7 @@ static int32_t CmAppCertInfoUnpackFromService(const struct CmBlob *outData, stru return CM_SUCCESS; } -static int32_t GetAppCert(enum CmMessage type, const struct CmBlob *certUri, const uint32_t store, +static int32_t GetAppCert(enum CertManagerInterfaceCode type, const struct CmBlob *certUri, const uint32_t store, struct Credential *certificate) { int32_t ret; @@ -586,7 +588,7 @@ int32_t CmClientGetAppCert(const struct CmBlob *keyUri, const uint32_t store, st return GetAppCert(CM_MSG_GET_APP_CERTIFICATE, keyUri, store, certificate); } -static int32_t ClientSerializationAndSend(enum CmMessage message, struct CmParam *params, +static int32_t ClientSerializationAndSend(enum CertManagerInterfaceCode message, struct CmParam *params, uint32_t paramCount, struct CmBlob *outBlob) { struct CmParamSet *sendParamSet = NULL; @@ -814,7 +816,7 @@ int32_t CmClientAbort(const struct CmBlob *handle) return ret; } -static int32_t GetUserCertList(enum CmMessage type, const uint32_t store, +static int32_t GetUserCertList(enum CertManagerInterfaceCode type, const uint32_t store, struct CertList *certificateList) { int32_t ret = CM_SUCCESS; @@ -861,7 +863,7 @@ int32_t CmClientGetUserCertList(const uint32_t store, struct CertList *certifica return GetUserCertList(CM_MSG_GET_USER_CERTIFICATE_LIST, store, certificateList); } -static int32_t GetUserCertInfo(enum CmMessage type, const struct CmBlob *certUri, +static int32_t GetUserCertInfo(enum CertManagerInterfaceCode type, const struct CmBlob *certUri, const uint32_t store, struct CertInfo *userCertInfo) { int32_t ret = CM_SUCCESS; @@ -909,7 +911,7 @@ int32_t CmClientGetUserCertInfo(const struct CmBlob *certUri, const uint32_t sto return GetUserCertInfo(CM_MSG_GET_USER_CERTIFICATE_INFO, certUri, store, certificateInfo); } -static int32_t SetUserCertStatus(enum CmMessage type, const struct CmBlob *certUri, +static int32_t SetUserCertStatus(enum CertManagerInterfaceCode type, const struct CmBlob *certUri, const uint32_t store, const uint32_t status) { int32_t ret = CM_SUCCESS; @@ -944,8 +946,8 @@ int32_t CmClientSetUserCertStatus(const struct CmBlob *certUri, const uint32_t s return SetUserCertStatus(CM_MSG_SET_USER_CERTIFICATE_STATUS, certUri, store, status); } -static int32_t InstallUserCert(enum CmMessage type, const struct CmBlob *userCert, const struct CmBlob *certAlias, - struct CmBlob *certUri) +static int32_t InstallUserCert(enum CertManagerInterfaceCode type, const struct CmBlob *userCert, + const struct CmBlob *certAlias, struct CmBlob *certUri) { int32_t ret = CM_SUCCESS; struct CmBlob parcelBlob = {0, NULL}; @@ -978,7 +980,7 @@ int32_t CmClientInstallUserTrustedCert(const struct CmBlob *userCert, const stru return InstallUserCert(CM_MSG_INSTALL_USER_CERTIFICATE, userCert, certAlias, certUri); } -static int32_t UninstallUserCert(enum CmMessage type, const struct CmBlob *certUri) +static int32_t UninstallUserCert(enum CertManagerInterfaceCode type, const struct CmBlob *certUri) { int32_t ret = CM_SUCCESS; struct CmBlob parcelBlob = {0, NULL}; @@ -1009,7 +1011,7 @@ int32_t CmClientUninstallUserTrustedCert(const struct CmBlob *certUri) return UninstallUserCert(CM_MSG_UNINSTALL_USER_CERTIFICATE, certUri); } -static int32_t UninstallAllUserCert(enum CmMessage type) +static int32_t UninstallAllUserCert(enum CertManagerInterfaceCode type) { int ret = CM_SUCCESS; uint8_t temp[4] = {0}; /* only use to construct parcelBlob */ diff --git a/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/src/cm_request.cpp b/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/src/cm_request.cpp index e0da403df31c140276e00cffa5d50cb108142e0b..3cf46f6f93ba73d72979634ad0cadacdf34af9f0 100644 --- a/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/src/cm_request.cpp +++ b/frameworks/cert_manager_standard/main/os_dependency/cm_ipc/src/cm_request.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -28,6 +28,7 @@ using namespace std; using namespace OHOS; +using namespace OHOS::Security::CertManager; namespace { constexpr int SA_ID_KEYSTORE_SERVICE = 3512; @@ -98,7 +99,7 @@ static int32_t CmReadRequestReply(MessageParcel &reply, struct CmBlob *outBlob) return CM_SUCCESS; } -int32_t SendRequest(enum CmMessage type, const struct CmBlob *inBlob, +int32_t SendRequest(CertManagerInterfaceCode type, const struct CmBlob *inBlob, struct CmBlob *outBlob) { uint32_t i = 0; @@ -128,7 +129,7 @@ int32_t SendRequest(enum CmMessage type, const struct CmBlob *inBlob, data.WriteUint32(inBlob->size); data.WriteBuffer(inBlob->data, static_cast(inBlob->size)); - int error = cmProxy->SendRequest(type, data, reply, option); + int error = cmProxy->SendRequest(static_cast(type), data, reply, option); if (error != 0) { CM_LOG_E("SendRequest error:%d", error); return error; @@ -153,4 +154,4 @@ void OnDemandLoadCertManagerCallback::OnLoadSystemAbilityFail(int32_t systemAbil sptr OnDemandLoadCertManagerCallback::Promise(void) { return promise_.get_future().get(); -} \ No newline at end of file +} diff --git a/services/cert_manager_standard/cert_manager_service/main/os_dependency/sa/cm_sa.cpp b/services/cert_manager_standard/cert_manager_service/main/os_dependency/sa/cm_sa.cpp index aae9b60e2be65a2b8c0da434775ab1ac50d87cee..9082af6a334d69b94aeeea16d6c19ff3abea3b92 100644 --- a/services/cert_manager_standard/cert_manager_service/main/os_dependency/sa/cm_sa.cpp +++ b/services/cert_manager_standard/cert_manager_service/main/os_dependency/sa/cm_sa.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -47,36 +47,36 @@ using CmIpcAppHandlerFuncProc = void (*)(const struct CmBlob *msg, struct CmBlob const CmContext *context); struct CmIpcPoint { - enum CmMessage msgId; + CertManagerInterfaceCode msgId; CmIpcAppHandlerFuncProc handler; }; static struct CmIpcPoint g_cmIpcHandler[] = { - { CM_MSG_INSTALL_APP_CERTIFICATE, CmIpcServiceInstallAppCert }, - { CM_MSG_UNINSTALL_APP_CERTIFICATE, CmIpcServiceUninstallAppCert }, - { CM_MSG_UNINSTALL_ALL_APP_CERTIFICATE, CmIpcServiceUninstallAllAppCert }, - { CM_MSG_GET_APP_CERTIFICATE_LIST, CmIpcServiceGetAppCertList }, - { CM_MSG_GET_APP_CERTIFICATE, CmIpcServiceGetAppCert }, - - { CM_MSG_GRANT_APP_CERT, CmIpcServiceGrantAppCertificate }, - { CM_MSG_GET_AUTHED_LIST, CmIpcServiceGetAuthorizedAppList }, - { CM_MSG_CHECK_IS_AUTHED_APP, CmIpcServiceIsAuthorizedApp }, - { CM_MSG_REMOVE_GRANT_APP, CmIpcServiceRemoveGrantedApp }, - { CM_MSG_INIT, CmIpcServiceInit }, - { CM_MSG_UPDATE, CmIpcServiceUpdate }, - { CM_MSG_FINISH, CmIpcServiceFinish }, - { CM_MSG_ABORT, CmIpcServiceAbort }, - - { CM_MSG_GET_USER_CERTIFICATE_LIST, CmIpcServiceGetUserCertList }, - { CM_MSG_GET_USER_CERTIFICATE_INFO, CmIpcServiceGetUserCertInfo }, - { CM_MSG_SET_USER_CERTIFICATE_STATUS, CmIpcServiceSetUserCertStatus }, - { CM_MSG_INSTALL_USER_CERTIFICATE, CmIpcServiceInstallUserCert }, - { CM_MSG_UNINSTALL_USER_CERTIFICATE, CmIpcServiceUninstallUserCert }, - { CM_MSG_UNINSTALL_ALL_USER_CERTIFICATE, CmIpcServiceUninstallAllUserCert }, - - { CM_MSG_GET_CERTIFICATE_LIST, CmIpcServiceGetCertificateList }, - { CM_MSG_GET_CERTIFICATE_INFO, CmIpcServiceGetCertificateInfo }, - { CM_MSG_SET_CERTIFICATE_STATUS, CmIpcServiceSetCertStatus }, + { CertManagerInterfaceCode::CM_MSG_INSTALL_APP_CERTIFICATE, CmIpcServiceInstallAppCert }, + { CertManagerInterfaceCode::CM_MSG_UNINSTALL_APP_CERTIFICATE, CmIpcServiceUninstallAppCert }, + { CertManagerInterfaceCode::CM_MSG_UNINSTALL_ALL_APP_CERTIFICATE, CmIpcServiceUninstallAllAppCert }, + { CertManagerInterfaceCode::CM_MSG_GET_APP_CERTIFICATE_LIST, CmIpcServiceGetAppCertList }, + { CertManagerInterfaceCode::CM_MSG_GET_APP_CERTIFICATE, CmIpcServiceGetAppCert }, + + { CertManagerInterfaceCode::CM_MSG_GRANT_APP_CERT, CmIpcServiceGrantAppCertificate }, + { CertManagerInterfaceCode::CM_MSG_GET_AUTHED_LIST, CmIpcServiceGetAuthorizedAppList }, + { CertManagerInterfaceCode::CM_MSG_CHECK_IS_AUTHED_APP, CmIpcServiceIsAuthorizedApp }, + { CertManagerInterfaceCode::CM_MSG_REMOVE_GRANT_APP, CmIpcServiceRemoveGrantedApp }, + { CertManagerInterfaceCode::CM_MSG_INIT, CmIpcServiceInit }, + { CertManagerInterfaceCode::CM_MSG_UPDATE, CmIpcServiceUpdate }, + { CertManagerInterfaceCode::CM_MSG_FINISH, CmIpcServiceFinish }, + { CertManagerInterfaceCode::CM_MSG_ABORT, CmIpcServiceAbort }, + + { CertManagerInterfaceCode::CM_MSG_GET_USER_CERTIFICATE_LIST, CmIpcServiceGetUserCertList }, + { CertManagerInterfaceCode::CM_MSG_GET_USER_CERTIFICATE_INFO, CmIpcServiceGetUserCertInfo }, + { CertManagerInterfaceCode::CM_MSG_SET_USER_CERTIFICATE_STATUS, CmIpcServiceSetUserCertStatus }, + { CertManagerInterfaceCode::CM_MSG_INSTALL_USER_CERTIFICATE, CmIpcServiceInstallUserCert }, + { CertManagerInterfaceCode::CM_MSG_UNINSTALL_USER_CERTIFICATE, CmIpcServiceUninstallUserCert }, + { CertManagerInterfaceCode::CM_MSG_UNINSTALL_ALL_USER_CERTIFICATE, CmIpcServiceUninstallAllUserCert }, + + { CertManagerInterfaceCode::CM_MSG_GET_CERTIFICATE_LIST, CmIpcServiceGetCertificateList }, + { CertManagerInterfaceCode::CM_MSG_GET_CERTIFICATE_INFO, CmIpcServiceGetCertificateInfo }, + { CertManagerInterfaceCode::CM_MSG_SET_CERTIFICATE_STATUS, CmIpcServiceSetCertStatus }, }; static void SubscribEvent() @@ -114,7 +114,7 @@ static int32_t ProcessMessage(uint32_t code, uint32_t outSize, const struct CmBl { uint32_t size = sizeof(g_cmIpcHandler) / sizeof(g_cmIpcHandler[0]); for (uint32_t i = 0; i < size; ++i) { - if (code != g_cmIpcHandler[i].msgId) { + if (code != static_cast(g_cmIpcHandler[i].msgId)) { continue; } struct CmBlob outData = { 0, nullptr }; diff --git a/services/cert_manager_standard/cert_manager_service/main/os_dependency/sa/cm_sa.h b/services/cert_manager_standard/cert_manager_service/main/os_dependency/sa/cm_sa.h index 99e13f3af6c8cb28b41957e89a8870995736fddd..efb0c7fe1228dbef441a08b94d334844eab3d14f 100644 --- a/services/cert_manager_standard/cert_manager_service/main/os_dependency/sa/cm_sa.h +++ b/services/cert_manager_standard/cert_manager_service/main/os_dependency/sa/cm_sa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -23,7 +23,7 @@ #include "nocopyable.h" #include "system_ability.h" -#include "cm_ipc_msg_code.h" +#include "cert_manager_ipc_interface_code.h" namespace OHOS { namespace Security { @@ -44,34 +44,57 @@ class ICertManagerService : public IRemoteBroker { public: DECLARE_INTERFACE_DESCRIPTOR(u"ohos.security.cm.service"); // message code - uint32_t MSG_CODE_BASE = CM_MSG_BASE; - - uint32_t MSG_CODE_GEN_KEY = CM_MSG_GEN_KEY; - uint32_t MSG_CODE_GET_CERTIFICATE_LIST = CM_MSG_GET_CERTIFICATE_LIST; - uint32_t MSG_CODE_GET_CERTIFICATE_INFO = CM_MSG_GET_CERTIFICATE_INFO; - uint32_t MSG_CODE_SET_CERTIFICATE_STATUS = CM_MSG_SET_CERTIFICATE_STATUS; - uint32_t MSG_CODE_INSTALL_APP_CERTIFICATE = CM_MSG_INSTALL_APP_CERTIFICATE; - uint32_t MSG_CODE_UNINSTALL_APP_CERTIFICATE = CM_MSG_UNINSTALL_APP_CERTIFICATE; - uint32_t MSG_CODE_UNINSTALL_ALL_APP_CERTIFICATE = CM_MSG_UNINSTALL_ALL_APP_CERTIFICATE; - uint32_t MSG_CODE_GET_APP_CERTIFICATE_LIST = CM_MSG_GET_APP_CERTIFICATE_LIST; - uint32_t MSG_CODE_GET_APP_CERTIFICATE = CM_MSG_GET_APP_CERTIFICATE; - uint32_t MSG_CODE_GRANT_APP_CERT = CM_MSG_GRANT_APP_CERT; - uint32_t MSG_CODE_GET_AUTHED_LIST = CM_MSG_GET_AUTHED_LIST; - uint32_t MSG_CODE_CHECK_IS_AUTHED_APP = CM_MSG_CHECK_IS_AUTHED_APP; - uint32_t MSG_CODE_REMOVE_GRANT_APP = CM_MSG_REMOVE_GRANT_APP; - uint32_t MSG_CODE_INIT = CM_MSG_INIT; - uint32_t MSG_CODE_UPDATE = CM_MSG_UPDATE; - uint32_t MSG_CODE_FINISH = CM_MSG_FINISH; - uint32_t MSG_CODE_ABORT = CM_MSG_ABORT; - uint32_t MSG_CODE_GET_USER_CERTIFICATE_LIST = CM_MSG_GET_USER_CERTIFICATE_LIST; - uint32_t MSG_CODE_GET_USER_CERTIFICATE_INFO = CM_MSG_GET_USER_CERTIFICATE_INFO; - uint32_t MSG_CODE_SET_USER_CERTIFICATE_STATUS = CM_MSG_SET_USER_CERTIFICATE_STATUS; - uint32_t MSG_CODE_INSTALL_USER_CERTIFICATE = CM_MSG_INSTALL_USER_CERTIFICATE; - uint32_t MSG_CODE_UNINSTALL_USER_CERTIFICATE = CM_MSG_UNINSTALL_USER_CERTIFICATE; - uint32_t MSG_CODE_UNINSTALL_ALL_USER_CERTIFICATE = CM_MSG_UNINSTALL_ALL_USER_CERTIFICATE; + uint32_t MSG_CODE_BASE = static_cast(CertManagerInterfaceCode::CM_MSG_BASE); + + uint32_t MSG_CODE_GEN_KEY = static_cast( + CertManagerInterfaceCode::CM_MSG_GEN_KEY); + uint32_t MSG_CODE_GET_CERTIFICATE_LIST = static_cast( + CertManagerInterfaceCode::CM_MSG_GET_CERTIFICATE_LIST); + uint32_t MSG_CODE_GET_CERTIFICATE_INFO = static_cast( + CertManagerInterfaceCode::CM_MSG_GET_CERTIFICATE_INFO); + uint32_t MSG_CODE_SET_CERTIFICATE_STATUS = static_cast( + CertManagerInterfaceCode::CM_MSG_SET_CERTIFICATE_STATUS); + uint32_t MSG_CODE_INSTALL_APP_CERTIFICATE = static_cast( + CertManagerInterfaceCode::CM_MSG_INSTALL_APP_CERTIFICATE); + uint32_t MSG_CODE_UNINSTALL_APP_CERTIFICATE = static_cast( + CertManagerInterfaceCode::CM_MSG_UNINSTALL_APP_CERTIFICATE); + uint32_t MSG_CODE_UNINSTALL_ALL_APP_CERTIFICATE = static_cast( + CertManagerInterfaceCode::CM_MSG_UNINSTALL_ALL_APP_CERTIFICATE); + uint32_t MSG_CODE_GET_APP_CERTIFICATE_LIST = static_cast( + CertManagerInterfaceCode::CM_MSG_GET_APP_CERTIFICATE_LIST); + uint32_t MSG_CODE_GET_APP_CERTIFICATE = static_cast( + CertManagerInterfaceCode::CM_MSG_GET_APP_CERTIFICATE); + uint32_t MSG_CODE_GRANT_APP_CERT = static_cast( + CertManagerInterfaceCode::CM_MSG_GRANT_APP_CERT); + uint32_t MSG_CODE_GET_AUTHED_LIST = static_cast( + CertManagerInterfaceCode::CM_MSG_GET_AUTHED_LIST); + uint32_t MSG_CODE_CHECK_IS_AUTHED_APP = static_cast( + CertManagerInterfaceCode::CM_MSG_CHECK_IS_AUTHED_APP); + uint32_t MSG_CODE_REMOVE_GRANT_APP = static_cast( + CertManagerInterfaceCode::CM_MSG_REMOVE_GRANT_APP); + uint32_t MSG_CODE_INIT = static_cast( + CertManagerInterfaceCode::CM_MSG_INIT); + uint32_t MSG_CODE_UPDATE = static_cast( + CertManagerInterfaceCode::CM_MSG_UPDATE); + uint32_t MSG_CODE_FINISH = static_cast( + CertManagerInterfaceCode::CM_MSG_FINISH); + uint32_t MSG_CODE_ABORT = static_cast( + CertManagerInterfaceCode::CM_MSG_ABORT); + uint32_t MSG_CODE_GET_USER_CERTIFICATE_LIST = static_cast( + CertManagerInterfaceCode::CM_MSG_GET_USER_CERTIFICATE_LIST); + uint32_t MSG_CODE_GET_USER_CERTIFICATE_INFO = static_cast( + CertManagerInterfaceCode::CM_MSG_GET_USER_CERTIFICATE_INFO); + uint32_t MSG_CODE_SET_USER_CERTIFICATE_STATUS = static_cast( + CertManagerInterfaceCode::CM_MSG_SET_USER_CERTIFICATE_STATUS); + uint32_t MSG_CODE_INSTALL_USER_CERTIFICATE = static_cast( + CertManagerInterfaceCode::CM_MSG_INSTALL_USER_CERTIFICATE); + uint32_t MSG_CODE_UNINSTALL_USER_CERTIFICATE = static_cast( + CertManagerInterfaceCode::CM_MSG_UNINSTALL_USER_CERTIFICATE); + uint32_t MSG_CODE_UNINSTALL_ALL_USER_CERTIFICATE = static_cast( + CertManagerInterfaceCode::CM_MSG_UNINSTALL_ALL_USER_CERTIFICATE); /* new cmd type must be added before CM_MSG_MAX */ - uint32_t MSG_CODE_MAX = CM_MSG_MAX; + uint32_t MSG_CODE_MAX = static_cast(CertManagerInterfaceCode::CM_MSG_MAX); }; class CertManagerService : public SystemAbility, public IRemoteStub { diff --git a/test/fuzz_test/cmipcserviceabort_fuzzer/cmipcserviceabort_fuzzer.cpp b/test/fuzz_test/cmipcserviceabort_fuzzer/cmipcserviceabort_fuzzer.cpp index 23a4d68f55dd8730f365f3955d48d06f1907a001..07326c9232c79b8f4057219172a4aeeace93cb8e 100644 --- a/test/fuzz_test/cmipcserviceabort_fuzzer/cmipcserviceabort_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceabort_fuzzer/cmipcserviceabort_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_ABORT, false, CmIpcServiceAbort)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_ABORT, false, CmIpcServiceAbort)) { return false; } diff --git a/test/fuzz_test/cmipcservicefinish_fuzzer/cmipcservicefinish_fuzzer.cpp b/test/fuzz_test/cmipcservicefinish_fuzzer/cmipcservicefinish_fuzzer.cpp index 4e6a996fb59d52067e1d36fcd56b20d9933b3f83..a4ad856f38ba5a1e4d20ca9ab3117b8c40f76b58 100644 --- a/test/fuzz_test/cmipcservicefinish_fuzzer/cmipcservicefinish_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicefinish_fuzzer/cmipcservicefinish_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_FINISH, false, CmIpcServiceFinish)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_FINISH, false, CmIpcServiceFinish)) { return false; } diff --git a/test/fuzz_test/cmipcservicegetappcert_fuzzer/cmipcservicegetappcert_fuzzer.cpp b/test/fuzz_test/cmipcservicegetappcert_fuzzer/cmipcservicegetappcert_fuzzer.cpp index 5b4d3f9dce55e79fbd96e8c413bf7da2930ac520..9cf0d78c00cf8d24b75bf6fb2ebd1e64d024c279 100644 --- a/test/fuzz_test/cmipcservicegetappcert_fuzzer/cmipcservicegetappcert_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicegetappcert_fuzzer/cmipcservicegetappcert_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_GET_APP_CERTIFICATE, false, CmIpcServiceGetAppCert)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_GET_APP_CERTIFICATE, + false, CmIpcServiceGetAppCert)) { return false; } diff --git a/test/fuzz_test/cmipcservicegetappcertlist_fuzzer/cmipcservicegetappcertlist_fuzzer.cpp b/test/fuzz_test/cmipcservicegetappcertlist_fuzzer/cmipcservicegetappcertlist_fuzzer.cpp index 747db39088dcecbc8085788805c63677b7f6ea86..559445e60f17f958804e0e13f852e382bd7efabf 100644 --- a/test/fuzz_test/cmipcservicegetappcertlist_fuzzer/cmipcservicegetappcertlist_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicegetappcertlist_fuzzer/cmipcservicegetappcertlist_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_GET_APP_CERTIFICATE_LIST, false, CmIpcServiceGetAppCertList)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_GET_APP_CERTIFICATE_LIST, + false, CmIpcServiceGetAppCertList)) { return false; } diff --git a/test/fuzz_test/cmipcservicegetauthorizedapplist_fuzzer/cmipcservicegetauthorizedapplist_fuzzer.cpp b/test/fuzz_test/cmipcservicegetauthorizedapplist_fuzzer/cmipcservicegetauthorizedapplist_fuzzer.cpp index 9222eb5104e04a22f8043f155a9d561092b6856c..7355cd4cf33dcc3a143270452cd746cc1daced7c 100644 --- a/test/fuzz_test/cmipcservicegetauthorizedapplist_fuzzer/cmipcservicegetauthorizedapplist_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicegetauthorizedapplist_fuzzer/cmipcservicegetauthorizedapplist_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_GET_AUTHED_LIST, false, CmIpcServiceGetAuthorizedAppList)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_GET_AUTHED_LIST, + false, CmIpcServiceGetAuthorizedAppList)) { return false; } diff --git a/test/fuzz_test/cmipcservicegetcertificateinfo_fuzzer/cmipcservicegetcertificateinfo_fuzzer.cpp b/test/fuzz_test/cmipcservicegetcertificateinfo_fuzzer/cmipcservicegetcertificateinfo_fuzzer.cpp index d675a2fefdab596d5a2c9c1c597e4cfe0e79ba44..bf7dea115751e22307aa70b4e7467e1a1171cae9 100644 --- a/test/fuzz_test/cmipcservicegetcertificateinfo_fuzzer/cmipcservicegetcertificateinfo_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicegetcertificateinfo_fuzzer/cmipcservicegetcertificateinfo_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_GET_CERTIFICATE_INFO, false, CmIpcServiceGetCertificateInfo)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_GET_CERTIFICATE_INFO, + false, CmIpcServiceGetCertificateInfo)) { return false; } diff --git a/test/fuzz_test/cmipcservicegetcertificatelist_fuzzer/cmipcservicegetcertificatelist_fuzzer.cpp b/test/fuzz_test/cmipcservicegetcertificatelist_fuzzer/cmipcservicegetcertificatelist_fuzzer.cpp index 07d2658889ba4fa8f16b61cc408147c6925fdb69..e1c2024bfd3182f1660b1da5859380d336a85f3b 100644 --- a/test/fuzz_test/cmipcservicegetcertificatelist_fuzzer/cmipcservicegetcertificatelist_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicegetcertificatelist_fuzzer/cmipcservicegetcertificatelist_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_GET_CERTIFICATE_LIST, false, CmIpcServiceGetCertificateList)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_GET_CERTIFICATE_LIST, + false, CmIpcServiceGetCertificateList)) { return false; } diff --git a/test/fuzz_test/cmipcservicegetusercertinfo_fuzzer/cmipcservicegetusercertinfo_fuzzer.cpp b/test/fuzz_test/cmipcservicegetusercertinfo_fuzzer/cmipcservicegetusercertinfo_fuzzer.cpp index c1b68eceffb91b1fba7ec800999ecfbcb033b099..1c9a19c4269ffc172ee34080835fccb4b0599421 100644 --- a/test/fuzz_test/cmipcservicegetusercertinfo_fuzzer/cmipcservicegetusercertinfo_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicegetusercertinfo_fuzzer/cmipcservicegetusercertinfo_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_GET_USER_CERTIFICATE_INFO, + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_GET_USER_CERTIFICATE_INFO, false, CmIpcServiceGetUserCertInfo)) { return false; } diff --git a/test/fuzz_test/cmipcservicegetusercertlist_fuzzer/cmipcservicegetusercertlist_fuzzer.cpp b/test/fuzz_test/cmipcservicegetusercertlist_fuzzer/cmipcservicegetusercertlist_fuzzer.cpp index 39cd98ed4bb7e84d632fc31dfdd03268763e8560..fb0ea0163d4518da2089ce2b33ca3bf5b0a03762 100644 --- a/test/fuzz_test/cmipcservicegetusercertlist_fuzzer/cmipcservicegetusercertlist_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicegetusercertlist_fuzzer/cmipcservicegetusercertlist_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_GET_USER_CERTIFICATE_LIST, + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_GET_USER_CERTIFICATE_LIST, false, CmIpcServiceGetUserCertList)) { return false; } diff --git a/test/fuzz_test/cmipcservicegrantappcertificate_fuzzer/cmipcservicegrantappcertificate_fuzzer.cpp b/test/fuzz_test/cmipcservicegrantappcertificate_fuzzer/cmipcservicegrantappcertificate_fuzzer.cpp index d19b67415b1fe3df4f49dce5a2445054fbf85647..eaefca3e2b7c9faeb86bf90dfa620415ad036f29 100644 --- a/test/fuzz_test/cmipcservicegrantappcertificate_fuzzer/cmipcservicegrantappcertificate_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicegrantappcertificate_fuzzer/cmipcservicegrantappcertificate_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_GRANT_APP_CERT, false, CmIpcServiceGrantAppCertificate)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_GRANT_APP_CERT, + false, CmIpcServiceGrantAppCertificate)) { return false; } diff --git a/test/fuzz_test/cmipcserviceinit_fuzzer/cmipcserviceinit_fuzzer.cpp b/test/fuzz_test/cmipcserviceinit_fuzzer/cmipcserviceinit_fuzzer.cpp index f2d71cdd07314112ab8100e95ab40ef1832e1d58..64bcf117b65d5b2d549c22d5080bca10aa074206 100644 --- a/test/fuzz_test/cmipcserviceinit_fuzzer/cmipcserviceinit_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceinit_fuzzer/cmipcserviceinit_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_INIT, false, CmIpcServiceInit)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_INIT, false, CmIpcServiceInit)) { return false; } diff --git a/test/fuzz_test/cmipcserviceinstallappcert_fuzzer/cmipcserviceinstallappcert_fuzzer.cpp b/test/fuzz_test/cmipcserviceinstallappcert_fuzzer/cmipcserviceinstallappcert_fuzzer.cpp index 30d4244e9405f60e02ec68adfb33bfa16046d1ac..8e71d0a2796b3ecd0c2fe256d072e0c6e6206133 100644 --- a/test/fuzz_test/cmipcserviceinstallappcert_fuzzer/cmipcserviceinstallappcert_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceinstallappcert_fuzzer/cmipcserviceinstallappcert_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_INSTALL_APP_CERTIFICATE, false, CmIpcServiceInstallAppCert)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_INSTALL_APP_CERTIFICATE, + false, CmIpcServiceInstallAppCert)) { return false; } diff --git a/test/fuzz_test/cmipcserviceinstallusercert_fuzzer/cmipcserviceinstallusercert_fuzzer.cpp b/test/fuzz_test/cmipcserviceinstallusercert_fuzzer/cmipcserviceinstallusercert_fuzzer.cpp index d6efc15e15c0b06081546872e905bd21dbafa356..8c89e410a24acbdbafd6b30651b0ef0e2e3d186d 100644 --- a/test/fuzz_test/cmipcserviceinstallusercert_fuzzer/cmipcserviceinstallusercert_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceinstallusercert_fuzzer/cmipcserviceinstallusercert_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_INSTALL_USER_CERTIFICATE, false, CmIpcServiceInstallUserCert)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_INSTALL_USER_CERTIFICATE, + false, CmIpcServiceInstallUserCert)) { return false; } diff --git a/test/fuzz_test/cmipcserviceisauthorizedapp_fuzzer/cmipcserviceisauthorizedapp_fuzzer.cpp b/test/fuzz_test/cmipcserviceisauthorizedapp_fuzzer/cmipcserviceisauthorizedapp_fuzzer.cpp index d483495e2ee3b5747b21b315eeab67f508a1c0de..b5c997e58fa39bf030dad159fcf0a0d11f3a8026 100644 --- a/test/fuzz_test/cmipcserviceisauthorizedapp_fuzzer/cmipcserviceisauthorizedapp_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceisauthorizedapp_fuzzer/cmipcserviceisauthorizedapp_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_CHECK_IS_AUTHED_APP, false, CmIpcServiceIsAuthorizedApp)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_CHECK_IS_AUTHED_APP, + false, CmIpcServiceIsAuthorizedApp)) { return false; } diff --git a/test/fuzz_test/cmipcserviceremovegrantedapp_fuzzer/cmipcserviceremovegrantedapp_fuzzer.cpp b/test/fuzz_test/cmipcserviceremovegrantedapp_fuzzer/cmipcserviceremovegrantedapp_fuzzer.cpp index 0d3f8e33ad69db699f799a823502ed305ef5f45e..643f17a35ce7e8e205063c280477def38c2405f1 100644 --- a/test/fuzz_test/cmipcserviceremovegrantedapp_fuzzer/cmipcserviceremovegrantedapp_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceremovegrantedapp_fuzzer/cmipcserviceremovegrantedapp_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_REMOVE_GRANT_APP, false, CmIpcServiceRemoveGrantedApp)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_REMOVE_GRANT_APP, + false, CmIpcServiceRemoveGrantedApp)) { return false; } diff --git a/test/fuzz_test/cmipcservicesetcertstatus_fuzzer/cmipcservicesetcertstatus_fuzzer.cpp b/test/fuzz_test/cmipcservicesetcertstatus_fuzzer/cmipcservicesetcertstatus_fuzzer.cpp index b1be26a74d8a7e6b027bce15c0803ec87efbda9d..a948b990f4e030e54d3bae59875c53e592cc0861 100644 --- a/test/fuzz_test/cmipcservicesetcertstatus_fuzzer/cmipcservicesetcertstatus_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicesetcertstatus_fuzzer/cmipcservicesetcertstatus_fuzzer.cpp @@ -20,11 +20,13 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_SET_CERTIFICATE_STATUS, false, CmIpcServiceSetCertStatus)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_SET_CERTIFICATE_STATUS, + false, CmIpcServiceSetCertStatus)) { return false; } diff --git a/test/fuzz_test/cmipcservicesetusercertstatus_fuzzer/cmipcservicesetusercertstatus_fuzzer.cpp b/test/fuzz_test/cmipcservicesetusercertstatus_fuzzer/cmipcservicesetusercertstatus_fuzzer.cpp index 0215e1b173584bae8639a08f169bd9bf657ddd64..3f2149c2f254250576e0874ecf9e77c50039ea3a 100644 --- a/test/fuzz_test/cmipcservicesetusercertstatus_fuzzer/cmipcservicesetusercertstatus_fuzzer.cpp +++ b/test/fuzz_test/cmipcservicesetusercertstatus_fuzzer/cmipcservicesetusercertstatus_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_SET_USER_CERTIFICATE_STATUS, + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_SET_USER_CERTIFICATE_STATUS, false, CmIpcServiceSetUserCertStatus)) { return false; } diff --git a/test/fuzz_test/cmipcserviceuninstallallappcert_fuzzer/cmipcserviceuninstallallappcert_fuzzer.cpp b/test/fuzz_test/cmipcserviceuninstallallappcert_fuzzer/cmipcserviceuninstallallappcert_fuzzer.cpp index 8f1cd8ec7e0cbaaa192de93da4de35391f8b788d..452c29c41697ec3b72899d951361ad6f34fc0969 100644 --- a/test/fuzz_test/cmipcserviceuninstallallappcert_fuzzer/cmipcserviceuninstallallappcert_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceuninstallallappcert_fuzzer/cmipcserviceuninstallallappcert_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_UNINSTALL_APP_CERTIFICATE, + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_UNINSTALL_APP_CERTIFICATE, false, CmIpcServiceUninstallAllAppCert)) { return false; } diff --git a/test/fuzz_test/cmipcserviceuninstallallusercert_fuzzer/cmipcserviceuninstallallusercert_fuzzer.cpp b/test/fuzz_test/cmipcserviceuninstallallusercert_fuzzer/cmipcserviceuninstallallusercert_fuzzer.cpp index 7d848a84e7eaa72f6b086a8cb2448029aa2e60b3..c43d97a7472cd156d46ee150748b3ee9acb4d91b 100644 --- a/test/fuzz_test/cmipcserviceuninstallallusercert_fuzzer/cmipcserviceuninstallallusercert_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceuninstallallusercert_fuzzer/cmipcserviceuninstallallusercert_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_UNINSTALL_ALL_USER_CERTIFICATE, + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_UNINSTALL_ALL_USER_CERTIFICATE, false, CmIpcServiceUninstallAllUserCert)) { return false; } diff --git a/test/fuzz_test/cmipcserviceuninstallappcert_fuzzer/cmipcserviceuninstallappcert_fuzzer.cpp b/test/fuzz_test/cmipcserviceuninstallappcert_fuzzer/cmipcserviceuninstallappcert_fuzzer.cpp index 2ed14dd18083bd6a253ab8f38e2b954df330f099..e9c9f91d08af253ea1efcc3ad1fe015d96c6ee00 100644 --- a/test/fuzz_test/cmipcserviceuninstallappcert_fuzzer/cmipcserviceuninstallappcert_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceuninstallappcert_fuzzer/cmipcserviceuninstallappcert_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_UNINSTALL_APP_CERTIFICATE, + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_UNINSTALL_APP_CERTIFICATE, false, CmIpcServiceUninstallAppCert)) { return false; } diff --git a/test/fuzz_test/cmipcserviceuninstallusercert_fuzzer/cmipcserviceuninstallusercert_fuzzer.cpp b/test/fuzz_test/cmipcserviceuninstallusercert_fuzzer/cmipcserviceuninstallusercert_fuzzer.cpp index e6894c4847d068b7de5f74225d26b0c416c2fb64..38d6bd047e50eb0d398aa132217129d9cdd7ce63 100644 --- a/test/fuzz_test/cmipcserviceuninstallusercert_fuzzer/cmipcserviceuninstallusercert_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceuninstallusercert_fuzzer/cmipcserviceuninstallusercert_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_UNINSTALL_USER_CERTIFICATE, + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_UNINSTALL_USER_CERTIFICATE, false, CmIpcServiceUninstallUserCert)) { return false; } diff --git a/test/fuzz_test/cmipcserviceupdate_fuzzer/cmipcserviceupdate_fuzzer.cpp b/test/fuzz_test/cmipcserviceupdate_fuzzer/cmipcserviceupdate_fuzzer.cpp index 883913224b076cb1e993e01f650661da3d37a633..3dba16fb53c257d447f7133cda7beef12ab25d8e 100644 --- a/test/fuzz_test/cmipcserviceupdate_fuzzer/cmipcserviceupdate_fuzzer.cpp +++ b/test/fuzz_test/cmipcserviceupdate_fuzzer/cmipcserviceupdate_fuzzer.cpp @@ -20,11 +20,12 @@ #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { CertmanagerTest::SetATPermission(); - if (!IpcServiceApiFuzzerTest(data, size, CM_MSG_UPDATE, false, CmIpcServiceUpdate)) { + if (!IpcServiceApiFuzzerTest(data, size, CertManagerInterfaceCode::CM_MSG_UPDATE, false, CmIpcServiceUpdate)) { return false; } diff --git a/test/fuzz_test/cmsendrequest_fuzzer/cmsendrequest_fuzzer.cpp b/test/fuzz_test/cmsendrequest_fuzzer/cmsendrequest_fuzzer.cpp index 680cbc08d525a0a97fdfd8ee6b103e8aad3b9807..f888e65a89ddc713946bf51f4d8697493ac98a5d 100644 --- a/test/fuzz_test/cmsendrequest_fuzzer/cmsendrequest_fuzzer.cpp +++ b/test/fuzz_test/cmsendrequest_fuzzer/cmsendrequest_fuzzer.cpp @@ -15,17 +15,17 @@ #include "cmsendrequest_fuzzer.h" -#include "cm_ipc_msg_code.h" #include "cm_fuzz_test_common.h" #include "cm_param.h" #include "cm_request.h" #include "cm_test_common.h" using namespace CmFuzzTest; +using namespace OHOS::Security::CertManager; namespace OHOS { bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size) { - uint32_t minSize = sizeof(enum CmMessage) + sizeof(struct CmParamSet) + sizeof(struct CmBlob); + uint32_t minSize = sizeof(CertManagerInterfaceCode) + sizeof(struct CmParamSet) + sizeof(struct CmBlob); uint8_t *myData = nullptr; if (!CopyMyData(data, size, minSize, &myData)) { return false; @@ -34,11 +34,12 @@ namespace OHOS { uint32_t remainSize = static_cast(size); uint32_t offset = 0; - enum CmMessage type; - (void)memcpy_s(&type, sizeof(enum CmMessage), myData, sizeof(enum CmMessage)); - type = static_cast( - static_cast(type) % static_cast(CM_MSG_MAX - CM_MSG_BASE) + - static_cast(CM_MSG_BASE)); + CertManagerInterfaceCode type; + (void)memcpy_s(&type, sizeof(CertManagerInterfaceCode), myData, sizeof(CertManagerInterfaceCode)); + type = static_cast(static_cast(type) % + (static_cast(CertManagerInterfaceCode::CM_MSG_MAX) - + static_cast(CertManagerInterfaceCode::CM_MSG_BASE)) + + static_cast(CertManagerInterfaceCode::CM_MSG_BASE)); offset += sizeof(uint32_t); remainSize -= sizeof(uint32_t); diff --git a/test/fuzz_test/fuzz_test_common/include/cm_fuzz_test_common.h b/test/fuzz_test/fuzz_test_common/include/cm_fuzz_test_common.h index d32010df51783e2b148bb9db36632f48bec17e10..7e4752ecc0ce0ed668bf90b840474e4ee742cc00 100644 --- a/test/fuzz_test/fuzz_test_common/include/cm_fuzz_test_common.h +++ b/test/fuzz_test/fuzz_test_common/include/cm_fuzz_test_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -16,7 +16,7 @@ #ifndef CM_FUZZ_TEST_COMMON_H #define CM_FUZZ_TEST_COMMON_H -#include "cm_ipc_msg_code.h" +#include "cert_manager_ipc_interface_code.h" #include "cm_mem.h" #include "cm_param.h" #include "cm_type.h" @@ -33,10 +33,11 @@ bool GetCertInfoFromBuffer(uint8_t *srcData, uint32_t *remSize, uint32_t *offset bool CopyMyData(const uint8_t *data, const size_t size, const uint32_t minSize, uint8_t **myData); -bool ConstructParamSet(uint8_t *srcData, uint32_t *remainSize, uint32_t *offset, enum CmMessage code, - struct CmParamSet **paramSetOut); +bool ConstructParamSet(uint8_t *srcData, uint32_t *remainSize, uint32_t *offset, + OHOS::Security::CertManager::CertManagerInterfaceCode code, struct CmParamSet **paramSetOut); -bool IpcServiceApiFuzzerTest(const uint8_t *data, const size_t size, enum CmMessage code, bool isParamsetToBlob, - void (*ipcServiceApi)(const struct CmBlob *, struct CmBlob *, const struct CmContext *)); +bool IpcServiceApiFuzzerTest(const uint8_t *data, const size_t size, + OHOS::Security::CertManager::CertManagerInterfaceCode code, + bool isParamsetToBlob, void (*ipcServiceApi)(const struct CmBlob *, struct CmBlob *, const struct CmContext *)); } // namespace CmFuzzTest #endif /* CM_FUZZ_TEST_COMMON_H */ diff --git a/test/fuzz_test/fuzz_test_common/src/cm_fuzz_test_common.cpp b/test/fuzz_test/fuzz_test_common/src/cm_fuzz_test_common.cpp index 3e7e17d19f9e4e8ce285428ecadb9b6c82c2a238..26e0d4004d6318fcfd85464e7e66b4e686477570 100644 --- a/test/fuzz_test/fuzz_test_common/src/cm_fuzz_test_common.cpp +++ b/test/fuzz_test/fuzz_test_common/src/cm_fuzz_test_common.cpp @@ -18,6 +18,8 @@ #include "cm_ipc_client_serialization.h" #include "message_parcel.h" +using namespace OHOS::Security::CertManager; + namespace CmFuzzTest { bool GetUintFromBuffer(uint8_t *srcData, uint32_t *remSize, uint32_t *offset, uint32_t *outVal) { @@ -102,26 +104,26 @@ constexpr uint32_t PARAM_COUNT_THREE = 3; constexpr uint32_t PARAM_COUNT_FOUR = 4; struct CmFuzzerCodeParams { - enum CmMessage code; + CertManagerInterfaceCode code; uint32_t paramCnt; struct CmParam params[PARAM_COUNT_FOUR]; }; constexpr struct CmFuzzerCodeParams g_codeParams[] = { - { CM_MSG_GET_CERTIFICATE_LIST, + { CertManagerInterfaceCode::CM_MSG_GET_CERTIFICATE_LIST, PARAM_COUNT_ONE, { { .tag = CM_TAG_PARAM0_UINT32, .uint32Param = 0 } } }, - { CM_MSG_GET_CERTIFICATE_INFO, + { CertManagerInterfaceCode::CM_MSG_GET_CERTIFICATE_INFO, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM0_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_SET_CERTIFICATE_STATUS, + { CertManagerInterfaceCode::CM_MSG_SET_CERTIFICATE_STATUS, PARAM_COUNT_THREE, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, @@ -129,7 +131,7 @@ constexpr struct CmFuzzerCodeParams g_codeParams[] = { { .tag = CM_TAG_PARAM1_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_INSTALL_APP_CERTIFICATE, + { CertManagerInterfaceCode::CM_MSG_INSTALL_APP_CERTIFICATE, PARAM_COUNT_FOUR, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, @@ -138,98 +140,98 @@ constexpr struct CmFuzzerCodeParams g_codeParams[] = { { .tag = CM_TAG_PARAM3_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_UNINSTALL_APP_CERTIFICATE, + { CertManagerInterfaceCode::CM_MSG_UNINSTALL_APP_CERTIFICATE, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM0_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_UNINSTALL_ALL_APP_CERTIFICATE, + { CertManagerInterfaceCode::CM_MSG_UNINSTALL_ALL_APP_CERTIFICATE, 0, { } }, - { CM_MSG_GET_APP_CERTIFICATE_LIST, + { CertManagerInterfaceCode::CM_MSG_GET_APP_CERTIFICATE_LIST, PARAM_COUNT_ONE, { { .tag = CM_TAG_PARAM0_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_GET_APP_CERTIFICATE, + { CertManagerInterfaceCode::CM_MSG_GET_APP_CERTIFICATE, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM0_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_GRANT_APP_CERT, + { CertManagerInterfaceCode::CM_MSG_GRANT_APP_CERT, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM1_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_GET_AUTHED_LIST, + { CertManagerInterfaceCode::CM_MSG_GET_AUTHED_LIST, PARAM_COUNT_ONE, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, } }, - { CM_MSG_CHECK_IS_AUTHED_APP, + { CertManagerInterfaceCode::CM_MSG_CHECK_IS_AUTHED_APP, PARAM_COUNT_ONE, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, } }, - { CM_MSG_REMOVE_GRANT_APP, + { CertManagerInterfaceCode::CM_MSG_REMOVE_GRANT_APP, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM1_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_INIT, + { CertManagerInterfaceCode::CM_MSG_INIT, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM1_BUFFER, .blob = { 0, nullptr } }, } }, - { CM_MSG_UPDATE, + { CertManagerInterfaceCode::CM_MSG_UPDATE, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM1_BUFFER, .blob = { 0, nullptr } }, } }, - { CM_MSG_FINISH, + { CertManagerInterfaceCode::CM_MSG_FINISH, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM1_BUFFER, .blob = { 0, nullptr } }, } }, - { CM_MSG_ABORT, + { CertManagerInterfaceCode::CM_MSG_ABORT, PARAM_COUNT_ONE, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, } }, - { CM_MSG_GET_USER_CERTIFICATE_LIST, + { CertManagerInterfaceCode::CM_MSG_GET_USER_CERTIFICATE_LIST, PARAM_COUNT_ONE, { { .tag = CM_TAG_PARAM0_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_GET_USER_CERTIFICATE_INFO, + { CertManagerInterfaceCode::CM_MSG_GET_USER_CERTIFICATE_INFO, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM0_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_SET_USER_CERTIFICATE_STATUS, + { CertManagerInterfaceCode::CM_MSG_SET_USER_CERTIFICATE_STATUS, PARAM_COUNT_THREE, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, @@ -237,28 +239,28 @@ constexpr struct CmFuzzerCodeParams g_codeParams[] = { { .tag = CM_TAG_PARAM1_UINT32, .uint32Param = 0 }, } }, - { CM_MSG_INSTALL_USER_CERTIFICATE, + { CertManagerInterfaceCode::CM_MSG_INSTALL_USER_CERTIFICATE, PARAM_COUNT_TWO, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, { .tag = CM_TAG_PARAM1_BUFFER, .blob = { 0, nullptr } }, } }, - { CM_MSG_UNINSTALL_USER_CERTIFICATE, + { CertManagerInterfaceCode::CM_MSG_UNINSTALL_USER_CERTIFICATE, PARAM_COUNT_ONE, { { .tag = CM_TAG_PARAM0_BUFFER, .blob = { 0, nullptr } }, } }, - { CM_MSG_UNINSTALL_ALL_USER_CERTIFICATE, + { CertManagerInterfaceCode::CM_MSG_UNINSTALL_ALL_USER_CERTIFICATE, 0, { } }, }; -bool ConstructParamSet(uint8_t *srcData, uint32_t *remainSize, uint32_t *offset, enum CmMessage code, - struct CmParamSet **paramSetOut) +bool ConstructParamSet(uint8_t *srcData, uint32_t *remainSize, + uint32_t *offset, CertManagerInterfaceCode code, struct CmParamSet **paramSetOut) { struct CmParam params[PARAM_COUNT_FOUR] = {}; uint32_t paramCnt = 0; @@ -302,8 +304,8 @@ bool ConstructParamSet(uint8_t *srcData, uint32_t *remainSize, uint32_t *offset, return true; } -bool IpcServiceApiFuzzerTest(const uint8_t *data, const size_t size, enum CmMessage code, bool isParamsetToBlob, - void (*ipcServiceApi)(const struct CmBlob *, struct CmBlob *, const struct CmContext *)) +bool IpcServiceApiFuzzerTest(const uint8_t *data, const size_t size, CertManagerInterfaceCode code, + bool isParamsetToBlob, void (*ipcServiceApi)(const struct CmBlob *, struct CmBlob *, const struct CmContext *)) { uint32_t minSize = sizeof(struct CmBlob) + sizeof(struct CmBlob); uint8_t *myData = nullptr;