1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61: #include <stdio.h>
62: #include <openssl/err.h>
63: #include "e_aep_err.h"
64:
65:
66: #ifndef OPENSSL_NO_ERR
67:
68: #define ERR_FUNC(func) ERR_PACK(0,func,0)
69: #define ERR_REASON(reason) ERR_PACK(0,0,reason)
70:
71: static ERR_STRING_DATA AEPHK_str_functs[]=
72: {
73: {ERR_FUNC(AEPHK_F_AEP_CTRL), "AEP_CTRL"},
74: {ERR_FUNC(AEPHK_F_AEP_FINISH), "AEP_FINISH"},
75: {ERR_FUNC(AEPHK_F_AEP_GET_CONNECTION), "AEP_GET_CONNECTION"},
76: {ERR_FUNC(AEPHK_F_AEP_INIT), "AEP_INIT"},
77: {ERR_FUNC(AEPHK_F_AEP_MOD_EXP), "AEP_MOD_EXP"},
78: {ERR_FUNC(AEPHK_F_AEP_MOD_EXP_CRT), "AEP_MOD_EXP_CRT"},
79: {ERR_FUNC(AEPHK_F_AEP_RAND), "AEP_RAND"},
80: {ERR_FUNC(AEPHK_F_AEP_RSA_MOD_EXP), "AEP_RSA_MOD_EXP"},
81: {0,NULL}
82: };
83:
84: static ERR_STRING_DATA AEPHK_str_reasons[]=
85: {
86: {ERR_REASON(AEPHK_R_ALREADY_LOADED) ,"already loaded"},
87: {ERR_REASON(AEPHK_R_CLOSE_HANDLES_FAILED),"close handles failed"},
88: {ERR_REASON(AEPHK_R_CONNECTIONS_IN_USE) ,"connections in use"},
89: {ERR_REASON(AEPHK_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"},
90: {ERR_REASON(AEPHK_R_FINALIZE_FAILED) ,"finalize failed"},
91: {ERR_REASON(AEPHK_R_GET_HANDLE_FAILED) ,"get handle failed"},
92: {ERR_REASON(AEPHK_R_GET_RANDOM_FAILED) ,"get random failed"},
93: {ERR_REASON(AEPHK_R_INIT_FAILURE) ,"init failure"},
94: {ERR_REASON(AEPHK_R_MISSING_KEY_COMPONENTS),"missing key components"},
95: {ERR_REASON(AEPHK_R_MOD_EXP_CRT_FAILED) ,"mod exp crt failed"},
96: {ERR_REASON(AEPHK_R_MOD_EXP_FAILED) ,"mod exp failed"},
97: {ERR_REASON(AEPHK_R_NOT_LOADED) ,"not loaded"},
98: {ERR_REASON(AEPHK_R_OK) ,"ok"},
99: {ERR_REASON(AEPHK_R_RETURN_CONNECTION_FAILED),"return connection failed"},
100: {ERR_REASON(AEPHK_R_SETBNCALLBACK_FAILURE),"setbncallback failure"},
101: {ERR_REASON(AEPHK_R_SIZE_TOO_LARGE_OR_TOO_SMALL),"size too large or too small"},
102: {ERR_REASON(AEPHK_R_UNIT_FAILURE) ,"unit failure"},
103: {0,NULL}
104: };
105:
106: #endif
107:
108: #ifdef AEPHK_LIB_NAME
109: static ERR_STRING_DATA AEPHK_lib_name[]=
110: {
111: {0 ,AEPHK_LIB_NAME},
112: {0,NULL}
113: };
114: #endif
115:
116:
117: static int AEPHK_lib_error_code=0;
118: static int AEPHK_error_init=1;
119:
120: static void ERR_load_AEPHK_strings(void)
121: {
122: if (AEPHK_lib_error_code == 0)
123: AEPHK_lib_error_code=ERR_get_next_error_library();
124:
125: if (AEPHK_error_init)
126: {
127: AEPHK_error_init=0;
128: #ifndef OPENSSL_NO_ERR
129: ERR_load_strings(AEPHK_lib_error_code,AEPHK_str_functs);
130: ERR_load_strings(AEPHK_lib_error_code,AEPHK_str_reasons);
131: #endif
132:
133: #ifdef AEPHK_LIB_NAME
134: AEPHK_lib_name->error = ERR_PACK(AEPHK_lib_error_code,0,0);
135: ERR_load_strings(0,AEPHK_lib_name);
136: #endif
137: }
138: }
139:
140: static void ERR_unload_AEPHK_strings(void)
141: {
142: if (AEPHK_error_init == 0)
143: {
144: #ifndef OPENSSL_NO_ERR
145: ERR_unload_strings(AEPHK_lib_error_code,AEPHK_str_functs);
146: ERR_unload_strings(AEPHK_lib_error_code,AEPHK_str_reasons);
147: #endif
148:
149: #ifdef AEPHK_LIB_NAME
150: ERR_unload_strings(0,AEPHK_lib_name);
151: #endif
152: AEPHK_error_init=1;
153: }
154: }
155:
156: static void ERR_AEPHK_error(int function, int reason, char *file, int line)
157: {
158: if (AEPHK_lib_error_code == 0)
159: AEPHK_lib_error_code=ERR_get_next_error_library();
160: ERR_PUT_error(AEPHK_lib_error_code,function,reason,file,line);
161: }