API参考
载入中...
搜索中...
未找到
app_errno.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15
16#ifndef HITLS_APP_ERRNO_H
17#define HITLS_APP_ERRNO_H
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#define HITLS_APP_SUCCESS 0
24
25// The return value of HITLS APP ranges from 0, 1, 3 to 125.
26// 3 to 125 are external error codes.
27enum HITLS_APP_ERROR {
28 HITLS_APP_HELP = 0x1, /* *< the subcommand has the help option */
29 HITLS_APP_SECUREC_FAIL, /* *< error returned by the safe function */
30 HITLS_APP_MEM_ALLOC_FAIL, /* *< failed to apply for memory resources */
31 HITLS_APP_INVALID_ARG, /* *< invalid parameter */
32 HITLS_APP_INTERNAL_EXCEPTION,
33 HITLS_APP_ENCODE_FAIL, /* *< encodeing failure */
34 HITLS_APP_CRYPTO_FAIL,
35 HITLS_APP_PASSWD_FAIL,
36 HITLS_APP_UIO_FAIL,
37 HITLS_APP_STDIN_FAIL, /* *< incorrect stdin input */
38 HITLS_APP_INFO_CMP_FAIL, /* *< failed to match the received information with the parameter */
39 HITLS_APP_INVALID_DN_TYPE,
40 HITLS_APP_INVALID_DN_VALUE,
41 HITLS_APP_INVALID_GENERAL_NAME_TYPE,
42 HITLS_APP_INVALID_GENERAL_NAME,
43 HITLS_APP_INVALID_IP,
44 HITLS_APP_ERR_CONF_GET_SECTION,
45 HITLS_APP_NO_EXT,
46
47 HITLS_APP_INIT_FAILED,
48 HITLS_APP_COPY_ARGS_FAILED,
49
50 HITLS_APP_OPT_UNKOWN, /* *< option error */
51 HITLS_APP_OPT_NAME_INVALID, /* *< the subcommand name is invalid */
52 HITLS_APP_OPT_VALUETYPE_INVALID, /* *< the parameter type of the subcommand is invalid */
53 HITLS_APP_OPT_TYPE_INVALID, /* *< the subcommand type is invalid */
54 HITLS_APP_OPT_VALUE_INVALID, /* *< the subcommand parameter value is invalid */
55
56 HITLS_APP_DECODE_FAIL, /* *< decoding failure */
57 HITLS_APP_CERT_VERIFY_FAIL, /* *< certificate verification failed */
58 HITLS_APP_X509_FAIL, /* *< x509-related error. */
59 HITLS_APP_SAL_FAIL, /* *< sal-related error. */
60 HITLS_APP_BSL_FAIL, /* *< bsl-related error. */
61 HITLS_APP_CONF_FAIL, /* *< conf-related error. */
62
63 HITLS_APP_LOAD_CERT_FAIL, /* *< Failed to load the cert. */
64 HITLS_APP_LOAD_CSR_FAIL, /* *< Failed to load the csr. */
65 HITLS_APP_LOAD_KEY_FAIL, /* *< Failed to load the public and private keys. */
66 HITLS_APP_ENCODE_KEY_FAIL, /* *< Failed to encode the public and private keys. */
67 /* TLS Client/Server specific errors */
68 HITLS_APP_ERR_CREATE_CTX, /* *< Failed to create TLS context */
69 HITLS_APP_ERR_CONNECT, /* *< Failed to connect to server */
70 HITLS_APP_ERR_LISTEN, /* *< Failed to create listening socket */
71 HITLS_APP_ERR_HANDSHAKE, /* *< TLS handshake failed */
72 HITLS_APP_ERR_SEND_DATA, /* *< Failed to send data */
73 HITLS_APP_ERR_SET_CIPHER, /* *< Failed to set cipher suites */
74 HITLS_APP_ERR_SET_SIGNATURE, /* *< Failed to set signature algorithms */
75 HITLS_APP_ERR_SET_GROUPS, /* *< Failed to set curves/groups */
76 HITLS_APP_ERR_LOAD_CA, /* *< Failed to load CA certificate */
77 HITLS_APP_ERR_SET_VERIFY, /* *< Failed to set verification options */
78 HITLS_APP_ERR_SET_TLCP_CERT, /* *< Failed to set TLCP certificate */
79 HITLS_APP_ERR_SET_COOKIE, /* *< Failed to set cookie exchange */
80 HITLS_APP_ERR_RESOLVE_HOST, /* *< Failed to resolve hostname */
81
82 HITLS_APP_ROOT_CHECK_FAIL, /* *< root user check failed. */
83 HITLS_APP_INTEGRITY_VERIFY_FAIL, /* *< integrity verify failed. */
84
85 HITLS_APP_MAX = 126, /* *< maximum of the error code */
86};
87
88#ifdef __cplusplus
89}
90#endif
91#endif