1193645Ssimon/* crypto/fips_err.h */
2193645Ssimon/* ====================================================================
3193645Ssimon * Copyright (c) 1999-2007 The OpenSSL Project.  All rights reserved.
4193645Ssimon *
5193645Ssimon * Redistribution and use in source and binary forms, with or without
6193645Ssimon * modification, are permitted provided that the following conditions
7193645Ssimon * are met:
8193645Ssimon *
9193645Ssimon * 1. Redistributions of source code must retain the above copyright
10296465Sdelphij *    notice, this list of conditions and the following disclaimer.
11193645Ssimon *
12193645Ssimon * 2. Redistributions in binary form must reproduce the above copyright
13193645Ssimon *    notice, this list of conditions and the following disclaimer in
14193645Ssimon *    the documentation and/or other materials provided with the
15193645Ssimon *    distribution.
16193645Ssimon *
17193645Ssimon * 3. All advertising materials mentioning features or use of this
18193645Ssimon *    software must display the following acknowledgment:
19193645Ssimon *    "This product includes software developed by the OpenSSL Project
20193645Ssimon *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
21193645Ssimon *
22193645Ssimon * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23193645Ssimon *    endorse or promote products derived from this software without
24193645Ssimon *    prior written permission. For written permission, please contact
25193645Ssimon *    openssl-core@OpenSSL.org.
26193645Ssimon *
27193645Ssimon * 5. Products derived from this software may not be called "OpenSSL"
28193645Ssimon *    nor may "OpenSSL" appear in their names without prior written
29193645Ssimon *    permission of the OpenSSL Project.
30193645Ssimon *
31193645Ssimon * 6. Redistributions of any form whatsoever must retain the following
32193645Ssimon *    acknowledgment:
33193645Ssimon *    "This product includes software developed by the OpenSSL Project
34193645Ssimon *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
35193645Ssimon *
36193645Ssimon * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37193645Ssimon * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38193645Ssimon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39193645Ssimon * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
40193645Ssimon * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41193645Ssimon * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42193645Ssimon * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43193645Ssimon * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44193645Ssimon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45193645Ssimon * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46193645Ssimon * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47193645Ssimon * OF THE POSSIBILITY OF SUCH DAMAGE.
48193645Ssimon * ====================================================================
49193645Ssimon *
50193645Ssimon * This product includes cryptographic software written by Eric Young
51193645Ssimon * (eay@cryptsoft.com).  This product includes software written by Tim
52193645Ssimon * Hudson (tjh@cryptsoft.com).
53193645Ssimon *
54193645Ssimon */
55193645Ssimon
56296465Sdelphij/*
57296465Sdelphij * NOTE: this file was auto generated by the mkerr.pl script: any changes
58193645Ssimon * made to it will be overwritten when the script next updates this file,
59193645Ssimon * only reason strings will be preserved.
60193645Ssimon */
61193645Ssimon
62193645Ssimon#include <stdio.h>
63193645Ssimon#include <openssl/err.h>
64193645Ssimon#include <openssl/fips.h>
65193645Ssimon
66193645Ssimon/* BEGIN ERROR CODES */
67193645Ssimon#ifndef OPENSSL_NO_ERR
68193645Ssimon
69296465Sdelphij# define ERR_FUNC(func) ERR_PACK(ERR_LIB_FIPS,func,0)
70296465Sdelphij# define ERR_REASON(reason) ERR_PACK(ERR_LIB_FIPS,0,reason)
71193645Ssimon
72296465Sdelphijstatic ERR_STRING_DATA FIPS_str_functs[] = {
73296465Sdelphij    {ERR_FUNC(FIPS_F_DH_BUILTIN_GENPARAMS), "DH_BUILTIN_GENPARAMS"},
74296465Sdelphij    {ERR_FUNC(FIPS_F_DSA_BUILTIN_PARAMGEN), "DSA_BUILTIN_PARAMGEN"},
75296465Sdelphij    {ERR_FUNC(FIPS_F_DSA_DO_SIGN), "DSA_do_sign"},
76296465Sdelphij    {ERR_FUNC(FIPS_F_DSA_DO_VERIFY), "DSA_do_verify"},
77296465Sdelphij    {ERR_FUNC(FIPS_F_EVP_CIPHERINIT_EX), "EVP_CipherInit_ex"},
78296465Sdelphij    {ERR_FUNC(FIPS_F_EVP_DIGESTINIT_EX), "EVP_DigestInit_ex"},
79296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_CHECK_DSA), "FIPS_CHECK_DSA"},
80296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_CHECK_INCORE_FINGERPRINT),
81296465Sdelphij     "FIPS_CHECK_INCORE_FINGERPRINT"},
82296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_CHECK_RSA), "FIPS_CHECK_RSA"},
83296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_DSA_CHECK), "FIPS_DSA_CHECK"},
84296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_MODE_SET), "FIPS_mode_set"},
85296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_PKEY_SIGNATURE_TEST), "fips_pkey_signature_test"},
86296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_SELFTEST_AES), "FIPS_selftest_aes"},
87296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_SELFTEST_DES), "FIPS_selftest_des"},
88296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_SELFTEST_DSA), "FIPS_selftest_dsa"},
89296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_SELFTEST_HMAC), "FIPS_selftest_hmac"},
90296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_SELFTEST_RNG), "FIPS_selftest_rng"},
91296465Sdelphij    {ERR_FUNC(FIPS_F_FIPS_SELFTEST_SHA1), "FIPS_selftest_sha1"},
92296465Sdelphij    {ERR_FUNC(FIPS_F_HASH_FINAL), "HASH_FINAL"},
93296465Sdelphij    {ERR_FUNC(FIPS_F_RSA_BUILTIN_KEYGEN), "RSA_BUILTIN_KEYGEN"},
94296465Sdelphij    {ERR_FUNC(FIPS_F_RSA_EAY_PRIVATE_DECRYPT), "RSA_EAY_PRIVATE_DECRYPT"},
95296465Sdelphij    {ERR_FUNC(FIPS_F_RSA_EAY_PRIVATE_ENCRYPT), "RSA_EAY_PRIVATE_ENCRYPT"},
96296465Sdelphij    {ERR_FUNC(FIPS_F_RSA_EAY_PUBLIC_DECRYPT), "RSA_EAY_PUBLIC_DECRYPT"},
97296465Sdelphij    {ERR_FUNC(FIPS_F_RSA_EAY_PUBLIC_ENCRYPT), "RSA_EAY_PUBLIC_ENCRYPT"},
98296465Sdelphij    {ERR_FUNC(FIPS_F_RSA_X931_GENERATE_KEY_EX), "RSA_X931_generate_key_ex"},
99296465Sdelphij    {ERR_FUNC(FIPS_F_SSLEAY_RAND_BYTES), "SSLEAY_RAND_BYTES"},
100296465Sdelphij    {0, NULL}
101296465Sdelphij};
102193645Ssimon
103296465Sdelphijstatic ERR_STRING_DATA FIPS_str_reasons[] = {
104296465Sdelphij    {ERR_REASON(FIPS_R_CANNOT_READ_EXE), "cannot read exe"},
105296465Sdelphij    {ERR_REASON(FIPS_R_CANNOT_READ_EXE_DIGEST), "cannot read exe digest"},
106296465Sdelphij    {ERR_REASON(FIPS_R_CONTRADICTING_EVIDENCE), "contradicting evidence"},
107296465Sdelphij    {ERR_REASON(FIPS_R_EXE_DIGEST_DOES_NOT_MATCH),
108296465Sdelphij     "exe digest does not match"},
109296465Sdelphij    {ERR_REASON(FIPS_R_FINGERPRINT_DOES_NOT_MATCH),
110296465Sdelphij     "fingerprint does not match"},
111296465Sdelphij    {ERR_REASON(FIPS_R_FINGERPRINT_DOES_NOT_MATCH_NONPIC_RELOCATED),
112296465Sdelphij     "fingerprint does not match nonpic relocated"},
113296465Sdelphij    {ERR_REASON(FIPS_R_FINGERPRINT_DOES_NOT_MATCH_SEGMENT_ALIASING),
114296465Sdelphij     "fingerprint does not match segment aliasing"},
115296465Sdelphij    {ERR_REASON(FIPS_R_FIPS_MODE_ALREADY_SET), "fips mode already set"},
116296465Sdelphij    {ERR_REASON(FIPS_R_FIPS_SELFTEST_FAILED), "fips selftest failed"},
117296465Sdelphij    {ERR_REASON(FIPS_R_INVALID_KEY_LENGTH), "invalid key length"},
118296465Sdelphij    {ERR_REASON(FIPS_R_KEY_TOO_SHORT), "key too short"},
119296465Sdelphij    {ERR_REASON(FIPS_R_NON_FIPS_METHOD), "non fips method"},
120296465Sdelphij    {ERR_REASON(FIPS_R_PAIRWISE_TEST_FAILED), "pairwise test failed"},
121296465Sdelphij    {ERR_REASON(FIPS_R_RSA_DECRYPT_ERROR), "rsa decrypt error"},
122296465Sdelphij    {ERR_REASON(FIPS_R_RSA_ENCRYPT_ERROR), "rsa encrypt error"},
123296465Sdelphij    {ERR_REASON(FIPS_R_SELFTEST_FAILED), "selftest failed"},
124296465Sdelphij    {ERR_REASON(FIPS_R_TEST_FAILURE), "test failure"},
125296465Sdelphij    {ERR_REASON(FIPS_R_UNSUPPORTED_PLATFORM), "unsupported platform"},
126296465Sdelphij    {0, NULL}
127296465Sdelphij};
128193645Ssimon
129193645Ssimon#endif
130193645Ssimon
131193645Ssimonvoid ERR_load_FIPS_strings(void)
132296465Sdelphij{
133193645Ssimon#ifndef OPENSSL_NO_ERR
134193645Ssimon
135296465Sdelphij    if (ERR_func_error_string(FIPS_str_functs[0].error) == NULL) {
136296465Sdelphij        ERR_load_strings(0, FIPS_str_functs);
137296465Sdelphij        ERR_load_strings(0, FIPS_str_reasons);
138296465Sdelphij    }
139193645Ssimon#endif
140296465Sdelphij}
141