summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2014-07-02 12:40:41 +0000
committerjsing <>2014-07-02 12:40:41 +0000
commit5d76c08888ad3e5028eaf3d231dc8b7a6401f5b7 (patch)
treeb30795902753a8648dfea061f384120dda253034 /src
parentae9d23f02624214dfa3102cd43e55bcff2a8b940 (diff)
downloadopenbsd-5d76c08888ad3e5028eaf3d231dc8b7a6401f5b7.tar.gz
openbsd-5d76c08888ad3e5028eaf3d231dc8b7a6401f5b7.tar.bz2
openbsd-5d76c08888ad3e5028eaf3d231dc8b7a6401f5b7.zip
KNF.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/pkcs7/pkcs7.h112
-rw-r--r--src/lib/libssl/src/crypto/pkcs7/pkcs7.h112
2 files changed, 102 insertions, 122 deletions
diff --git a/src/lib/libcrypto/pkcs7/pkcs7.h b/src/lib/libcrypto/pkcs7/pkcs7.h
index 37492fc7fe..609ce04553 100644
--- a/src/lib/libcrypto/pkcs7/pkcs7.h
+++ b/src/lib/libcrypto/pkcs7/pkcs7.h
@@ -1,25 +1,25 @@
1/* $OpenBSD: pkcs7.h,v 1.13 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pkcs7.h,v 1.14 2014/07/02 12:40:41 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com). 6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL. 7 * The implementation was written so as to conform with Netscapes SSL.
8 * 8 *
9 * This library is free for commercial and non-commercial use as long as 9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions 10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA, 11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation 12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms 13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com). 14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 * 15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in 16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed. 17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution 18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used. 19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or 20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package. 21 * in documentation (online or textual) provided with the package.
22 * 22 *
23 * Redistribution and use in source and binary forms, with or without 23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions 24 * modification, are permitted provided that the following conditions
25 * are met: 25 * are met:
@@ -34,10 +34,10 @@
34 * Eric Young (eay@cryptsoft.com)" 34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library 35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-). 36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from 37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement: 38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 * 40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE. 51 * SUCH DAMAGE.
52 * 52 *
53 * The licence and distribution terms for any publically available version or 53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be 54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
@@ -76,14 +76,12 @@ Digest_Encryption_ID rsaEncryption
76Key_Encryption_ID rsaEncryption 76Key_Encryption_ID rsaEncryption
77*/ 77*/
78 78
79typedef struct pkcs7_issuer_and_serial_st 79typedef struct pkcs7_issuer_and_serial_st {
80 {
81 X509_NAME *issuer; 80 X509_NAME *issuer;
82 ASN1_INTEGER *serial; 81 ASN1_INTEGER *serial;
83 } PKCS7_ISSUER_AND_SERIAL; 82} PKCS7_ISSUER_AND_SERIAL;
84 83
85typedef struct pkcs7_signer_info_st 84typedef struct pkcs7_signer_info_st {
86 {
87 ASN1_INTEGER *version; /* version 1 */ 85 ASN1_INTEGER *version; /* version 1 */
88 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; 86 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
89 X509_ALGOR *digest_alg; 87 X509_ALGOR *digest_alg;
@@ -94,25 +92,23 @@ typedef struct pkcs7_signer_info_st
94 92
95 /* The private key to sign with */ 93 /* The private key to sign with */
96 EVP_PKEY *pkey; 94 EVP_PKEY *pkey;
97 } PKCS7_SIGNER_INFO; 95} PKCS7_SIGNER_INFO;
98 96
99DECLARE_STACK_OF(PKCS7_SIGNER_INFO) 97DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
100DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) 98DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO)
101 99
102typedef struct pkcs7_recip_info_st 100typedef struct pkcs7_recip_info_st {
103 {
104 ASN1_INTEGER *version; /* version 0 */ 101 ASN1_INTEGER *version; /* version 0 */
105 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; 102 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
106 X509_ALGOR *key_enc_algor; 103 X509_ALGOR *key_enc_algor;
107 ASN1_OCTET_STRING *enc_key; 104 ASN1_OCTET_STRING *enc_key;
108 X509 *cert; /* get the pub-key from this */ 105 X509 *cert; /* get the pub-key from this */
109 } PKCS7_RECIP_INFO; 106} PKCS7_RECIP_INFO;
110 107
111DECLARE_STACK_OF(PKCS7_RECIP_INFO) 108DECLARE_STACK_OF(PKCS7_RECIP_INFO)
112DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) 109DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO)
113 110
114typedef struct pkcs7_signed_st 111typedef struct pkcs7_signed_st {
115 {
116 ASN1_INTEGER *version; /* version 1 */ 112 ASN1_INTEGER *version; /* version 1 */
117 STACK_OF(X509_ALGOR) *md_algs; /* md used */ 113 STACK_OF(X509_ALGOR) *md_algs; /* md used */
118 STACK_OF(X509) *cert; /* [ 0 ] */ 114 STACK_OF(X509) *cert; /* [ 0 ] */
@@ -120,27 +116,24 @@ typedef struct pkcs7_signed_st
120 STACK_OF(PKCS7_SIGNER_INFO) *signer_info; 116 STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
121 117
122 struct pkcs7_st *contents; 118 struct pkcs7_st *contents;
123 } PKCS7_SIGNED; 119} PKCS7_SIGNED;
124/* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. 120/* The above structure is very very similar to PKCS7_SIGN_ENVELOPE.
125 * How about merging the two */ 121 * How about merging the two */
126 122
127typedef struct pkcs7_enc_content_st 123typedef struct pkcs7_enc_content_st {
128 {
129 ASN1_OBJECT *content_type; 124 ASN1_OBJECT *content_type;
130 X509_ALGOR *algorithm; 125 X509_ALGOR *algorithm;
131 ASN1_OCTET_STRING *enc_data; /* [ 0 ] */ 126 ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
132 const EVP_CIPHER *cipher; 127 const EVP_CIPHER *cipher;
133 } PKCS7_ENC_CONTENT; 128} PKCS7_ENC_CONTENT;
134 129
135typedef struct pkcs7_enveloped_st 130typedef struct pkcs7_enveloped_st {
136 {
137 ASN1_INTEGER *version; /* version 0 */ 131 ASN1_INTEGER *version; /* version 0 */
138 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; 132 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
139 PKCS7_ENC_CONTENT *enc_data; 133 PKCS7_ENC_CONTENT *enc_data;
140 } PKCS7_ENVELOPE; 134} PKCS7_ENVELOPE;
141 135
142typedef struct pkcs7_signedandenveloped_st 136typedef struct pkcs7_signedandenveloped_st {
143 {
144 ASN1_INTEGER *version; /* version 1 */ 137 ASN1_INTEGER *version; /* version 1 */
145 STACK_OF(X509_ALGOR) *md_algs; /* md used */ 138 STACK_OF(X509_ALGOR) *md_algs; /* md used */
146 STACK_OF(X509) *cert; /* [ 0 ] */ 139 STACK_OF(X509) *cert; /* [ 0 ] */
@@ -149,24 +142,21 @@ typedef struct pkcs7_signedandenveloped_st
149 142
150 PKCS7_ENC_CONTENT *enc_data; 143 PKCS7_ENC_CONTENT *enc_data;
151 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; 144 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
152 } PKCS7_SIGN_ENVELOPE; 145} PKCS7_SIGN_ENVELOPE;
153 146
154typedef struct pkcs7_digest_st 147typedef struct pkcs7_digest_st {
155 {
156 ASN1_INTEGER *version; /* version 0 */ 148 ASN1_INTEGER *version; /* version 0 */
157 X509_ALGOR *md; /* md used */ 149 X509_ALGOR *md; /* md used */
158 struct pkcs7_st *contents; 150 struct pkcs7_st *contents;
159 ASN1_OCTET_STRING *digest; 151 ASN1_OCTET_STRING *digest;
160 } PKCS7_DIGEST; 152} PKCS7_DIGEST;
161 153
162typedef struct pkcs7_encrypted_st 154typedef struct pkcs7_encrypted_st {
163 {
164 ASN1_INTEGER *version; /* version 0 */ 155 ASN1_INTEGER *version; /* version 0 */
165 PKCS7_ENC_CONTENT *enc_data; 156 PKCS7_ENC_CONTENT *enc_data;
166 } PKCS7_ENCRYPT; 157} PKCS7_ENCRYPT;
167 158
168typedef struct pkcs7_st 159typedef struct pkcs7_st {
169 {
170 /* The following is non NULL if it contains ASN1 encoding of 160 /* The following is non NULL if it contains ASN1 encoding of
171 * this structure */ 161 * this structure */
172 unsigned char *asn1; 162 unsigned char *asn1;
@@ -206,8 +196,8 @@ typedef struct pkcs7_st
206 196
207 /* Anything else */ 197 /* Anything else */
208 ASN1_TYPE *other; 198 ASN1_TYPE *other;
209 } d; 199 } d;
210 } PKCS7; 200} PKCS7;
211 201
212DECLARE_STACK_OF(PKCS7) 202DECLARE_STACK_OF(PKCS7)
213DECLARE_ASN1_SET_OF(PKCS7) 203DECLARE_ASN1_SET_OF(PKCS7)
@@ -271,13 +261,13 @@ DECLARE_PKCS12_STACK_OF(PKCS7)
271 261
272DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) 262DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
273 263
274int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type, 264int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
275 unsigned char *md,unsigned int *len); 265 const EVP_MD *type, unsigned char *md, unsigned int *len);
276PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7); 266PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
277int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7); 267int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7);
278PKCS7 *PKCS7_dup(PKCS7 *p7); 268PKCS7 *PKCS7_dup(PKCS7 *p7);
279PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7); 269PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
280int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); 270int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7);
281int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); 271int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
282int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); 272int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
283 273
@@ -303,16 +293,16 @@ int PKCS7_set_type(PKCS7 *p7, int type);
303int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); 293int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
304int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); 294int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
305int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, 295int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
306 const EVP_MD *dgst); 296 const EVP_MD *dgst);
307int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); 297int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
308int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); 298int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
309int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); 299int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
310int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); 300int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
311int PKCS7_content_new(PKCS7 *p7, int nid); 301int PKCS7_content_new(PKCS7 *p7, int nid);
312int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, 302int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
313 BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); 303 BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
314int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, 304int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
315 X509 *x509); 305 X509 *x509);
316 306
317BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); 307BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
318int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); 308int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
@@ -320,14 +310,14 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
320 310
321 311
322PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, 312PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
323 EVP_PKEY *pkey, const EVP_MD *dgst); 313 EVP_PKEY *pkey, const EVP_MD *dgst);
324X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); 314X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
325int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); 315int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
326STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); 316STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
327 317
328PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); 318PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
329void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk, 319void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
330 X509_ALGOR **pdig, X509_ALGOR **psig); 320 X509_ALGOR **pdig, X509_ALGOR **psig);
331void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); 321void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
332int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); 322int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
333int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); 323int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
@@ -336,41 +326,41 @@ int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
336 326
337PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); 327PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
338ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); 328ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
339int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si,int nid,int type, 329int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
340 void *data); 330 void *data);
341int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, 331int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
342 void *value); 332 void *value);
343ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); 333ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);
344ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); 334ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);
345int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, 335int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
346 STACK_OF(X509_ATTRIBUTE) *sk); 336 STACK_OF(X509_ATTRIBUTE) *sk);
347int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,STACK_OF(X509_ATTRIBUTE) *sk); 337int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, STACK_OF(X509_ATTRIBUTE) *sk);
348 338
349 339
350PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, 340PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
351 BIO *data, int flags); 341 BIO *data, int flags);
352 342
353PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, 343PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
354 X509 *signcert, EVP_PKEY *pkey, const EVP_MD *md, 344 X509 *signcert, EVP_PKEY *pkey, const EVP_MD *md,
355 int flags); 345 int flags);
356 346
357int PKCS7_final(PKCS7 *p7, BIO *data, int flags); 347int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
358int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, 348int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
359 BIO *indata, BIO *out, int flags); 349 BIO *indata, BIO *out, int flags);
360STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); 350STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
361PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, 351PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
362 int flags); 352 int flags);
363int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); 353int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags);
364 354
365int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, 355int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
366 STACK_OF(X509_ALGOR) *cap); 356 STACK_OF(X509_ALGOR) *cap);
367STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); 357STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
368int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); 358int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
369 359
370int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); 360int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
371int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); 361int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
372int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, 362int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
373 const unsigned char *md, int mdlen); 363 const unsigned char *md, int mdlen);
374 364
375int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); 365int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
376PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); 366PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
diff --git a/src/lib/libssl/src/crypto/pkcs7/pkcs7.h b/src/lib/libssl/src/crypto/pkcs7/pkcs7.h
index 37492fc7fe..609ce04553 100644
--- a/src/lib/libssl/src/crypto/pkcs7/pkcs7.h
+++ b/src/lib/libssl/src/crypto/pkcs7/pkcs7.h
@@ -1,25 +1,25 @@
1/* $OpenBSD: pkcs7.h,v 1.13 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pkcs7.h,v 1.14 2014/07/02 12:40:41 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com). 6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL. 7 * The implementation was written so as to conform with Netscapes SSL.
8 * 8 *
9 * This library is free for commercial and non-commercial use as long as 9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions 10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA, 11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation 12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms 13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com). 14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 * 15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in 16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed. 17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution 18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used. 19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or 20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package. 21 * in documentation (online or textual) provided with the package.
22 * 22 *
23 * Redistribution and use in source and binary forms, with or without 23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions 24 * modification, are permitted provided that the following conditions
25 * are met: 25 * are met:
@@ -34,10 +34,10 @@
34 * Eric Young (eay@cryptsoft.com)" 34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library 35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-). 36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from 37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement: 38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 * 40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE. 51 * SUCH DAMAGE.
52 * 52 *
53 * The licence and distribution terms for any publically available version or 53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be 54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
@@ -76,14 +76,12 @@ Digest_Encryption_ID rsaEncryption
76Key_Encryption_ID rsaEncryption 76Key_Encryption_ID rsaEncryption
77*/ 77*/
78 78
79typedef struct pkcs7_issuer_and_serial_st 79typedef struct pkcs7_issuer_and_serial_st {
80 {
81 X509_NAME *issuer; 80 X509_NAME *issuer;
82 ASN1_INTEGER *serial; 81 ASN1_INTEGER *serial;
83 } PKCS7_ISSUER_AND_SERIAL; 82} PKCS7_ISSUER_AND_SERIAL;
84 83
85typedef struct pkcs7_signer_info_st 84typedef struct pkcs7_signer_info_st {
86 {
87 ASN1_INTEGER *version; /* version 1 */ 85 ASN1_INTEGER *version; /* version 1 */
88 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; 86 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
89 X509_ALGOR *digest_alg; 87 X509_ALGOR *digest_alg;
@@ -94,25 +92,23 @@ typedef struct pkcs7_signer_info_st
94 92
95 /* The private key to sign with */ 93 /* The private key to sign with */
96 EVP_PKEY *pkey; 94 EVP_PKEY *pkey;
97 } PKCS7_SIGNER_INFO; 95} PKCS7_SIGNER_INFO;
98 96
99DECLARE_STACK_OF(PKCS7_SIGNER_INFO) 97DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
100DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) 98DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO)
101 99
102typedef struct pkcs7_recip_info_st 100typedef struct pkcs7_recip_info_st {
103 {
104 ASN1_INTEGER *version; /* version 0 */ 101 ASN1_INTEGER *version; /* version 0 */
105 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; 102 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
106 X509_ALGOR *key_enc_algor; 103 X509_ALGOR *key_enc_algor;
107 ASN1_OCTET_STRING *enc_key; 104 ASN1_OCTET_STRING *enc_key;
108 X509 *cert; /* get the pub-key from this */ 105 X509 *cert; /* get the pub-key from this */
109 } PKCS7_RECIP_INFO; 106} PKCS7_RECIP_INFO;
110 107
111DECLARE_STACK_OF(PKCS7_RECIP_INFO) 108DECLARE_STACK_OF(PKCS7_RECIP_INFO)
112DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) 109DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO)
113 110
114typedef struct pkcs7_signed_st 111typedef struct pkcs7_signed_st {
115 {
116 ASN1_INTEGER *version; /* version 1 */ 112 ASN1_INTEGER *version; /* version 1 */
117 STACK_OF(X509_ALGOR) *md_algs; /* md used */ 113 STACK_OF(X509_ALGOR) *md_algs; /* md used */
118 STACK_OF(X509) *cert; /* [ 0 ] */ 114 STACK_OF(X509) *cert; /* [ 0 ] */
@@ -120,27 +116,24 @@ typedef struct pkcs7_signed_st
120 STACK_OF(PKCS7_SIGNER_INFO) *signer_info; 116 STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
121 117
122 struct pkcs7_st *contents; 118 struct pkcs7_st *contents;
123 } PKCS7_SIGNED; 119} PKCS7_SIGNED;
124/* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. 120/* The above structure is very very similar to PKCS7_SIGN_ENVELOPE.
125 * How about merging the two */ 121 * How about merging the two */
126 122
127typedef struct pkcs7_enc_content_st 123typedef struct pkcs7_enc_content_st {
128 {
129 ASN1_OBJECT *content_type; 124 ASN1_OBJECT *content_type;
130 X509_ALGOR *algorithm; 125 X509_ALGOR *algorithm;
131 ASN1_OCTET_STRING *enc_data; /* [ 0 ] */ 126 ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
132 const EVP_CIPHER *cipher; 127 const EVP_CIPHER *cipher;
133 } PKCS7_ENC_CONTENT; 128} PKCS7_ENC_CONTENT;
134 129
135typedef struct pkcs7_enveloped_st 130typedef struct pkcs7_enveloped_st {
136 {
137 ASN1_INTEGER *version; /* version 0 */ 131 ASN1_INTEGER *version; /* version 0 */
138 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; 132 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
139 PKCS7_ENC_CONTENT *enc_data; 133 PKCS7_ENC_CONTENT *enc_data;
140 } PKCS7_ENVELOPE; 134} PKCS7_ENVELOPE;
141 135
142typedef struct pkcs7_signedandenveloped_st 136typedef struct pkcs7_signedandenveloped_st {
143 {
144 ASN1_INTEGER *version; /* version 1 */ 137 ASN1_INTEGER *version; /* version 1 */
145 STACK_OF(X509_ALGOR) *md_algs; /* md used */ 138 STACK_OF(X509_ALGOR) *md_algs; /* md used */
146 STACK_OF(X509) *cert; /* [ 0 ] */ 139 STACK_OF(X509) *cert; /* [ 0 ] */
@@ -149,24 +142,21 @@ typedef struct pkcs7_signedandenveloped_st
149 142
150 PKCS7_ENC_CONTENT *enc_data; 143 PKCS7_ENC_CONTENT *enc_data;
151 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; 144 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
152 } PKCS7_SIGN_ENVELOPE; 145} PKCS7_SIGN_ENVELOPE;
153 146
154typedef struct pkcs7_digest_st 147typedef struct pkcs7_digest_st {
155 {
156 ASN1_INTEGER *version; /* version 0 */ 148 ASN1_INTEGER *version; /* version 0 */
157 X509_ALGOR *md; /* md used */ 149 X509_ALGOR *md; /* md used */
158 struct pkcs7_st *contents; 150 struct pkcs7_st *contents;
159 ASN1_OCTET_STRING *digest; 151 ASN1_OCTET_STRING *digest;
160 } PKCS7_DIGEST; 152} PKCS7_DIGEST;
161 153
162typedef struct pkcs7_encrypted_st 154typedef struct pkcs7_encrypted_st {
163 {
164 ASN1_INTEGER *version; /* version 0 */ 155 ASN1_INTEGER *version; /* version 0 */
165 PKCS7_ENC_CONTENT *enc_data; 156 PKCS7_ENC_CONTENT *enc_data;
166 } PKCS7_ENCRYPT; 157} PKCS7_ENCRYPT;
167 158
168typedef struct pkcs7_st 159typedef struct pkcs7_st {
169 {
170 /* The following is non NULL if it contains ASN1 encoding of 160 /* The following is non NULL if it contains ASN1 encoding of
171 * this structure */ 161 * this structure */
172 unsigned char *asn1; 162 unsigned char *asn1;
@@ -206,8 +196,8 @@ typedef struct pkcs7_st
206 196
207 /* Anything else */ 197 /* Anything else */
208 ASN1_TYPE *other; 198 ASN1_TYPE *other;
209 } d; 199 } d;
210 } PKCS7; 200} PKCS7;
211 201
212DECLARE_STACK_OF(PKCS7) 202DECLARE_STACK_OF(PKCS7)
213DECLARE_ASN1_SET_OF(PKCS7) 203DECLARE_ASN1_SET_OF(PKCS7)
@@ -271,13 +261,13 @@ DECLARE_PKCS12_STACK_OF(PKCS7)
271 261
272DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) 262DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
273 263
274int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type, 264int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
275 unsigned char *md,unsigned int *len); 265 const EVP_MD *type, unsigned char *md, unsigned int *len);
276PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7); 266PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
277int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7); 267int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7);
278PKCS7 *PKCS7_dup(PKCS7 *p7); 268PKCS7 *PKCS7_dup(PKCS7 *p7);
279PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7); 269PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
280int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); 270int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7);
281int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); 271int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
282int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); 272int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
283 273
@@ -303,16 +293,16 @@ int PKCS7_set_type(PKCS7 *p7, int type);
303int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); 293int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
304int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); 294int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
305int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, 295int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
306 const EVP_MD *dgst); 296 const EVP_MD *dgst);
307int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); 297int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
308int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); 298int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
309int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); 299int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
310int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); 300int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
311int PKCS7_content_new(PKCS7 *p7, int nid); 301int PKCS7_content_new(PKCS7 *p7, int nid);
312int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, 302int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
313 BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); 303 BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
314int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, 304int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
315 X509 *x509); 305 X509 *x509);
316 306
317BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); 307BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
318int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); 308int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
@@ -320,14 +310,14 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
320 310
321 311
322PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, 312PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
323 EVP_PKEY *pkey, const EVP_MD *dgst); 313 EVP_PKEY *pkey, const EVP_MD *dgst);
324X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); 314X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
325int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); 315int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
326STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); 316STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
327 317
328PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); 318PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
329void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk, 319void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
330 X509_ALGOR **pdig, X509_ALGOR **psig); 320 X509_ALGOR **pdig, X509_ALGOR **psig);
331void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); 321void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
332int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); 322int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
333int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); 323int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
@@ -336,41 +326,41 @@ int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
336 326
337PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); 327PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
338ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); 328ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
339int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si,int nid,int type, 329int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
340 void *data); 330 void *data);
341int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, 331int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
342 void *value); 332 void *value);
343ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); 333ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);
344ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); 334ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);
345int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, 335int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
346 STACK_OF(X509_ATTRIBUTE) *sk); 336 STACK_OF(X509_ATTRIBUTE) *sk);
347int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,STACK_OF(X509_ATTRIBUTE) *sk); 337int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, STACK_OF(X509_ATTRIBUTE) *sk);
348 338
349 339
350PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, 340PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
351 BIO *data, int flags); 341 BIO *data, int flags);
352 342
353PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, 343PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
354 X509 *signcert, EVP_PKEY *pkey, const EVP_MD *md, 344 X509 *signcert, EVP_PKEY *pkey, const EVP_MD *md,
355 int flags); 345 int flags);
356 346
357int PKCS7_final(PKCS7 *p7, BIO *data, int flags); 347int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
358int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, 348int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
359 BIO *indata, BIO *out, int flags); 349 BIO *indata, BIO *out, int flags);
360STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); 350STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
361PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, 351PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
362 int flags); 352 int flags);
363int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); 353int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags);
364 354
365int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, 355int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
366 STACK_OF(X509_ALGOR) *cap); 356 STACK_OF(X509_ALGOR) *cap);
367STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); 357STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
368int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); 358int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
369 359
370int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); 360int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
371int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); 361int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
372int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, 362int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
373 const unsigned char *md, int mdlen); 363 const unsigned char *md, int mdlen);
374 364
375int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); 365int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
376PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); 366PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);