1193323Sed/* e_atalla_err.c */
2193323Sed/* ====================================================================
3193323Sed * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
4193323Sed *
5193323Sed * Redistribution and use in source and binary forms, with or without
6193323Sed * modification, are permitted provided that the following conditions
7193323Sed * are met:
8193323Sed *
9193323Sed * 1. Redistributions of source code must retain the above copyright
10193323Sed *    notice, this list of conditions and the following disclaimer.
11193323Sed *
12193323Sed * 2. Redistributions in binary form must reproduce the above copyright
13193323Sed *    notice, this list of conditions and the following disclaimer in
14193323Sed *    the documentation and/or other materials provided with the
15193323Sed *    distribution.
16193323Sed *
17193323Sed * 3. All advertising materials mentioning features or use of this
18193323Sed *    software must display the following acknowledgment:
19193323Sed *    "This product includes software developed by the OpenSSL Project
20193323Sed *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
21193323Sed *
22193323Sed * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23193323Sed *    endorse or promote products derived from this software without
24193323Sed *    prior written permission. For written permission, please contact
25193323Sed *    openssl-core@OpenSSL.org.
26193323Sed *
27193323Sed * 5. Products derived from this software may not be called "OpenSSL"
28193323Sed *    nor may "OpenSSL" appear in their names without prior written
29193323Sed *    permission of the OpenSSL Project.
30193323Sed *
31193323Sed * 6. Redistributions of any form whatsoever must retain the following
32193323Sed *    acknowledgment:
33193323Sed *    "This product includes software developed by the OpenSSL Project
34193323Sed *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
35193323Sed *
36193323Sed * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37193323Sed * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38193323Sed * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39193323Sed * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
40193323Sed * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41193323Sed * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42193323Sed * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43193323Sed * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44193323Sed * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45193323Sed * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46193323Sed * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47193323Sed * OF THE POSSIBILITY OF SUCH DAMAGE.
48193323Sed * ====================================================================
49193323Sed *
50193323Sed * This product includes cryptographic software written by Eric Young
51193323Sed * (eay@cryptsoft.com).  This product includes software written by Tim
52193323Sed * Hudson (tjh@cryptsoft.com).
53193323Sed *
54193323Sed */
55193323Sed
56193323Sed/*
57193323Sed * NOTE: this file was auto generated by the mkerr.pl script: any changes
58193323Sed * made to it will be overwritten when the script next updates this file,
59193323Sed * only reason strings will be preserved.
60193323Sed */
61193323Sed
62193323Sed#include <stdio.h>
63193323Sed#include <openssl/err.h>
64193323Sed#include "e_atalla_err.h"
65193323Sed
66193323Sed/* BEGIN ERROR CODES */
67193323Sed#ifndef OPENSSL_NO_ERR
68193323Sed
69193323Sed# define ERR_FUNC(func) ERR_PACK(0,func,0)
70193323Sed# define ERR_REASON(reason) ERR_PACK(0,0,reason)
71193323Sed
72193323Sedstatic ERR_STRING_DATA ATALLA_str_functs[] = {
73193323Sed    {ERR_FUNC(ATALLA_F_ATALLA_CTRL), "ATALLA_CTRL"},
74193323Sed    {ERR_FUNC(ATALLA_F_ATALLA_FINISH), "ATALLA_FINISH"},
75193323Sed    {ERR_FUNC(ATALLA_F_ATALLA_INIT), "ATALLA_INIT"},
76193323Sed    {ERR_FUNC(ATALLA_F_ATALLA_MOD_EXP), "ATALLA_MOD_EXP"},
77193323Sed    {ERR_FUNC(ATALLA_F_ATALLA_RSA_MOD_EXP), "ATALLA_RSA_MOD_EXP"},
78193323Sed    {0, NULL}
79193323Sed};
80193323Sed
81193323Sedstatic ERR_STRING_DATA ATALLA_str_reasons[] = {
82193323Sed    {ERR_REASON(ATALLA_R_ALREADY_LOADED), "already loaded"},
83193323Sed    {ERR_REASON(ATALLA_R_BN_CTX_FULL), "bn ctx full"},
84193323Sed    {ERR_REASON(ATALLA_R_BN_EXPAND_FAIL), "bn expand fail"},
85193323Sed    {ERR_REASON(ATALLA_R_CTRL_COMMAND_NOT_IMPLEMENTED),
86193323Sed     "ctrl command not implemented"},
87193323Sed    {ERR_REASON(ATALLA_R_MISSING_KEY_COMPONENTS), "missing key components"},
88193323Sed    {ERR_REASON(ATALLA_R_NOT_LOADED), "not loaded"},
89193323Sed    {ERR_REASON(ATALLA_R_REQUEST_FAILED), "request failed"},
90193323Sed    {ERR_REASON(ATALLA_R_UNIT_FAILURE), "unit failure"},
91193323Sed    {0, NULL}
92193323Sed};
93193323Sed
94193323Sed#endif
95193323Sed
96193323Sed#ifdef ATALLA_LIB_NAME
97193323Sedstatic ERR_STRING_DATA ATALLA_lib_name[] = {
98193323Sed    {0, ATALLA_LIB_NAME},
99193323Sed    {0, NULL}
100193323Sed};
101193323Sed#endif
102193323Sed
103193323Sedstatic int ATALLA_lib_error_code = 0;
104193323Sedstatic int ATALLA_error_init = 1;
105193323Sed
106193323Sedstatic void ERR_load_ATALLA_strings(void)
107193323Sed{
108193323Sed    if (ATALLA_lib_error_code == 0)
109193323Sed        ATALLA_lib_error_code = ERR_get_next_error_library();
110193323Sed
111193323Sed    if (ATALLA_error_init) {
112193323Sed        ATALLA_error_init = 0;
113193323Sed#ifndef OPENSSL_NO_ERR
114193323Sed        ERR_load_strings(ATALLA_lib_error_code, ATALLA_str_functs);
115193323Sed        ERR_load_strings(ATALLA_lib_error_code, ATALLA_str_reasons);
116193323Sed#endif
117193323Sed
118193323Sed#ifdef ATALLA_LIB_NAME
119193323Sed        ATALLA_lib_name->error = ERR_PACK(ATALLA_lib_error_code, 0, 0);
120193323Sed        ERR_load_strings(0, ATALLA_lib_name);
121193323Sed#endif
122193323Sed    }
123193323Sed}
124193323Sed
125193323Sedstatic void ERR_unload_ATALLA_strings(void)
126193323Sed{
127193323Sed    if (ATALLA_error_init == 0) {
128193323Sed#ifndef OPENSSL_NO_ERR
129193323Sed        ERR_unload_strings(ATALLA_lib_error_code, ATALLA_str_functs);
130193323Sed        ERR_unload_strings(ATALLA_lib_error_code, ATALLA_str_reasons);
131193323Sed#endif
132193323Sed
133193323Sed#ifdef ATALLA_LIB_NAME
134193323Sed        ERR_unload_strings(0, ATALLA_lib_name);
135193323Sed#endif
136193323Sed        ATALLA_error_init = 1;
137193323Sed    }
138193323Sed}
139193323Sed
140193323Sedstatic void ERR_ATALLA_error(int function, int reason, char *file, int line)
141193323Sed{
142193323Sed    if (ATALLA_lib_error_code == 0)
143193323Sed        ATALLA_lib_error_code = ERR_get_next_error_library();
144193323Sed    ERR_PUT_error(ATALLA_lib_error_code, function, reason, file, line);
145193323Sed}
146193323Sed