Add a warning stipulating how things should be coded in ossl_init_base
[openssl.git] / crypto / pkcs7 / pkcs7err.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/pkcs7.h>
14
15 /* BEGIN ERROR CODES */
16 #ifndef OPENSSL_NO_ERR
17
18 # define ERR_FUNC(func) ERR_PACK(ERR_LIB_PKCS7,func,0)
19 # define ERR_REASON(reason) ERR_PACK(ERR_LIB_PKCS7,0,reason)
20
21 static ERR_STRING_DATA PKCS7_str_functs[] = {
22     {ERR_FUNC(PKCS7_F_DO_PKCS7_SIGNED_ATTRIB), "do_pkcs7_signed_attrib"},
23     {ERR_FUNC(PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME),
24      "PKCS7_add0_attrib_signing_time"},
25     {ERR_FUNC(PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP),
26      "PKCS7_add_attrib_smimecap"},
27     {ERR_FUNC(PKCS7_F_PKCS7_ADD_CERTIFICATE), "PKCS7_add_certificate"},
28     {ERR_FUNC(PKCS7_F_PKCS7_ADD_CRL), "PKCS7_add_crl"},
29     {ERR_FUNC(PKCS7_F_PKCS7_ADD_RECIPIENT_INFO), "PKCS7_add_recipient_info"},
30     {ERR_FUNC(PKCS7_F_PKCS7_ADD_SIGNATURE), "PKCS7_add_signature"},
31     {ERR_FUNC(PKCS7_F_PKCS7_ADD_SIGNER), "PKCS7_add_signer"},
32     {ERR_FUNC(PKCS7_F_PKCS7_BIO_ADD_DIGEST), "PKCS7_bio_add_digest"},
33     {ERR_FUNC(PKCS7_F_PKCS7_COPY_EXISTING_DIGEST),
34      "pkcs7_copy_existing_digest"},
35     {ERR_FUNC(PKCS7_F_PKCS7_CTRL), "PKCS7_ctrl"},
36     {ERR_FUNC(PKCS7_F_PKCS7_DATADECODE), "PKCS7_dataDecode"},
37     {ERR_FUNC(PKCS7_F_PKCS7_DATAFINAL), "PKCS7_dataFinal"},
38     {ERR_FUNC(PKCS7_F_PKCS7_DATAINIT), "PKCS7_dataInit"},
39     {ERR_FUNC(PKCS7_F_PKCS7_DATAVERIFY), "PKCS7_dataVerify"},
40     {ERR_FUNC(PKCS7_F_PKCS7_DECRYPT), "PKCS7_decrypt"},
41     {ERR_FUNC(PKCS7_F_PKCS7_DECRYPT_RINFO), "pkcs7_decrypt_rinfo"},
42     {ERR_FUNC(PKCS7_F_PKCS7_ENCODE_RINFO), "pkcs7_encode_rinfo"},
43     {ERR_FUNC(PKCS7_F_PKCS7_ENCRYPT), "PKCS7_encrypt"},
44     {ERR_FUNC(PKCS7_F_PKCS7_FINAL), "PKCS7_final"},
45     {ERR_FUNC(PKCS7_F_PKCS7_FIND_DIGEST), "PKCS7_find_digest"},
46     {ERR_FUNC(PKCS7_F_PKCS7_GET0_SIGNERS), "PKCS7_get0_signers"},
47     {ERR_FUNC(PKCS7_F_PKCS7_RECIP_INFO_SET), "PKCS7_RECIP_INFO_set"},
48     {ERR_FUNC(PKCS7_F_PKCS7_SET_CIPHER), "PKCS7_set_cipher"},
49     {ERR_FUNC(PKCS7_F_PKCS7_SET_CONTENT), "PKCS7_set_content"},
50     {ERR_FUNC(PKCS7_F_PKCS7_SET_DIGEST), "PKCS7_set_digest"},
51     {ERR_FUNC(PKCS7_F_PKCS7_SET_TYPE), "PKCS7_set_type"},
52     {ERR_FUNC(PKCS7_F_PKCS7_SIGN), "PKCS7_sign"},
53     {ERR_FUNC(PKCS7_F_PKCS7_SIGNATUREVERIFY), "PKCS7_signatureVerify"},
54     {ERR_FUNC(PKCS7_F_PKCS7_SIGNER_INFO_SET), "PKCS7_SIGNER_INFO_set"},
55     {ERR_FUNC(PKCS7_F_PKCS7_SIGNER_INFO_SIGN), "PKCS7_SIGNER_INFO_sign"},
56     {ERR_FUNC(PKCS7_F_PKCS7_SIGN_ADD_SIGNER), "PKCS7_sign_add_signer"},
57     {ERR_FUNC(PKCS7_F_PKCS7_SIMPLE_SMIMECAP), "PKCS7_simple_smimecap"},
58     {ERR_FUNC(PKCS7_F_PKCS7_VERIFY), "PKCS7_verify"},
59     {0, NULL}
60 };
61
62 static ERR_STRING_DATA PKCS7_str_reasons[] = {
63     {ERR_REASON(PKCS7_R_CERTIFICATE_VERIFY_ERROR),
64      "certificate verify error"},
65     {ERR_REASON(PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER),
66      "cipher has no object identifier"},
67     {ERR_REASON(PKCS7_R_CIPHER_NOT_INITIALIZED), "cipher not initialized"},
68     {ERR_REASON(PKCS7_R_CONTENT_AND_DATA_PRESENT),
69      "content and data present"},
70     {ERR_REASON(PKCS7_R_CTRL_ERROR), "ctrl error"},
71     {ERR_REASON(PKCS7_R_DECRYPT_ERROR), "decrypt error"},
72     {ERR_REASON(PKCS7_R_DIGEST_FAILURE), "digest failure"},
73     {ERR_REASON(PKCS7_R_ENCRYPTION_CTRL_FAILURE), "encryption ctrl failure"},
74     {ERR_REASON(PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),
75      "encryption not supported for this key type"},
76     {ERR_REASON(PKCS7_R_ERROR_ADDING_RECIPIENT), "error adding recipient"},
77     {ERR_REASON(PKCS7_R_ERROR_SETTING_CIPHER), "error setting cipher"},
78     {ERR_REASON(PKCS7_R_INVALID_NULL_POINTER), "invalid null pointer"},
79     {ERR_REASON(PKCS7_R_INVALID_SIGNED_DATA_TYPE),
80      "invalid signed data type"},
81     {ERR_REASON(PKCS7_R_NO_CONTENT), "no content"},
82     {ERR_REASON(PKCS7_R_NO_DEFAULT_DIGEST), "no default digest"},
83     {ERR_REASON(PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND),
84      "no matching digest type found"},
85     {ERR_REASON(PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE),
86      "no recipient matches certificate"},
87     {ERR_REASON(PKCS7_R_NO_SIGNATURES_ON_DATA), "no signatures on data"},
88     {ERR_REASON(PKCS7_R_NO_SIGNERS), "no signers"},
89     {ERR_REASON(PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE),
90      "operation not supported on this type"},
91     {ERR_REASON(PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR),
92      "pkcs7 add signature error"},
93     {ERR_REASON(PKCS7_R_PKCS7_ADD_SIGNER_ERROR), "pkcs7 add signer error"},
94     {ERR_REASON(PKCS7_R_PKCS7_DATASIGN), "pkcs7 datasign"},
95     {ERR_REASON(PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE),
96      "private key does not match certificate"},
97     {ERR_REASON(PKCS7_R_SIGNATURE_FAILURE), "signature failure"},
98     {ERR_REASON(PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND),
99      "signer certificate not found"},
100     {ERR_REASON(PKCS7_R_SIGNING_CTRL_FAILURE), "signing ctrl failure"},
101     {ERR_REASON(PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE),
102      "signing not supported for this key type"},
103     {ERR_REASON(PKCS7_R_SMIME_TEXT_ERROR), "smime text error"},
104     {ERR_REASON(PKCS7_R_UNABLE_TO_FIND_CERTIFICATE),
105      "unable to find certificate"},
106     {ERR_REASON(PKCS7_R_UNABLE_TO_FIND_MEM_BIO), "unable to find mem bio"},
107     {ERR_REASON(PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST),
108      "unable to find message digest"},
109     {ERR_REASON(PKCS7_R_UNKNOWN_DIGEST_TYPE), "unknown digest type"},
110     {ERR_REASON(PKCS7_R_UNKNOWN_OPERATION), "unknown operation"},
111     {ERR_REASON(PKCS7_R_UNSUPPORTED_CIPHER_TYPE), "unsupported cipher type"},
112     {ERR_REASON(PKCS7_R_UNSUPPORTED_CONTENT_TYPE),
113      "unsupported content type"},
114     {ERR_REASON(PKCS7_R_WRONG_CONTENT_TYPE), "wrong content type"},
115     {ERR_REASON(PKCS7_R_WRONG_PKCS7_TYPE), "wrong pkcs7 type"},
116     {0, NULL}
117 };
118
119 #endif
120
121 int ERR_load_PKCS7_strings(void)
122 {
123 #ifndef OPENSSL_NO_ERR
124
125     if (ERR_func_error_string(PKCS7_str_functs[0].error) == NULL) {
126         ERR_load_strings(0, PKCS7_str_functs);
127         ERR_load_strings(0, PKCS7_str_reasons);
128     }
129 #endif
130     return 1;
131 }