3f4b8ef0bc7af1bdaefe1edea41f0f5a5884cb05
[openssl.git] / crypto / x509 / x509_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/x509.h>
14
15 /* BEGIN ERROR CODES */
16 #ifndef OPENSSL_NO_ERR
17
18 # define ERR_FUNC(func) ERR_PACK(ERR_LIB_X509,func,0)
19 # define ERR_REASON(reason) ERR_PACK(ERR_LIB_X509,0,reason)
20
21 static ERR_STRING_DATA X509_str_functs[] = {
22     {ERR_FUNC(X509_F_ADD_CERT_DIR), "add_cert_dir"},
23     {ERR_FUNC(X509_F_BUILD_CHAIN), "build_chain"},
24     {ERR_FUNC(X509_F_BY_FILE_CTRL), "by_file_ctrl"},
25     {ERR_FUNC(X509_F_CHECK_NAME_CONSTRAINTS), "check_name_constraints"},
26     {ERR_FUNC(X509_F_CHECK_POLICY), "check_policy"},
27     {ERR_FUNC(X509_F_DANE_I2D), "dane_i2d"},
28     {ERR_FUNC(X509_F_DIR_CTRL), "dir_ctrl"},
29     {ERR_FUNC(X509_F_GET_CERT_BY_SUBJECT), "get_cert_by_subject"},
30     {ERR_FUNC(X509_F_NETSCAPE_SPKI_B64_DECODE), "NETSCAPE_SPKI_b64_decode"},
31     {ERR_FUNC(X509_F_NETSCAPE_SPKI_B64_ENCODE), "NETSCAPE_SPKI_b64_encode"},
32     {ERR_FUNC(X509_F_X509AT_ADD1_ATTR), "X509at_add1_attr"},
33     {ERR_FUNC(X509_F_X509V3_ADD_EXT), "X509v3_add_ext"},
34     {ERR_FUNC(X509_F_X509_ATTRIBUTE_CREATE_BY_NID),
35      "X509_ATTRIBUTE_create_by_NID"},
36     {ERR_FUNC(X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ),
37      "X509_ATTRIBUTE_create_by_OBJ"},
38     {ERR_FUNC(X509_F_X509_ATTRIBUTE_CREATE_BY_TXT),
39      "X509_ATTRIBUTE_create_by_txt"},
40     {ERR_FUNC(X509_F_X509_ATTRIBUTE_GET0_DATA), "X509_ATTRIBUTE_get0_data"},
41     {ERR_FUNC(X509_F_X509_ATTRIBUTE_SET1_DATA), "X509_ATTRIBUTE_set1_data"},
42     {ERR_FUNC(X509_F_X509_CHECK_PRIVATE_KEY), "X509_check_private_key"},
43     {ERR_FUNC(X509_F_X509_CRL_DIFF), "X509_CRL_diff"},
44     {ERR_FUNC(X509_F_X509_CRL_PRINT_FP), "X509_CRL_print_fp"},
45     {ERR_FUNC(X509_F_X509_EXTENSION_CREATE_BY_NID),
46      "X509_EXTENSION_create_by_NID"},
47     {ERR_FUNC(X509_F_X509_EXTENSION_CREATE_BY_OBJ),
48      "X509_EXTENSION_create_by_OBJ"},
49     {ERR_FUNC(X509_F_X509_GET_PUBKEY_PARAMETERS),
50      "X509_get_pubkey_parameters"},
51     {ERR_FUNC(X509_F_X509_LOAD_CERT_CRL_FILE), "X509_load_cert_crl_file"},
52     {ERR_FUNC(X509_F_X509_LOAD_CERT_FILE), "X509_load_cert_file"},
53     {ERR_FUNC(X509_F_X509_LOAD_CRL_FILE), "X509_load_crl_file"},
54     {ERR_FUNC(X509_F_X509_NAME_ADD_ENTRY), "X509_NAME_add_entry"},
55     {ERR_FUNC(X509_F_X509_NAME_ENTRY_CREATE_BY_NID),
56      "X509_NAME_ENTRY_create_by_NID"},
57     {ERR_FUNC(X509_F_X509_NAME_ENTRY_CREATE_BY_TXT),
58      "X509_NAME_ENTRY_create_by_txt"},
59     {ERR_FUNC(X509_F_X509_NAME_ENTRY_SET_OBJECT),
60      "X509_NAME_ENTRY_set_object"},
61     {ERR_FUNC(X509_F_X509_NAME_ONELINE), "X509_NAME_oneline"},
62     {ERR_FUNC(X509_F_X509_NAME_PRINT), "X509_NAME_print"},
63     {ERR_FUNC(X509_F_X509_OBJECT_NEW), "X509_OBJECT_new"},
64     {ERR_FUNC(X509_F_X509_PRINT_EX_FP), "X509_print_ex_fp"},
65     {ERR_FUNC(X509_F_X509_PUBKEY_DECODE), "x509_pubkey_decode"},
66     {ERR_FUNC(X509_F_X509_PUBKEY_GET0), "X509_PUBKEY_get0"},
67     {ERR_FUNC(X509_F_X509_PUBKEY_SET), "X509_PUBKEY_set"},
68     {ERR_FUNC(X509_F_X509_REQ_CHECK_PRIVATE_KEY),
69      "X509_REQ_check_private_key"},
70     {ERR_FUNC(X509_F_X509_REQ_PRINT_EX), "X509_REQ_print_ex"},
71     {ERR_FUNC(X509_F_X509_REQ_PRINT_FP), "X509_REQ_print_fp"},
72     {ERR_FUNC(X509_F_X509_REQ_TO_X509), "X509_REQ_to_X509"},
73     {ERR_FUNC(X509_F_X509_STORE_ADD_CERT), "X509_STORE_add_cert"},
74     {ERR_FUNC(X509_F_X509_STORE_ADD_CRL), "X509_STORE_add_crl"},
75     {ERR_FUNC(X509_F_X509_STORE_CTX_GET1_ISSUER),
76      "X509_STORE_CTX_get1_issuer"},
77     {ERR_FUNC(X509_F_X509_STORE_CTX_INIT), "X509_STORE_CTX_init"},
78     {ERR_FUNC(X509_F_X509_STORE_CTX_NEW), "X509_STORE_CTX_new"},
79     {ERR_FUNC(X509_F_X509_STORE_CTX_PURPOSE_INHERIT),
80      "X509_STORE_CTX_purpose_inherit"},
81     {ERR_FUNC(X509_F_X509_TO_X509_REQ), "X509_to_X509_REQ"},
82     {ERR_FUNC(X509_F_X509_TRUST_ADD), "X509_TRUST_add"},
83     {ERR_FUNC(X509_F_X509_TRUST_SET), "X509_TRUST_set"},
84     {ERR_FUNC(X509_F_X509_VERIFY_CERT), "X509_verify_cert"},
85     {0, NULL}
86 };
87
88 static ERR_STRING_DATA X509_str_reasons[] = {
89     {ERR_REASON(X509_R_AKID_MISMATCH), "akid mismatch"},
90     {ERR_REASON(X509_R_BAD_SELECTOR), "bad selector"},
91     {ERR_REASON(X509_R_BAD_X509_FILETYPE), "bad x509 filetype"},
92     {ERR_REASON(X509_R_BASE64_DECODE_ERROR), "base64 decode error"},
93     {ERR_REASON(X509_R_CANT_CHECK_DH_KEY), "cant check dh key"},
94     {ERR_REASON(X509_R_CERT_ALREADY_IN_HASH_TABLE),
95      "cert already in hash table"},
96     {ERR_REASON(X509_R_CRL_ALREADY_DELTA), "crl already delta"},
97     {ERR_REASON(X509_R_CRL_VERIFY_FAILURE), "crl verify failure"},
98     {ERR_REASON(X509_R_IDP_MISMATCH), "idp mismatch"},
99     {ERR_REASON(X509_R_INVALID_DIRECTORY), "invalid directory"},
100     {ERR_REASON(X509_R_INVALID_FIELD_NAME), "invalid field name"},
101     {ERR_REASON(X509_R_INVALID_TRUST), "invalid trust"},
102     {ERR_REASON(X509_R_ISSUER_MISMATCH), "issuer mismatch"},
103     {ERR_REASON(X509_R_KEY_TYPE_MISMATCH), "key type mismatch"},
104     {ERR_REASON(X509_R_KEY_VALUES_MISMATCH), "key values mismatch"},
105     {ERR_REASON(X509_R_LOADING_CERT_DIR), "loading cert dir"},
106     {ERR_REASON(X509_R_LOADING_DEFAULTS), "loading defaults"},
107     {ERR_REASON(X509_R_METHOD_NOT_SUPPORTED), "method not supported"},
108     {ERR_REASON(X509_R_NAME_TOO_LONG), "name too long"},
109     {ERR_REASON(X509_R_NEWER_CRL_NOT_NEWER), "newer crl not newer"},
110     {ERR_REASON(X509_R_NO_CERT_SET_FOR_US_TO_VERIFY),
111      "no cert set for us to verify"},
112     {ERR_REASON(X509_R_NO_CRL_NUMBER), "no crl number"},
113     {ERR_REASON(X509_R_PUBLIC_KEY_DECODE_ERROR), "public key decode error"},
114     {ERR_REASON(X509_R_PUBLIC_KEY_ENCODE_ERROR), "public key encode error"},
115     {ERR_REASON(X509_R_SHOULD_RETRY), "should retry"},
116     {ERR_REASON(X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN),
117      "unable to find parameters in chain"},
118     {ERR_REASON(X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY),
119      "unable to get certs public key"},
120     {ERR_REASON(X509_R_UNKNOWN_KEY_TYPE), "unknown key type"},
121     {ERR_REASON(X509_R_UNKNOWN_NID), "unknown nid"},
122     {ERR_REASON(X509_R_UNKNOWN_PURPOSE_ID), "unknown purpose id"},
123     {ERR_REASON(X509_R_UNKNOWN_TRUST_ID), "unknown trust id"},
124     {ERR_REASON(X509_R_UNSUPPORTED_ALGORITHM), "unsupported algorithm"},
125     {ERR_REASON(X509_R_WRONG_LOOKUP_TYPE), "wrong lookup type"},
126     {ERR_REASON(X509_R_WRONG_TYPE), "wrong type"},
127     {0, NULL}
128 };
129
130 #endif
131
132 int ERR_load_X509_strings(void)
133 {
134 #ifndef OPENSSL_NO_ERR
135
136     if (ERR_func_error_string(X509_str_functs[0].error) == NULL) {
137         ERR_load_strings(0, X509_str_functs);
138         ERR_load_strings(0, X509_str_reasons);
139     }
140 #endif
141     return 1;
142 }