summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/engine/eng_err.c
diff options
context:
space:
mode:
authorjsing <>2014-06-10 15:20:40 +0000
committerjsing <>2014-06-10 15:20:40 +0000
commit1f0ada29dbbd22c18c51187561c2eb01d2a776b2 (patch)
tree26b9352fb9a5ac6c506e8003ffd77006cf098bbb /src/lib/libcrypto/engine/eng_err.c
parent3d34b57814cfdc90c98c015ae0dbd3c1862c83cd (diff)
downloadopenbsd-1f0ada29dbbd22c18c51187561c2eb01d2a776b2.tar.gz
openbsd-1f0ada29dbbd22c18c51187561c2eb01d2a776b2.tar.bz2
openbsd-1f0ada29dbbd22c18c51187561c2eb01d2a776b2.zip
KNF.
Diffstat (limited to 'src/lib/libcrypto/engine/eng_err.c')
-rw-r--r--src/lib/libcrypto/engine/eng_err.c193
1 files changed, 95 insertions, 98 deletions
diff --git a/src/lib/libcrypto/engine/eng_err.c b/src/lib/libcrypto/engine/eng_err.c
index 81c70acfa8..baf2b3d92d 100644
--- a/src/lib/libcrypto/engine/eng_err.c
+++ b/src/lib/libcrypto/engine/eng_err.c
@@ -7,7 +7,7 @@
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 11 *
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in 13 * notice, this list of conditions and the following disclaimer in
@@ -68,106 +68,103 @@
68#define ERR_FUNC(func) ERR_PACK(ERR_LIB_ENGINE,func,0) 68#define ERR_FUNC(func) ERR_PACK(ERR_LIB_ENGINE,func,0)
69#define ERR_REASON(reason) ERR_PACK(ERR_LIB_ENGINE,0,reason) 69#define ERR_REASON(reason) ERR_PACK(ERR_LIB_ENGINE,0,reason)
70 70
71static ERR_STRING_DATA ENGINE_str_functs[]= 71static ERR_STRING_DATA ENGINE_str_functs[]= {
72 { 72 {ERR_FUNC(ENGINE_F_DYNAMIC_CTRL), "DYNAMIC_CTRL"},
73{ERR_FUNC(ENGINE_F_DYNAMIC_CTRL), "DYNAMIC_CTRL"}, 73 {ERR_FUNC(ENGINE_F_DYNAMIC_GET_DATA_CTX), "DYNAMIC_GET_DATA_CTX"},
74{ERR_FUNC(ENGINE_F_DYNAMIC_GET_DATA_CTX), "DYNAMIC_GET_DATA_CTX"}, 74 {ERR_FUNC(ENGINE_F_DYNAMIC_LOAD), "DYNAMIC_LOAD"},
75{ERR_FUNC(ENGINE_F_DYNAMIC_LOAD), "DYNAMIC_LOAD"}, 75 {ERR_FUNC(ENGINE_F_DYNAMIC_SET_DATA_CTX), "DYNAMIC_SET_DATA_CTX"},
76{ERR_FUNC(ENGINE_F_DYNAMIC_SET_DATA_CTX), "DYNAMIC_SET_DATA_CTX"}, 76 {ERR_FUNC(ENGINE_F_ENGINE_ADD), "ENGINE_add"},
77{ERR_FUNC(ENGINE_F_ENGINE_ADD), "ENGINE_add"}, 77 {ERR_FUNC(ENGINE_F_ENGINE_BY_ID), "ENGINE_by_id"},
78{ERR_FUNC(ENGINE_F_ENGINE_BY_ID), "ENGINE_by_id"}, 78 {ERR_FUNC(ENGINE_F_ENGINE_CMD_IS_EXECUTABLE), "ENGINE_cmd_is_executable"},
79{ERR_FUNC(ENGINE_F_ENGINE_CMD_IS_EXECUTABLE), "ENGINE_cmd_is_executable"}, 79 {ERR_FUNC(ENGINE_F_ENGINE_CTRL), "ENGINE_ctrl"},
80{ERR_FUNC(ENGINE_F_ENGINE_CTRL), "ENGINE_ctrl"}, 80 {ERR_FUNC(ENGINE_F_ENGINE_CTRL_CMD), "ENGINE_ctrl_cmd"},
81{ERR_FUNC(ENGINE_F_ENGINE_CTRL_CMD), "ENGINE_ctrl_cmd"}, 81 {ERR_FUNC(ENGINE_F_ENGINE_CTRL_CMD_STRING), "ENGINE_ctrl_cmd_string"},
82{ERR_FUNC(ENGINE_F_ENGINE_CTRL_CMD_STRING), "ENGINE_ctrl_cmd_string"}, 82 {ERR_FUNC(ENGINE_F_ENGINE_FINISH), "ENGINE_finish"},
83{ERR_FUNC(ENGINE_F_ENGINE_FINISH), "ENGINE_finish"}, 83 {ERR_FUNC(ENGINE_F_ENGINE_FREE_UTIL), "ENGINE_FREE_UTIL"},
84{ERR_FUNC(ENGINE_F_ENGINE_FREE_UTIL), "ENGINE_FREE_UTIL"}, 84 {ERR_FUNC(ENGINE_F_ENGINE_GET_CIPHER), "ENGINE_get_cipher"},
85{ERR_FUNC(ENGINE_F_ENGINE_GET_CIPHER), "ENGINE_get_cipher"}, 85 {ERR_FUNC(ENGINE_F_ENGINE_GET_DEFAULT_TYPE), "ENGINE_GET_DEFAULT_TYPE"},
86{ERR_FUNC(ENGINE_F_ENGINE_GET_DEFAULT_TYPE), "ENGINE_GET_DEFAULT_TYPE"}, 86 {ERR_FUNC(ENGINE_F_ENGINE_GET_DIGEST), "ENGINE_get_digest"},
87{ERR_FUNC(ENGINE_F_ENGINE_GET_DIGEST), "ENGINE_get_digest"}, 87 {ERR_FUNC(ENGINE_F_ENGINE_GET_NEXT), "ENGINE_get_next"},
88{ERR_FUNC(ENGINE_F_ENGINE_GET_NEXT), "ENGINE_get_next"}, 88 {ERR_FUNC(ENGINE_F_ENGINE_GET_PKEY_ASN1_METH), "ENGINE_get_pkey_asn1_meth"},
89{ERR_FUNC(ENGINE_F_ENGINE_GET_PKEY_ASN1_METH), "ENGINE_get_pkey_asn1_meth"}, 89 {ERR_FUNC(ENGINE_F_ENGINE_GET_PKEY_METH), "ENGINE_get_pkey_meth"},
90{ERR_FUNC(ENGINE_F_ENGINE_GET_PKEY_METH), "ENGINE_get_pkey_meth"}, 90 {ERR_FUNC(ENGINE_F_ENGINE_GET_PREV), "ENGINE_get_prev"},
91{ERR_FUNC(ENGINE_F_ENGINE_GET_PREV), "ENGINE_get_prev"}, 91 {ERR_FUNC(ENGINE_F_ENGINE_INIT), "ENGINE_init"},
92{ERR_FUNC(ENGINE_F_ENGINE_INIT), "ENGINE_init"}, 92 {ERR_FUNC(ENGINE_F_ENGINE_LIST_ADD), "ENGINE_LIST_ADD"},
93{ERR_FUNC(ENGINE_F_ENGINE_LIST_ADD), "ENGINE_LIST_ADD"}, 93 {ERR_FUNC(ENGINE_F_ENGINE_LIST_REMOVE), "ENGINE_LIST_REMOVE"},
94{ERR_FUNC(ENGINE_F_ENGINE_LIST_REMOVE), "ENGINE_LIST_REMOVE"}, 94 {ERR_FUNC(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY), "ENGINE_load_private_key"},
95{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY), "ENGINE_load_private_key"}, 95 {ERR_FUNC(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY), "ENGINE_load_public_key"},
96{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY), "ENGINE_load_public_key"}, 96 {ERR_FUNC(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT), "ENGINE_load_ssl_client_cert"},
97{ERR_FUNC(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT), "ENGINE_load_ssl_client_cert"}, 97 {ERR_FUNC(ENGINE_F_ENGINE_NEW), "ENGINE_new"},
98{ERR_FUNC(ENGINE_F_ENGINE_NEW), "ENGINE_new"}, 98 {ERR_FUNC(ENGINE_F_ENGINE_REMOVE), "ENGINE_remove"},
99{ERR_FUNC(ENGINE_F_ENGINE_REMOVE), "ENGINE_remove"}, 99 {ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_STRING), "ENGINE_set_default_string"},
100{ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_STRING), "ENGINE_set_default_string"}, 100 {ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_TYPE), "ENGINE_SET_DEFAULT_TYPE"},
101{ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_TYPE), "ENGINE_SET_DEFAULT_TYPE"}, 101 {ERR_FUNC(ENGINE_F_ENGINE_SET_ID), "ENGINE_set_id"},
102{ERR_FUNC(ENGINE_F_ENGINE_SET_ID), "ENGINE_set_id"}, 102 {ERR_FUNC(ENGINE_F_ENGINE_SET_NAME), "ENGINE_set_name"},
103{ERR_FUNC(ENGINE_F_ENGINE_SET_NAME), "ENGINE_set_name"}, 103 {ERR_FUNC(ENGINE_F_ENGINE_TABLE_REGISTER), "ENGINE_TABLE_REGISTER"},
104{ERR_FUNC(ENGINE_F_ENGINE_TABLE_REGISTER), "ENGINE_TABLE_REGISTER"}, 104 {ERR_FUNC(ENGINE_F_ENGINE_UNLOAD_KEY), "ENGINE_UNLOAD_KEY"},
105{ERR_FUNC(ENGINE_F_ENGINE_UNLOAD_KEY), "ENGINE_UNLOAD_KEY"}, 105 {ERR_FUNC(ENGINE_F_ENGINE_UNLOCKED_FINISH), "ENGINE_UNLOCKED_FINISH"},
106{ERR_FUNC(ENGINE_F_ENGINE_UNLOCKED_FINISH), "ENGINE_UNLOCKED_FINISH"}, 106 {ERR_FUNC(ENGINE_F_ENGINE_UP_REF), "ENGINE_up_ref"},
107{ERR_FUNC(ENGINE_F_ENGINE_UP_REF), "ENGINE_up_ref"}, 107 {ERR_FUNC(ENGINE_F_INT_CTRL_HELPER), "INT_CTRL_HELPER"},
108{ERR_FUNC(ENGINE_F_INT_CTRL_HELPER), "INT_CTRL_HELPER"}, 108 {ERR_FUNC(ENGINE_F_INT_ENGINE_CONFIGURE), "INT_ENGINE_CONFIGURE"},
109{ERR_FUNC(ENGINE_F_INT_ENGINE_CONFIGURE), "INT_ENGINE_CONFIGURE"}, 109 {ERR_FUNC(ENGINE_F_INT_ENGINE_MODULE_INIT), "INT_ENGINE_MODULE_INIT"},
110{ERR_FUNC(ENGINE_F_INT_ENGINE_MODULE_INIT), "INT_ENGINE_MODULE_INIT"}, 110 {ERR_FUNC(ENGINE_F_LOG_MESSAGE), "LOG_MESSAGE"},
111{ERR_FUNC(ENGINE_F_LOG_MESSAGE), "LOG_MESSAGE"}, 111 {0, NULL}
112{0,NULL} 112};
113 };
114 113
115static ERR_STRING_DATA ENGINE_str_reasons[]= 114static ERR_STRING_DATA ENGINE_str_reasons[]= {
116 { 115 {ERR_REASON(ENGINE_R_ALREADY_LOADED) , "already loaded"},
117{ERR_REASON(ENGINE_R_ALREADY_LOADED) ,"already loaded"}, 116 {ERR_REASON(ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER), "argument is not a number"},
118{ERR_REASON(ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER),"argument is not a number"}, 117 {ERR_REASON(ENGINE_R_CMD_NOT_EXECUTABLE) , "cmd not executable"},
119{ERR_REASON(ENGINE_R_CMD_NOT_EXECUTABLE) ,"cmd not executable"}, 118 {ERR_REASON(ENGINE_R_COMMAND_TAKES_INPUT), "command takes input"},
120{ERR_REASON(ENGINE_R_COMMAND_TAKES_INPUT),"command takes input"}, 119 {ERR_REASON(ENGINE_R_COMMAND_TAKES_NO_INPUT), "command takes no input"},
121{ERR_REASON(ENGINE_R_COMMAND_TAKES_NO_INPUT),"command takes no input"}, 120 {ERR_REASON(ENGINE_R_CONFLICTING_ENGINE_ID), "conflicting engine id"},
122{ERR_REASON(ENGINE_R_CONFLICTING_ENGINE_ID),"conflicting engine id"}, 121 {ERR_REASON(ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED), "ctrl command not implemented"},
123{ERR_REASON(ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"}, 122 {ERR_REASON(ENGINE_R_DH_NOT_IMPLEMENTED) , "dh not implemented"},
124{ERR_REASON(ENGINE_R_DH_NOT_IMPLEMENTED) ,"dh not implemented"}, 123 {ERR_REASON(ENGINE_R_DSA_NOT_IMPLEMENTED), "dsa not implemented"},
125{ERR_REASON(ENGINE_R_DSA_NOT_IMPLEMENTED),"dsa not implemented"}, 124 {ERR_REASON(ENGINE_R_DSO_FAILURE) , "DSO failure"},
126{ERR_REASON(ENGINE_R_DSO_FAILURE) ,"DSO failure"}, 125 {ERR_REASON(ENGINE_R_DSO_NOT_FOUND) , "dso not found"},
127{ERR_REASON(ENGINE_R_DSO_NOT_FOUND) ,"dso not found"}, 126 {ERR_REASON(ENGINE_R_ENGINES_SECTION_ERROR), "engines section error"},
128{ERR_REASON(ENGINE_R_ENGINES_SECTION_ERROR),"engines section error"}, 127 {ERR_REASON(ENGINE_R_ENGINE_CONFIGURATION_ERROR), "engine configuration error"},
129{ERR_REASON(ENGINE_R_ENGINE_CONFIGURATION_ERROR),"engine configuration error"}, 128 {ERR_REASON(ENGINE_R_ENGINE_IS_NOT_IN_LIST), "engine is not in the list"},
130{ERR_REASON(ENGINE_R_ENGINE_IS_NOT_IN_LIST),"engine is not in the list"}, 129 {ERR_REASON(ENGINE_R_ENGINE_SECTION_ERROR), "engine section error"},
131{ERR_REASON(ENGINE_R_ENGINE_SECTION_ERROR),"engine section error"}, 130 {ERR_REASON(ENGINE_R_FAILED_LOADING_PRIVATE_KEY), "failed loading private key"},
132{ERR_REASON(ENGINE_R_FAILED_LOADING_PRIVATE_KEY),"failed loading private key"}, 131 {ERR_REASON(ENGINE_R_FAILED_LOADING_PUBLIC_KEY), "failed loading public key"},
133{ERR_REASON(ENGINE_R_FAILED_LOADING_PUBLIC_KEY),"failed loading public key"}, 132 {ERR_REASON(ENGINE_R_FINISH_FAILED) , "finish failed"},
134{ERR_REASON(ENGINE_R_FINISH_FAILED) ,"finish failed"}, 133 {ERR_REASON(ENGINE_R_GET_HANDLE_FAILED) , "could not obtain hardware handle"},
135{ERR_REASON(ENGINE_R_GET_HANDLE_FAILED) ,"could not obtain hardware handle"}, 134 {ERR_REASON(ENGINE_R_ID_OR_NAME_MISSING) , "'id' or 'name' missing"},
136{ERR_REASON(ENGINE_R_ID_OR_NAME_MISSING) ,"'id' or 'name' missing"}, 135 {ERR_REASON(ENGINE_R_INIT_FAILED) , "init failed"},
137{ERR_REASON(ENGINE_R_INIT_FAILED) ,"init failed"}, 136 {ERR_REASON(ENGINE_R_INTERNAL_LIST_ERROR), "internal list error"},
138{ERR_REASON(ENGINE_R_INTERNAL_LIST_ERROR),"internal list error"}, 137 {ERR_REASON(ENGINE_R_INVALID_ARGUMENT) , "invalid argument"},
139{ERR_REASON(ENGINE_R_INVALID_ARGUMENT) ,"invalid argument"}, 138 {ERR_REASON(ENGINE_R_INVALID_CMD_NAME) , "invalid cmd name"},
140{ERR_REASON(ENGINE_R_INVALID_CMD_NAME) ,"invalid cmd name"}, 139 {ERR_REASON(ENGINE_R_INVALID_CMD_NUMBER) , "invalid cmd number"},
141{ERR_REASON(ENGINE_R_INVALID_CMD_NUMBER) ,"invalid cmd number"}, 140 {ERR_REASON(ENGINE_R_INVALID_INIT_VALUE) , "invalid init value"},
142{ERR_REASON(ENGINE_R_INVALID_INIT_VALUE) ,"invalid init value"}, 141 {ERR_REASON(ENGINE_R_INVALID_STRING) , "invalid string"},
143{ERR_REASON(ENGINE_R_INVALID_STRING) ,"invalid string"}, 142 {ERR_REASON(ENGINE_R_NOT_INITIALISED) , "not initialised"},
144{ERR_REASON(ENGINE_R_NOT_INITIALISED) ,"not initialised"}, 143 {ERR_REASON(ENGINE_R_NOT_LOADED) , "not loaded"},
145{ERR_REASON(ENGINE_R_NOT_LOADED) ,"not loaded"}, 144 {ERR_REASON(ENGINE_R_NO_CONTROL_FUNCTION), "no control function"},
146{ERR_REASON(ENGINE_R_NO_CONTROL_FUNCTION),"no control function"}, 145 {ERR_REASON(ENGINE_R_NO_INDEX) , "no index"},
147{ERR_REASON(ENGINE_R_NO_INDEX) ,"no index"}, 146 {ERR_REASON(ENGINE_R_NO_LOAD_FUNCTION) , "no load function"},
148{ERR_REASON(ENGINE_R_NO_LOAD_FUNCTION) ,"no load function"}, 147 {ERR_REASON(ENGINE_R_NO_REFERENCE) , "no reference"},
149{ERR_REASON(ENGINE_R_NO_REFERENCE) ,"no reference"}, 148 {ERR_REASON(ENGINE_R_NO_SUCH_ENGINE) , "no such engine"},
150{ERR_REASON(ENGINE_R_NO_SUCH_ENGINE) ,"no such engine"}, 149 {ERR_REASON(ENGINE_R_NO_UNLOAD_FUNCTION) , "no unload function"},
151{ERR_REASON(ENGINE_R_NO_UNLOAD_FUNCTION) ,"no unload function"}, 150 {ERR_REASON(ENGINE_R_PROVIDE_PARAMETERS) , "provide parameters"},
152{ERR_REASON(ENGINE_R_PROVIDE_PARAMETERS) ,"provide parameters"}, 151 {ERR_REASON(ENGINE_R_RSA_NOT_IMPLEMENTED), "rsa not implemented"},
153{ERR_REASON(ENGINE_R_RSA_NOT_IMPLEMENTED),"rsa not implemented"}, 152 {ERR_REASON(ENGINE_R_UNIMPLEMENTED_CIPHER), "unimplemented cipher"},
154{ERR_REASON(ENGINE_R_UNIMPLEMENTED_CIPHER),"unimplemented cipher"}, 153 {ERR_REASON(ENGINE_R_UNIMPLEMENTED_DIGEST), "unimplemented digest"},
155{ERR_REASON(ENGINE_R_UNIMPLEMENTED_DIGEST),"unimplemented digest"}, 154 {ERR_REASON(ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD), "unimplemented public key method"},
156{ERR_REASON(ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD),"unimplemented public key method"}, 155 {ERR_REASON(ENGINE_R_VERSION_INCOMPATIBILITY), "version incompatibility"},
157{ERR_REASON(ENGINE_R_VERSION_INCOMPATIBILITY),"version incompatibility"}, 156 {0, NULL}
158{0,NULL} 157};
159 };
160 158
161#endif 159#endif
162 160
163void ERR_load_ENGINE_strings(void) 161void
164 { 162ERR_load_ENGINE_strings(void)
163{
165#ifndef OPENSSL_NO_ERR 164#ifndef OPENSSL_NO_ERR
166 165 if (ERR_func_error_string(ENGINE_str_functs[0].error) == NULL) {
167 if (ERR_func_error_string(ENGINE_str_functs[0].error) == NULL) 166 ERR_load_strings(0, ENGINE_str_functs);
168 { 167 ERR_load_strings(0, ENGINE_str_reasons);
169 ERR_load_strings(0,ENGINE_str_functs);
170 ERR_load_strings(0,ENGINE_str_reasons);
171 }
172#endif
173 } 168 }
169#endif
170}