Copyright consolidation 04/10
[openssl.git] / crypto / pkcs7 / pkcs7err.c
1 /*
2  * Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 /*
11  * NOTE: this file was auto generated by the mkerr.pl script: any changes
12  * made to it will be overwritten when the script next updates this file,
13  * only reason strings will be preserved.
14  */
15
16 #include <stdio.h>
17 #include <openssl/err.h>
18 #include <openssl/pkcs7.h>
19
20 /* BEGIN ERROR CODES */
21 #ifndef OPENSSL_NO_ERR
22
23 # define ERR_FUNC(func) ERR_PACK(ERR_LIB_PKCS7,func,0)
24 # define ERR_REASON(reason) ERR_PACK(ERR_LIB_PKCS7,0,reason)
25
26 static ERR_STRING_DATA PKCS7_str_functs[] = {
27     {ERR_FUNC(PKCS7_F_B64_READ_PKCS7), "B64_READ_PKCS7"},
28     {ERR_FUNC(PKCS7_F_B64_WRITE_PKCS7), "B64_WRITE_PKCS7"},
29     {ERR_FUNC(PKCS7_F_DO_PKCS7_SIGNED_ATTRIB), "do_pkcs7_signed_attrib"},
30     {ERR_FUNC(PKCS7_F_I2D_PKCS7_BIO_STREAM), "i2d_PKCS7_bio_stream"},
31     {ERR_FUNC(PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME),
32      "PKCS7_add0_attrib_signing_time"},
33     {ERR_FUNC(PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP), "PKCS7_add_attrib_smimecap"},
34     {ERR_FUNC(PKCS7_F_PKCS7_ADD_CERTIFICATE), "PKCS7_add_certificate"},
35     {ERR_FUNC(PKCS7_F_PKCS7_ADD_CRL), "PKCS7_add_crl"},
36     {ERR_FUNC(PKCS7_F_PKCS7_ADD_RECIPIENT_INFO), "PKCS7_add_recipient_info"},
37     {ERR_FUNC(PKCS7_F_PKCS7_ADD_SIGNATURE), "PKCS7_add_signature"},
38     {ERR_FUNC(PKCS7_F_PKCS7_ADD_SIGNER), "PKCS7_add_signer"},
39     {ERR_FUNC(PKCS7_F_PKCS7_BIO_ADD_DIGEST), "PKCS7_bio_add_digest"},
40     {ERR_FUNC(PKCS7_F_PKCS7_COPY_EXISTING_DIGEST),
41      "pkcs7_copy_existing_digest"},
42     {ERR_FUNC(PKCS7_F_PKCS7_CTRL), "PKCS7_ctrl"},
43     {ERR_FUNC(PKCS7_F_PKCS7_DATADECODE), "PKCS7_dataDecode"},
44     {ERR_FUNC(PKCS7_F_PKCS7_DATAFINAL), "PKCS7_dataFinal"},
45     {ERR_FUNC(PKCS7_F_PKCS7_DATAINIT), "PKCS7_dataInit"},
46     {ERR_FUNC(PKCS7_F_PKCS7_DATASIGN), "PKCS7_DATASIGN"},
47     {ERR_FUNC(PKCS7_F_PKCS7_DATAVERIFY), "PKCS7_dataVerify"},
48     {ERR_FUNC(PKCS7_F_PKCS7_DECRYPT), "PKCS7_decrypt"},
49     {ERR_FUNC(PKCS7_F_PKCS7_DECRYPT_RINFO), "pkcs7_decrypt_rinfo"},
50     {ERR_FUNC(PKCS7_F_PKCS7_ENCODE_RINFO), "pkcs7_encode_rinfo"},
51     {ERR_FUNC(PKCS7_F_PKCS7_ENCRYPT), "PKCS7_encrypt"},
52     {ERR_FUNC(PKCS7_F_PKCS7_FINAL), "PKCS7_final"},
53     {ERR_FUNC(PKCS7_F_PKCS7_FIND_DIGEST), "PKCS7_find_digest"},
54     {ERR_FUNC(PKCS7_F_PKCS7_GET0_SIGNERS), "PKCS7_get0_signers"},
55     {ERR_FUNC(PKCS7_F_PKCS7_RECIP_INFO_SET), "PKCS7_RECIP_INFO_set"},
56     {ERR_FUNC(PKCS7_F_PKCS7_SET_CIPHER), "PKCS7_set_cipher"},
57     {ERR_FUNC(PKCS7_F_PKCS7_SET_CONTENT), "PKCS7_set_content"},
58     {ERR_FUNC(PKCS7_F_PKCS7_SET_DIGEST), "PKCS7_set_digest"},
59     {ERR_FUNC(PKCS7_F_PKCS7_SET_TYPE), "PKCS7_set_type"},
60     {ERR_FUNC(PKCS7_F_PKCS7_SIGN), "PKCS7_sign"},
61     {ERR_FUNC(PKCS7_F_PKCS7_SIGNATUREVERIFY), "PKCS7_signatureVerify"},
62     {ERR_FUNC(PKCS7_F_PKCS7_SIGNER_INFO_SET), "PKCS7_SIGNER_INFO_set"},
63     {ERR_FUNC(PKCS7_F_PKCS7_SIGNER_INFO_SIGN), "PKCS7_SIGNER_INFO_sign"},
64     {ERR_FUNC(PKCS7_F_PKCS7_SIGN_ADD_SIGNER), "PKCS7_sign_add_signer"},
65     {ERR_FUNC(PKCS7_F_PKCS7_SIMPLE_SMIMECAP), "PKCS7_simple_smimecap"},
66     {ERR_FUNC(PKCS7_F_PKCS7_VERIFY), "PKCS7_verify"},
67     {ERR_FUNC(PKCS7_F_SMIME_READ_PKCS7), "SMIME_read_PKCS7"},
68     {ERR_FUNC(PKCS7_F_SMIME_TEXT), "SMIME_text"},
69     {0, NULL}
70 };
71
72 static ERR_STRING_DATA PKCS7_str_reasons[] = {
73     {ERR_REASON(PKCS7_R_CERTIFICATE_VERIFY_ERROR), "certificate verify error"},
74     {ERR_REASON(PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER),
75      "cipher has no object identifier"},
76     {ERR_REASON(PKCS7_R_CIPHER_NOT_INITIALIZED), "cipher not initialized"},
77     {ERR_REASON(PKCS7_R_CONTENT_AND_DATA_PRESENT), "content and data present"},
78     {ERR_REASON(PKCS7_R_CTRL_ERROR), "ctrl error"},
79     {ERR_REASON(PKCS7_R_DECODE_ERROR), "decode error"},
80     {ERR_REASON(PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH),
81      "decrypted key is wrong length"},
82     {ERR_REASON(PKCS7_R_DECRYPT_ERROR), "decrypt error"},
83     {ERR_REASON(PKCS7_R_DIGEST_FAILURE), "digest failure"},
84     {ERR_REASON(PKCS7_R_ENCRYPTION_CTRL_FAILURE), "encryption ctrl failure"},
85     {ERR_REASON(PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),
86      "encryption not supported for this key type"},
87     {ERR_REASON(PKCS7_R_ERROR_ADDING_RECIPIENT), "error adding recipient"},
88     {ERR_REASON(PKCS7_R_ERROR_SETTING_CIPHER), "error setting cipher"},
89     {ERR_REASON(PKCS7_R_INVALID_MIME_TYPE), "invalid mime type"},
90     {ERR_REASON(PKCS7_R_INVALID_NULL_POINTER), "invalid null pointer"},
91     {ERR_REASON(PKCS7_R_INVALID_SIGNED_DATA_TYPE), "invalid signed data type"},
92     {ERR_REASON(PKCS7_R_MIME_NO_CONTENT_TYPE), "mime no content type"},
93     {ERR_REASON(PKCS7_R_MIME_PARSE_ERROR), "mime parse error"},
94     {ERR_REASON(PKCS7_R_MIME_SIG_PARSE_ERROR), "mime sig parse error"},
95     {ERR_REASON(PKCS7_R_MISSING_CERIPEND_INFO), "missing ceripend info"},
96     {ERR_REASON(PKCS7_R_NO_CONTENT), "no content"},
97     {ERR_REASON(PKCS7_R_NO_CONTENT_TYPE), "no content type"},
98     {ERR_REASON(PKCS7_R_NO_DEFAULT_DIGEST), "no default digest"},
99     {ERR_REASON(PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND),
100      "no matching digest type found"},
101     {ERR_REASON(PKCS7_R_NO_MULTIPART_BODY_FAILURE),
102      "no multipart body failure"},
103     {ERR_REASON(PKCS7_R_NO_MULTIPART_BOUNDARY), "no multipart boundary"},
104     {ERR_REASON(PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE),
105      "no recipient matches certificate"},
106     {ERR_REASON(PKCS7_R_NO_RECIPIENT_MATCHES_KEY), "no recipient matches key"},
107     {ERR_REASON(PKCS7_R_NO_SIGNATURES_ON_DATA), "no signatures on data"},
108     {ERR_REASON(PKCS7_R_NO_SIGNERS), "no signers"},
109     {ERR_REASON(PKCS7_R_NO_SIG_CONTENT_TYPE), "no sig content type"},
110     {ERR_REASON(PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE),
111      "operation not supported on this type"},
112     {ERR_REASON(PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR),
113      "pkcs7 add signature error"},
114     {ERR_REASON(PKCS7_R_PKCS7_ADD_SIGNER_ERROR), "pkcs7 add signer error"},
115     {ERR_REASON(PKCS7_R_PKCS7_DATAFINAL), "pkcs7 datafinal"},
116     {ERR_REASON(PKCS7_R_PKCS7_DATAFINAL_ERROR), "pkcs7 datafinal error"},
117     {ERR_REASON(PKCS7_R_PKCS7_DATASIGN), "pkcs7 datasign"},
118     {ERR_REASON(PKCS7_R_PKCS7_PARSE_ERROR), "pkcs7 parse error"},
119     {ERR_REASON(PKCS7_R_PKCS7_SIG_PARSE_ERROR), "pkcs7 sig parse error"},
120     {ERR_REASON(PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE),
121      "private key does not match certificate"},
122     {ERR_REASON(PKCS7_R_SIGNATURE_FAILURE), "signature failure"},
123     {ERR_REASON(PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND),
124      "signer certificate not found"},
125     {ERR_REASON(PKCS7_R_SIGNING_CTRL_FAILURE), "signing ctrl failure"},
126     {ERR_REASON(PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),
127      "signing not supported for this key type"},
128     {ERR_REASON(PKCS7_R_SIG_INVALID_MIME_TYPE), "sig invalid mime type"},
129     {ERR_REASON(PKCS7_R_SMIME_TEXT_ERROR), "smime text error"},
130     {ERR_REASON(PKCS7_R_UNABLE_TO_FIND_CERTIFICATE),
131      "unable to find certificate"},
132     {ERR_REASON(PKCS7_R_UNABLE_TO_FIND_MEM_BIO), "unable to find mem bio"},
133     {ERR_REASON(PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST),
134      "unable to find message digest"},
135     {ERR_REASON(PKCS7_R_UNKNOWN_DIGEST_TYPE), "unknown digest type"},
136     {ERR_REASON(PKCS7_R_UNKNOWN_OPERATION), "unknown operation"},
137     {ERR_REASON(PKCS7_R_UNSUPPORTED_CIPHER_TYPE), "unsupported cipher type"},
138     {ERR_REASON(PKCS7_R_UNSUPPORTED_CONTENT_TYPE), "unsupported content type"},
139     {ERR_REASON(PKCS7_R_WRONG_CONTENT_TYPE), "wrong content type"},
140     {ERR_REASON(PKCS7_R_WRONG_PKCS7_TYPE), "wrong pkcs7 type"},
141     {0, NULL}
142 };
143
144 #endif
145
146 void ERR_load_PKCS7_strings(void)
147 {
148 #ifndef OPENSSL_NO_ERR
149
150     if (ERR_func_error_string(PKCS7_str_functs[0].error) == NULL) {
151         ERR_load_strings(0, PKCS7_str_functs);
152         ERR_load_strings(0, PKCS7_str_reasons);
153     }
154 #endif
155 }