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