diff options
author | jsing <> | 2014-07-02 12:40:41 +0000 |
---|---|---|
committer | jsing <> | 2014-07-02 12:40:41 +0000 |
commit | 5d76c08888ad3e5028eaf3d231dc8b7a6401f5b7 (patch) | |
tree | b30795902753a8648dfea061f384120dda253034 /src | |
parent | ae9d23f02624214dfa3102cd43e55bcff2a8b940 (diff) | |
download | openbsd-5d76c08888ad3e5028eaf3d231dc8b7a6401f5b7.tar.gz openbsd-5d76c08888ad3e5028eaf3d231dc8b7a6401f5b7.tar.bz2 openbsd-5d76c08888ad3e5028eaf3d231dc8b7a6401f5b7.zip |
KNF.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/pkcs7/pkcs7.h | 112 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/pkcs7/pkcs7.h | 112 |
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 | |||
76 | Key_Encryption_ID rsaEncryption | 76 | Key_Encryption_ID rsaEncryption |
77 | */ | 77 | */ |
78 | 78 | ||
79 | typedef struct pkcs7_issuer_and_serial_st | 79 | typedef 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 | ||
85 | typedef struct pkcs7_signer_info_st | 84 | typedef 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 | ||
99 | DECLARE_STACK_OF(PKCS7_SIGNER_INFO) | 97 | DECLARE_STACK_OF(PKCS7_SIGNER_INFO) |
100 | DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) | 98 | DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) |
101 | 99 | ||
102 | typedef struct pkcs7_recip_info_st | 100 | typedef 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 | ||
111 | DECLARE_STACK_OF(PKCS7_RECIP_INFO) | 108 | DECLARE_STACK_OF(PKCS7_RECIP_INFO) |
112 | DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) | 109 | DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) |
113 | 110 | ||
114 | typedef struct pkcs7_signed_st | 111 | typedef 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 | ||
127 | typedef struct pkcs7_enc_content_st | 123 | typedef 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 | ||
135 | typedef struct pkcs7_enveloped_st | 130 | typedef 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 | ||
142 | typedef struct pkcs7_signedandenveloped_st | 136 | typedef 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 | ||
154 | typedef struct pkcs7_digest_st | 147 | typedef 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 | ||
162 | typedef struct pkcs7_encrypted_st | 154 | typedef 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 | ||
168 | typedef struct pkcs7_st | 159 | typedef 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 | ||
212 | DECLARE_STACK_OF(PKCS7) | 202 | DECLARE_STACK_OF(PKCS7) |
213 | DECLARE_ASN1_SET_OF(PKCS7) | 203 | DECLARE_ASN1_SET_OF(PKCS7) |
@@ -271,13 +261,13 @@ DECLARE_PKCS12_STACK_OF(PKCS7) | |||
271 | 261 | ||
272 | DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) | 262 | DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) |
273 | 263 | ||
274 | int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type, | 264 | int 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); |
276 | PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7); | 266 | PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7); |
277 | int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7); | 267 | int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7); |
278 | PKCS7 *PKCS7_dup(PKCS7 *p7); | 268 | PKCS7 *PKCS7_dup(PKCS7 *p7); |
279 | PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7); | 269 | PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7); |
280 | int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); | 270 | int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7); |
281 | int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); | 271 | int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); |
282 | int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); | 272 | int 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); | |||
303 | int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); | 293 | int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); |
304 | int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); | 294 | int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); |
305 | int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, | 295 | int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, |
306 | const EVP_MD *dgst); | 296 | const EVP_MD *dgst); |
307 | int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); | 297 | int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); |
308 | int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); | 298 | int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); |
309 | int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); | 299 | int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); |
310 | int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); | 300 | int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); |
311 | int PKCS7_content_new(PKCS7 *p7, int nid); | 301 | int PKCS7_content_new(PKCS7 *p7, int nid); |
312 | int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, | 302 | int 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); |
314 | int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, | 304 | int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, |
315 | X509 *x509); | 305 | X509 *x509); |
316 | 306 | ||
317 | BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); | 307 | BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); |
318 | int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); | 308 | int 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 | ||
322 | PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, | 312 | PKCS7_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); |
324 | X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); | 314 | X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); |
325 | int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); | 315 | int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); |
326 | STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); | 316 | STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); |
327 | 317 | ||
328 | PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); | 318 | PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); |
329 | void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk, | 319 | void 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); |
331 | void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); | 321 | void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); |
332 | int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); | 322 | int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); |
333 | int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); | 323 | int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); |
@@ -336,41 +326,41 @@ int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7); | |||
336 | 326 | ||
337 | PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); | 327 | PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); |
338 | ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); | 328 | ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); |
339 | int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si,int nid,int type, | 329 | int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type, |
340 | void *data); | 330 | void *data); |
341 | int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, | 331 | int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, |
342 | void *value); | 332 | void *value); |
343 | ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); | 333 | ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); |
344 | ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); | 334 | ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); |
345 | int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, | 335 | int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, |
346 | STACK_OF(X509_ATTRIBUTE) *sk); | 336 | STACK_OF(X509_ATTRIBUTE) *sk); |
347 | int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,STACK_OF(X509_ATTRIBUTE) *sk); | 337 | int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, STACK_OF(X509_ATTRIBUTE) *sk); |
348 | 338 | ||
349 | 339 | ||
350 | PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, | 340 | PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, |
351 | BIO *data, int flags); | 341 | BIO *data, int flags); |
352 | 342 | ||
353 | PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, | 343 | PKCS7_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 | ||
357 | int PKCS7_final(PKCS7 *p7, BIO *data, int flags); | 347 | int PKCS7_final(PKCS7 *p7, BIO *data, int flags); |
358 | int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, | 348 | int 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); |
360 | STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); | 350 | STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); |
361 | PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, | 351 | PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, |
362 | int flags); | 352 | int flags); |
363 | int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); | 353 | int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); |
364 | 354 | ||
365 | int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, | 355 | int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, |
366 | STACK_OF(X509_ALGOR) *cap); | 356 | STACK_OF(X509_ALGOR) *cap); |
367 | STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); | 357 | STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); |
368 | int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); | 358 | int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); |
369 | 359 | ||
370 | int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); | 360 | int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); |
371 | int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); | 361 | int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); |
372 | int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, | 362 | int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, |
373 | const unsigned char *md, int mdlen); | 363 | const unsigned char *md, int mdlen); |
374 | 364 | ||
375 | int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); | 365 | int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); |
376 | PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); | 366 | PKCS7 *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 | |||
76 | Key_Encryption_ID rsaEncryption | 76 | Key_Encryption_ID rsaEncryption |
77 | */ | 77 | */ |
78 | 78 | ||
79 | typedef struct pkcs7_issuer_and_serial_st | 79 | typedef 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 | ||
85 | typedef struct pkcs7_signer_info_st | 84 | typedef 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 | ||
99 | DECLARE_STACK_OF(PKCS7_SIGNER_INFO) | 97 | DECLARE_STACK_OF(PKCS7_SIGNER_INFO) |
100 | DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) | 98 | DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) |
101 | 99 | ||
102 | typedef struct pkcs7_recip_info_st | 100 | typedef 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 | ||
111 | DECLARE_STACK_OF(PKCS7_RECIP_INFO) | 108 | DECLARE_STACK_OF(PKCS7_RECIP_INFO) |
112 | DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) | 109 | DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) |
113 | 110 | ||
114 | typedef struct pkcs7_signed_st | 111 | typedef 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 | ||
127 | typedef struct pkcs7_enc_content_st | 123 | typedef 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 | ||
135 | typedef struct pkcs7_enveloped_st | 130 | typedef 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 | ||
142 | typedef struct pkcs7_signedandenveloped_st | 136 | typedef 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 | ||
154 | typedef struct pkcs7_digest_st | 147 | typedef 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 | ||
162 | typedef struct pkcs7_encrypted_st | 154 | typedef 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 | ||
168 | typedef struct pkcs7_st | 159 | typedef 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 | ||
212 | DECLARE_STACK_OF(PKCS7) | 202 | DECLARE_STACK_OF(PKCS7) |
213 | DECLARE_ASN1_SET_OF(PKCS7) | 203 | DECLARE_ASN1_SET_OF(PKCS7) |
@@ -271,13 +261,13 @@ DECLARE_PKCS12_STACK_OF(PKCS7) | |||
271 | 261 | ||
272 | DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) | 262 | DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) |
273 | 263 | ||
274 | int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type, | 264 | int 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); |
276 | PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7); | 266 | PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7); |
277 | int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7); | 267 | int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7); |
278 | PKCS7 *PKCS7_dup(PKCS7 *p7); | 268 | PKCS7 *PKCS7_dup(PKCS7 *p7); |
279 | PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7); | 269 | PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7); |
280 | int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); | 270 | int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7); |
281 | int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); | 271 | int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); |
282 | int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); | 272 | int 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); | |||
303 | int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); | 293 | int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); |
304 | int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); | 294 | int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); |
305 | int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, | 295 | int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, |
306 | const EVP_MD *dgst); | 296 | const EVP_MD *dgst); |
307 | int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); | 297 | int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); |
308 | int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); | 298 | int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); |
309 | int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); | 299 | int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); |
310 | int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); | 300 | int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); |
311 | int PKCS7_content_new(PKCS7 *p7, int nid); | 301 | int PKCS7_content_new(PKCS7 *p7, int nid); |
312 | int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, | 302 | int 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); |
314 | int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, | 304 | int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, |
315 | X509 *x509); | 305 | X509 *x509); |
316 | 306 | ||
317 | BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); | 307 | BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); |
318 | int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); | 308 | int 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 | ||
322 | PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, | 312 | PKCS7_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); |
324 | X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); | 314 | X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); |
325 | int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); | 315 | int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); |
326 | STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); | 316 | STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); |
327 | 317 | ||
328 | PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); | 318 | PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); |
329 | void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk, | 319 | void 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); |
331 | void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); | 321 | void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); |
332 | int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); | 322 | int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); |
333 | int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); | 323 | int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); |
@@ -336,41 +326,41 @@ int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7); | |||
336 | 326 | ||
337 | PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); | 327 | PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); |
338 | ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); | 328 | ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); |
339 | int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si,int nid,int type, | 329 | int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type, |
340 | void *data); | 330 | void *data); |
341 | int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, | 331 | int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, |
342 | void *value); | 332 | void *value); |
343 | ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); | 333 | ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); |
344 | ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); | 334 | ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); |
345 | int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, | 335 | int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, |
346 | STACK_OF(X509_ATTRIBUTE) *sk); | 336 | STACK_OF(X509_ATTRIBUTE) *sk); |
347 | int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,STACK_OF(X509_ATTRIBUTE) *sk); | 337 | int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, STACK_OF(X509_ATTRIBUTE) *sk); |
348 | 338 | ||
349 | 339 | ||
350 | PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, | 340 | PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, |
351 | BIO *data, int flags); | 341 | BIO *data, int flags); |
352 | 342 | ||
353 | PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, | 343 | PKCS7_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 | ||
357 | int PKCS7_final(PKCS7 *p7, BIO *data, int flags); | 347 | int PKCS7_final(PKCS7 *p7, BIO *data, int flags); |
358 | int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, | 348 | int 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); |
360 | STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); | 350 | STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); |
361 | PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, | 351 | PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, |
362 | int flags); | 352 | int flags); |
363 | int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); | 353 | int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); |
364 | 354 | ||
365 | int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, | 355 | int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, |
366 | STACK_OF(X509_ALGOR) *cap); | 356 | STACK_OF(X509_ALGOR) *cap); |
367 | STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); | 357 | STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); |
368 | int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); | 358 | int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); |
369 | 359 | ||
370 | int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); | 360 | int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); |
371 | int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); | 361 | int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); |
372 | int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, | 362 | int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, |
373 | const unsigned char *md, int mdlen); | 363 | const unsigned char *md, int mdlen); |
374 | 364 | ||
375 | int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); | 365 | int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); |
376 | PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); | 366 | PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); |