Initial support for enveloped data decrypt. Extent runex.pl to cover these
[openssl.git] / crypto / cms / cms_err.c
1 /* crypto/cms/cms_err.c */
2 /* ====================================================================
3  * Copyright (c) 1999-2007 The OpenSSL Project.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer. 
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in
14  *    the documentation and/or other materials provided with the
15  *    distribution.
16  *
17  * 3. All advertising materials mentioning features or use of this
18  *    software must display the following acknowledgment:
19  *    "This product includes software developed by the OpenSSL Project
20  *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
21  *
22  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23  *    endorse or promote products derived from this software without
24  *    prior written permission. For written permission, please contact
25  *    openssl-core@OpenSSL.org.
26  *
27  * 5. Products derived from this software may not be called "OpenSSL"
28  *    nor may "OpenSSL" appear in their names without prior written
29  *    permission of the OpenSSL Project.
30  *
31  * 6. Redistributions of any form whatsoever must retain the following
32  *    acknowledgment:
33  *    "This product includes software developed by the OpenSSL Project
34  *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
35  *
36  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47  * OF THE POSSIBILITY OF SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This product includes cryptographic software written by Eric Young
51  * (eay@cryptsoft.com).  This product includes software written by Tim
52  * Hudson (tjh@cryptsoft.com).
53  *
54  */
55
56 /* NOTE: this file was auto generated by the mkerr.pl script: any changes
57  * made to it will be overwritten when the script next updates this file,
58  * only reason strings will be preserved.
59  */
60
61 #include <stdio.h>
62 #include <openssl/err.h>
63 #include <openssl/cms.h>
64
65 /* BEGIN ERROR CODES */
66 #ifndef OPENSSL_NO_ERR
67
68 #define ERR_FUNC(func) ERR_PACK(ERR_LIB_CMS,func,0)
69 #define ERR_REASON(reason) ERR_PACK(ERR_LIB_CMS,0,reason)
70
71 static ERR_STRING_DATA CMS_str_functs[]=
72         {
73 {ERR_FUNC(CMS_F_CHECK_CONTENT), "CHECK_CONTENT"},
74 {ERR_FUNC(CMS_F_CMS_ADD1_RECIPIENT_CERT),       "CMS_ADD1_RECIPIENT_CERT"},
75 {ERR_FUNC(CMS_F_CMS_ADD1_SIGNER),       "CMS_add1_signer"},
76 {ERR_FUNC(CMS_F_CMS_ADD1_SIGNINGTIME),  "CMS_ADD1_SIGNINGTIME"},
77 {ERR_FUNC(CMS_F_CMS_BIO_TO_ENCRYPTEDCONTENT),   "CMS_BIO_TO_ENCRYPTEDCONTENT"},
78 {ERR_FUNC(CMS_F_CMS_BIO_TO_ENCRYPTEDCONTENT_BIO),       "CMS_BIO_TO_ENCRYPTEDCONTENT_BIO"},
79 {ERR_FUNC(CMS_F_CMS_COMPRESS),  "CMS_compress"},
80 {ERR_FUNC(CMS_F_CMS_COMPRESSEDDATA_CREATE),     "CMS_COMPRESSEDDATA_CREATE"},
81 {ERR_FUNC(CMS_F_CMS_COMPRESSEDDATA_INIT_BIO),   "CMS_COMPRESSEDDATA_INIT_BIO"},
82 {ERR_FUNC(CMS_F_CMS_COPY_CONTENT),      "CMS_COPY_CONTENT"},
83 {ERR_FUNC(CMS_F_CMS_COPY_MESSAGEDIGEST),        "CMS_COPY_MESSAGEDIGEST"},
84 {ERR_FUNC(CMS_F_CMS_DATA),      "CMS_data"},
85 {ERR_FUNC(CMS_F_CMS_DATAFINAL), "CMS_dataFinal"},
86 {ERR_FUNC(CMS_F_CMS_DATAINIT),  "CMS_dataInit"},
87 {ERR_FUNC(CMS_F_CMS_DECRYPT),   "CMS_decrypt"},
88 {ERR_FUNC(CMS_F_CMS_DECRYPTEDCONTENT_DECRYPT_BIO),      "CMS_DECRYPTEDCONTENT_DECRYPT_BIO"},
89 {ERR_FUNC(CMS_F_CMS_DECRYPTEDCONTENT_ENCRYPT_BIO),      "CMS_DECRYPTEDCONTENT_ENCRYPT_BIO"},
90 {ERR_FUNC(CMS_F_CMS_DIGESTALGORITHM_FIND_CTX),  "CMS_DIGESTALGORITHM_FIND_CTX"},
91 {ERR_FUNC(CMS_F_CMS_DIGESTALGORITHM_INIT_BIO),  "CMS_DIGESTALGORITHM_INIT_BIO"},
92 {ERR_FUNC(CMS_F_CMS_DIGESTEDDATA_DO_FINAL),     "CMS_DIGESTEDDATA_DO_FINAL"},
93 {ERR_FUNC(CMS_F_CMS_DIGEST_VERIFY),     "CMS_digest_verify"},
94 {ERR_FUNC(CMS_F_CMS_ENCRYPTEDCONTENT_DECRYPT_BIO),      "CMS_ENCRYPTEDCONTENT_DECRYPT_BIO"},
95 {ERR_FUNC(CMS_F_CMS_ENCRYPTEDCONTENT_ENCRYPT_BIO),      "CMS_ENCRYPTEDCONTENT_ENCRYPT_BIO"},
96 {ERR_FUNC(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO), "CMS_ENCRYPTEDCONTENT_INIT_BIO"},
97 {ERR_FUNC(CMS_F_CMS_ENCRYPTEDCONTENT_TO_BIO),   "CMS_ENCRYPTEDCONTENT_TO_BIO"},
98 {ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_DECRYPT),     "CMS_EncryptedData_decrypt"},
99 {ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT),     "CMS_EncryptedData_encrypt"},
100 {ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_INIT_BIO),    "CMS_ENCRYPTEDDATA_INIT_BIO"},
101 {ERR_FUNC(CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY),    "CMS_EncryptedData_set1_key"},
102 {ERR_FUNC(CMS_F_CMS_ENCRYPTED_DATA_DECRYPT),    "CMS_ENCRYPTED_DATA_DECRYPT"},
103 {ERR_FUNC(CMS_F_CMS_ENVELOPED_DATA_INIT),       "CMS_ENVELOPED_DATA_INIT"},
104 {ERR_FUNC(CMS_F_CMS_FINAL),     "CMS_final"},
105 {ERR_FUNC(CMS_F_CMS_GET0_CERTIFICATE_CHOICES),  "CMS_GET0_CERTIFICATE_CHOICES"},
106 {ERR_FUNC(CMS_F_CMS_GET0_CONTENT),      "CMS_get0_content"},
107 {ERR_FUNC(CMS_F_CMS_GET0_ECONTENT_TYPE),        "CMS_GET0_ECONTENT_TYPE"},
108 {ERR_FUNC(CMS_F_CMS_GET0_ENVELOPED),    "CMS_GET0_ENVELOPED"},
109 {ERR_FUNC(CMS_F_CMS_GET0_REVOCATION_CHOICES),   "CMS_GET0_REVOCATION_CHOICES"},
110 {ERR_FUNC(CMS_F_CMS_GET0_SIGNED),       "CMS_GET0_SIGNED"},
111 {ERR_FUNC(CMS_F_CMS_RECIPIENTINFO_DECRYPT),     "CMS_RecipientInfo_decrypt"},
112 {ERR_FUNC(CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP),       "CMS_RecipientInfo_ktri_cert_cmp"},
113 {ERR_FUNC(CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS),      "CMS_RecipientInfo_ktri_get0_algs"},
114 {ERR_FUNC(CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID), "CMS_RecipientInfo_ktri_get0_signer_id"},
115 {ERR_FUNC(CMS_F_CMS_SET1_SIGNERIDENTIFIER),     "CMS_SET1_SIGNERIDENTIFIER"},
116 {ERR_FUNC(CMS_F_CMS_SET_DETACHED),      "CMS_set_detached"},
117 {ERR_FUNC(CMS_F_CMS_SIGN),      "CMS_sign"},
118 {ERR_FUNC(CMS_F_CMS_SIGNED_DATA_INIT),  "CMS_SIGNED_DATA_INIT"},
119 {ERR_FUNC(CMS_F_CMS_SIGNERINFO_CONTENT_SIGN),   "CMS_SIGNERINFO_CONTENT_SIGN"},
120 {ERR_FUNC(CMS_F_CMS_SIGNERINFO_SIGN),   "CMS_SignerInfo_sign"},
121 {ERR_FUNC(CMS_F_CMS_SIGNERINFO_VERIFY), "CMS_SignerInfo_verify"},
122 {ERR_FUNC(CMS_F_CMS_SIGNERINFO_VERIFY_CERT),    "CMS_SIGNERINFO_VERIFY_CERT"},
123 {ERR_FUNC(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT), "CMS_SignerInfo_verify_content"},
124 {ERR_FUNC(CMS_F_CMS_STREAM),    "CMS_stream"},
125 {ERR_FUNC(CMS_F_CMS_UNCOMPRESS),        "CMS_uncompress"},
126 {ERR_FUNC(CMS_F_CMS_VERIFY),    "CMS_verify"},
127 {0,NULL}
128         };
129
130 static ERR_STRING_DATA CMS_str_reasons[]=
131         {
132 {ERR_REASON(CMS_R_ADD_SIGNER_ERROR)      ,"add signer error"},
133 {ERR_REASON(CMS_R_CERTIFICATE_VERIFY_ERROR),"certificate verify error"},
134 {ERR_REASON(CMS_R_CIPHER_INITIALISATION_ERROR),"cipher initialisation error"},
135 {ERR_REASON(CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR),"cipher parameter initialisation error"},
136 {ERR_REASON(CMS_R_CMS_DATAFINAL_ERROR)   ,"cms datafinal error"},
137 {ERR_REASON(CMS_R_CMS_LIB)               ,"cms lib"},
138 {ERR_REASON(CMS_R_CONTENT_NOT_FOUND)     ,"content not found"},
139 {ERR_REASON(CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA),"content type not compressed data"},
140 {ERR_REASON(CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA),"content type not enveloped data"},
141 {ERR_REASON(CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA),"content type not signed data"},
142 {ERR_REASON(CMS_R_CONTENT_VERIFY_ERROR)  ,"content verify error"},
143 {ERR_REASON(CMS_R_CTRL_ERROR)            ,"ctrl error"},
144 {ERR_REASON(CMS_R_CTRL_FAILURE)          ,"ctrl failure"},
145 {ERR_REASON(CMS_R_ERROR_GETTING_PUBLIC_KEY),"error getting public key"},
146 {ERR_REASON(CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE),"error reading messagedigest attribute"},
147 {ERR_REASON(CMS_R_INVALID_KEY_LENGTH)    ,"invalid key length"},
148 {ERR_REASON(CMS_R_MD_BIO_INIT_ERROR)     ,"md bio init error"},
149 {ERR_REASON(CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH),"messagedigest attribute wrong length"},
150 {ERR_REASON(CMS_R_MESSAGEDIGEST_WRONG_LENGTH),"messagedigest wrong length"},
151 {ERR_REASON(CMS_R_NOT_ENCRYPTED_DATA)    ,"not encrypted data"},
152 {ERR_REASON(CMS_R_NOT_KEY_TRANSPORT)     ,"not key transport"},
153 {ERR_REASON(CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),"not supported for this key type"},
154 {ERR_REASON(CMS_R_NO_CIPHER)             ,"no cipher"},
155 {ERR_REASON(CMS_R_NO_CONTENT)            ,"no content"},
156 {ERR_REASON(CMS_R_NO_DEFAULT_DIGEST)     ,"no default digest"},
157 {ERR_REASON(CMS_R_NO_DIGEST_SET)         ,"no digest set"},
158 {ERR_REASON(CMS_R_NO_MATCHING_DIGEST)    ,"no matching digest"},
159 {ERR_REASON(CMS_R_NO_MATCHING_RECIPIENT) ,"no matching recipient"},
160 {ERR_REASON(CMS_R_NO_PRIVATE_KEY)        ,"no private key"},
161 {ERR_REASON(CMS_R_NO_PUBLIC_KEY)         ,"no public key"},
162 {ERR_REASON(CMS_R_NO_SIGNERS)            ,"no signers"},
163 {ERR_REASON(CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE),"private key does not match certificate"},
164 {ERR_REASON(CMS_R_SIGNER_CERTIFICATE_NOT_FOUND),"signer certificate not found"},
165 {ERR_REASON(CMS_R_SIGNFINAL_ERROR)       ,"signfinal error"},
166 {ERR_REASON(CMS_R_SMIME_TEXT_ERROR)      ,"smime text error"},
167 {ERR_REASON(CMS_R_STORE_INIT_ERROR)      ,"store init error"},
168 {ERR_REASON(CMS_R_TYPE_NOT_COMPRESSED_DATA),"type not compressed data"},
169 {ERR_REASON(CMS_R_TYPE_NOT_DATA)         ,"type not data"},
170 {ERR_REASON(CMS_R_TYPE_NOT_DIGESTED_DATA),"type not digested data"},
171 {ERR_REASON(CMS_R_TYPE_NOT_ENCRYPTED_DATA),"type not encrypted data"},
172 {ERR_REASON(CMS_R_TYPE_NOT_ENVELOPED_DATA),"type not enveloped data"},
173 {ERR_REASON(CMS_R_UNABLE_TO_FINALIZE_CONTEXT),"unable to finalize context"},
174 {ERR_REASON(CMS_R_UNKNOWN_CIPHER)        ,"unknown cipher"},
175 {ERR_REASON(CMS_R_UNKNOWN_DIGEST_ALGORIHM),"unknown digest algorihm"},
176 {ERR_REASON(CMS_R_UNKNOWN_ID)            ,"unknown id"},
177 {ERR_REASON(CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM),"unsupported compression algorithm"},
178 {ERR_REASON(CMS_R_UNSUPPORTED_CONTENT_TYPE),"unsupported content type"},
179 {ERR_REASON(CMS_R_UNSUPPORTED_TYPE)      ,"unsupported type"},
180 {ERR_REASON(CMS_R_VERIFICATION_FAILURE)  ,"verification failure"},
181 {0,NULL}
182         };
183
184 #endif
185
186 void ERR_load_CMS_strings(void)
187         {
188 #ifndef OPENSSL_NO_ERR
189
190         if (ERR_func_error_string(CMS_str_functs[0].error) == NULL)
191                 {
192                 ERR_load_strings(0,CMS_str_functs);
193                 ERR_load_strings(0,CMS_str_reasons);
194                 }
195 #endif
196         }