1109998Smarkm/* hw_cluster_labs_err.c */
2109998Smarkm/* ====================================================================
3109998Smarkm * Copyright (c) 1999-2002 The OpenSSL Project.  All rights reserved.
4109998Smarkm *
5109998Smarkm * Redistribution and use in source and binary forms, with or without
6109998Smarkm * modification, are permitted provided that the following conditions
7109998Smarkm * are met:
8109998Smarkm *
9109998Smarkm * 1. Redistributions of source code must retain the above copyright
10296465Sdelphij *    notice, this list of conditions and the following disclaimer.
11109998Smarkm *
12109998Smarkm * 2. Redistributions in binary form must reproduce the above copyright
13109998Smarkm *    notice, this list of conditions and the following disclaimer in
14109998Smarkm *    the documentation and/or other materials provided with the
15109998Smarkm *    distribution.
16109998Smarkm *
17109998Smarkm * 3. All advertising materials mentioning features or use of this
18109998Smarkm *    software must display the following acknowledgment:
19109998Smarkm *    "This product includes software developed by the OpenSSL Project
20109998Smarkm *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
21109998Smarkm *
22109998Smarkm * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23109998Smarkm *    endorse or promote products derived from this software without
24109998Smarkm *    prior written permission. For written permission, please contact
25109998Smarkm *    openssl-core@OpenSSL.org.
26109998Smarkm *
27109998Smarkm * 5. Products derived from this software may not be called "OpenSSL"
28109998Smarkm *    nor may "OpenSSL" appear in their names without prior written
29109998Smarkm *    permission of the OpenSSL Project.
30109998Smarkm *
31109998Smarkm * 6. Redistributions of any form whatsoever must retain the following
32109998Smarkm *    acknowledgment:
33109998Smarkm *    "This product includes software developed by the OpenSSL Project
34109998Smarkm *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
35109998Smarkm *
36109998Smarkm * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37109998Smarkm * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38109998Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39109998Smarkm * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
40109998Smarkm * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41109998Smarkm * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42109998Smarkm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43109998Smarkm * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44109998Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45109998Smarkm * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46109998Smarkm * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47109998Smarkm * OF THE POSSIBILITY OF SUCH DAMAGE.
48109998Smarkm * ====================================================================
49109998Smarkm *
50109998Smarkm * This product includes cryptographic software written by Eric Young
51109998Smarkm * (eay@cryptsoft.com).  This product includes software written by Tim
52109998Smarkm * Hudson (tjh@cryptsoft.com).
53109998Smarkm *
54109998Smarkm */
55109998Smarkm
56296465Sdelphij/*
57296465Sdelphij * NOTE: this file was auto generated by the mkerr.pl script: any changes
58109998Smarkm * made to it will be overwritten when the script next updates this file,
59109998Smarkm * only reason strings will be preserved.
60109998Smarkm */
61109998Smarkm
62109998Smarkm#include <stdio.h>
63109998Smarkm#include <openssl/err.h>
64109998Smarkm#include "hw_cluster_labs_err.h"
65109998Smarkm
66109998Smarkm/* BEGIN ERROR CODES */
67109998Smarkm#ifndef OPENSSL_NO_ERR
68296465Sdelphijstatic ERR_STRING_DATA CL_str_functs[] = {
69296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_CTRL, 0), "CLUSTER_LABS_CTRL"},
70296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_DSA_SIGN, 0), "CLUSTER_LABS_DSA_SIGN"},
71296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_DSA_VERIFY, 0), "CLUSTER_LABS_DSA_VERIFY"},
72296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_FINISH, 0), "CLUSTER_LABS_FINISH"},
73296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_INIT, 0), "CLUSTER_LABS_INIT"},
74296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_MOD_EXP, 0), "CLUSTER_LABS_MOD_EXP"},
75296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_MOD_EXP_CRT, 0),
76296465Sdelphij     "CLUSTER_LABS_MOD_EXP_CRT"},
77296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_RAND_BYTES, 0), "CLUSTER_LABS_RAND_BYTES"},
78296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_RSA_MOD_EXP, 0),
79296465Sdelphij     "CLUSTER_LABS_RSA_MOD_EXP"},
80296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_RSA_PRIV_DEC, 0),
81296465Sdelphij     "CLUSTER_LABS_RSA_PRIV_DEC"},
82296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_RSA_PRIV_ENC, 0),
83296465Sdelphij     "CLUSTER_LABS_RSA_PRIV_ENC"},
84296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_RSA_PUB_DEC, 0),
85296465Sdelphij     "CLUSTER_LABS_RSA_PUB_DEC"},
86296465Sdelphij    {ERR_PACK(0, CL_F_CLUSTER_LABS_RSA_PUB_ENC, 0),
87296465Sdelphij     "CLUSTER_LABS_RSA_PUB_ENC"},
88296465Sdelphij    {0, NULL}
89296465Sdelphij};
90109998Smarkm
91296465Sdelphijstatic ERR_STRING_DATA CL_str_reasons[] = {
92296465Sdelphij    {CL_R_ALREADY_LOADED, "already loaded"},
93296465Sdelphij    {CL_R_COMMAND_NOT_IMPLEMENTED, "command not implemented"},
94296465Sdelphij    {CL_R_DSO_FAILURE, "dso failure"},
95296465Sdelphij    {CL_R_FUNCTION_NOT_BINDED, "function not binded"},
96296465Sdelphij    {CL_R_INIT_FAILED, "init failed"},
97296465Sdelphij    {CL_R_NOT_LOADED, "not loaded"},
98296465Sdelphij    {0, NULL}
99296465Sdelphij};
100109998Smarkm
101109998Smarkm#endif
102109998Smarkm
103109998Smarkm#ifdef CL_LIB_NAME
104296465Sdelphijstatic ERR_STRING_DATA CL_lib_name[] = {
105296465Sdelphij    {0, CL_LIB_NAME},
106296465Sdelphij    {0, NULL}
107296465Sdelphij};
108109998Smarkm#endif
109109998Smarkm
110296465Sdelphijstatic int CL_lib_error_code = 0;
111296465Sdelphijstatic int CL_error_init = 1;
112109998Smarkm
113109998Smarkmstatic void ERR_load_CL_strings(void)
114296465Sdelphij{
115296465Sdelphij    if (CL_lib_error_code == 0)
116296465Sdelphij        CL_lib_error_code = ERR_get_next_error_library();
117109998Smarkm
118296465Sdelphij    if (CL_error_init) {
119296465Sdelphij        CL_error_init = 0;
120109998Smarkm#ifndef OPENSSL_NO_ERR
121296465Sdelphij        ERR_load_strings(CL_lib_error_code, CL_str_functs);
122296465Sdelphij        ERR_load_strings(CL_lib_error_code, CL_str_reasons);
123109998Smarkm#endif
124109998Smarkm
125109998Smarkm#ifdef CL_LIB_NAME
126296465Sdelphij        CL_lib_name->error = ERR_PACK(CL_lib_error_code, 0, 0);
127296465Sdelphij        ERR_load_strings(0, CL_lib_name);
128109998Smarkm#endif
129296465Sdelphij    }
130296465Sdelphij}
131109998Smarkm
132109998Smarkmstatic void ERR_unload_CL_strings(void)
133296465Sdelphij{
134296465Sdelphij    if (CL_error_init == 0) {
135109998Smarkm#ifndef OPENSSL_NO_ERR
136296465Sdelphij        ERR_unload_strings(CL_lib_error_code, CL_str_functs);
137296465Sdelphij        ERR_unload_strings(CL_lib_error_code, CL_str_reasons);
138109998Smarkm#endif
139109998Smarkm
140109998Smarkm#ifdef CL_LIB_NAME
141296465Sdelphij        ERR_unload_strings(0, CL_lib_name);
142109998Smarkm#endif
143296465Sdelphij        CL_error_init = 1;
144296465Sdelphij    }
145296465Sdelphij}
146109998Smarkm
147109998Smarkmstatic void ERR_CL_error(int function, int reason, char *file, int line)
148296465Sdelphij{
149296465Sdelphij    if (CL_lib_error_code == 0)
150296465Sdelphij        CL_lib_error_code = ERR_get_next_error_library();
151296465Sdelphij    ERR_PUT_error(CL_lib_error_code, function, reason, file, line);
152296465Sdelphij}
153