summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cms/cms.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/cms/cms.h')
-rw-r--r--src/lib/libcrypto/cms/cms.h188
1 files changed, 80 insertions, 108 deletions
diff --git a/src/lib/libcrypto/cms/cms.h b/src/lib/libcrypto/cms/cms.h
index 150607469d..0a782d3163 100644
--- a/src/lib/libcrypto/cms/cms.h
+++ b/src/lib/libcrypto/cms/cms.h
@@ -10,7 +10,7 @@
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 14 *
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 16 * notice, this list of conditions and the following disclaimer in
@@ -132,110 +132,94 @@ int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
132 132
133BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms); 133BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
134int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags); 134int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
135int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags); 135int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
136 int flags);
136CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont); 137CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
137int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags); 138int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
138 139
139int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags); 140int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags);
140 141
141CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, 142CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
142 BIO *data, unsigned int flags); 143 STACK_OF(X509) *certs, BIO *data, unsigned int flags);
143 144
144CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, 145CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert,
145 X509 *signcert, EVP_PKEY *pkey, 146 EVP_PKEY *pkey, STACK_OF(X509) *certs, unsigned int flags);
146 STACK_OF(X509) *certs,
147 unsigned int flags);
148 147
149int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags); 148int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
150CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags); 149CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
151 150
152int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out, 151int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
153 unsigned int flags); 152 unsigned int flags);
154CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md, 153CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
155 unsigned int flags); 154 unsigned int flags);
156 155
157int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, 156int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, const unsigned char *key,
158 const unsigned char *key, size_t keylen, 157 size_t keylen, BIO *dcont, BIO *out, unsigned int flags);
159 BIO *dcont, BIO *out, unsigned int flags);
160 158
161CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher, 159CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
162 const unsigned char *key, size_t keylen, 160 const unsigned char *key, size_t keylen, unsigned int flags);
163 unsigned int flags);
164 161
165int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph, 162int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
166 const unsigned char *key, size_t keylen); 163 const unsigned char *key, size_t keylen);
167 164
168int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, 165int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
169 X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags); 166 X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
170 167
171int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, 168int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
172 STACK_OF(X509) *certs, 169 STACK_OF(X509) *certs, X509_STORE *store, unsigned int flags);
173 X509_STORE *store, unsigned int flags);
174 170
175STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); 171STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
176 172
177CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in, 173CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
178 const EVP_CIPHER *cipher, unsigned int flags); 174 const EVP_CIPHER *cipher, unsigned int flags);
175
176int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, BIO *dcont,
177 BIO *out, unsigned int flags);
179 178
180int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
181 BIO *dcont, BIO *out,
182 unsigned int flags);
183
184int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert); 179int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
185int CMS_decrypt_set1_key(CMS_ContentInfo *cms, 180int CMS_decrypt_set1_key(CMS_ContentInfo *cms, unsigned char *key,
186 unsigned char *key, size_t keylen, 181 size_t keylen, unsigned char *id, size_t idlen);
187 unsigned char *id, size_t idlen); 182int CMS_decrypt_set1_password(CMS_ContentInfo *cms, unsigned char *pass,
188int CMS_decrypt_set1_password(CMS_ContentInfo *cms, 183 ssize_t passlen);
189 unsigned char *pass, ssize_t passlen);
190 184
191STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); 185STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
192int CMS_RecipientInfo_type(CMS_RecipientInfo *ri); 186int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
193CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher); 187CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
194CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, 188CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip,
195 X509 *recip, unsigned int flags); 189 unsigned int flags);
196int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey); 190int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
197int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); 191int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
198int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, 192int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, EVP_PKEY **pk,
199 EVP_PKEY **pk, X509 **recip, 193 X509 **recip, X509_ALGOR **palg);
200 X509_ALGOR **palg);
201int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri, 194int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
202 ASN1_OCTET_STRING **keyid, 195 ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno);
203 X509_NAME **issuer, ASN1_INTEGER **sno);
204 196
205CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, 197CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
206 unsigned char *key, size_t keylen, 198 unsigned char *key, size_t keylen, unsigned char *id, size_t idlen,
207 unsigned char *id, size_t idlen, 199 ASN1_GENERALIZEDTIME *date, ASN1_OBJECT *otherTypeId,
208 ASN1_GENERALIZEDTIME *date, 200 ASN1_TYPE *otherType);
209 ASN1_OBJECT *otherTypeId, 201
210 ASN1_TYPE *otherType); 202int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, X509_ALGOR **palg,
211 203 ASN1_OCTET_STRING **pid, ASN1_GENERALIZEDTIME **pdate,
212int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, 204 ASN1_OBJECT **potherid, ASN1_TYPE **pothertype);
213 X509_ALGOR **palg, 205
214 ASN1_OCTET_STRING **pid, 206int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, unsigned char *key,
215 ASN1_GENERALIZEDTIME **pdate, 207 size_t keylen);
216 ASN1_OBJECT **potherid, 208
217 ASN1_TYPE **pothertype); 209int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
218 210 const unsigned char *id, size_t idlen);
219int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, 211
220 unsigned char *key, size_t keylen); 212int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, unsigned char *pass,
221 213 ssize_t passlen);
222int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, 214
223 const unsigned char *id, size_t idlen); 215CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms, int iter,
224 216 int wrap_nid, int pbe_nid, unsigned char *pass, ssize_t passlen,
225int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, 217 const EVP_CIPHER *kekciph);
226 unsigned char *pass,
227 ssize_t passlen);
228
229CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
230 int iter, int wrap_nid, int pbe_nid,
231 unsigned char *pass,
232 ssize_t passlen,
233 const EVP_CIPHER *kekciph);
234 218
235int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); 219int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
236 220
237int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, 221int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
238 unsigned int flags); 222 unsigned int flags);
239CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags); 223CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
240 224
241int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid); 225int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
@@ -252,82 +236,70 @@ int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
252STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); 236STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
253 237
254int CMS_SignedData_init(CMS_ContentInfo *cms); 238int CMS_SignedData_init(CMS_ContentInfo *cms);
255CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, 239CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, X509 *signer,
256 X509 *signer, EVP_PKEY *pk, const EVP_MD *md, 240 EVP_PKEY *pk, const EVP_MD *md, unsigned int flags);
257 unsigned int flags);
258STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); 241STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
259 242
260void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer); 243void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
261int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, 244int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
262 ASN1_OCTET_STRING **keyid, 245 ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno);
263 X509_NAME **issuer, ASN1_INTEGER **sno);
264int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert); 246int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
265int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs, 247int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
266 unsigned int flags); 248 unsigned int flags);
267void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, X509 **signer, 249void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, X509 **signer,
268 X509_ALGOR **pdig, X509_ALGOR **psig); 250 X509_ALGOR **pdig, X509_ALGOR **psig);
269int CMS_SignerInfo_sign(CMS_SignerInfo *si); 251int CMS_SignerInfo_sign(CMS_SignerInfo *si);
270int CMS_SignerInfo_verify(CMS_SignerInfo *si); 252int CMS_SignerInfo_verify(CMS_SignerInfo *si);
271int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain); 253int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
272 254
273int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs); 255int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
274int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs, 256int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs, int algnid,
275 int algnid, int keysize); 257 int keysize);
276int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap); 258int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
277 259
278int CMS_signed_get_attr_count(const CMS_SignerInfo *si); 260int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
279int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, 261int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, int lastpos);
280 int lastpos);
281int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj, 262int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,
282 int lastpos); 263 int lastpos);
283X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc); 264X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
284X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc); 265X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
285int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); 266int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
286int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, 267int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *obj,
287 const ASN1_OBJECT *obj, int type, 268 int type, const void *bytes, int len);
288 const void *bytes, int len); 269int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, int nid, int type,
289int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, 270 const void *bytes, int len);
290 int nid, int type, 271int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si, const char *attrname,
291 const void *bytes, int len); 272 int type, const void *bytes, int len);
292int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
293 const char *attrname, int type,
294 const void *bytes, int len);
295void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, 273void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
296 int lastpos, int type); 274 int lastpos, int type);
297 275
298int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si); 276int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
299int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid, 277int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
300 int lastpos); 278 int lastpos);
301int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj, 279int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,
302 int lastpos); 280 int lastpos);
303X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc); 281X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
304X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc); 282X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
305int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); 283int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
306int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si, 284int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *obj,
307 const ASN1_OBJECT *obj, int type, 285 int type, const void *bytes, int len);
308 const void *bytes, int len); 286int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, int nid, int type,
309int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, 287 const void *bytes, int len);
310 int nid, int type, 288int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si, const char *attrname,
311 const void *bytes, int len); 289 int type, const void *bytes, int len);
312int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
313 const char *attrname, int type,
314 const void *bytes, int len);
315void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, 290void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
316 int lastpos, int type); 291 int lastpos, int type);
317 292
318#ifdef HEADER_X509V3_H 293#ifdef HEADER_X509V3_H
319 294
320int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr); 295int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
321CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen, 296CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
322 int allorfirst, 297 int allorfirst, STACK_OF(GENERAL_NAMES) *receiptList,
323 STACK_OF(GENERAL_NAMES) *receiptList, 298 STACK_OF(GENERAL_NAMES) *receiptsTo);
324 STACK_OF(GENERAL_NAMES) *receiptsTo);
325int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr); 299int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
326void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, 300void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, ASN1_STRING **pcid,
327 ASN1_STRING **pcid, 301 int *pallorfirst, STACK_OF(GENERAL_NAMES) **plist,
328 int *pallorfirst, 302 STACK_OF(GENERAL_NAMES) **prto);
329 STACK_OF(GENERAL_NAMES) **plist,
330 STACK_OF(GENERAL_NAMES) **prto);
331 303
332#endif 304#endif
333 305