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_4758cca_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 CCA4758_str_functs[]=
72: {
73: {ERR_FUNC(CCA4758_F_CCA_RSA_SIGN), "CCA_RSA_SIGN"},
74: {ERR_FUNC(CCA4758_F_CCA_RSA_VERIFY), "CCA_RSA_VERIFY"},
75: {ERR_FUNC(CCA4758_F_IBM_4758_CCA_CTRL), "IBM_4758_CCA_CTRL"},
76: {ERR_FUNC(CCA4758_F_IBM_4758_CCA_FINISH), "IBM_4758_CCA_FINISH"},
77: {ERR_FUNC(CCA4758_F_IBM_4758_CCA_INIT), "IBM_4758_CCA_INIT"},
78: {ERR_FUNC(CCA4758_F_IBM_4758_LOAD_PRIVKEY), "IBM_4758_LOAD_PRIVKEY"},
79: {ERR_FUNC(CCA4758_F_IBM_4758_LOAD_PUBKEY), "IBM_4758_LOAD_PUBKEY"},
80: {0,NULL}
81: };
82:
83: static ERR_STRING_DATA CCA4758_str_reasons[]=
84: {
85: {ERR_REASON(CCA4758_R_ALREADY_LOADED) ,"already loaded"},
86: {ERR_REASON(CCA4758_R_ASN1_OID_UNKNOWN_FOR_MD),"asn1 oid unknown for md"},
87: {ERR_REASON(CCA4758_R_COMMAND_NOT_IMPLEMENTED),"command not implemented"},
88: {ERR_REASON(CCA4758_R_DSO_FAILURE) ,"dso failure"},
89: {ERR_REASON(CCA4758_R_FAILED_LOADING_PRIVATE_KEY),"failed loading private key"},
90: {ERR_REASON(CCA4758_R_FAILED_LOADING_PUBLIC_KEY),"failed loading public key"},
91: {ERR_REASON(CCA4758_R_NOT_LOADED) ,"not loaded"},
92: {ERR_REASON(CCA4758_R_SIZE_TOO_LARGE_OR_TOO_SMALL),"size too large or too small"},
93: {ERR_REASON(CCA4758_R_UNIT_FAILURE) ,"unit failure"},
94: {ERR_REASON(CCA4758_R_UNKNOWN_ALGORITHM_TYPE),"unknown algorithm type"},
95: {0,NULL}
96: };
97:
98: #endif
99:
100: #ifdef CCA4758_LIB_NAME
101: static ERR_STRING_DATA CCA4758_lib_name[]=
102: {
103: {0 ,CCA4758_LIB_NAME},
104: {0,NULL}
105: };
106: #endif
107:
108:
109: static int CCA4758_lib_error_code=0;
110: static int CCA4758_error_init=1;
111:
112: static void ERR_load_CCA4758_strings(void)
113: {
114: if (CCA4758_lib_error_code == 0)
115: CCA4758_lib_error_code=ERR_get_next_error_library();
116:
117: if (CCA4758_error_init)
118: {
119: CCA4758_error_init=0;
120: #ifndef OPENSSL_NO_ERR
121: ERR_load_strings(CCA4758_lib_error_code,CCA4758_str_functs);
122: ERR_load_strings(CCA4758_lib_error_code,CCA4758_str_reasons);
123: #endif
124:
125: #ifdef CCA4758_LIB_NAME
126: CCA4758_lib_name->error = ERR_PACK(CCA4758_lib_error_code,0,0);
127: ERR_load_strings(0,CCA4758_lib_name);
128: #endif
129: }
130: }
131:
132: static void ERR_unload_CCA4758_strings(void)
133: {
134: if (CCA4758_error_init == 0)
135: {
136: #ifndef OPENSSL_NO_ERR
137: ERR_unload_strings(CCA4758_lib_error_code,CCA4758_str_functs);
138: ERR_unload_strings(CCA4758_lib_error_code,CCA4758_str_reasons);
139: #endif
140:
141: #ifdef CCA4758_LIB_NAME
142: ERR_unload_strings(0,CCA4758_lib_name);
143: #endif
144: CCA4758_error_init=1;
145: }
146: }
147:
148: static void ERR_CCA4758_error(int function, int reason, char *file, int line)
149: {
150: if (CCA4758_lib_error_code == 0)
151: CCA4758_lib_error_code=ERR_get_next_error_library();
152: ERR_PUT_error(CCA4758_lib_error_code,function,reason,file,line);
153: }