1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef CODE_SIGN_ERR_CODE_H 17 #define CODE_SIGN_ERR_CODE_H 18 19 namespace OHOS { 20 namespace Security { 21 namespace CodeSign { 22 enum CommonErrCode { 23 CS_SUCCESS = 0, 24 CS_ERR_MEMORY = -0x1, 25 CS_ERR_NO_PERMISSION = -0x2, 26 CS_ERR_NO_SIGNATURE = -0x3, 27 CS_ERR_INVALID_SIGNATURE = -0x4 28 }; 29 30 enum FileOperationErrCode { 31 CS_ERR_FILE_INVALID = -0x100, 32 CS_ERR_FILE_PATH = -0x101, 33 CS_ERR_FILE_OPEN = -0x102, 34 CS_ERR_FILE_READ = -0x103, 35 CS_ERR_EXTRACT_FILES = -0x104 36 }; 37 38 enum SignErrCode { 39 CS_ERR_PARAM_INVALID = -0x200, 40 CS_ERR_HUKS_OBTAIN_CERT = -0x201, 41 CS_ERR_HUKS_SIGN = -0x202, 42 CS_ERR_HUKS_INIT_KEY = -0x203, 43 CS_ERR_COMPUTE_DIGEST = -0x204 44 }; 45 46 enum OpenSSLErrCode { 47 CS_ERR_OPENSSL_LOAD_CERT = -0x210, 48 CS_ERR_OPENSSL_CREATE_PKCS7_DATA = -0x211, 49 CS_ERR_OPENSSL_PKCS7 = -0x212 50 }; 51 52 enum FsverityErrCode { 53 CS_ERR_ENABLE = -0x300, 54 CS_ERR_FSVREITY_NOT_SUPPORTED = -0x301, 55 CS_ERR_FSVERITY_NOT_ENABLED = -0x302 56 }; 57 58 enum IPCErrCode { 59 CS_ERR_IPC_MSG_INVALID = -0x500, 60 CS_ERR_IPC_WRITE_DATA = -0x501, 61 CS_ERR_IPC_READ_DATA = -0x502, 62 CS_ERR_REMOTE_CONNECTION = -0x503, 63 CS_ERR_SA_GET_SAMGR = -0x504, 64 CS_ERR_SA_GET_PROXY = -0x505, 65 CS_ERR_SA_LOAD_FAILED = -0x506, 66 CS_ERR_SA_LOAD_TIMEOUT = -0x507 67 }; 68 } 69 } 70 } 71 #endif