a0d22506d4cb0b4d8c74563b018a4b91f831ae91
[openssl.git] / crypto / evp / evp_err.c
1 /*
2  * Generated by util/mkerr.pl DO NOT EDIT
3  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
4  *
5  * Licensed under the OpenSSL license (the "License").  You may not use
6  * this file except in compliance with the License.  You can obtain a copy
7  * in the file LICENSE in the source distribution or at
8  * https://www.openssl.org/source/license.html
9  */
10
11 #include <stdio.h>
12 #include <openssl/err.h>
13 #include <openssl/evp.h>
14
15 /* BEGIN ERROR CODES */
16 #ifndef OPENSSL_NO_ERR
17
18 # define ERR_FUNC(func) ERR_PACK(ERR_LIB_EVP,func,0)
19 # define ERR_REASON(reason) ERR_PACK(ERR_LIB_EVP,0,reason)
20
21 static ERR_STRING_DATA EVP_str_functs[] = {
22     {ERR_FUNC(EVP_F_AESNI_INIT_KEY), "aesni_init_key"},
23     {ERR_FUNC(EVP_F_AES_INIT_KEY), "aes_init_key"},
24     {ERR_FUNC(EVP_F_AES_T4_INIT_KEY), "aes_t4_init_key"},
25     {ERR_FUNC(EVP_F_ALG_MODULE_INIT), "alg_module_init"},
26     {ERR_FUNC(EVP_F_CAMELLIA_INIT_KEY), "camellia_init_key"},
27     {ERR_FUNC(EVP_F_CHACHA20_POLY1305_CTRL), "chacha20_poly1305_ctrl"},
28     {ERR_FUNC(EVP_F_CMLL_T4_INIT_KEY), "cmll_t4_init_key"},
29     {ERR_FUNC(EVP_F_DO_SIGVER_INIT), "do_sigver_init"},
30     {ERR_FUNC(EVP_F_EVP_CIPHERINIT_EX), "EVP_CipherInit_ex"},
31     {ERR_FUNC(EVP_F_EVP_CIPHER_CTX_COPY), "EVP_CIPHER_CTX_copy"},
32     {ERR_FUNC(EVP_F_EVP_CIPHER_CTX_CTRL), "EVP_CIPHER_CTX_ctrl"},
33     {ERR_FUNC(EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH),
34      "EVP_CIPHER_CTX_set_key_length"},
35     {ERR_FUNC(EVP_F_EVP_DECRYPTFINAL_EX), "EVP_DecryptFinal_ex"},
36     {ERR_FUNC(EVP_F_EVP_DECRYPTUPDATE), "EVP_DecryptUpdate"},
37     {ERR_FUNC(EVP_F_EVP_DIGESTINIT_EX), "EVP_DigestInit_ex"},
38     {ERR_FUNC(EVP_F_EVP_ENCRYPTFINAL_EX), "EVP_EncryptFinal_ex"},
39     {ERR_FUNC(EVP_F_EVP_ENCRYPTUPDATE), "EVP_EncryptUpdate"},
40     {ERR_FUNC(EVP_F_EVP_MD_CTX_COPY_EX), "EVP_MD_CTX_copy_ex"},
41     {ERR_FUNC(EVP_F_EVP_MD_SIZE), "EVP_MD_size"},
42     {ERR_FUNC(EVP_F_EVP_OPENINIT), "EVP_OpenInit"},
43     {ERR_FUNC(EVP_F_EVP_PBE_ALG_ADD), "EVP_PBE_alg_add"},
44     {ERR_FUNC(EVP_F_EVP_PBE_ALG_ADD_TYPE), "EVP_PBE_alg_add_type"},
45     {ERR_FUNC(EVP_F_EVP_PBE_CIPHERINIT), "EVP_PBE_CipherInit"},
46     {ERR_FUNC(EVP_F_EVP_PBE_SCRYPT), "EVP_PBE_scrypt"},
47     {ERR_FUNC(EVP_F_EVP_PKCS82PKEY), "EVP_PKCS82PKEY"},
48     {ERR_FUNC(EVP_F_EVP_PKEY2PKCS8), "EVP_PKEY2PKCS8"},
49     {ERR_FUNC(EVP_F_EVP_PKEY_COPY_PARAMETERS), "EVP_PKEY_copy_parameters"},
50     {ERR_FUNC(EVP_F_EVP_PKEY_CTX_CTRL), "EVP_PKEY_CTX_ctrl"},
51     {ERR_FUNC(EVP_F_EVP_PKEY_CTX_CTRL_STR), "EVP_PKEY_CTX_ctrl_str"},
52     {ERR_FUNC(EVP_F_EVP_PKEY_CTX_DUP), "EVP_PKEY_CTX_dup"},
53     {ERR_FUNC(EVP_F_EVP_PKEY_DECRYPT), "EVP_PKEY_decrypt"},
54     {ERR_FUNC(EVP_F_EVP_PKEY_DECRYPT_INIT), "EVP_PKEY_decrypt_init"},
55     {ERR_FUNC(EVP_F_EVP_PKEY_DECRYPT_OLD), "EVP_PKEY_decrypt_old"},
56     {ERR_FUNC(EVP_F_EVP_PKEY_DERIVE), "EVP_PKEY_derive"},
57     {ERR_FUNC(EVP_F_EVP_PKEY_DERIVE_INIT), "EVP_PKEY_derive_init"},
58     {ERR_FUNC(EVP_F_EVP_PKEY_DERIVE_SET_PEER), "EVP_PKEY_derive_set_peer"},
59     {ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT), "EVP_PKEY_encrypt"},
60     {ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT_INIT), "EVP_PKEY_encrypt_init"},
61     {ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT_OLD), "EVP_PKEY_encrypt_old"},
62     {ERR_FUNC(EVP_F_EVP_PKEY_GET0_DH), "EVP_PKEY_get0_DH"},
63     {ERR_FUNC(EVP_F_EVP_PKEY_GET0_DSA), "EVP_PKEY_get0_DSA"},
64     {ERR_FUNC(EVP_F_EVP_PKEY_GET0_EC_KEY), "EVP_PKEY_get0_EC_KEY"},
65     {ERR_FUNC(EVP_F_EVP_PKEY_GET0_HMAC), "EVP_PKEY_get0_hmac"},
66     {ERR_FUNC(EVP_F_EVP_PKEY_GET0_RSA), "EVP_PKEY_get0_RSA"},
67     {ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN), "EVP_PKEY_keygen"},
68     {ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN_INIT), "EVP_PKEY_keygen_init"},
69     {ERR_FUNC(EVP_F_EVP_PKEY_NEW), "EVP_PKEY_new"},
70     {ERR_FUNC(EVP_F_EVP_PKEY_PARAMGEN), "EVP_PKEY_paramgen"},
71     {ERR_FUNC(EVP_F_EVP_PKEY_PARAMGEN_INIT), "EVP_PKEY_paramgen_init"},
72     {ERR_FUNC(EVP_F_EVP_PKEY_SIGN), "EVP_PKEY_sign"},
73     {ERR_FUNC(EVP_F_EVP_PKEY_SIGN_INIT), "EVP_PKEY_sign_init"},
74     {ERR_FUNC(EVP_F_EVP_PKEY_VERIFY), "EVP_PKEY_verify"},
75     {ERR_FUNC(EVP_F_EVP_PKEY_VERIFY_INIT), "EVP_PKEY_verify_init"},
76     {ERR_FUNC(EVP_F_EVP_PKEY_VERIFY_RECOVER), "EVP_PKEY_verify_recover"},
77     {ERR_FUNC(EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT),
78      "EVP_PKEY_verify_recover_init"},
79     {ERR_FUNC(EVP_F_EVP_SIGNFINAL), "EVP_SignFinal"},
80     {ERR_FUNC(EVP_F_EVP_VERIFYFINAL), "EVP_VerifyFinal"},
81     {ERR_FUNC(EVP_F_INT_CTX_NEW), "int_ctx_new"},
82     {ERR_FUNC(EVP_F_PKCS5_PBE_KEYIVGEN), "PKCS5_PBE_keyivgen"},
83     {ERR_FUNC(EVP_F_PKCS5_V2_PBE_KEYIVGEN), "PKCS5_v2_PBE_keyivgen"},
84     {ERR_FUNC(EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN), "PKCS5_v2_PBKDF2_keyivgen"},
85     {ERR_FUNC(EVP_F_PKCS5_V2_SCRYPT_KEYIVGEN), "PKCS5_v2_scrypt_keyivgen"},
86     {ERR_FUNC(EVP_F_PKEY_SET_TYPE), "pkey_set_type"},
87     {ERR_FUNC(EVP_F_RC2_MAGIC_TO_METH), "rc2_magic_to_meth"},
88     {ERR_FUNC(EVP_F_RC5_CTRL), "rc5_ctrl"},
89     {0, NULL}
90 };
91
92 static ERR_STRING_DATA EVP_str_reasons[] = {
93     {ERR_REASON(EVP_R_AES_KEY_SETUP_FAILED), "aes key setup failed"},
94     {ERR_REASON(EVP_R_BAD_DECRYPT), "bad decrypt"},
95     {ERR_REASON(EVP_R_BUFFER_TOO_SMALL), "buffer too small"},
96     {ERR_REASON(EVP_R_CAMELLIA_KEY_SETUP_FAILED),
97      "camellia key setup failed"},
98     {ERR_REASON(EVP_R_CIPHER_PARAMETER_ERROR), "cipher parameter error"},
99     {ERR_REASON(EVP_R_COMMAND_NOT_SUPPORTED), "command not supported"},
100     {ERR_REASON(EVP_R_COPY_ERROR), "copy error"},
101     {ERR_REASON(EVP_R_CTRL_NOT_IMPLEMENTED), "ctrl not implemented"},
102     {ERR_REASON(EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED),
103      "ctrl operation not implemented"},
104     {ERR_REASON(EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH),
105      "data not multiple of block length"},
106     {ERR_REASON(EVP_R_DECODE_ERROR), "decode error"},
107     {ERR_REASON(EVP_R_DIFFERENT_KEY_TYPES), "different key types"},
108     {ERR_REASON(EVP_R_DIFFERENT_PARAMETERS), "different parameters"},
109     {ERR_REASON(EVP_R_ERROR_LOADING_SECTION), "error loading section"},
110     {ERR_REASON(EVP_R_ERROR_SETTING_FIPS_MODE), "error setting fips mode"},
111     {ERR_REASON(EVP_R_EXPECTING_AN_HMAC_KEY), "expecting an hmac key"},
112     {ERR_REASON(EVP_R_EXPECTING_AN_RSA_KEY), "expecting an rsa key"},
113     {ERR_REASON(EVP_R_EXPECTING_A_DH_KEY), "expecting a dh key"},
114     {ERR_REASON(EVP_R_EXPECTING_A_DSA_KEY), "expecting a dsa key"},
115     {ERR_REASON(EVP_R_EXPECTING_A_EC_KEY), "expecting a ec key"},
116     {ERR_REASON(EVP_R_FIPS_MODE_NOT_SUPPORTED), "fips mode not supported"},
117     {ERR_REASON(EVP_R_ILLEGAL_SCRYPT_PARAMETERS),
118      "illegal scrypt parameters"},
119     {ERR_REASON(EVP_R_INITIALIZATION_ERROR), "initialization error"},
120     {ERR_REASON(EVP_R_INPUT_NOT_INITIALIZED), "input not initialized"},
121     {ERR_REASON(EVP_R_INVALID_DIGEST), "invalid digest"},
122     {ERR_REASON(EVP_R_INVALID_FIPS_MODE), "invalid fips mode"},
123     {ERR_REASON(EVP_R_INVALID_KEY_LENGTH), "invalid key length"},
124     {ERR_REASON(EVP_R_INVALID_OPERATION), "invalid operation"},
125     {ERR_REASON(EVP_R_KEYGEN_FAILURE), "keygen failure"},
126     {ERR_REASON(EVP_R_MEMORY_LIMIT_EXCEEDED), "memory limit exceeded"},
127     {ERR_REASON(EVP_R_MESSAGE_DIGEST_IS_NULL), "message digest is null"},
128     {ERR_REASON(EVP_R_METHOD_NOT_SUPPORTED), "method not supported"},
129     {ERR_REASON(EVP_R_MISSING_PARAMETERS), "missing parameters"},
130     {ERR_REASON(EVP_R_NO_CIPHER_SET), "no cipher set"},
131     {ERR_REASON(EVP_R_NO_DEFAULT_DIGEST), "no default digest"},
132     {ERR_REASON(EVP_R_NO_DIGEST_SET), "no digest set"},
133     {ERR_REASON(EVP_R_NO_KEY_SET), "no key set"},
134     {ERR_REASON(EVP_R_NO_OPERATION_SET), "no operation set"},
135     {ERR_REASON(EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
136      "operation not supported for this keytype"},
137     {ERR_REASON(EVP_R_OPERATON_NOT_INITIALIZED), "operaton not initialized"},
138     {ERR_REASON(EVP_R_PARTIALLY_OVERLAPPING), "partially overlapping buffers"},
139     {ERR_REASON(EVP_R_PRIVATE_KEY_DECODE_ERROR), "private key decode error"},
140     {ERR_REASON(EVP_R_PRIVATE_KEY_ENCODE_ERROR), "private key encode error"},
141     {ERR_REASON(EVP_R_PUBLIC_KEY_NOT_RSA), "public key not rsa"},
142     {ERR_REASON(EVP_R_UNKNOWN_CIPHER), "unknown cipher"},
143     {ERR_REASON(EVP_R_UNKNOWN_DIGEST), "unknown digest"},
144     {ERR_REASON(EVP_R_UNKNOWN_OPTION), "unknown option"},
145     {ERR_REASON(EVP_R_UNKNOWN_PBE_ALGORITHM), "unknown pbe algorithm"},
146     {ERR_REASON(EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS),
147      "unsuported number of rounds"},
148     {ERR_REASON(EVP_R_UNSUPPORTED_ALGORITHM), "unsupported algorithm"},
149     {ERR_REASON(EVP_R_UNSUPPORTED_CIPHER), "unsupported cipher"},
150     {ERR_REASON(EVP_R_UNSUPPORTED_KEYLENGTH), "unsupported keylength"},
151     {ERR_REASON(EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION),
152      "unsupported key derivation function"},
153     {ERR_REASON(EVP_R_UNSUPPORTED_KEY_SIZE), "unsupported key size"},
154     {ERR_REASON(EVP_R_UNSUPPORTED_PRF), "unsupported prf"},
155     {ERR_REASON(EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM),
156      "unsupported private key algorithm"},
157     {ERR_REASON(EVP_R_UNSUPPORTED_SALT_TYPE), "unsupported salt type"},
158     {ERR_REASON(EVP_R_WRAP_MODE_NOT_ALLOWED), "wrap mode not allowed"},
159     {ERR_REASON(EVP_R_WRONG_FINAL_BLOCK_LENGTH), "wrong final block length"},
160     {0, NULL}
161 };
162
163 #endif
164
165 int ERR_load_EVP_strings(void)
166 {
167 #ifndef OPENSSL_NO_ERR
168
169     if (ERR_func_error_string(EVP_str_functs[0].error) == NULL) {
170         ERR_load_strings(0, EVP_str_functs);
171         ERR_load_strings(0, EVP_str_reasons);
172     }
173 #endif
174     return 1;
175 }