xref: /dflybsd-src/crypto/libressl/include/openssl/cms.h (revision cca6fc5243d2098262ea81f83ad5b28d3b800f4a)
1*cca6fc52SDaniel Fojt /* $OpenBSD: cms.h,v 1.15 2019/08/11 10:15:30 jsing Exp $ */
2*cca6fc52SDaniel Fojt /*
3*cca6fc52SDaniel Fojt  * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
4*cca6fc52SDaniel Fojt  * project.
5*cca6fc52SDaniel Fojt  */
6*cca6fc52SDaniel Fojt /* ====================================================================
7*cca6fc52SDaniel Fojt  * Copyright (c) 2008 The OpenSSL Project.  All rights reserved.
8*cca6fc52SDaniel Fojt  *
9*cca6fc52SDaniel Fojt  * Redistribution and use in source and binary forms, with or without
10*cca6fc52SDaniel Fojt  * modification, are permitted provided that the following conditions
11*cca6fc52SDaniel Fojt  * are met:
12*cca6fc52SDaniel Fojt  *
13*cca6fc52SDaniel Fojt  * 1. Redistributions of source code must retain the above copyright
14*cca6fc52SDaniel Fojt  *    notice, this list of conditions and the following disclaimer.
15*cca6fc52SDaniel Fojt  *
16*cca6fc52SDaniel Fojt  * 2. Redistributions in binary form must reproduce the above copyright
17*cca6fc52SDaniel Fojt  *    notice, this list of conditions and the following disclaimer in
18*cca6fc52SDaniel Fojt  *    the documentation and/or other materials provided with the
19*cca6fc52SDaniel Fojt  *    distribution.
20*cca6fc52SDaniel Fojt  *
21*cca6fc52SDaniel Fojt  * 3. All advertising materials mentioning features or use of this
22*cca6fc52SDaniel Fojt  *    software must display the following acknowledgment:
23*cca6fc52SDaniel Fojt  *    "This product includes software developed by the OpenSSL Project
24*cca6fc52SDaniel Fojt  *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
25*cca6fc52SDaniel Fojt  *
26*cca6fc52SDaniel Fojt  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27*cca6fc52SDaniel Fojt  *    endorse or promote products derived from this software without
28*cca6fc52SDaniel Fojt  *    prior written permission. For written permission, please contact
29*cca6fc52SDaniel Fojt  *    licensing@OpenSSL.org.
30*cca6fc52SDaniel Fojt  *
31*cca6fc52SDaniel Fojt  * 5. Products derived from this software may not be called "OpenSSL"
32*cca6fc52SDaniel Fojt  *    nor may "OpenSSL" appear in their names without prior written
33*cca6fc52SDaniel Fojt  *    permission of the OpenSSL Project.
34*cca6fc52SDaniel Fojt  *
35*cca6fc52SDaniel Fojt  * 6. Redistributions of any form whatsoever must retain the following
36*cca6fc52SDaniel Fojt  *    acknowledgment:
37*cca6fc52SDaniel Fojt  *    "This product includes software developed by the OpenSSL Project
38*cca6fc52SDaniel Fojt  *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
39*cca6fc52SDaniel Fojt  *
40*cca6fc52SDaniel Fojt  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41*cca6fc52SDaniel Fojt  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42*cca6fc52SDaniel Fojt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43*cca6fc52SDaniel Fojt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
44*cca6fc52SDaniel Fojt  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45*cca6fc52SDaniel Fojt  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46*cca6fc52SDaniel Fojt  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47*cca6fc52SDaniel Fojt  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48*cca6fc52SDaniel Fojt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49*cca6fc52SDaniel Fojt  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50*cca6fc52SDaniel Fojt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51*cca6fc52SDaniel Fojt  * OF THE POSSIBILITY OF SUCH DAMAGE.
52*cca6fc52SDaniel Fojt  * ====================================================================
53*cca6fc52SDaniel Fojt  */
54*cca6fc52SDaniel Fojt 
55*cca6fc52SDaniel Fojt #ifndef HEADER_CMS_H
56*cca6fc52SDaniel Fojt #define HEADER_CMS_H
57*cca6fc52SDaniel Fojt 
58*cca6fc52SDaniel Fojt #include <openssl/opensslconf.h>
59*cca6fc52SDaniel Fojt 
60*cca6fc52SDaniel Fojt #ifndef OPENSSL_NO_CMS
61*cca6fc52SDaniel Fojt #include <openssl/x509.h>
62*cca6fc52SDaniel Fojt #include <openssl/x509v3.h>
63*cca6fc52SDaniel Fojt #ifdef __cplusplus
64*cca6fc52SDaniel Fojt extern "C" {
65*cca6fc52SDaniel Fojt #endif
66*cca6fc52SDaniel Fojt 
67*cca6fc52SDaniel Fojt typedef struct CMS_ContentInfo_st CMS_ContentInfo;
68*cca6fc52SDaniel Fojt typedef struct CMS_SignerInfo_st CMS_SignerInfo;
69*cca6fc52SDaniel Fojt typedef struct CMS_CertificateChoices CMS_CertificateChoices;
70*cca6fc52SDaniel Fojt typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
71*cca6fc52SDaniel Fojt typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
72*cca6fc52SDaniel Fojt typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
73*cca6fc52SDaniel Fojt typedef struct CMS_Receipt_st CMS_Receipt;
74*cca6fc52SDaniel Fojt typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
75*cca6fc52SDaniel Fojt typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
76*cca6fc52SDaniel Fojt 
77*cca6fc52SDaniel Fojt DECLARE_STACK_OF(CMS_SignerInfo)
78*cca6fc52SDaniel Fojt DECLARE_STACK_OF(CMS_RecipientEncryptedKey)
79*cca6fc52SDaniel Fojt DECLARE_STACK_OF(CMS_RecipientInfo)
80*cca6fc52SDaniel Fojt DECLARE_STACK_OF(CMS_RevocationInfoChoice)
81*cca6fc52SDaniel Fojt CMS_ContentInfo *CMS_ContentInfo_new(void);
82*cca6fc52SDaniel Fojt void CMS_ContentInfo_free(CMS_ContentInfo *a);
83*cca6fc52SDaniel Fojt CMS_ContentInfo *d2i_CMS_ContentInfo(CMS_ContentInfo **a, const unsigned char **in, long len);
84*cca6fc52SDaniel Fojt int i2d_CMS_ContentInfo(CMS_ContentInfo *a, unsigned char **out);
85*cca6fc52SDaniel Fojt extern const ASN1_ITEM CMS_ContentInfo_it;
86*cca6fc52SDaniel Fojt CMS_ReceiptRequest *CMS_ReceiptRequest_new(void);
87*cca6fc52SDaniel Fojt void CMS_ReceiptRequest_free(CMS_ReceiptRequest *a);
88*cca6fc52SDaniel Fojt CMS_ReceiptRequest *d2i_CMS_ReceiptRequest(CMS_ReceiptRequest **a, const unsigned char **in, long len);
89*cca6fc52SDaniel Fojt int i2d_CMS_ReceiptRequest(CMS_ReceiptRequest *a, unsigned char **out);
90*cca6fc52SDaniel Fojt extern const ASN1_ITEM CMS_ReceiptRequest_it;
91*cca6fc52SDaniel Fojt int CMS_ContentInfo_print_ctx(BIO *out, CMS_ContentInfo *x, int indent, const ASN1_PCTX *pctx);
92*cca6fc52SDaniel Fojt 
93*cca6fc52SDaniel Fojt #define CMS_SIGNERINFO_ISSUER_SERIAL    0
94*cca6fc52SDaniel Fojt #define CMS_SIGNERINFO_KEYIDENTIFIER    1
95*cca6fc52SDaniel Fojt 
96*cca6fc52SDaniel Fojt #define CMS_RECIPINFO_NONE              -1
97*cca6fc52SDaniel Fojt #define CMS_RECIPINFO_TRANS             0
98*cca6fc52SDaniel Fojt #define CMS_RECIPINFO_AGREE             1
99*cca6fc52SDaniel Fojt #define CMS_RECIPINFO_KEK               2
100*cca6fc52SDaniel Fojt #define CMS_RECIPINFO_PASS              3
101*cca6fc52SDaniel Fojt #define CMS_RECIPINFO_OTHER             4
102*cca6fc52SDaniel Fojt 
103*cca6fc52SDaniel Fojt /* S/MIME related flags */
104*cca6fc52SDaniel Fojt 
105*cca6fc52SDaniel Fojt #define CMS_TEXT                        0x1
106*cca6fc52SDaniel Fojt #define CMS_NOCERTS                     0x2
107*cca6fc52SDaniel Fojt #define CMS_NO_CONTENT_VERIFY           0x4
108*cca6fc52SDaniel Fojt #define CMS_NO_ATTR_VERIFY              0x8
109*cca6fc52SDaniel Fojt #define CMS_NOSIGS                      \
110*cca6fc52SDaniel Fojt                         (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
111*cca6fc52SDaniel Fojt #define CMS_NOINTERN                    0x10
112*cca6fc52SDaniel Fojt #define CMS_NO_SIGNER_CERT_VERIFY       0x20
113*cca6fc52SDaniel Fojt #define CMS_NOVERIFY                    0x20
114*cca6fc52SDaniel Fojt #define CMS_DETACHED                    0x40
115*cca6fc52SDaniel Fojt #define CMS_BINARY                      0x80
116*cca6fc52SDaniel Fojt #define CMS_NOATTR                      0x100
117*cca6fc52SDaniel Fojt #define CMS_NOSMIMECAP                  0x200
118*cca6fc52SDaniel Fojt #define CMS_NOOLDMIMETYPE               0x400
119*cca6fc52SDaniel Fojt #define CMS_CRLFEOL                     0x800
120*cca6fc52SDaniel Fojt #define CMS_STREAM                      0x1000
121*cca6fc52SDaniel Fojt #define CMS_NOCRL                       0x2000
122*cca6fc52SDaniel Fojt #define CMS_PARTIAL                     0x4000
123*cca6fc52SDaniel Fojt #define CMS_REUSE_DIGEST                0x8000
124*cca6fc52SDaniel Fojt #define CMS_USE_KEYID                   0x10000
125*cca6fc52SDaniel Fojt #define CMS_DEBUG_DECRYPT               0x20000
126*cca6fc52SDaniel Fojt #define CMS_KEY_PARAM                   0x40000
127*cca6fc52SDaniel Fojt #define CMS_ASCIICRLF                   0x80000
128*cca6fc52SDaniel Fojt 
129*cca6fc52SDaniel Fojt const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
130*cca6fc52SDaniel Fojt 
131*cca6fc52SDaniel Fojt BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
132*cca6fc52SDaniel Fojt int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
133*cca6fc52SDaniel Fojt 
134*cca6fc52SDaniel Fojt ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
135*cca6fc52SDaniel Fojt int CMS_is_detached(CMS_ContentInfo *cms);
136*cca6fc52SDaniel Fojt int CMS_set_detached(CMS_ContentInfo *cms, int detached);
137*cca6fc52SDaniel Fojt 
138*cca6fc52SDaniel Fojt #ifdef HEADER_PEM_H
139*cca6fc52SDaniel Fojt CMS_ContentInfo *PEM_read_bio_CMS(BIO *bp, CMS_ContentInfo **x,
140*cca6fc52SDaniel Fojt     pem_password_cb *cb, void *u);
141*cca6fc52SDaniel Fojt CMS_ContentInfo *PEM_read_CMS(FILE *fp, CMS_ContentInfo **x,
142*cca6fc52SDaniel Fojt     pem_password_cb *cb, void *u);
143*cca6fc52SDaniel Fojt int PEM_write_bio_CMS(BIO *bp, const CMS_ContentInfo *x);
144*cca6fc52SDaniel Fojt int PEM_write_CMS(FILE *fp, const CMS_ContentInfo *x);
145*cca6fc52SDaniel Fojt #endif
146*cca6fc52SDaniel Fojt int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
147*cca6fc52SDaniel Fojt CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
148*cca6fc52SDaniel Fojt int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
149*cca6fc52SDaniel Fojt 
150*cca6fc52SDaniel Fojt BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
151*cca6fc52SDaniel Fojt int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
152*cca6fc52SDaniel Fojt int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
153*cca6fc52SDaniel Fojt     int flags);
154*cca6fc52SDaniel Fojt CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
155*cca6fc52SDaniel Fojt int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
156*cca6fc52SDaniel Fojt 
157*cca6fc52SDaniel Fojt int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags);
158*cca6fc52SDaniel Fojt 
159*cca6fc52SDaniel Fojt CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
160*cca6fc52SDaniel Fojt     BIO *data, unsigned int flags);
161*cca6fc52SDaniel Fojt 
162*cca6fc52SDaniel Fojt CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert,
163*cca6fc52SDaniel Fojt     EVP_PKEY *pkey, STACK_OF(X509) *certs, unsigned int flags);
164*cca6fc52SDaniel Fojt 
165*cca6fc52SDaniel Fojt int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
166*cca6fc52SDaniel Fojt CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
167*cca6fc52SDaniel Fojt 
168*cca6fc52SDaniel Fojt int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
169*cca6fc52SDaniel Fojt     unsigned int flags);
170*cca6fc52SDaniel Fojt CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
171*cca6fc52SDaniel Fojt     unsigned int flags);
172*cca6fc52SDaniel Fojt 
173*cca6fc52SDaniel Fojt int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, const unsigned char *key,
174*cca6fc52SDaniel Fojt     size_t keylen, BIO *dcont, BIO *out, unsigned int flags);
175*cca6fc52SDaniel Fojt 
176*cca6fc52SDaniel Fojt CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
177*cca6fc52SDaniel Fojt     const unsigned char *key, size_t keylen, unsigned int flags);
178*cca6fc52SDaniel Fojt 
179*cca6fc52SDaniel Fojt int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
180*cca6fc52SDaniel Fojt     const unsigned char *key, size_t keylen);
181*cca6fc52SDaniel Fojt 
182*cca6fc52SDaniel Fojt int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
183*cca6fc52SDaniel Fojt     X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
184*cca6fc52SDaniel Fojt 
185*cca6fc52SDaniel Fojt int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
186*cca6fc52SDaniel Fojt     STACK_OF(X509) *certs, X509_STORE *store, unsigned int flags);
187*cca6fc52SDaniel Fojt 
188*cca6fc52SDaniel Fojt STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
189*cca6fc52SDaniel Fojt 
190*cca6fc52SDaniel Fojt CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
191*cca6fc52SDaniel Fojt     const EVP_CIPHER *cipher, unsigned int flags);
192*cca6fc52SDaniel Fojt 
193*cca6fc52SDaniel Fojt int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
194*cca6fc52SDaniel Fojt     BIO *dcont, BIO *out, unsigned int flags);
195*cca6fc52SDaniel Fojt 
196*cca6fc52SDaniel Fojt int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
197*cca6fc52SDaniel Fojt int CMS_decrypt_set1_key(CMS_ContentInfo *cms, unsigned char *key,
198*cca6fc52SDaniel Fojt     size_t keylen, const unsigned char *id, size_t idlen);
199*cca6fc52SDaniel Fojt int CMS_decrypt_set1_password(CMS_ContentInfo *cms, unsigned char *pass,
200*cca6fc52SDaniel Fojt     ssize_t passlen);
201*cca6fc52SDaniel Fojt 
202*cca6fc52SDaniel Fojt STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
203*cca6fc52SDaniel Fojt int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
204*cca6fc52SDaniel Fojt EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
205*cca6fc52SDaniel Fojt CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
206*cca6fc52SDaniel Fojt CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip,
207*cca6fc52SDaniel Fojt     unsigned int flags);
208*cca6fc52SDaniel Fojt int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
209*cca6fc52SDaniel Fojt int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
210*cca6fc52SDaniel Fojt int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, EVP_PKEY **pk,
211*cca6fc52SDaniel Fojt     X509 **recip, X509_ALGOR **palg);
212*cca6fc52SDaniel Fojt int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
213*cca6fc52SDaniel Fojt     ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno);
214*cca6fc52SDaniel Fojt 
215*cca6fc52SDaniel Fojt CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
216*cca6fc52SDaniel Fojt     unsigned char *key, size_t keylen, unsigned char *id, size_t idlen,
217*cca6fc52SDaniel Fojt     ASN1_GENERALIZEDTIME *date, ASN1_OBJECT *otherTypeId, ASN1_TYPE *otherType);
218*cca6fc52SDaniel Fojt 
219*cca6fc52SDaniel Fojt int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, X509_ALGOR **palg,
220*cca6fc52SDaniel Fojt     ASN1_OCTET_STRING **pid, ASN1_GENERALIZEDTIME **pdate,
221*cca6fc52SDaniel Fojt     ASN1_OBJECT **potherid, ASN1_TYPE **pothertype);
222*cca6fc52SDaniel Fojt 
223*cca6fc52SDaniel Fojt int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, unsigned char *key,
224*cca6fc52SDaniel Fojt     size_t keylen);
225*cca6fc52SDaniel Fojt 
226*cca6fc52SDaniel Fojt int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
227*cca6fc52SDaniel Fojt     const unsigned char *id, size_t idlen);
228*cca6fc52SDaniel Fojt 
229*cca6fc52SDaniel Fojt int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, unsigned char *pass,
230*cca6fc52SDaniel Fojt     ssize_t passlen);
231*cca6fc52SDaniel Fojt 
232*cca6fc52SDaniel Fojt CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms, int iter,
233*cca6fc52SDaniel Fojt     int wrap_nid, int pbe_nid, unsigned char *pass, ssize_t passlen,
234*cca6fc52SDaniel Fojt     const EVP_CIPHER *kekciph);
235*cca6fc52SDaniel Fojt 
236*cca6fc52SDaniel Fojt int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
237*cca6fc52SDaniel Fojt int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
238*cca6fc52SDaniel Fojt 
239*cca6fc52SDaniel Fojt int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
240*cca6fc52SDaniel Fojt     unsigned int flags);
241*cca6fc52SDaniel Fojt CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
242*cca6fc52SDaniel Fojt 
243*cca6fc52SDaniel Fojt int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
244*cca6fc52SDaniel Fojt const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
245*cca6fc52SDaniel Fojt 
246*cca6fc52SDaniel Fojt CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
247*cca6fc52SDaniel Fojt int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
248*cca6fc52SDaniel Fojt int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
249*cca6fc52SDaniel Fojt STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
250*cca6fc52SDaniel Fojt 
251*cca6fc52SDaniel Fojt CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
252*cca6fc52SDaniel Fojt int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
253*cca6fc52SDaniel Fojt int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
254*cca6fc52SDaniel Fojt STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
255*cca6fc52SDaniel Fojt 
256*cca6fc52SDaniel Fojt int CMS_SignedData_init(CMS_ContentInfo *cms);
257*cca6fc52SDaniel Fojt CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, X509 *signer,
258*cca6fc52SDaniel Fojt     EVP_PKEY *pk, const EVP_MD *md, unsigned int flags);
259*cca6fc52SDaniel Fojt EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
260*cca6fc52SDaniel Fojt EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
261*cca6fc52SDaniel Fojt STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
262*cca6fc52SDaniel Fojt 
263*cca6fc52SDaniel Fojt void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
264*cca6fc52SDaniel Fojt int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid,
265*cca6fc52SDaniel Fojt     X509_NAME **issuer, ASN1_INTEGER **sno);
266*cca6fc52SDaniel Fojt int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
267*cca6fc52SDaniel Fojt int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
268*cca6fc52SDaniel Fojt     unsigned int flags);
269*cca6fc52SDaniel Fojt void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, X509 **signer,
270*cca6fc52SDaniel Fojt     X509_ALGOR **pdig, X509_ALGOR **psig);
271*cca6fc52SDaniel Fojt ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
272*cca6fc52SDaniel Fojt int CMS_SignerInfo_sign(CMS_SignerInfo *si);
273*cca6fc52SDaniel Fojt int CMS_SignerInfo_verify(CMS_SignerInfo *si);
274*cca6fc52SDaniel Fojt int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
275*cca6fc52SDaniel Fojt 
276*cca6fc52SDaniel Fojt int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
277*cca6fc52SDaniel Fojt int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs, int algnid,
278*cca6fc52SDaniel Fojt     int keysize);
279*cca6fc52SDaniel Fojt int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
280*cca6fc52SDaniel Fojt 
281*cca6fc52SDaniel Fojt int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
282*cca6fc52SDaniel Fojt int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, int lastpos);
283*cca6fc52SDaniel Fojt int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj,
284*cca6fc52SDaniel Fojt     int lastpos);
285*cca6fc52SDaniel Fojt X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
286*cca6fc52SDaniel Fojt X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
287*cca6fc52SDaniel Fojt int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
288*cca6fc52SDaniel Fojt int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *obj,
289*cca6fc52SDaniel Fojt     int type, const void *bytes, int len);
290*cca6fc52SDaniel Fojt int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, int nid, int type,
291*cca6fc52SDaniel Fojt     const void *bytes, int len);
292*cca6fc52SDaniel Fojt int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
293*cca6fc52SDaniel Fojt     const char *attrname, int type, const void *bytes, int len);
294*cca6fc52SDaniel Fojt void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *oid,
295*cca6fc52SDaniel Fojt     int lastpos, int type);
296*cca6fc52SDaniel Fojt 
297*cca6fc52SDaniel Fojt int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
298*cca6fc52SDaniel Fojt int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
299*cca6fc52SDaniel Fojt     int lastpos);
300*cca6fc52SDaniel Fojt int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si,
301*cca6fc52SDaniel Fojt     const ASN1_OBJECT *obj, int lastpos);
302*cca6fc52SDaniel Fojt X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
303*cca6fc52SDaniel Fojt X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
304*cca6fc52SDaniel Fojt int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
305*cca6fc52SDaniel Fojt int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
306*cca6fc52SDaniel Fojt     const ASN1_OBJECT *obj, int type, const void *bytes, int len);
307*cca6fc52SDaniel Fojt int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, int nid, int type,
308*cca6fc52SDaniel Fojt     const void *bytes, int len);
309*cca6fc52SDaniel Fojt int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si, const char *attrname,
310*cca6fc52SDaniel Fojt     int type, const void *bytes, int len);
311*cca6fc52SDaniel Fojt void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
312*cca6fc52SDaniel Fojt     int lastpos, int type);
313*cca6fc52SDaniel Fojt 
314*cca6fc52SDaniel Fojt #ifdef HEADER_X509V3_H
315*cca6fc52SDaniel Fojt 
316*cca6fc52SDaniel Fojt int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
317*cca6fc52SDaniel Fojt CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
318*cca6fc52SDaniel Fojt     int allorfirst, STACK_OF(GENERAL_NAMES) *receiptList,
319*cca6fc52SDaniel Fojt     STACK_OF(GENERAL_NAMES) *receiptsTo);
320*cca6fc52SDaniel Fojt int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
321*cca6fc52SDaniel Fojt void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, ASN1_STRING **pcid,
322*cca6fc52SDaniel Fojt     int *pallorfirst, STACK_OF(GENERAL_NAMES) **plist,
323*cca6fc52SDaniel Fojt     STACK_OF(GENERAL_NAMES) **prto);
324*cca6fc52SDaniel Fojt #endif
325*cca6fc52SDaniel Fojt int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri, X509_ALGOR **palg,
326*cca6fc52SDaniel Fojt     ASN1_OCTET_STRING **pukm);
327*cca6fc52SDaniel Fojt STACK_OF(CMS_RecipientEncryptedKey) *
328*cca6fc52SDaniel Fojt     CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
329*cca6fc52SDaniel Fojt 
330*cca6fc52SDaniel Fojt int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
331*cca6fc52SDaniel Fojt     X509_ALGOR **pubalg, ASN1_BIT_STRING **pubkey, ASN1_OCTET_STRING **keyid,
332*cca6fc52SDaniel Fojt     X509_NAME **issuer, ASN1_INTEGER **sno);
333*cca6fc52SDaniel Fojt 
334*cca6fc52SDaniel Fojt int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
335*cca6fc52SDaniel Fojt 
336*cca6fc52SDaniel Fojt int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
337*cca6fc52SDaniel Fojt     ASN1_OCTET_STRING **keyid, ASN1_GENERALIZEDTIME **tm,
338*cca6fc52SDaniel Fojt     CMS_OtherKeyAttribute **other, X509_NAME **issuer, ASN1_INTEGER **sno);
339*cca6fc52SDaniel Fojt int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
340*cca6fc52SDaniel Fojt     X509 *cert);
341*cca6fc52SDaniel Fojt int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
342*cca6fc52SDaniel Fojt EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
343*cca6fc52SDaniel Fojt int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
344*cca6fc52SDaniel Fojt     CMS_RecipientInfo *ri, CMS_RecipientEncryptedKey *rek);
345*cca6fc52SDaniel Fojt 
346*cca6fc52SDaniel Fojt int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
347*cca6fc52SDaniel Fojt     ASN1_OCTET_STRING *ukm, int keylen);
348*cca6fc52SDaniel Fojt 
349*cca6fc52SDaniel Fojt /* Backward compatibility for spelling errors. */
350*cca6fc52SDaniel Fojt #define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM
351*cca6fc52SDaniel Fojt #define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \
352*cca6fc52SDaniel Fojt     CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
353*cca6fc52SDaniel Fojt 
354*cca6fc52SDaniel Fojt int ERR_load_CMS_strings(void);
355*cca6fc52SDaniel Fojt 
356*cca6fc52SDaniel Fojt /*
357*cca6fc52SDaniel Fojt  * CMS function codes.
358*cca6fc52SDaniel Fojt  */
359*cca6fc52SDaniel Fojt #define CMS_F_CHECK_CONTENT                              99
360*cca6fc52SDaniel Fojt #define CMS_F_CMS_ADD0_CERT                              164
361*cca6fc52SDaniel Fojt #define CMS_F_CMS_ADD0_RECIPIENT_KEY                     100
362*cca6fc52SDaniel Fojt #define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD                165
363*cca6fc52SDaniel Fojt #define CMS_F_CMS_ADD1_RECEIPTREQUEST                    158
364*cca6fc52SDaniel Fojt #define CMS_F_CMS_ADD1_RECIPIENT_CERT                    101
365*cca6fc52SDaniel Fojt #define CMS_F_CMS_ADD1_SIGNER                            102
366*cca6fc52SDaniel Fojt #define CMS_F_CMS_ADD1_SIGNINGTIME                       103
367*cca6fc52SDaniel Fojt #define CMS_F_CMS_COMPRESS                               104
368*cca6fc52SDaniel Fojt #define CMS_F_CMS_COMPRESSEDDATA_CREATE                  105
369*cca6fc52SDaniel Fojt #define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO                106
370*cca6fc52SDaniel Fojt #define CMS_F_CMS_COPY_CONTENT                           107
371*cca6fc52SDaniel Fojt #define CMS_F_CMS_COPY_MESSAGEDIGEST                     108
372*cca6fc52SDaniel Fojt #define CMS_F_CMS_DATA                                   109
373*cca6fc52SDaniel Fojt #define CMS_F_CMS_DATAFINAL                              110
374*cca6fc52SDaniel Fojt #define CMS_F_CMS_DATAINIT                               111
375*cca6fc52SDaniel Fojt #define CMS_F_CMS_DECRYPT                                112
376*cca6fc52SDaniel Fojt #define CMS_F_CMS_DECRYPT_SET1_KEY                       113
377*cca6fc52SDaniel Fojt #define CMS_F_CMS_DECRYPT_SET1_PASSWORD                  166
378*cca6fc52SDaniel Fojt #define CMS_F_CMS_DECRYPT_SET1_PKEY                      114
379*cca6fc52SDaniel Fojt #define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX               115
380*cca6fc52SDaniel Fojt #define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO               116
381*cca6fc52SDaniel Fojt #define CMS_F_CMS_DIGESTEDDATA_DO_FINAL                  117
382*cca6fc52SDaniel Fojt #define CMS_F_CMS_DIGEST_VERIFY                          118
383*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENCODE_RECEIPT                         161
384*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENCRYPT                                119
385*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENCRYPTEDCONTENT_INIT                  179
386*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO              120
387*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT                  121
388*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT                  122
389*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY                 123
390*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENVELOPEDDATA_CREATE                   124
391*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO                 125
392*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENVELOPED_DATA_INIT                    126
393*cca6fc52SDaniel Fojt #define CMS_F_CMS_ENV_ASN1_CTRL                          171
394*cca6fc52SDaniel Fojt #define CMS_F_CMS_FINAL                                  127
395*cca6fc52SDaniel Fojt #define CMS_F_CMS_GET0_CERTIFICATE_CHOICES               128
396*cca6fc52SDaniel Fojt #define CMS_F_CMS_GET0_CONTENT                           129
397*cca6fc52SDaniel Fojt #define CMS_F_CMS_GET0_ECONTENT_TYPE                     130
398*cca6fc52SDaniel Fojt #define CMS_F_CMS_GET0_ENVELOPED                         131
399*cca6fc52SDaniel Fojt #define CMS_F_CMS_GET0_REVOCATION_CHOICES                132
400*cca6fc52SDaniel Fojt #define CMS_F_CMS_GET0_SIGNED                            133
401*cca6fc52SDaniel Fojt #define CMS_F_CMS_MSGSIGDIGEST_ADD1                      162
402*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECEIPTREQUEST_CREATE0                 159
403*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECEIPT_VERIFY                         160
404*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_DECRYPT                  134
405*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_ENCRYPT                  169
406*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT             178
407*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG            175
408*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID        173
409*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS           172
410*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP         174
411*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT            135
412*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT            136
413*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID            137
414*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP             138
415*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP            139
416*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT             140
417*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT             141
418*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS           142
419*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID      143
420*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT               167
421*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_SET0_KEY                 144
422*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD            168
423*cca6fc52SDaniel Fojt #define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY                145
424*cca6fc52SDaniel Fojt #define CMS_F_CMS_SD_ASN1_CTRL                           170
425*cca6fc52SDaniel Fojt #define CMS_F_CMS_SET1_IAS                               176
426*cca6fc52SDaniel Fojt #define CMS_F_CMS_SET1_KEYID                             177
427*cca6fc52SDaniel Fojt #define CMS_F_CMS_SET1_SIGNERIDENTIFIER                  146
428*cca6fc52SDaniel Fojt #define CMS_F_CMS_SET_DETACHED                           147
429*cca6fc52SDaniel Fojt #define CMS_F_CMS_SIGN                                   148
430*cca6fc52SDaniel Fojt #define CMS_F_CMS_SIGNED_DATA_INIT                       149
431*cca6fc52SDaniel Fojt #define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN                150
432*cca6fc52SDaniel Fojt #define CMS_F_CMS_SIGNERINFO_SIGN                        151
433*cca6fc52SDaniel Fojt #define CMS_F_CMS_SIGNERINFO_VERIFY                      152
434*cca6fc52SDaniel Fojt #define CMS_F_CMS_SIGNERINFO_VERIFY_CERT                 153
435*cca6fc52SDaniel Fojt #define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT              154
436*cca6fc52SDaniel Fojt #define CMS_F_CMS_SIGN_RECEIPT                           163
437*cca6fc52SDaniel Fojt #define CMS_F_CMS_STREAM                                 155
438*cca6fc52SDaniel Fojt #define CMS_F_CMS_UNCOMPRESS                             156
439*cca6fc52SDaniel Fojt #define CMS_F_CMS_VERIFY                                 157
440*cca6fc52SDaniel Fojt #define CMS_F_KEK_UNWRAP_KEY                             180
441*cca6fc52SDaniel Fojt 
442*cca6fc52SDaniel Fojt /*
443*cca6fc52SDaniel Fojt  * CMS reason codes.
444*cca6fc52SDaniel Fojt  */
445*cca6fc52SDaniel Fojt #define CMS_R_ADD_SIGNER_ERROR                           99
446*cca6fc52SDaniel Fojt #define CMS_R_CERTIFICATE_ALREADY_PRESENT                175
447*cca6fc52SDaniel Fojt #define CMS_R_CERTIFICATE_HAS_NO_KEYID                   160
448*cca6fc52SDaniel Fojt #define CMS_R_CERTIFICATE_VERIFY_ERROR                   100
449*cca6fc52SDaniel Fojt #define CMS_R_CIPHER_INITIALISATION_ERROR                101
450*cca6fc52SDaniel Fojt #define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR      102
451*cca6fc52SDaniel Fojt #define CMS_R_CMS_DATAFINAL_ERROR                        103
452*cca6fc52SDaniel Fojt #define CMS_R_CMS_LIB                                    104
453*cca6fc52SDaniel Fojt #define CMS_R_CONTENTIDENTIFIER_MISMATCH                 170
454*cca6fc52SDaniel Fojt #define CMS_R_CONTENT_NOT_FOUND                          105
455*cca6fc52SDaniel Fojt #define CMS_R_CONTENT_TYPE_MISMATCH                      171
456*cca6fc52SDaniel Fojt #define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA           106
457*cca6fc52SDaniel Fojt #define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA            107
458*cca6fc52SDaniel Fojt #define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA               108
459*cca6fc52SDaniel Fojt #define CMS_R_CONTENT_VERIFY_ERROR                       109
460*cca6fc52SDaniel Fojt #define CMS_R_CTRL_ERROR                                 110
461*cca6fc52SDaniel Fojt #define CMS_R_CTRL_FAILURE                               111
462*cca6fc52SDaniel Fojt #define CMS_R_DECRYPT_ERROR                              112
463*cca6fc52SDaniel Fojt #define CMS_R_ERROR_GETTING_PUBLIC_KEY                   113
464*cca6fc52SDaniel Fojt #define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE      114
465*cca6fc52SDaniel Fojt #define CMS_R_ERROR_SETTING_KEY                          115
466*cca6fc52SDaniel Fojt #define CMS_R_ERROR_SETTING_RECIPIENTINFO                116
467*cca6fc52SDaniel Fojt #define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH               117
468*cca6fc52SDaniel Fojt #define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER           176
469*cca6fc52SDaniel Fojt #define CMS_R_INVALID_KEY_LENGTH                         118
470*cca6fc52SDaniel Fojt #define CMS_R_MD_BIO_INIT_ERROR                          119
471*cca6fc52SDaniel Fojt #define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH       120
472*cca6fc52SDaniel Fojt #define CMS_R_MESSAGEDIGEST_WRONG_LENGTH                 121
473*cca6fc52SDaniel Fojt #define CMS_R_MSGSIGDIGEST_ERROR                         172
474*cca6fc52SDaniel Fojt #define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE          162
475*cca6fc52SDaniel Fojt #define CMS_R_MSGSIGDIGEST_WRONG_LENGTH                  163
476*cca6fc52SDaniel Fojt #define CMS_R_NEED_ONE_SIGNER                            164
477*cca6fc52SDaniel Fojt #define CMS_R_NOT_A_SIGNED_RECEIPT                       165
478*cca6fc52SDaniel Fojt #define CMS_R_NOT_ENCRYPTED_DATA                         122
479*cca6fc52SDaniel Fojt #define CMS_R_NOT_KEK                                    123
480*cca6fc52SDaniel Fojt #define CMS_R_NOT_KEY_AGREEMENT                          181
481*cca6fc52SDaniel Fojt #define CMS_R_NOT_KEY_TRANSPORT                          124
482*cca6fc52SDaniel Fojt #define CMS_R_NOT_PWRI                                   177
483*cca6fc52SDaniel Fojt #define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE            125
484*cca6fc52SDaniel Fojt #define CMS_R_NO_CIPHER                                  126
485*cca6fc52SDaniel Fojt #define CMS_R_NO_CONTENT                                 127
486*cca6fc52SDaniel Fojt #define CMS_R_NO_CONTENT_TYPE                            173
487*cca6fc52SDaniel Fojt #define CMS_R_NO_DEFAULT_DIGEST                          128
488*cca6fc52SDaniel Fojt #define CMS_R_NO_DIGEST_SET                              129
489*cca6fc52SDaniel Fojt #define CMS_R_NO_KEY                                     130
490*cca6fc52SDaniel Fojt #define CMS_R_NO_KEY_OR_CERT                             174
491*cca6fc52SDaniel Fojt #define CMS_R_NO_MATCHING_DIGEST                         131
492*cca6fc52SDaniel Fojt #define CMS_R_NO_MATCHING_RECIPIENT                      132
493*cca6fc52SDaniel Fojt #define CMS_R_NO_MATCHING_SIGNATURE                      166
494*cca6fc52SDaniel Fojt #define CMS_R_NO_MSGSIGDIGEST                            167
495*cca6fc52SDaniel Fojt #define CMS_R_NO_PASSWORD                                178
496*cca6fc52SDaniel Fojt #define CMS_R_NO_PRIVATE_KEY                             133
497*cca6fc52SDaniel Fojt #define CMS_R_NO_PUBLIC_KEY                              134
498*cca6fc52SDaniel Fojt #define CMS_R_NO_RECEIPT_REQUEST                         168
499*cca6fc52SDaniel Fojt #define CMS_R_NO_SIGNERS                                 135
500*cca6fc52SDaniel Fojt #define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE     136
501*cca6fc52SDaniel Fojt #define CMS_R_RECEIPT_DECODE_ERROR                       169
502*cca6fc52SDaniel Fojt #define CMS_R_RECIPIENT_ERROR                            137
503*cca6fc52SDaniel Fojt #define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND               138
504*cca6fc52SDaniel Fojt #define CMS_R_SIGNFINAL_ERROR                            139
505*cca6fc52SDaniel Fojt #define CMS_R_SMIME_TEXT_ERROR                           140
506*cca6fc52SDaniel Fojt #define CMS_R_STORE_INIT_ERROR                           141
507*cca6fc52SDaniel Fojt #define CMS_R_TYPE_NOT_COMPRESSED_DATA                   142
508*cca6fc52SDaniel Fojt #define CMS_R_TYPE_NOT_DATA                              143
509*cca6fc52SDaniel Fojt #define CMS_R_TYPE_NOT_DIGESTED_DATA                     144
510*cca6fc52SDaniel Fojt #define CMS_R_TYPE_NOT_ENCRYPTED_DATA                    145
511*cca6fc52SDaniel Fojt #define CMS_R_TYPE_NOT_ENVELOPED_DATA                    146
512*cca6fc52SDaniel Fojt #define CMS_R_UNABLE_TO_FINALIZE_CONTEXT                 147
513*cca6fc52SDaniel Fojt #define CMS_R_UNKNOWN_CIPHER                             148
514*cca6fc52SDaniel Fojt #define CMS_R_UNKNOWN_DIGEST_ALGORITHM                   149
515*cca6fc52SDaniel Fojt #define CMS_R_UNKNOWN_ID                                 150
516*cca6fc52SDaniel Fojt #define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM          151
517*cca6fc52SDaniel Fojt #define CMS_R_UNSUPPORTED_CONTENT_TYPE                   152
518*cca6fc52SDaniel Fojt #define CMS_R_UNSUPPORTED_KEK_ALGORITHM                  153
519*cca6fc52SDaniel Fojt #define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM       179
520*cca6fc52SDaniel Fojt #define CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE             155
521*cca6fc52SDaniel Fojt #define CMS_R_UNSUPPORTED_RECIPIENT_TYPE                 154
522*cca6fc52SDaniel Fojt #define CMS_R_UNSUPPORTED_TYPE                           156
523*cca6fc52SDaniel Fojt #define CMS_R_UNWRAP_ERROR                               157
524*cca6fc52SDaniel Fojt #define CMS_R_UNWRAP_FAILURE                             180
525*cca6fc52SDaniel Fojt #define CMS_R_VERIFICATION_FAILURE                       158
526*cca6fc52SDaniel Fojt #define CMS_R_WRAP_ERROR                                 159
527*cca6fc52SDaniel Fojt 
528*cca6fc52SDaniel Fojt #ifdef  __cplusplus
529*cca6fc52SDaniel Fojt }
530*cca6fc52SDaniel Fojt #endif
531*cca6fc52SDaniel Fojt #endif
532*cca6fc52SDaniel Fojt #endif
533