1 /* error.c error handling functionality
2 * Copyright (C) 2002 Simon Josefsson
4 * This file is part of libgsasl.
6 * Libgsasl is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * Libgsasl is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with libgsasl; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * @err: libgsasl error code
28 * Return value: Returns a pointer to a statically allocated string
29 * containing a description of the error with the error value
30 * @var{err}. This string can be used to output a diagnostic message
34 gsasl_strerror (int err
)
41 p
= _("Libgsasl success");
44 case GSASL_NEEDS_MORE
:
45 p
= _("SASL mechanisms needs more data (application error)");
48 case GSASL_UNKNOWN_MECHANISM
:
49 p
= _("Unknown SASL mechanism (application error)");
52 case GSASL_MECHANISM_CALLED_TOO_MANY_TIMES
:
53 p
= _("SASL mechanism called too many times (application error)");
56 case GSASL_TOO_SMALL_BUFFER
:
57 p
= _("SASL function need larger buffer (application error)");
60 case GSASL_FOPEN_ERROR
:
61 p
= _("Could not open file in SASL library");
64 case GSASL_FCLOSE_ERROR
:
65 p
= _("Could not close file in SASL library");
68 case GSASL_MALLOC_ERROR
:
69 p
= _("Memory allocation error in SASL library");
72 case GSASL_BASE64_ERROR
:
73 p
= _("Base 64 coding error in SASL library");
76 case GSASL_GCRYPT_ERROR
:
77 p
= _("Gcrypt error in SASL library");
80 case GSASL_GSSAPI_RELEASE_BUFFER_ERROR
:
81 p
= _("GSSAPI library could not deallocate memory in gss_release_buffer() in SASL library. This is a serious internal error.");
84 case GSASL_GSSAPI_IMPORT_NAME_ERROR
:
85 p
= _("GSSAPI library could not understand a peer name in gss_import_name() in SASL library. This may be due to incorrect user supplied data.");
88 case GSASL_GSSAPI_INIT_SEC_CONTEXT_ERROR
:
89 p
= _("GSSAPI error in client while negotiating security context in gss_init_sec_context() in SASL library. This is most likely due insufficient credentials or malicious interactions.");
92 case GSASL_GSSAPI_ACCEPT_SEC_CONTEXT_ERROR
:
93 p
= _("GSSAPI error in server while negotiating security context in gss_init_sec_context() in SASL library. This is most likely due insufficient credentials or malicious interactions.");
96 case GSASL_GSSAPI_UNWRAP_ERROR
:
97 p
= _("GSSAPI error while decrypting or decoding data in gss_unwrap() in SASL library. This is most likely due to data corruption.");
100 case GSASL_GSSAPI_WRAP_ERROR
:
101 p
= _("GSSAPI error while encrypting or encoding data in gss_wrap() in SASL library.");
104 case GSASL_GSSAPI_ACQUIRE_CRED_ERROR
:
105 p
= _("GSSAPI error acquiring credentials in gss_acquire_cred() in SASL library. This is most likely due to not having the proper Kerberos key available in /etc/krb5.keytab on the server.");
108 case GSASL_GSSAPI_DISPLAY_NAME_ERROR
:
109 p
= _("GSSAPI error creating a display name denoting the client in gss_display_name() in SASL library. This is probably because the client suplied bad data.");
112 case GSASL_GSSAPI_UNSUPPORTED_PROTECTION_ERROR
:
113 p
= _("Other entity requested integrity or confidentiality protection in GSSAPI mechanism but this is currently not implemented.");
116 case GSASL_NEED_CLIENT_ANONYMOUS_CALLBACK
:
117 p
= _("SASL mechanism needs gsasl_client_callback_anonymous() callback (application error)");
120 case GSASL_NEED_CLIENT_PASSWORD_CALLBACK
:
121 p
= _("SASL mechanism needs gsasl_client_callback_password() callback (application error)");
124 case GSASL_NEED_CLIENT_PASSCODE_CALLBACK
:
125 p
= _("SASL mechanism needs gsasl_client_callback_passcode() callback (application error)");
128 case GSASL_NEED_CLIENT_PIN_CALLBACK
:
129 p
= _("SASL mechanism needs gsasl_client_callback_pin() callback (application error)");
132 case GSASL_NEED_CLIENT_AUTHORIZATION_ID_CALLBACK
:
133 p
= _("SASL mechanism needs gsasl_client_callback_authorization_id() callback (application error)");
136 case GSASL_NEED_CLIENT_AUTHENTICATION_ID_CALLBACK
:
137 p
= _("SASL mechanism needs gsasl_client_callback_authentication_id() callback (application error)");
140 case GSASL_NEED_CLIENT_SERVICE_CALLBACK
:
141 p
= _("SASL mechanism needs gsasl_client_callback_service() callback (application error)");
144 case GSASL_NEED_SERVER_VALIDATE_CALLBACK
:
145 p
= _("SASL mechanism needs gsasl_server_callback_validate() callback (application error)");
148 case GSASL_NEED_SERVER_CRAM_MD5_CALLBACK
:
149 p
= _("SASL mechanism needs gsasl_server_callback_cram_md5() callback (application error)");
152 case GSASL_NEED_SERVER_DIGEST_MD5_CALLBACK
:
153 p
= _("SASL mechanism needs gsasl_server_callback_digest_md5() callback (application error)");
156 case GSASL_NEED_SERVER_ANONYMOUS_CALLBACK
:
157 p
= _("SASL mechanism needs gsasl_server_callback_anonymous() callback (application error)");
160 case GSASL_NEED_SERVER_EXTERNAL_CALLBACK
:
161 p
= _("SASL mechanism needs gsasl_server_callback_external() callback (application error)");
164 case GSASL_NEED_SERVER_REALM_CALLBACK
:
165 p
= _("SASL mechanism needs gsasl_server_callback_realm() callback (application error)");
168 case GSASL_NEED_SERVER_SECURID_CALLBACK
:
169 p
= _("SASL mechanism needs gsasl_server_callback_securid() callback (application error)");
172 case GSASL_NEED_SERVER_SERVICE_CALLBACK
:
173 p
= _("SASL mechanism needs gsasl_server_callback_service() callback (application error)");
176 case GSASL_NEED_SERVER_GSSAPI_CALLBACK
:
177 p
= _("SASL mechanism needs gsasl_server_callback_gssapi() callback (application error)");
180 case GSASL_MECHANISM_PARSE_ERROR
:
181 p
= _("SASL mechanism could not parse input");
184 case GSASL_AUTHENTICATION_ERROR
:
185 p
= _("Error authentication user");
188 case GSASL_CANNOT_GET_CTX
:
189 p
= _("Cannot get internal library handle (library error)");
192 case GSASL_NO_MORE_REALMS
:
193 p
= _("No more realms available (non-fatal)");
197 p
= _("Libgsasl unknown error");