diff options
21 files changed, 3388 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BIO_new_CMS.3 b/src/lib/libcrypto/man/BIO_new_CMS.3 new file mode 100644 index 0000000000..d35fb0b7bf --- /dev/null +++ b/src/lib/libcrypto/man/BIO_new_CMS.3 | |||
@@ -0,0 +1,138 @@ | |||
1 | .\" $OpenBSD: BIO_new_CMS.3,v 1.4 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL df75c2bfc Dec 9 01:02:36 2018 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt BIO_NEW_CMS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm BIO_new_CMS | ||
56 | .Nd CMS streaming filter BIO | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft BIO * | ||
60 | .Fo BIO_new_CMS | ||
61 | .Fa "BIO *out" | ||
62 | .Fa "CMS_ContentInfo *cms" | ||
63 | .Fc | ||
64 | .Sh DESCRIPTION | ||
65 | .Fn BIO_new_CMS | ||
66 | returns a streaming filter | ||
67 | .Vt BIO | ||
68 | chain based on | ||
69 | .Fa cms . | ||
70 | The output of the filter is written to | ||
71 | .Fa out . | ||
72 | Any data written to the chain is automatically translated | ||
73 | to a BER format CMS structure of the appropriate type. | ||
74 | .Pp | ||
75 | The chain returned by this function behaves like a standard filter | ||
76 | .Vt BIO . | ||
77 | It supports non blocking I/O. | ||
78 | Content is processed and streamed on the fly and not all held in memory | ||
79 | at once: so it is possible to encode very large structures. | ||
80 | After all content has been written through the chain, | ||
81 | .Xr BIO_flush 3 | ||
82 | must be called to finalise the structure. | ||
83 | .Pp | ||
84 | The | ||
85 | .Dv CMS_STREAM | ||
86 | flag must be included in the corresponding | ||
87 | .Fa flags | ||
88 | parameter of the | ||
89 | .Fa cms | ||
90 | creation function. | ||
91 | .Pp | ||
92 | If an application wishes to write additional data to | ||
93 | .Fa out , | ||
94 | BIOs should be removed from the chain using | ||
95 | .Xr BIO_pop 3 | ||
96 | and freed with | ||
97 | .Xr BIO_free 3 | ||
98 | until | ||
99 | .Fa out | ||
100 | is reached. | ||
101 | If no additional data needs to be written, | ||
102 | .Xr BIO_free_all 3 | ||
103 | can be called to free up the whole chain. | ||
104 | .Pp | ||
105 | Any content written through the filter is used verbatim: | ||
106 | no canonical translation is performed. | ||
107 | .Pp | ||
108 | It is possible to chain multiple BIOs to, for example, | ||
109 | create a triple wrapped signed, enveloped, signed structure. | ||
110 | In this case it is the application's responsibility | ||
111 | to set the inner content type of any outer | ||
112 | .Vt CMS_ContentInfo | ||
113 | structures. | ||
114 | .Pp | ||
115 | Large numbers of small writes through the chain should be avoided as this | ||
116 | will produce an output consisting of lots of OCTET STRING structures. | ||
117 | Prepending a | ||
118 | .Xr BIO_f_buffer 3 | ||
119 | buffering BIO will prevent this. | ||
120 | .Sh RETURN VALUES | ||
121 | .Fn BIO_new_CMS | ||
122 | returns a | ||
123 | .Vt BIO | ||
124 | chain when successful or | ||
125 | .Dv NULL | ||
126 | if an error occurred. | ||
127 | The error can be obtained from | ||
128 | .Xr ERR_get_error 3 . | ||
129 | .Sh SEE ALSO | ||
130 | .Xr CMS_encrypt 3 , | ||
131 | .Xr CMS_sign 3 | ||
132 | .Sh HISTORY | ||
133 | The | ||
134 | .Fn BIO_new_CMS | ||
135 | function was added in OpenSSL 1.0.0. | ||
136 | .Sh BUGS | ||
137 | There is currently no corresponding inverse BIO | ||
138 | which can decode a CMS structure on the fly. | ||
diff --git a/src/lib/libcrypto/man/CMS_add0_cert.3 b/src/lib/libcrypto/man/CMS_add0_cert.3 new file mode 100644 index 0000000000..9f99e2259f --- /dev/null +++ b/src/lib/libcrypto/man/CMS_add0_cert.3 | |||
@@ -0,0 +1,177 @@ | |||
1 | .\" $OpenBSD: CMS_add0_cert.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_ADD0_CERT 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_add0_cert , | ||
56 | .Nm CMS_add1_cert , | ||
57 | .Nm CMS_get1_certs , | ||
58 | .Nm CMS_add0_crl , | ||
59 | .Nm CMS_add1_crl , | ||
60 | .Nm CMS_get1_crls | ||
61 | .Nd CMS certificate and CRL utility functions | ||
62 | .Sh SYNOPSIS | ||
63 | .In openssl/cms.h | ||
64 | .Ft int | ||
65 | .Fo CMS_add0_cert | ||
66 | .Fa "CMS_ContentInfo *cms" | ||
67 | .Fa "X509 *cert" | ||
68 | .Fc | ||
69 | .Ft int | ||
70 | .Fo CMS_add1_cert | ||
71 | .Fa "CMS_ContentInfo *cms" | ||
72 | .Fa "X509 *cert" | ||
73 | .Fc | ||
74 | .Ft STACK_OF(X509) * | ||
75 | .Fo CMS_get1_certs | ||
76 | .Fa "CMS_ContentInfo *cms" | ||
77 | .Fc | ||
78 | .Ft int | ||
79 | .Fo CMS_add0_crl | ||
80 | .Fa "CMS_ContentInfo *cms" | ||
81 | .Fa "X509_CRL *crl" | ||
82 | .Fc | ||
83 | .Ft int | ||
84 | .Fo CMS_add1_crl | ||
85 | .Fa "CMS_ContentInfo *cms" | ||
86 | .Fa "X509_CRL *crl" | ||
87 | .Fc | ||
88 | .Ft STACK_OF(X509_CRL) * | ||
89 | .Fo CMS_get1_crls | ||
90 | .Fa "CMS_ContentInfo *cms" | ||
91 | .Fc | ||
92 | .Sh DESCRIPTION | ||
93 | .Fn CMS_add0_cert | ||
94 | and | ||
95 | .Fn CMS_add1_cert | ||
96 | add the certificate | ||
97 | .Fa cert | ||
98 | to | ||
99 | .Fa cms . | ||
100 | .Fa cms | ||
101 | must be of type signed data or enveloped data. | ||
102 | .Pp | ||
103 | .Fn CMS_get1_certs | ||
104 | returns all certificates in | ||
105 | .Fa cms . | ||
106 | .Pp | ||
107 | .Fn CMS_add0_crl | ||
108 | and | ||
109 | .Fn CMS_add1_crl | ||
110 | add the CRL | ||
111 | .Fa crl | ||
112 | to | ||
113 | .Fa cms . | ||
114 | .Fn CMS_get1_crls | ||
115 | returns any CRLs in | ||
116 | .Fa cms . | ||
117 | .Pp | ||
118 | The | ||
119 | .Vt CMS_ContentInfo | ||
120 | structure | ||
121 | .Fa cms | ||
122 | must be of type signed data or enveloped data or an error will be | ||
123 | returned. | ||
124 | .Pp | ||
125 | The signed data certificates and CRLs are added to the | ||
126 | .Sy certificates | ||
127 | and | ||
128 | .Sy crls | ||
129 | fields of the SignedData structure. | ||
130 | For enveloped data, they are added to | ||
131 | .Sy OriginatorInfo . | ||
132 | .Pp | ||
133 | As the | ||
134 | .Sq 0 | ||
135 | in the function name implies, | ||
136 | .Fn CMS_add0_cert | ||
137 | adds | ||
138 | .Fa cert | ||
139 | internally to | ||
140 | .Fa cms | ||
141 | and it must not be freed up after the call, as opposed to | ||
142 | .Fn CMS_add1_cert | ||
143 | where | ||
144 | .Fa cert | ||
145 | must be freed up. | ||
146 | .Pp | ||
147 | The same certificate or CRL must not be added to the same cms structure | ||
148 | more than once. | ||
149 | .Sh RETURN VALUES | ||
150 | .Fn CMS_add0_cert , | ||
151 | .Fn CMS_add1_cert , | ||
152 | .Fn CMS_add0_crl , | ||
153 | and | ||
154 | .Fn CMS_add1_crl | ||
155 | return 1 for success or 0 for failure. | ||
156 | .Pp | ||
157 | .Fn CMS_get1_certs | ||
158 | and | ||
159 | .Fn CMS_get1_crls | ||
160 | return the STACK of certificates or CRLs or | ||
161 | .Dv NULL | ||
162 | if there are none or an error occurs. | ||
163 | The only error which will occur in practice is if the | ||
164 | .Fa cms | ||
165 | type is invalid. | ||
166 | .Sh SEE ALSO | ||
167 | .Xr CMS_encrypt 3 , | ||
168 | .Xr CMS_sign 3 , | ||
169 | .Xr ERR_get_error 3 | ||
170 | .Sh HISTORY | ||
171 | .Fn CMS_add0_cert , | ||
172 | .Fn CMS_add1_cert , | ||
173 | .Fn CMS_get1_certs , | ||
174 | .Fn CMS_add0_crl | ||
175 | and | ||
176 | .Fn CMS_get1_crls | ||
177 | were all first added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_add1_recipient_cert.3 b/src/lib/libcrypto/man/CMS_add1_recipient_cert.3 new file mode 100644 index 0000000000..47307fdaa1 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_add1_recipient_cert.3 | |||
@@ -0,0 +1,165 @@ | |||
1 | .\" $OpenBSD: CMS_add1_recipient_cert.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_ADD1_RECIPIENT_CERT 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_add1_recipient_cert , | ||
56 | .Nm CMS_add0_recipient_key | ||
57 | .Nd add recipients to a CMS enveloped data structure | ||
58 | .Sh SYNOPSIS | ||
59 | .In openssl/cms.h | ||
60 | .Ft CMS_RecipientInfo * | ||
61 | .Fo CMS_add1_recipient_cert | ||
62 | .Fa "CMS_ContentInfo *cms" | ||
63 | .Fa "X509 *recip" | ||
64 | .Fa "unsigned int flags" | ||
65 | .Fc | ||
66 | .Ft CMS_RecipientInfo * | ||
67 | .Fo CMS_add0_recipient_key | ||
68 | .Fa "CMS_ContentInfo *cms" | ||
69 | .Fa "int nid" | ||
70 | .Fa "unsigned char *key" | ||
71 | .Fa "size_t keylen" | ||
72 | .Fa "unsigned char *id" | ||
73 | .Fa "size_t idlen" | ||
74 | .Fa "ASN1_GENERALIZEDTIME *date" | ||
75 | .Fa "ASN1_OBJECT *otherTypeId" | ||
76 | .Fa "ASN1_TYPE *otherType" | ||
77 | .Fc | ||
78 | .Sh DESCRIPTION | ||
79 | .Fn CMS_add1_recipient_cert | ||
80 | adds the recipient | ||
81 | .Fa recip | ||
82 | to the | ||
83 | .Vt CMS_ContentInfo | ||
84 | enveloped data structure | ||
85 | .Fa cms | ||
86 | as a KeyTransRecipientInfo structure. | ||
87 | .Pp | ||
88 | .Fn CMS_add0_recipient_key | ||
89 | adds the symmetric key | ||
90 | .Fa key | ||
91 | of length | ||
92 | .Fa keylen | ||
93 | using the wrapping algorithm | ||
94 | .Fa nid , | ||
95 | the identifier | ||
96 | .Fa id | ||
97 | of length | ||
98 | .Fa idlen , | ||
99 | and the optional values | ||
100 | .Fa date , | ||
101 | .Fa otherTypeId | ||
102 | and | ||
103 | .Fa otherType | ||
104 | to the | ||
105 | .Vt CMS_ContentInfo | ||
106 | enveloped data structure | ||
107 | .Fa cms | ||
108 | as a KEKRecipientInfo structure. | ||
109 | .Pp | ||
110 | The | ||
111 | .Vt CMS_ContentInfo | ||
112 | structure should be obtained from an initial call to | ||
113 | .Xr CMS_encrypt 3 | ||
114 | with the flag | ||
115 | .Dv CMS_PARTIAL | ||
116 | set. | ||
117 | .Pp | ||
118 | The main purpose of this function is to provide finer control over a CMS | ||
119 | enveloped data structure where the simpler | ||
120 | .Xr CMS_encrypt 3 | ||
121 | function defaults are not appropriate, | ||
122 | for example if one or more KEKRecipientInfo structures need to be added. | ||
123 | New attributes can also be added using the returned | ||
124 | .Vt CMS_RecipientInfo | ||
125 | structure and the CMS attribute utility functions. | ||
126 | .Pp | ||
127 | By default, recipient certificates are identified using issuer | ||
128 | name and serial number. | ||
129 | If the flag | ||
130 | .Dv CMS_USE_KEYID | ||
131 | is set, it will use the subject key identifier value instead. | ||
132 | An error occurs if all recipient certificates do not have a subject key | ||
133 | identifier extension. | ||
134 | .Pp | ||
135 | Currently only AES based key wrapping algorithms are supported for | ||
136 | .Fa nid , | ||
137 | specifically | ||
138 | .Dv NID_id_aes128_wrap , | ||
139 | .Dv NID_id_aes192_wrap , | ||
140 | and | ||
141 | .Dv NID_id_aes256_wrap . | ||
142 | If | ||
143 | .Fa nid | ||
144 | is set to | ||
145 | .Dv NID_undef , | ||
146 | then an AES wrap algorithm will be used consistent with | ||
147 | .Fa keylen . | ||
148 | .Sh RETURN VALUES | ||
149 | .Fn CMS_add1_recipient_cert | ||
150 | and | ||
151 | .Fn CMS_add0_recipient_key | ||
152 | return an internal pointer to the | ||
153 | .Vt CMS_RecipientInfo | ||
154 | structure just added or | ||
155 | .Dv NULL | ||
156 | if an error occurs. | ||
157 | .Sh SEE ALSO | ||
158 | .Xr CMS_decrypt 3 , | ||
159 | .Xr CMS_final 3 , | ||
160 | .Xr ERR_get_error 3 | ||
161 | .Sh HISTORY | ||
162 | .Fn CMS_add1_recipient_cert | ||
163 | and | ||
164 | .Fn CMS_add0_recipient_key | ||
165 | were added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_add1_signer.3 b/src/lib/libcrypto/man/CMS_add1_signer.3 new file mode 100644 index 0000000000..065e15c7be --- /dev/null +++ b/src/lib/libcrypto/man/CMS_add1_signer.3 | |||
@@ -0,0 +1,203 @@ | |||
1 | .\" $OpenBSD: CMS_add1_signer.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_ADD1_SIGNER 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_add1_signer , | ||
56 | .Nm CMS_SignerInfo_sign | ||
57 | .Nd add a signer to a CMS_ContentInfo signed data structure | ||
58 | .Sh SYNOPSIS | ||
59 | .In openssl/cms.h | ||
60 | .Ft CMS_SignerInfo * | ||
61 | .Fo CMS_add1_signer | ||
62 | .Fa "CMS_ContentInfo *cms" | ||
63 | .Fa "X509 *signcert" | ||
64 | .Fa "EVP_PKEY *pkey" | ||
65 | .Fa "const EVP_MD *md" | ||
66 | .Fa "unsigned int flags" | ||
67 | .Fc | ||
68 | .Ft int | ||
69 | .Fo CMS_SignerInfo_sign | ||
70 | .Fa "CMS_SignerInfo *si" | ||
71 | .Fc | ||
72 | .Sh DESCRIPTION | ||
73 | .Fn CMS_add1_signer | ||
74 | adds a signer with certificate | ||
75 | .Fa signcert | ||
76 | and private key | ||
77 | .Fa pkey | ||
78 | using message digest | ||
79 | .Fa md | ||
80 | to the | ||
81 | .Vt CMS_ContentInfo | ||
82 | SignedData structure | ||
83 | .Fa cms . | ||
84 | .Pp | ||
85 | The | ||
86 | .Vt CMS_ContentInfo | ||
87 | structure should be obtained from an initial call to | ||
88 | .Xr CMS_sign 3 | ||
89 | with the flag | ||
90 | .Dv CMS_PARTIAL | ||
91 | set or in the case or re-signing a valid | ||
92 | .Vt CMS_ContentInfo | ||
93 | SignedData structure. | ||
94 | .Pp | ||
95 | If the | ||
96 | .Fa md | ||
97 | parameter is | ||
98 | .Dv NULL , | ||
99 | then the default digest for the public key algorithm will be used. | ||
100 | .Pp | ||
101 | Unless the | ||
102 | .Dv CMS_REUSE_DIGEST | ||
103 | flag is set, the returned | ||
104 | .Vt CMS_ContentInfo | ||
105 | structure is not complete and must be finalized either by streaming | ||
106 | (if applicable) or a call to | ||
107 | .Xr CMS_final 3 . | ||
108 | .Pp | ||
109 | The | ||
110 | .Fn CMS_SignerInfo_sign | ||
111 | function will explicitly sign a | ||
112 | .Vt CMS_SignerInfo | ||
113 | structure. | ||
114 | Its main use is when the | ||
115 | .Dv CMS_REUSE_DIGEST | ||
116 | and | ||
117 | .Dv CMS_PARTIAL | ||
118 | flags are both set. | ||
119 | .Pp | ||
120 | The main purpose of | ||
121 | .Fn CMS_add1_signer | ||
122 | is to provide finer control over a CMS signed data structure where the | ||
123 | simpler | ||
124 | .Xr CMS_sign 3 | ||
125 | function defaults are not appropriate, for example if multiple signers | ||
126 | or non default digest algorithms are needed. | ||
127 | New attributes can also be added using the returned | ||
128 | .Vt CMS_SignerInfo | ||
129 | structure and the CMS attribute utility functions or the CMS signed | ||
130 | receipt request functions. | ||
131 | .Pp | ||
132 | Any of the following flags (OR'ed together) can be passed in the | ||
133 | .Fa flags | ||
134 | parameter: | ||
135 | .Bl -tag -width Ds | ||
136 | .It Dv CMS_REUSE_DIGEST | ||
137 | Attempt to copy the content digest value from the | ||
138 | .Vt CMS_ContentInfo | ||
139 | structure to add a signer to an existing structure. | ||
140 | An error occurs if a matching digest value cannot be found to copy. | ||
141 | The returned | ||
142 | .Vt CMS_ContentInfo | ||
143 | structure will be valid and finalized when this flag is set. | ||
144 | .It Dv CMS_PARTIAL | ||
145 | If this flag is set in addition to | ||
146 | .Dv CMS_REUSE_DIGEST , | ||
147 | then the | ||
148 | .Vt CMS_SignerInfo | ||
149 | structure will not be finalized so additional attributes can be added. | ||
150 | In this case an explicit call to | ||
151 | .Fn CMS_SignerInfo_sign | ||
152 | is needed to finalize it. | ||
153 | .It Dv CMS_NOCERTS | ||
154 | Do not include the signer's certificate in the | ||
155 | .Vt CMS_ContentInfo | ||
156 | structure. | ||
157 | The signer's certificate must still be supplied in the | ||
158 | .Fa signcert | ||
159 | parameter though. | ||
160 | This can reduce the size of the signature if the signer's certificate can | ||
161 | be obtained by other means, for example from a previously signed message. | ||
162 | .Pp | ||
163 | The SignedData structure includes several CMS signedAttributes including | ||
164 | the signing time, the CMS content type and the supported list of ciphers | ||
165 | in an SMIMECapabilities attribute. | ||
166 | .It Dv CMS_NOATTR | ||
167 | Use no signedAttributes. | ||
168 | .It Dv CMS_NOSMIMECAP | ||
169 | Omit just the SMIMECapabilities. | ||
170 | .It Dv CMS_USE_KEYID | ||
171 | Use the subject key identifier value to identify signing certificates. | ||
172 | An error occurs if the signing certificate does not have a subject key | ||
173 | identifier extension. | ||
174 | By default, issuer name and serial number are used instead. | ||
175 | .El | ||
176 | .Pp | ||
177 | If present, the SMIMECapabilities attribute indicates support for the | ||
178 | following algorithms in preference order: 256 bit AES, Gost R3411-94, | ||
179 | Gost 28147-89, 192 bit AES, 128 bit AES, triple DES, 128 bit RC2, 64 bit | ||
180 | RC2, DES and 40 bit RC2. | ||
181 | If any of these algorithms is not available then it will not be | ||
182 | included: for example the GOST algorithms will not be included if | ||
183 | the GOST ENGINE is not loaded. | ||
184 | .Pp | ||
185 | .Fn CMS_add1_signer | ||
186 | returns an internal pointer to the | ||
187 | .Vt CMS_SignerInfo | ||
188 | structure just added. | ||
189 | This can be used to set additional attributes before it is finalized. | ||
190 | .Sh RETURN VALUES | ||
191 | .Fn CMS_add1_signer | ||
192 | returns an internal pointer to the | ||
193 | .Vt CMS_SignerInfo | ||
194 | structure just added or | ||
195 | .Dv NULL | ||
196 | if an error occurs. | ||
197 | .Sh SEE ALSO | ||
198 | .Xr CMS_final 3 , | ||
199 | .Xr CMS_sign 3 , | ||
200 | .Xr ERR_get_error 3 | ||
201 | .Sh HISTORY | ||
202 | .Fn CMS_add1_signer | ||
203 | was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_compress.3 b/src/lib/libcrypto/man/CMS_compress.3 new file mode 100644 index 0000000000..64bab79617 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_compress.3 | |||
@@ -0,0 +1,157 @@ | |||
1 | .\" $OpenBSD: CMS_compress.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_COMPRESS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_compress | ||
56 | .Nd create a CMS CompressedData structure | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft CMS_ContentInfo * | ||
60 | .Fo CMS_compress | ||
61 | .Fa "BIO *in" | ||
62 | .Fa "int comp_nid" | ||
63 | .Fa "unsigned int flags" | ||
64 | .Fc | ||
65 | .Sh DESCRIPTION | ||
66 | .Fn CMS_compress | ||
67 | creates and returns a CMS CompressedData structure. | ||
68 | .Fa comp_nid | ||
69 | is the compression algorithm to use or | ||
70 | .Dv NID_undef | ||
71 | to use the default algorithm (zlib compression). | ||
72 | .Fa in | ||
73 | is the content to be compressed. | ||
74 | .Fa flags | ||
75 | is an optional set of flags. | ||
76 | .Pp | ||
77 | The only currently supported compression algorithm is zlib using the NID | ||
78 | .Dv NID_zlib_compression . | ||
79 | .Pp | ||
80 | If zlib support is not compiled in, then | ||
81 | .Fn CMS_compress | ||
82 | will return an error. | ||
83 | .Pp | ||
84 | If the | ||
85 | .Dv CMS_TEXT | ||
86 | flag is set, MIME headers for type text/plain are prepended to the data. | ||
87 | .Pp | ||
88 | Normally the supplied content is translated into MIME canonical format | ||
89 | (as required by the S/MIME specifications); if | ||
90 | .Dv CMS_BINARY | ||
91 | is set, no translation occurs. | ||
92 | This option should be used if the supplied data is in binary format. | ||
93 | Otherwise, the translation will corrupt it. | ||
94 | If | ||
95 | .Dv CMS_BINARY | ||
96 | is set then | ||
97 | .Dv CMS_TEXT | ||
98 | is ignored. | ||
99 | .Pp | ||
100 | If the | ||
101 | .Dv CMS_STREAM | ||
102 | flag is set, a partial | ||
103 | .Vt CMS_ContentInfo | ||
104 | structure is returned suitable for streaming I/O: no data is read from | ||
105 | the BIO | ||
106 | .Fa in . | ||
107 | .Pp | ||
108 | The compressed data is included in the | ||
109 | .Vt CMS_ContentInfo | ||
110 | structure unless | ||
111 | .Dv CMS_DETACHED | ||
112 | is set, in which case it is omitted. | ||
113 | This is rarely used in practice and is not supported by | ||
114 | .Xr SMIME_write_CMS 3 . | ||
115 | .Pp | ||
116 | If the flag | ||
117 | .Dv CMS_STREAM | ||
118 | is set, the returned | ||
119 | .Vt CMS_ContentInfo | ||
120 | structure is | ||
121 | .Em not | ||
122 | complete and outputting its contents via a function that does not | ||
123 | properly finalize the | ||
124 | .Vt CMS_ContentInfo | ||
125 | structure will give unpredictable results. | ||
126 | .Pp | ||
127 | Several functions including | ||
128 | .Xr SMIME_write_CMS 3 , | ||
129 | .Xr i2d_CMS_bio_stream 3 , | ||
130 | and | ||
131 | .Xr PEM_write_bio_CMS_stream 3 | ||
132 | finalize the structure. | ||
133 | Alternatively finalization can be performed by obtaining the streaming | ||
134 | ASN1 | ||
135 | .Vt BIO | ||
136 | directly using | ||
137 | .Xr BIO_new_CMS 3 . | ||
138 | .Pp | ||
139 | Additional compression parameters such as the zlib compression level | ||
140 | cannot currently be set. | ||
141 | .Sh RETURN VALUES | ||
142 | .Fn CMS_compress | ||
143 | returns either a | ||
144 | .Vt CMS_ContentInfo | ||
145 | structure or | ||
146 | .Dv NULL | ||
147 | if an error occurred. | ||
148 | The error can be obtained from | ||
149 | .Xr ERR_get_error 3 . | ||
150 | .Sh SEE ALSO | ||
151 | .Xr CMS_uncompress 3 | ||
152 | .Sh HISTORY | ||
153 | .Fn CMS_compress | ||
154 | was added to OpenSSL 0.9.8. | ||
155 | The | ||
156 | .Dv CMS_STREAM | ||
157 | flag was added in OpenSSL 1.0.0. | ||
diff --git a/src/lib/libcrypto/man/CMS_decrypt.3 b/src/lib/libcrypto/man/CMS_decrypt.3 new file mode 100644 index 0000000000..de37b357a1 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_decrypt.3 | |||
@@ -0,0 +1,169 @@ | |||
1 | .\" $OpenBSD: CMS_decrypt.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008, 2014 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_DECRYPT 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_decrypt | ||
56 | .Nd decrypt content from a CMS envelopedData structure | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft int | ||
60 | .Fo CMS_decrypt | ||
61 | .Fa "CMS_ContentInfo *cms" | ||
62 | .Fa "EVP_PKEY *pkey" | ||
63 | .Fa "X509 *cert" | ||
64 | .Fa "BIO *dcont" | ||
65 | .Fa "BIO *out" | ||
66 | .Fa "unsigned int flags" | ||
67 | .Fc | ||
68 | .Sh DESCRIPTION | ||
69 | .Fn CMS_decrypt | ||
70 | extracts and decrypts the content from a CMS EnvelopedData structure. | ||
71 | .Fa pkey | ||
72 | is the private key of the recipient, | ||
73 | .Fa cert | ||
74 | is the recipient's certificate, | ||
75 | .Fa out | ||
76 | is a | ||
77 | .Vt BIO | ||
78 | to write the content to and | ||
79 | .Fa flags | ||
80 | is an optional set of flags. | ||
81 | .Pp | ||
82 | The | ||
83 | .Fa dcont | ||
84 | parameter is used in the rare case where the encrypted content is | ||
85 | detached. | ||
86 | It will normally be set to | ||
87 | .Dv NULL . | ||
88 | .Pp | ||
89 | Although the recipients certificate is not needed to decrypt the data it | ||
90 | is needed to locate the appropriate (of possible several) recipients in | ||
91 | the CMS structure. | ||
92 | .Pp | ||
93 | If | ||
94 | .Fa cert | ||
95 | is set to | ||
96 | .Dv NULL , | ||
97 | all possible recipients are tried. | ||
98 | This case however is problematic. | ||
99 | To thwart the MMA attack (Bleichenbacher's attack on PKCS #1 v1.5 RSA | ||
100 | padding) all recipients are tried whether they succeed or not. | ||
101 | If no recipient succeeds then a random symmetric key is used to decrypt | ||
102 | the content: this will typically output garbage and may (but is not | ||
103 | guaranteed to) ultimately return a padding error only. | ||
104 | If | ||
105 | .Fn CMS_decrypt | ||
106 | just returned an error when all recipient encrypted keys failed to | ||
107 | decrypt an attacker could use this in a timing attack. | ||
108 | If the special flag | ||
109 | .Dv CMS_DEBUG_DECRYPT | ||
110 | is set, then the above behaviour is modified and an error | ||
111 | .Em is | ||
112 | returned if no recipient encrypted key can be decrypted | ||
113 | .Em without | ||
114 | generating a random content encryption key. | ||
115 | Applications should use this flag with extreme caution | ||
116 | especially in automated gateways as it can leave them open to attack. | ||
117 | .Pp | ||
118 | It is possible to determine the correct recipient key by other means | ||
119 | (for example looking them up in a database) and setting them in the CMS | ||
120 | structure in advance using the CMS utility functions such as | ||
121 | .Xr CMS_set1_pkey 3 . | ||
122 | In this case both | ||
123 | .Fa cert | ||
124 | and | ||
125 | .Fa pkey | ||
126 | should be set to | ||
127 | .Dv NULL . | ||
128 | .Pp | ||
129 | To process KEKRecipientInfo types, | ||
130 | .Xr CMS_set1_key 3 | ||
131 | or | ||
132 | .Xr CMS_RecipientInfo_set0_key 3 | ||
133 | and | ||
134 | .Xr CMS_RecipientInfo_decrypt 3 | ||
135 | should be called before | ||
136 | .Fn CMS_decrypt | ||
137 | and | ||
138 | .Fa cert | ||
139 | and | ||
140 | .Fa pkey | ||
141 | set to | ||
142 | .Dv NULL . | ||
143 | .Pp | ||
144 | The following flags can be passed in the | ||
145 | .Fa flags | ||
146 | parameter: | ||
147 | .Pp | ||
148 | If the | ||
149 | .Dv CMS_TEXT | ||
150 | flag is set, MIME headers for type text/plain | ||
151 | are deleted from the content. | ||
152 | If the content is not of type text/plain, | ||
153 | then an error is returned. | ||
154 | .Sh RETURN VALUES | ||
155 | .Fn CMS_decrypt | ||
156 | returns either 1 for success or 0 for failure. | ||
157 | The error can be obtained from | ||
158 | .Xr ERR_get_error 3 . | ||
159 | .Sh SEE ALSO | ||
160 | .Xr CMS_encrypt 3 | ||
161 | .Sh HISTORY | ||
162 | .Fn CMS_decrypt | ||
163 | was added to OpenSSL 0.9.8. | ||
164 | .Sh BUGS | ||
165 | The lack of single pass processing and the need to hold all data in | ||
166 | memory as mentioned in | ||
167 | .Xr CMS_verify 3 | ||
168 | also applies to | ||
169 | .Fn CMS_decrypt . | ||
diff --git a/src/lib/libcrypto/man/CMS_encrypt.3 b/src/lib/libcrypto/man/CMS_encrypt.3 new file mode 100644 index 0000000000..8550de2c9f --- /dev/null +++ b/src/lib/libcrypto/man/CMS_encrypt.3 | |||
@@ -0,0 +1,190 @@ | |||
1 | .\" $OpenBSD: CMS_encrypt.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 83cf7abf May 29 13:07:08 2018 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_ENCRYPT 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_encrypt | ||
56 | .Nd create a CMS envelopedData structure | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft CMS_ContentInfo * | ||
60 | .Fo CMS_encrypt | ||
61 | .Fa "STACK_OF(X509) *certs" | ||
62 | .Fa "BIO *in" | ||
63 | .Fa "const EVP_CIPHER *cipher" | ||
64 | .Fa "unsigned int flags" | ||
65 | .Fc | ||
66 | .Sh DESCRIPTION | ||
67 | .Fn CMS_encrypt | ||
68 | creates and returns a CMS EnvelopedData structure. | ||
69 | .Fa certs | ||
70 | is a list of recipient certificates. | ||
71 | .Fa in | ||
72 | is the content to be encrypted. | ||
73 | .Fa cipher | ||
74 | is the symmetric cipher to use. | ||
75 | .Fa flags | ||
76 | is an optional set of flags. | ||
77 | .Pp | ||
78 | Only certificates carrying RSA, Diffie-Hellman or EC keys are supported | ||
79 | by this function. | ||
80 | .Pp | ||
81 | .Xr EVP_des_ede3_cbc 3 | ||
82 | (triple DES) is the algorithm of choice for S/MIME use because most | ||
83 | clients will support it. | ||
84 | .Pp | ||
85 | The algorithm passed in the | ||
86 | .Fa cipher | ||
87 | parameter must support ASN1 encoding of its parameters. | ||
88 | .Pp | ||
89 | Many browsers implement a "sign and encrypt" option which is simply an | ||
90 | S/MIME envelopedData containing an S/MIME signed message. | ||
91 | This can be readily produced by storing the S/MIME signed message in a | ||
92 | memory BIO and passing it to | ||
93 | .Fn CMS_encrypt . | ||
94 | .Pp | ||
95 | The following flags can be passed in the | ||
96 | .Fa flags | ||
97 | parameter: | ||
98 | .Bl -tag -width Ds | ||
99 | .It Dv CMS_TEXT | ||
100 | MIME headers for type text/plain are prepended to the data. | ||
101 | .It Dv CMS_BINARY | ||
102 | Do not translate the supplied content into MIME canonical format | ||
103 | even though that is required by the S/MIME specifications. | ||
104 | This option should be used if the supplied data is in binary format. | ||
105 | Otherwise, the translation will corrupt it. | ||
106 | If | ||
107 | .Dv CMS_BINARY | ||
108 | is set, then | ||
109 | .Dv CMS_TEXT | ||
110 | is ignored. | ||
111 | .It Dv CMS_USE_KEYID | ||
112 | Use the subject key identifier value to identify recipient certificates. | ||
113 | An error occurs if all recipient certificates do not have a subject key | ||
114 | identifier extension. | ||
115 | By default, issuer name and serial number are used instead. | ||
116 | .It Dv CMS_STREAM | ||
117 | Return a partial | ||
118 | .Vt CMS_ContentInfo | ||
119 | structure suitable for streaming I/O: no data is read from the BIO | ||
120 | .Fa in . | ||
121 | .It Dv CMS_PARTIAL | ||
122 | Return a partial | ||
123 | .Vt CMS_ContentInfo | ||
124 | structure to which additional recipients and attributes can | ||
125 | be added before finalization. | ||
126 | .It Dv CMS_DETACHED | ||
127 | Omit the data being encrypted from the | ||
128 | .Vt CMS_ContentInfo | ||
129 | structure. | ||
130 | This is rarely used in practice and is not supported by | ||
131 | .Xr SMIME_write_CMS 3 . | ||
132 | .El | ||
133 | .Pp | ||
134 | If the flag | ||
135 | .Dv CMS_STREAM | ||
136 | is set, the returned | ||
137 | .Vt CMS_ContentInfo | ||
138 | structure is | ||
139 | .Em not | ||
140 | complete and outputting its contents via a function that does not | ||
141 | properly finalize the | ||
142 | .Vt CMS_ContentInfo | ||
143 | structure will give unpredictable results. | ||
144 | .Pp | ||
145 | Several functions including | ||
146 | .Xr SMIME_write_CMS 3 , | ||
147 | .Xr i2d_CMS_bio_stream 3 , | ||
148 | .Xr PEM_write_bio_CMS_stream 3 | ||
149 | finalize the structure. | ||
150 | Alternatively finalization can be performed by obtaining the streaming | ||
151 | ASN1 | ||
152 | .Vt BIO | ||
153 | directly using | ||
154 | .Xr BIO_new_CMS 3 . | ||
155 | .Pp | ||
156 | The recipients specified in | ||
157 | .Fa certs | ||
158 | use a CMS KeyTransRecipientInfo info structure. | ||
159 | KEKRecipientInfo is also supported using the flag | ||
160 | .Dv CMS_PARTIAL | ||
161 | and | ||
162 | .Xr CMS_add0_recipient_key 3 . | ||
163 | .Pp | ||
164 | The parameter | ||
165 | .Fa certs | ||
166 | may be | ||
167 | .Dv NULL | ||
168 | if | ||
169 | .Dv CMS_PARTIAL | ||
170 | is set and recipients are added later using | ||
171 | .Xr CMS_add1_recipient_cert 3 | ||
172 | or | ||
173 | .Xr CMS_add0_recipient_key 3 . | ||
174 | .Sh RETURN VALUES | ||
175 | .Fn CMS_encrypt | ||
176 | returns either a | ||
177 | .Vt CMS_ContentInfo | ||
178 | structure or | ||
179 | .Dv NULL | ||
180 | if an error occurred. | ||
181 | The error can be obtained from | ||
182 | .Xr ERR_get_error 3 . | ||
183 | .Sh SEE ALSO | ||
184 | .Xr CMS_decrypt 3 | ||
185 | .Sh HISTORY | ||
186 | .Fn CMS_encrypt | ||
187 | was added to OpenSSL 0.9.8. | ||
188 | The | ||
189 | .Sy CMS_STREAM | ||
190 | flag was first supported in OpenSSL 1.0.0. | ||
diff --git a/src/lib/libcrypto/man/CMS_final.3 b/src/lib/libcrypto/man/CMS_final.3 new file mode 100644 index 0000000000..8404005c74 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_final.3 | |||
@@ -0,0 +1,98 @@ | |||
1 | .\" $OpenBSD: CMS_final.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 25ccb589 Jul 1 02:02:06 2019 +0800 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_FINAL 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_final | ||
56 | .Nd finalise a CMS_ContentInfo structure | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft int | ||
60 | .Fo CMS_final | ||
61 | .Fa "CMS_ContentInfo *cms" | ||
62 | .Fa "BIO *data" | ||
63 | .Fa "BIO *dcont" | ||
64 | .Fa "unsigned int flags" | ||
65 | .Fc | ||
66 | .Sh DESCRIPTION | ||
67 | .Fn CMS_final | ||
68 | finalises the structure | ||
69 | .Fa cms . | ||
70 | Its purpose is to perform any operations necessary on | ||
71 | .Fa cms | ||
72 | (digest computation for example) and set the appropriate fields. | ||
73 | The parameter | ||
74 | .Fa data | ||
75 | contains the content to be processed. | ||
76 | The | ||
77 | .Fa dcont | ||
78 | parameter contains a | ||
79 | .Vt BIO | ||
80 | to write content to after processing: this is | ||
81 | only used with detached data and will usually be set to | ||
82 | .Dv NULL . | ||
83 | .Pp | ||
84 | This function will normally be called when the | ||
85 | .Dv CMS_PARTIAL | ||
86 | flag is used. | ||
87 | It should only be used when streaming is not performed because the | ||
88 | streaming I/O functions perform finalisation operations internally. | ||
89 | .Sh RETURN VALUES | ||
90 | .Fn CMS_final | ||
91 | returns 1 for success or 0 for failure. | ||
92 | .Sh SEE ALSO | ||
93 | .Xr CMS_encrypt 3 , | ||
94 | .Xr CMS_sign 3 , | ||
95 | .Xr ERR_get_error 3 | ||
96 | .Sh HISTORY | ||
97 | .Fn CMS_final | ||
98 | was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 b/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 new file mode 100644 index 0000000000..07c16c5675 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 | |||
@@ -0,0 +1,323 @@ | |||
1 | .\" $OpenBSD: CMS_get0_RecipientInfos.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008, 2013 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_GET0_RECIPIENTINFOS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_get0_RecipientInfos , | ||
56 | .Nm CMS_RecipientInfo_type , | ||
57 | .Nm CMS_RecipientInfo_ktri_get0_signer_id , | ||
58 | .Nm CMS_RecipientInfo_ktri_cert_cmp , | ||
59 | .Nm CMS_RecipientInfo_set0_pkey , | ||
60 | .Nm CMS_RecipientInfo_kekri_get0_id , | ||
61 | .Nm CMS_RecipientInfo_kekri_id_cmp , | ||
62 | .Nm CMS_RecipientInfo_set0_key , | ||
63 | .Nm CMS_RecipientInfo_decrypt , | ||
64 | .Nm CMS_RecipientInfo_encrypt | ||
65 | .Nd CMS envelopedData RecipientInfo routines | ||
66 | .Sh SYNOPSIS | ||
67 | .In openssl/cms.h | ||
68 | .Ft STACK_OF(CMS_RecipientInfo) * | ||
69 | .Fo CMS_get0_RecipientInfos | ||
70 | .Fa "CMS_ContentInfo *cms" | ||
71 | .Fc | ||
72 | .Ft int | ||
73 | .Fo CMS_RecipientInfo_type | ||
74 | .Fa "CMS_RecipientInfo *ri" | ||
75 | .Fc | ||
76 | .Ft int | ||
77 | .Fo CMS_RecipientInfo_ktri_get0_signer_id | ||
78 | .Fa "CMS_RecipientInfo *ri" | ||
79 | .Fa "ASN1_OCTET_STRING **keyid" | ||
80 | .Fa "X509_NAME **issuer" | ||
81 | .Fa "ASN1_INTEGER **sno" | ||
82 | .Fc | ||
83 | .Ft int | ||
84 | .Fo CMS_RecipientInfo_ktri_cert_cmp | ||
85 | .Fa "CMS_RecipientInfo *ri" | ||
86 | .Fa "X509 *cert" | ||
87 | .Fc | ||
88 | .Ft int | ||
89 | .Fo CMS_RecipientInfo_set0_pkey | ||
90 | .Fa "CMS_RecipientInfo *ri" | ||
91 | .Fa "EVP_PKEY *pkey" | ||
92 | .Fc | ||
93 | .Ft int | ||
94 | .Fo CMS_RecipientInfo_kekri_get0_id | ||
95 | .Fa "CMS_RecipientInfo *ri" | ||
96 | .Fa "X509_ALGOR **palg" | ||
97 | .Fa "ASN1_OCTET_STRING **pid" | ||
98 | .Fa "ASN1_GENERALIZEDTIME **pdate" | ||
99 | .Fa "ASN1_OBJECT **potherid" | ||
100 | .Fa "ASN1_TYPE **pothertype" | ||
101 | .Fc | ||
102 | .Ft int | ||
103 | .Fo CMS_RecipientInfo_kekri_id_cmp | ||
104 | .Fa "CMS_RecipientInfo *ri" | ||
105 | .Fa "const unsigned char *id" | ||
106 | .Fa "size_t idlen" | ||
107 | .Fc | ||
108 | .Ft int | ||
109 | .Fo CMS_RecipientInfo_set0_key | ||
110 | .Fa "CMS_RecipientInfo *ri" | ||
111 | .Fa "unsigned char *key" | ||
112 | .Fa "size_t keylen" | ||
113 | .Fc | ||
114 | .Ft int | ||
115 | .Fo CMS_RecipientInfo_decrypt | ||
116 | .Fa "CMS_ContentInfo *cms" | ||
117 | .Fa "CMS_RecipientInfo *ri" | ||
118 | .Fc | ||
119 | .Ft int | ||
120 | .Fo CMS_RecipientInfo_encrypt | ||
121 | .Fa "CMS_ContentInfo *cms" | ||
122 | .Fa "CMS_RecipientInfo *ri" | ||
123 | .Fc | ||
124 | .Sh DESCRIPTION | ||
125 | The function | ||
126 | .Fn CMS_get0_RecipientInfos | ||
127 | returns all the | ||
128 | .Vt CMS_RecipientInfo | ||
129 | structures associated with a CMS EnvelopedData structure. | ||
130 | .Pp | ||
131 | .Fn CMS_RecipientInfo_type | ||
132 | returns the type of the | ||
133 | .Vt CMS_RecipientInfo | ||
134 | structure | ||
135 | .Fa ri . | ||
136 | It will currently return | ||
137 | .Dv CMS_RECIPINFO_TRANS , | ||
138 | .Dv CMS_RECIPINFO_AGREE , | ||
139 | .Dv CMS_RECIPINFO_KEK , | ||
140 | .Dv CMS_RECIPINFO_PASS , | ||
141 | or | ||
142 | .Dv CMS_RECIPINFO_OTHER . | ||
143 | .Pp | ||
144 | .Fn CMS_RecipientInfo_ktri_get0_signer_id | ||
145 | retrieves the certificate recipient identifier associated with a | ||
146 | specific | ||
147 | .Vt CMS_RecipientInfo | ||
148 | structure | ||
149 | .Fa ri , | ||
150 | which must be of type | ||
151 | .Dv CMS_RECIPINFO_TRANS . | ||
152 | Either the keyidentifier will be set in | ||
153 | .Fa keyid | ||
154 | or | ||
155 | .Em both | ||
156 | issuer name and serial number in | ||
157 | .Fa issuer | ||
158 | and | ||
159 | .Fa sno . | ||
160 | .Pp | ||
161 | .Fn CMS_RecipientInfo_ktri_cert_cmp | ||
162 | compares the certificate | ||
163 | .Fa cert | ||
164 | against the | ||
165 | .Vt CMS_RecipientInfo | ||
166 | structure | ||
167 | .Fa ri , | ||
168 | which must be of type | ||
169 | .Dv CMS_RECIPINFO_TRANS . | ||
170 | It returns zero if the comparison is successful or non-zero if not. | ||
171 | .Pp | ||
172 | .Fn CMS_RecipientInfo_set0_pkey | ||
173 | associates the private key | ||
174 | .Fa pkey | ||
175 | with the | ||
176 | .Vt CMS_RecipientInfo | ||
177 | structure | ||
178 | .Fa ri , | ||
179 | which must be of type | ||
180 | .Dv CMS_RECIPINFO_TRANS . | ||
181 | .Pp | ||
182 | .Fn CMS_RecipientInfo_kekri_get0_id | ||
183 | retrieves the key information from the | ||
184 | .Vt CMS_RecipientInfo | ||
185 | structure | ||
186 | .Fa ri | ||
187 | which must be of type | ||
188 | .Dv CMS_RECIPINFO_KEK . | ||
189 | Any of the remaining parameters can be | ||
190 | .Dv NULL | ||
191 | if the application is not interested in the value of a field. | ||
192 | Where a field is optional and absent, | ||
193 | .Dv NULL | ||
194 | will be written to the corresponding parameter. | ||
195 | The keyEncryptionAlgorithm field is written to | ||
196 | .Fa palg , | ||
197 | the keyIdentifier field is written to | ||
198 | .Fa pid , | ||
199 | the | ||
200 | .Sy date | ||
201 | field if present is written to | ||
202 | .Fa pdate . | ||
203 | If the | ||
204 | .Sy other | ||
205 | field is present the components | ||
206 | .Sy keyAttrId | ||
207 | and | ||
208 | .Sy keyAttr | ||
209 | are written to the parameters | ||
210 | .Fa potherid | ||
211 | and | ||
212 | .Fa pothertype . | ||
213 | .Pp | ||
214 | .Fn CMS_RecipientInfo_kekri_id_cmp | ||
215 | compares the ID in the | ||
216 | .Fa id | ||
217 | and | ||
218 | .Fa idlen | ||
219 | parameters against the keyIdentifier | ||
220 | .Vt CMS_RecipientInfo | ||
221 | structure | ||
222 | .Fa ri , | ||
223 | which must be of type | ||
224 | .Dv CMS_RECIPINFO_KEK . | ||
225 | It returns zero if the comparison is successful or non-zero if not. | ||
226 | .Pp | ||
227 | .Fn CMS_RecipientInfo_set0_key | ||
228 | associates the symmetric key | ||
229 | .Fa key | ||
230 | of length | ||
231 | .Fa keylen | ||
232 | with the | ||
233 | .Vt CMS_RecipientInfo | ||
234 | structure | ||
235 | .Fa ri , | ||
236 | which must be of type | ||
237 | .Dv CMS_RECIPINFO_KEK . | ||
238 | .Pp | ||
239 | .Fn CMS_RecipientInfo_decrypt | ||
240 | attempts to decrypt the | ||
241 | .Vt CMS_RecipientInfo | ||
242 | structure | ||
243 | .Fa ri | ||
244 | in structure | ||
245 | .Fa cms . | ||
246 | A key must have been associated with the structure first. | ||
247 | .Pp | ||
248 | .Fn CMS_RecipientInfo_encrypt | ||
249 | attempts to encrypt the | ||
250 | .Vt CMS_RecipientInfo | ||
251 | structure | ||
252 | .Fa ri | ||
253 | in structure | ||
254 | .Fa cms . | ||
255 | A key must have been associated with the structure first and the content | ||
256 | encryption key must be available: for example by a previous call to | ||
257 | .Fn CMS_RecipientInfo_decrypt . | ||
258 | .Pp | ||
259 | The main purpose of these functions is to enable an application to | ||
260 | lookup recipient keys using any appropriate technique when the simpler | ||
261 | method of | ||
262 | .Xr CMS_decrypt 3 | ||
263 | is not appropriate. | ||
264 | .Pp | ||
265 | In typical usage, an application will retrieve all | ||
266 | .Vt CMS_RecipientInfo | ||
267 | structures using | ||
268 | .Fn CMS_get0_RecipientInfos | ||
269 | and check the type of each using | ||
270 | .Fn CMS_RecipientInfo_type . | ||
271 | Depending on the type, the | ||
272 | .Vt CMS_RecipientInfo | ||
273 | structure can be ignored or its key identifier data retrieved using | ||
274 | an appropriate function. | ||
275 | If the corresponding secret or private key can be obtained by any | ||
276 | appropriate means it can then be associated with the structure and | ||
277 | .Fn CMS_RecipientInfo_decrypt | ||
278 | called. | ||
279 | If successful, | ||
280 | .Xr CMS_decrypt 3 | ||
281 | can be called with a | ||
282 | .Dv NULL | ||
283 | key to decrypt the enveloped content. | ||
284 | .Pp | ||
285 | The function | ||
286 | .Fn CMS_RecipientInfo_encrypt | ||
287 | can be used to add a new recipient to an existing enveloped data | ||
288 | structure. | ||
289 | Typically an application will first decrypt an appropriate | ||
290 | .Vt CMS_RecipientInfo | ||
291 | structure to make the content encrypt key available. | ||
292 | Ot will then add a new recipient using a function such as | ||
293 | .Xr CMS_add1_recipient_cert 3 | ||
294 | and finally encrypt the content encryption key using | ||
295 | .Fn CMS_RecipientInfo_encrypt . | ||
296 | .Sh RETURN VALUES | ||
297 | .Fn CMS_get0_RecipientInfos | ||
298 | returns all | ||
299 | .Vt CMS_RecipientInfo | ||
300 | structures, or | ||
301 | .Dv NULL | ||
302 | if an error occurs. | ||
303 | .Pp | ||
304 | .Fn CMS_RecipientInfo_ktri_get0_signer_id , | ||
305 | .Fn CMS_RecipientInfo_set0_pkey , | ||
306 | .Fn CMS_RecipientInfo_kekri_get0_id , | ||
307 | .Fn CMS_RecipientInfo_set0_key , | ||
308 | .Fn CMS_RecipientInfo_decrypt , | ||
309 | and | ||
310 | .Fn CMS_RecipientInfo_encrypt | ||
311 | return 1 for success or 0 if an error occurs. | ||
312 | .Pp | ||
313 | .Fn CMS_RecipientInfo_ktri_cert_cmp | ||
314 | and | ||
315 | .Fn CMS_RecipientInfo_kekri_id_cmp | ||
316 | return 0 for a successful comparison or non-zero otherwise. | ||
317 | .Pp | ||
318 | Any error can be obtained from | ||
319 | .Xr ERR_get_error 3 . | ||
320 | .Sh SEE ALSO | ||
321 | .Xr CMS_decrypt 3 | ||
322 | .Sh HISTORY | ||
323 | These functions were first was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_get0_SignerInfos.3 b/src/lib/libcrypto/man/CMS_get0_SignerInfos.3 new file mode 100644 index 0000000000..b9c8fee366 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_get0_SignerInfos.3 | |||
@@ -0,0 +1,180 @@ | |||
1 | .\" $OpenBSD: CMS_get0_SignerInfos.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 83cf7abf May 29 13:07:08 2018 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008, 2013 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_GET0_SIGNERINFOS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_get0_SignerInfos , | ||
56 | .Nm CMS_SignerInfo_get0_signer_id , | ||
57 | .Nm CMS_SignerInfo_get0_signature , | ||
58 | .Nm CMS_SignerInfo_cert_cmp , | ||
59 | .Nm CMS_SignerInfo_set1_signer_cert | ||
60 | .Nd CMS signedData signer functions | ||
61 | .Sh SYNOPSIS | ||
62 | .In openssl/cms.h | ||
63 | .Ft STACK_OF(CMS_SignerInfo) * | ||
64 | .Fo CMS_get0_SignerInfos | ||
65 | .Fa "CMS_ContentInfo *cms" | ||
66 | .Fc | ||
67 | .Ft int | ||
68 | .Fo CMS_SignerInfo_get0_signer_id | ||
69 | .Fa "CMS_SignerInfo *si" | ||
70 | .Fa "ASN1_OCTET_STRING **keyid" | ||
71 | .Fa "X509_NAME **issuer" | ||
72 | .Fa "ASN1_INTEGER **sno" | ||
73 | .Fc | ||
74 | .Ft ASN1_OCTET_STRING * | ||
75 | .Fo CMS_SignerInfo_get0_signature | ||
76 | .Fa "CMS_SignerInfo *si" | ||
77 | .Fc | ||
78 | .Ft int | ||
79 | .Fo CMS_SignerInfo_cert_cmp | ||
80 | .Fa "CMS_SignerInfo *si" | ||
81 | .Fa "X509 *cert" | ||
82 | .Fc | ||
83 | .Ft void | ||
84 | .Fo CMS_SignerInfo_set1_signer_cert | ||
85 | .Fa "CMS_SignerInfo *si" | ||
86 | .Fa "X509 *signer" | ||
87 | .Fc | ||
88 | .Sh DESCRIPTION | ||
89 | The function | ||
90 | .Fn CMS_get0_SignerInfos | ||
91 | returns all the | ||
92 | .Vt CMS_SignerInfo | ||
93 | structures associated with a CMS signedData structure. | ||
94 | .Pp | ||
95 | .Fn CMS_SignerInfo_get0_signer_id | ||
96 | retrieves the certificate signer identifier associated with a specific | ||
97 | .Vt CMS_SignerInfo | ||
98 | structure | ||
99 | .Fa si . | ||
100 | Either the keyidentifier will be set in | ||
101 | .Fa keyid | ||
102 | or | ||
103 | .Em both | ||
104 | issuer name and serial number in | ||
105 | .Fa issuer | ||
106 | and | ||
107 | .Fa sno . | ||
108 | .Pp | ||
109 | .Fn CMS_SignerInfo_get0_signature | ||
110 | retrieves the signature associated with | ||
111 | .Fa si | ||
112 | in a pointer to an | ||
113 | .Vt ASN1_OCTET_STRING | ||
114 | structure. | ||
115 | This pointer returned corresponds to the internal signature value of | ||
116 | .Fa si | ||
117 | so it may be read or modified. | ||
118 | .Pp | ||
119 | .Fn CMS_SignerInfo_cert_cmp | ||
120 | compares the certificate | ||
121 | .Fa cert | ||
122 | against the signer identifier | ||
123 | .Fa si . | ||
124 | It returns zero if the comparison is successful or non-zero if not. | ||
125 | .Pp | ||
126 | .Fn CMS_SignerInfo_set1_signer_cert | ||
127 | sets the signers certificate of | ||
128 | .Fa si | ||
129 | to | ||
130 | .Fa signer . | ||
131 | .Pp | ||
132 | The main purpose of these functions is to enable an application to | ||
133 | lookup signers certificates using any appropriate technique when the | ||
134 | simpler method of | ||
135 | .Xr CMS_verify 3 | ||
136 | is not appropriate. | ||
137 | .Pp | ||
138 | In typical usage an application will retrieve all | ||
139 | .Vt CMS_SignerInfo | ||
140 | structures using | ||
141 | .Fn CMS_get0_SignerInfos | ||
142 | and retrieve the identifier information using CMS. | ||
143 | It will then obtain the signer certificate by some unspecified means | ||
144 | (or return and error if it cannot be found) and set it using | ||
145 | .Fn CMS_SignerInfo_set1_signer_cert . | ||
146 | .Pp | ||
147 | Once all signer certificates have been set, | ||
148 | .Xr CMS_verify 3 | ||
149 | can be used. | ||
150 | .Pp | ||
151 | Although | ||
152 | .Fn CMS_get0_SignerInfos | ||
153 | can return | ||
154 | .Dv NULL | ||
155 | if an error occurs | ||
156 | .Em or | ||
157 | if there are no signers, this is not a problem in practice because the | ||
158 | only error which can occur is if the | ||
159 | .Fa cms | ||
160 | structure is not of type signedData due to application error. | ||
161 | .Sh RETURN VALUES | ||
162 | .Fn CMS_get0_SignerInfos | ||
163 | returns all | ||
164 | .Vt CMS_SignerInfo | ||
165 | structures, or | ||
166 | .Dv NULL | ||
167 | if there are no signers or an error occurs. | ||
168 | .Pp | ||
169 | .Fn CMS_SignerInfo_get0_signer_id | ||
170 | returns 1 for success or 0 for failure. | ||
171 | .Pp | ||
172 | .Fn CMS_SignerInfo_cert_cmp | ||
173 | returns 0 for a successful comparison or non-zero otherwise. | ||
174 | .Pp | ||
175 | Any error can be obtained from | ||
176 | .Xr ERR_get_error 3 . | ||
177 | .Sh SEE ALSO | ||
178 | .Xr CMS_verify 3 | ||
179 | .Sh HISTORY | ||
180 | These functions were first was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_get0_type.3 b/src/lib/libcrypto/man/CMS_get0_type.3 new file mode 100644 index 0000000000..982826c7ca --- /dev/null +++ b/src/lib/libcrypto/man/CMS_get0_type.3 | |||
@@ -0,0 +1,174 @@ | |||
1 | .\" $OpenBSD: CMS_get0_type.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 72a7a702 Feb 26 14:05:09 2019 +0000 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008, 2015 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_GET0_TYPE 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_get0_type , | ||
56 | .Nm CMS_set1_eContentType , | ||
57 | .Nm CMS_get0_eContentType , | ||
58 | .Nm CMS_get0_content | ||
59 | .Nd get and set CMS content types and content | ||
60 | .Sh SYNOPSIS | ||
61 | .In openssl/cms.h | ||
62 | .Ft const ASN1_OBJECT * | ||
63 | .Fo CMS_get0_type | ||
64 | .Fa "const CMS_ContentInfo *cms" | ||
65 | .Fc | ||
66 | .Ft int | ||
67 | .Fo CMS_set1_eContentType | ||
68 | .Fa "CMS_ContentInfo *cms" | ||
69 | .Fa "const ASN1_OBJECT *oid" | ||
70 | .Fc | ||
71 | .Ft const ASN1_OBJECT * | ||
72 | .Fo CMS_get0_eContentType | ||
73 | .Fa "CMS_ContentInfo *cms" | ||
74 | .Fc | ||
75 | .Ft ASN1_OCTET_STRING ** | ||
76 | .Fo CMS_get0_content | ||
77 | .Fa "CMS_ContentInfo *cms" | ||
78 | .Fc | ||
79 | .Sh DESCRIPTION | ||
80 | .Fn CMS_get0_type | ||
81 | returns the content type of a | ||
82 | .Vt CMS_ContentInfo | ||
83 | structure as an | ||
84 | .Vt ASN1_OBJECT | ||
85 | pointer. | ||
86 | An application can then decide how to process the | ||
87 | .Vt CMS_ContentInfo | ||
88 | structure based on this value. | ||
89 | .Pp | ||
90 | .Fn CMS_set1_eContentType | ||
91 | sets the embedded content type of a | ||
92 | .Vt CMS_ContentInfo | ||
93 | structure. | ||
94 | It should be called with CMS functions (such as | ||
95 | .Xr CMS_sign 3 , | ||
96 | .Xr CMS_encrypt 3 ) | ||
97 | with the | ||
98 | .Dv CMS_PARTIAL | ||
99 | flag and | ||
100 | .Em before | ||
101 | the structure is finalised, otherwise the results are undefined. | ||
102 | .Pp | ||
103 | .Fn CMS_get0_eContentType | ||
104 | returns a pointer to the embedded content type. | ||
105 | .Pp | ||
106 | .Fn CMS_get0_content | ||
107 | returns a pointer to the | ||
108 | .Vt ASN1_OCTET_STRING | ||
109 | pointer containing the embedded content. | ||
110 | .Pp | ||
111 | As the | ||
112 | .Sq 0 | ||
113 | in the function names imply, | ||
114 | .Fn CMS_get0_type , | ||
115 | .Fn CMS_get0_eContentType , | ||
116 | and | ||
117 | .Fn CMS_get0_content | ||
118 | return internal pointers which should | ||
119 | .Em not | ||
120 | be freed up. | ||
121 | .Fn CMS_set1_eContentType | ||
122 | copies the supplied OID and it | ||
123 | .Em should | ||
124 | be freed up after use. | ||
125 | .Pp | ||
126 | The | ||
127 | .Vt ASN1_OBJECT | ||
128 | values returned can be converted to an integer NID value using | ||
129 | .Xr OBJ_obj2nid 3 . | ||
130 | For the currently supported content types the following values are | ||
131 | returned: | ||
132 | .Dv NID_pkcs7_data , | ||
133 | .Dv NID_pkcs7_signed , | ||
134 | .Dv NID_pkcs7_digest , | ||
135 | .Dv NID_id_smime_ct_compressedData , | ||
136 | .Dv NID_pkcs7_encrypted , | ||
137 | .Dv NID_pkcs7_enveloped . | ||
138 | .Pp | ||
139 | The return value of | ||
140 | .Fn CMS_get0_content | ||
141 | is a pointer to the | ||
142 | .Vt ASN1_OCTET_STRING | ||
143 | content pointer. | ||
144 | That means that for example after | ||
145 | .Pp | ||
146 | .Dl ASN1_OCTET_STRING **pconf = CMS_get0_content(cms); | ||
147 | .Pp | ||
148 | .Pf * Va pconf | ||
149 | could be | ||
150 | .Dv NULL | ||
151 | if there is no embedded content. | ||
152 | Applications can access, modify or create the embedded content in a | ||
153 | .Vt CMS_ContentInfo | ||
154 | structure using this function. | ||
155 | Applications usually will not need to modify the embedded content as it | ||
156 | is normally set by higher level functions. | ||
157 | .Sh RETURN VALUES | ||
158 | .Fn CMS_get0_type | ||
159 | and | ||
160 | .Fn CMS_get0_eContentType | ||
161 | return an | ||
162 | .Vt ASN1_OBJECT | ||
163 | structure. | ||
164 | .Pp | ||
165 | .Fn CMS_set1_eContentType | ||
166 | returns 1 for success or 0 if an error occurred. | ||
167 | The error can be obtained from | ||
168 | .Xr ERR_get_error 3 . | ||
169 | .Sh HISTORY | ||
170 | .Fn CMS_get0_type , | ||
171 | .Fn CMS_set1_eContentType , | ||
172 | and | ||
173 | .Fn CMS_get0_eContentType | ||
174 | were all first added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 b/src/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 new file mode 100644 index 0000000000..d944f606d8 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 | |||
@@ -0,0 +1,175 @@ | |||
1 | .\" $OpenBSD: CMS_get1_ReceiptRequest.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 83cf7abf May 29 13:07:08 2018 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_GET1_RECEIPTREQUEST 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_ReceiptRequest_create0 , | ||
56 | .Nm CMS_add1_ReceiptRequest , | ||
57 | .Nm CMS_get1_ReceiptRequest , | ||
58 | .Nm CMS_ReceiptRequest_get0_values | ||
59 | .Nd CMS signed receipt request functions | ||
60 | .Sh SYNOPSIS | ||
61 | .In openssl/cms.h | ||
62 | .Ft CMS_ReceiptRequest * | ||
63 | .Fo CMS_ReceiptRequest_create0 | ||
64 | .Fa "unsigned char *id" | ||
65 | .Fa "int idlen" | ||
66 | .Fa "int allorfirst" | ||
67 | .Fa "STACK_OF(GENERAL_NAMES) *receiptList" | ||
68 | .Fa "STACK_OF(GENERAL_NAMES) *receiptsTo" | ||
69 | .Fc | ||
70 | .Ft int | ||
71 | .Fo CMS_add1_ReceiptRequest | ||
72 | .Fa "CMS_SignerInfo *si" | ||
73 | .Fa "CMS_ReceiptRequest *rr" | ||
74 | .Fc | ||
75 | .Ft int | ||
76 | .Fo CMS_get1_ReceiptRequest | ||
77 | .Fa "CMS_SignerInfo *si" | ||
78 | .Fa "CMS_ReceiptRequest **prr" | ||
79 | .Fc | ||
80 | .Ft void | ||
81 | .Fo CMS_ReceiptRequest_get0_values | ||
82 | .Fa "CMS_ReceiptRequest *rr" | ||
83 | .Fa "ASN1_STRING **pcid" | ||
84 | .Fa "int *pallorfirst" | ||
85 | .Fa "STACK_OF(GENERAL_NAMES) **plist" | ||
86 | .Fa "STACK_OF(GENERAL_NAMES) **prto" | ||
87 | .Fc | ||
88 | .Sh DESCRIPTION | ||
89 | .Fn CMS_ReceiptRequest_create0 | ||
90 | creates a signed receipt request structure. | ||
91 | The signedContentIdentifier field is set using | ||
92 | .Fa id | ||
93 | and | ||
94 | .Fa idlen , | ||
95 | or it is set to 32 bytes of pseudo random data if | ||
96 | .Fa id | ||
97 | is | ||
98 | .Dv NULL . | ||
99 | If | ||
100 | .Fa receiptList | ||
101 | is | ||
102 | .Dv NULL , | ||
103 | the allOrFirstTier option in receiptsFrom | ||
104 | is used and set to the value of the | ||
105 | .Fa allorfirst | ||
106 | parameter. | ||
107 | If | ||
108 | .Fa receiptList | ||
109 | is not | ||
110 | .Dv NULL , | ||
111 | the receiptList option in receiptsFrom is used. | ||
112 | The | ||
113 | .Fa receiptsTo | ||
114 | parameter specifies the receiptsTo field value. | ||
115 | .Pp | ||
116 | The | ||
117 | .Fn CMS_add1_ReceiptRequest | ||
118 | function adds a signed receipt request | ||
119 | .Fa rr | ||
120 | to the | ||
121 | .Vt CMS_SignerInfo | ||
122 | structure | ||
123 | .Fa si . | ||
124 | .Pp | ||
125 | .Fn CMS_get1_ReceiptRequest | ||
126 | looks for a signed receipt request in | ||
127 | .Fa si . | ||
128 | If any is found, it is decoded and written to | ||
129 | .Fa prr . | ||
130 | .Pp | ||
131 | .Fn CMS_ReceiptRequest_get0_values | ||
132 | retrieves the values of a receipt request. | ||
133 | The signedContentIdentifier is copied to | ||
134 | .Fa pcid . | ||
135 | If the allOrFirstTier option of receiptsFrom is used, | ||
136 | its value is copied to | ||
137 | .Fa pallorfirst ; | ||
138 | otherwise the receiptList field is copied to | ||
139 | .Fa plist . | ||
140 | The receiptsTo parameter is copied to | ||
141 | .Fa prto . | ||
142 | .Pp | ||
143 | For more details on the meaning of the fields see RFC2634. | ||
144 | .Pp | ||
145 | The contents of a signed receipt should only be considered meaningful if | ||
146 | the corresponding | ||
147 | .Vt CMS_ContentInfo | ||
148 | structure can be successfully verified using | ||
149 | .Xr CMS_verify 3 . | ||
150 | .Sh RETURN VALUES | ||
151 | .Fn CMS_ReceiptRequest_create0 | ||
152 | returns a signed receipt request structure or | ||
153 | .Dv NULL | ||
154 | if an error occurred. | ||
155 | .Pp | ||
156 | .Fn CMS_add1_ReceiptRequest | ||
157 | returns 1 for success or 0 if an error occurred. | ||
158 | .Pp | ||
159 | .Fn CMS_get1_ReceiptRequest | ||
160 | returns 1 is a signed receipt request is found and decoded. | ||
161 | It returns 0 if a signed receipt request is not present or -1 if it is | ||
162 | present but malformed. | ||
163 | .Sh SEE ALSO | ||
164 | .Xr CMS_sign 3 , | ||
165 | .Xr CMS_sign_receipt 3 , | ||
166 | .Xr CMS_verify 3 , | ||
167 | .Xr CMS_verify_receipt 3 , | ||
168 | .Xr ERR_get_error 3 | ||
169 | .Sh HISTORY | ||
170 | .Fn CMS_ReceiptRequest_create0 , | ||
171 | .Fn CMS_add1_ReceiptRequest , | ||
172 | .Fn CMS_get1_ReceiptRequest , | ||
173 | and | ||
174 | .Fn CMS_ReceiptRequest_get0_values | ||
175 | were added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_sign.3 b/src/lib/libcrypto/man/CMS_sign.3 new file mode 100644 index 0000000000..54d95f4a5d --- /dev/null +++ b/src/lib/libcrypto/man/CMS_sign.3 | |||
@@ -0,0 +1,224 @@ | |||
1 | .\" $OpenBSD: CMS_sign.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_SIGN 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_sign | ||
56 | .Nd create a CMS SignedData structure | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft CMS_ContentInfo * | ||
60 | .Fo CMS_sign | ||
61 | .Fa "X509 *signcert" | ||
62 | .Fa "EVP_PKEY *pkey" | ||
63 | .Fa "STACK_OF(X509) *certs" | ||
64 | .Fa "BIO *data" | ||
65 | .Fa "unsigned int flags" | ||
66 | .Fc | ||
67 | .Sh DESCRIPTION | ||
68 | .Fn CMS_sign | ||
69 | creates and returns a CMS SignedData structure. | ||
70 | .Fa signcert | ||
71 | is the certificate to sign with, | ||
72 | .Fa pkey | ||
73 | is the corresponding private key. | ||
74 | .Fa certs | ||
75 | is an optional additional set of certificates to include in the CMS | ||
76 | structure (for example any intermediate CAs in the chain). | ||
77 | Any or all of these parameters can be | ||
78 | .Dv NULL . | ||
79 | .Pp | ||
80 | The data to be signed is read from | ||
81 | .Fa data . | ||
82 | .Pp | ||
83 | .Fa flags | ||
84 | is an optional set of flags. | ||
85 | .Pp | ||
86 | Any of the following flags (OR'ed together) can be passed in the | ||
87 | .Fa flags | ||
88 | parameter: | ||
89 | .Bl -tag -width Ds | ||
90 | .It Dv CMS_TEXT | ||
91 | Prepend MIME headers for the type text/plain to the data. | ||
92 | Many S/MIME clients expect the signed content to include valid MIME | ||
93 | headers. | ||
94 | .It Dv CMS_NOCERTS | ||
95 | Do not include the signer's certificate in the | ||
96 | .Vt CMS_ContentInfo | ||
97 | structure. | ||
98 | The signer's certificate must still be supplied in the | ||
99 | .Fa signcert | ||
100 | parameter though. | ||
101 | This can reduce the size of the signature if the signers certificate can | ||
102 | be obtained by other means: for example a previously signed message. | ||
103 | .It Dv CMS_DETACHED | ||
104 | Omit the data being signed from the | ||
105 | .Vt CMS_ContentInfo | ||
106 | structure. | ||
107 | This is used for | ||
108 | .Vt CMS_ContentInfo | ||
109 | detached signatures which are used in S/MIME plaintext signed messages | ||
110 | for example. | ||
111 | .It Dv CMS_BINARY | ||
112 | Do not translate the supplied content into MIME canonical format | ||
113 | even though that is required by the S/MIME specifications. | ||
114 | This option should be used if the supplied data is in binary format. | ||
115 | Otherwise the translation will corrupt it. | ||
116 | .It Dv CMS_NOATTR | ||
117 | Do not use any signedAttributes. | ||
118 | By default, the SignedData structure includes several CMS | ||
119 | signedAttributes including the signing time, the CMS content type, | ||
120 | and the supported list of ciphers in an SMIMECapabilities attribute. | ||
121 | .It Dv CMS_NOSMIMECAP | ||
122 | Omit just the SMIMECapabilities. | ||
123 | If present, the SMIMECapabilities attribute indicates support for the | ||
124 | following algorithms in preference order: 256 bit AES, Gost R3411-94, | ||
125 | Gost 28147-89, 192 bit AES, 128 bit AES, triple DES, 128 bit RC2, 64 bit | ||
126 | RC2, DES and 40 bit RC2. | ||
127 | If any of these algorithms is not available, then it will not be | ||
128 | included: for example the GOST algorithms will not be included if | ||
129 | the GOST ENGINE is not loaded. | ||
130 | .It Dv CMS_USE_KEYID | ||
131 | Use the subject key identifier value to identify signing certificates. | ||
132 | An error occurs if the signing certificate does not have a subject key | ||
133 | identifier extension. | ||
134 | By default, issuer name and serial number are used instead. | ||
135 | .It Dv CMS_STREAM | ||
136 | Only initialize the returned | ||
137 | .Vt CMS_ContentInfo | ||
138 | structure to prepare it for performing the signing operation. | ||
139 | The signing is however | ||
140 | .Em not | ||
141 | performed and the data to be signed is not read from the | ||
142 | .Fa data | ||
143 | parameter. | ||
144 | Signing is deferred until after the data has been written. | ||
145 | In this way, data can be signed in a single pass. | ||
146 | The returned | ||
147 | .Vt CMS_ContentInfo | ||
148 | structure is | ||
149 | .Em not | ||
150 | complete and outputting its contents via a function that does not | ||
151 | properly finalize the | ||
152 | .Vt CMS_ContentInfo | ||
153 | structure will give unpredictable results. | ||
154 | Several functions including | ||
155 | .Xr SMIME_write_CMS 3 , | ||
156 | .Xr i2d_CMS_bio_stream 3 , | ||
157 | or | ||
158 | .Xr PEM_write_bio_CMS_stream 3 | ||
159 | finalize the structure. | ||
160 | Alternatively, finalization can be performed by obtaining the streaming | ||
161 | ASN1 | ||
162 | .Vt BIO | ||
163 | directly using | ||
164 | .Xr BIO_new_CMS 3 . | ||
165 | .It Dv CMS_PARTIAL | ||
166 | Output a partial | ||
167 | .Vt CMS_ContentInfo | ||
168 | structure to which additional signers and capabilities can be | ||
169 | added before finalization. | ||
170 | .El | ||
171 | .Pp | ||
172 | If a signer is specified, it will use the default digest for the signing | ||
173 | algorithm. | ||
174 | This is SHA1 for both RSA and DSA keys. | ||
175 | .Pp | ||
176 | If | ||
177 | .Fa signcert | ||
178 | and | ||
179 | .Fa pkey | ||
180 | are | ||
181 | .Dv NULL , | ||
182 | then a certificates only CMS structure is output. | ||
183 | .Pp | ||
184 | The function | ||
185 | .Fn CMS_sign | ||
186 | is a basic CMS signing function whose output will be suitable for many | ||
187 | purposes. | ||
188 | For finer control of the output format the | ||
189 | .Fa certs , | ||
190 | .Fa signcert | ||
191 | and | ||
192 | .Fa pkey | ||
193 | parameters can all be | ||
194 | .Dv NULL | ||
195 | and the | ||
196 | .Dv CMS_PARTIAL | ||
197 | flag set. | ||
198 | Then one or more signers can be added using the function | ||
199 | .Xr CMS_sign_add1_signer 3 , | ||
200 | non default digests can be used and custom attributes added. | ||
201 | .Xr CMS_final 3 | ||
202 | must then be called to finalize the structure if streaming is not | ||
203 | enabled. | ||
204 | .Sh RETURN VALUES | ||
205 | .Fn CMS_sign | ||
206 | returns either a valid | ||
207 | .Vt CMS_ContentInfo | ||
208 | structure or | ||
209 | .Dv NULL | ||
210 | if an error occurred. | ||
211 | The error can be obtained from | ||
212 | .Xr ERR_get_error 3 . | ||
213 | .Sh SEE ALSO | ||
214 | .Xr CMS_verify 3 | ||
215 | .Sh HISTORY | ||
216 | .Fn CMS_sign | ||
217 | was added to OpenSSL 0.9.8. | ||
218 | .Pp | ||
219 | The | ||
220 | .Dv CMS_STREAM | ||
221 | flag is only supported for detached data in OpenSSL 0.9.8, it is | ||
222 | supported for embedded data in OpenSSL 1.0.0 and later. | ||
223 | .Sh BUGS | ||
224 | Some attributes such as counter signatures are not supported. | ||
diff --git a/src/lib/libcrypto/man/CMS_sign_receipt.3 b/src/lib/libcrypto/man/CMS_sign_receipt.3 new file mode 100644 index 0000000000..7ddff976cc --- /dev/null +++ b/src/lib/libcrypto/man/CMS_sign_receipt.3 | |||
@@ -0,0 +1,110 @@ | |||
1 | .\" $OpenBSD: CMS_sign_receipt.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_SIGN_RECEIPT 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_sign_receipt | ||
56 | .Nd create a CMS signed receipt | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft CMS_ContentInfo * | ||
60 | .Fo CMS_sign_receipt | ||
61 | .Fa "CMS_SignerInfo *si" | ||
62 | .Fa "X509 *signcert" | ||
63 | .Fa "EVP_PKEY *pkey" | ||
64 | .Fa "STACK_OF(X509) *certs" | ||
65 | .Fa "unsigned int flags" | ||
66 | .Fc | ||
67 | .Sh DESCRIPTION | ||
68 | .Fn CMS_sign_receipt | ||
69 | creates and returns a CMS signed receipt structure. | ||
70 | .Fa si | ||
71 | is the | ||
72 | .Vt CMS_SignerInfo | ||
73 | structure containing the signed receipt request. | ||
74 | .Fa signcert | ||
75 | is the certificate to sign with, | ||
76 | .Fa pkey | ||
77 | is the corresponding private key. | ||
78 | .Fa certs | ||
79 | is an optional additional set of certificates to include in the CMS | ||
80 | structure (for example any intermediate CAs in the chain). | ||
81 | .Pp | ||
82 | .Fa flags | ||
83 | is an optional set of flags. | ||
84 | .Pp | ||
85 | This functions behaves in a similar way to | ||
86 | .Xr CMS_sign 3 | ||
87 | except the flag values | ||
88 | .Dv CMS_DETACHED , | ||
89 | .Dv CMS_BINARY , | ||
90 | .Dv CMS_NOATTR , | ||
91 | .Dv CMS_TEXT , | ||
92 | and | ||
93 | .Dv CMS_STREAM | ||
94 | are not supported since they do not make sense in the context of | ||
95 | signed receipts. | ||
96 | .Sh RETURN VALUES | ||
97 | .Fn CMS_sign_receipt | ||
98 | returns either a valid | ||
99 | .Vt CMS_ContentInfo | ||
100 | structure or | ||
101 | .Dv NULL | ||
102 | if an error occurred. | ||
103 | The error can be obtained from | ||
104 | .Xr ERR_get_error 3 . | ||
105 | .Sh SEE ALSO | ||
106 | .Xr CMS_sign 3 , | ||
107 | .Xr CMS_verify_receipt 3 | ||
108 | .Sh HISTORY | ||
109 | .Fn CMS_sign_receipt | ||
110 | was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_uncompress.3 b/src/lib/libcrypto/man/CMS_uncompress.3 new file mode 100644 index 0000000000..50926b7358 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_uncompress.3 | |||
@@ -0,0 +1,111 @@ | |||
1 | .\" $OpenBSD: CMS_uncompress.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_UNCOMPRESS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_uncompress | ||
56 | .Nd uncompress a CMS CompressedData structure | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft int | ||
60 | .Fo CMS_uncompress | ||
61 | .Fa "CMS_ContentInfo *cms" | ||
62 | .Fa "BIO *dcont" | ||
63 | .Fa "BIO *out" | ||
64 | .Fa "unsigned int flags" | ||
65 | .Fc | ||
66 | .Sh DESCRIPTION | ||
67 | .Fn CMS_uncompress | ||
68 | extracts and uncompresses the content from a CMS CompressedData | ||
69 | structure | ||
70 | .Fa cms . | ||
71 | .Fa out | ||
72 | is a | ||
73 | .Vt BIO | ||
74 | to write the content to and | ||
75 | .Fa flags | ||
76 | is an optional set of flags. | ||
77 | .Pp | ||
78 | The | ||
79 | .Fa dcont | ||
80 | parameter is used in the rare case where the compressed content is | ||
81 | detached. | ||
82 | It will normally be set to | ||
83 | .Dv NULL . | ||
84 | .Pp | ||
85 | The only currently supported compression algorithm is zlib: if the | ||
86 | structure indicates the use of any other algorithm, an error is returned. | ||
87 | .Pp | ||
88 | If zlib support is not compiled in, then | ||
89 | .Fn CMS_uncompress | ||
90 | will always return an error. | ||
91 | .Pp | ||
92 | If the | ||
93 | .Dv CMS_TEXT | ||
94 | flag is set, MIME headers for type text/plain are deleted from the content. | ||
95 | If the content is not of type text/plain, an error is returned. | ||
96 | .Sh RETURN VALUES | ||
97 | .Fn CMS_uncompress | ||
98 | returns either 1 for success or 0 for failure. | ||
99 | The error can be obtained from | ||
100 | .Xr ERR_get_error 3 . | ||
101 | .Sh SEE ALSO | ||
102 | .Xr CMS_compress 3 | ||
103 | .Sh HISTORY | ||
104 | .Fn CMS_uncompress | ||
105 | was added to OpenSSL 0.9.8. | ||
106 | .Sh BUGS | ||
107 | The lack of single pass processing and the need to hold all data in | ||
108 | memory as mentioned in | ||
109 | .Xr CMS_verify 3 | ||
110 | also applies to | ||
111 | .Fn CMS_uncompress . | ||
diff --git a/src/lib/libcrypto/man/CMS_verify.3 b/src/lib/libcrypto/man/CMS_verify.3 new file mode 100644 index 0000000000..cec1dc06d8 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_verify.3 | |||
@@ -0,0 +1,223 @@ | |||
1 | .\" $OpenBSD: CMS_verify.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 35fd9953 May 28 14:49:38 2019 +0200 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_VERIFY 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_verify , | ||
56 | .Nm CMS_get0_signers | ||
57 | .Nd verify a CMS SignedData structure | ||
58 | .Sh SYNOPSIS | ||
59 | .In openssl/cms.h | ||
60 | .Ft int | ||
61 | .Fo CMS_verify | ||
62 | .Fa "CMS_ContentInfo *cms" | ||
63 | .Fa "STACK_OF(X509) *certs" | ||
64 | .Fa "X509_STORE *store" | ||
65 | .Fa "BIO *indata" | ||
66 | .Fa "BIO *out" | ||
67 | .Fa "unsigned int flags" | ||
68 | .Fc | ||
69 | .Ft STACK_OF(X509) * | ||
70 | .Fo CMS_get0_signers | ||
71 | .Fa "CMS_ContentInfo *cms" | ||
72 | .Fc | ||
73 | .Sh DESCRIPTION | ||
74 | .Fn CMS_verify | ||
75 | verifies a CMS SignedData structure. | ||
76 | .Fa cms | ||
77 | is the | ||
78 | .Vt CMS_ContentInfo | ||
79 | structure to verify. | ||
80 | .Fa certs | ||
81 | is a set of certificates in which to search for the signing | ||
82 | certificate(s). | ||
83 | .Fa store | ||
84 | is a trusted certificate store used for chain verification. | ||
85 | .Fa indata | ||
86 | is the detached content if the content is not present in | ||
87 | .Fa cms . | ||
88 | The content is written to | ||
89 | .Fa out | ||
90 | if it is not | ||
91 | .Dv NULL . | ||
92 | .Pp | ||
93 | .Fa flags | ||
94 | is an optional set of flags, which can be used to modify the verify | ||
95 | operation. | ||
96 | .Pp | ||
97 | .Fn CMS_get0_signers | ||
98 | retrieves the signing certificate(s) from | ||
99 | .Fa cms . | ||
100 | It must be called after a successful | ||
101 | .Fn CMS_verify | ||
102 | operation. | ||
103 | .Pp | ||
104 | Normally the verify process proceeds as follows. | ||
105 | .Pp | ||
106 | Initially some sanity checks are performed on | ||
107 | .Fa cms . | ||
108 | The type of | ||
109 | .Fa cms | ||
110 | must be SignedData. | ||
111 | There must be at least one signature on the data and if the content is | ||
112 | detached; | ||
113 | .Fa indata | ||
114 | cannot be | ||
115 | .Dv NULL . | ||
116 | .Pp | ||
117 | An attempt is made to locate all the signing certificate(s), first | ||
118 | looking in the | ||
119 | .Fa certs | ||
120 | parameter (if it is not | ||
121 | .Dv NULL ) | ||
122 | and then looking in any certificates contained in the | ||
123 | .Fa cms | ||
124 | structure itself. | ||
125 | If any signing certificate cannot be located, the operation fails. | ||
126 | .Pp | ||
127 | Each signing certificate is chain verified using the | ||
128 | .Sy smimesign | ||
129 | purpose and the supplied trusted certificate store. | ||
130 | Any internal certificates in the message are used as untrusted CAs. | ||
131 | If CRL checking is enabled in | ||
132 | .Fa store , | ||
133 | any internal CRLs are used in addition to attempting to look them up in | ||
134 | .Fa store . | ||
135 | If any chain verify fails, an error code is returned. | ||
136 | .Pp | ||
137 | Finally the signed content is read (and written to | ||
138 | .Fa out | ||
139 | if it is not | ||
140 | .Dv NULL ) | ||
141 | and the signature is checked. | ||
142 | .Pp | ||
143 | If all signatures verify correctly, then the function is successful. | ||
144 | .Pp | ||
145 | Any of the following flags (OR'ed together) can be passed in the | ||
146 | .Fa flags | ||
147 | parameter to change the default verify behaviour: | ||
148 | .Bl -tag -width Ds | ||
149 | .It Dv CMS_NOINTERN | ||
150 | Do not use the certificates in the message itself when | ||
151 | locating the signing certificate(s). | ||
152 | This means that all the signing certificates must be in the | ||
153 | .Fa certs | ||
154 | parameter. | ||
155 | .It Dv CMS_NOCRL | ||
156 | If CRL checking is enabled in | ||
157 | .Fa store , | ||
158 | then any CRLs in the message itself are ignored. | ||
159 | It Dv CMS_TEXT | ||
160 | MIME headers for type text/plain are deleted from the content. | ||
161 | If the content is not of type text/plain, an error is returned. | ||
162 | .It Dv CMS_NO_SIGNER_CERT_VERIFY | ||
163 | Do not verify signing certificates. | ||
164 | .It Dv CMS_NO_ATTR_VERIFY | ||
165 | Do not check the signed attributes signature. | ||
166 | .It Dv CMS_NO_CONTENT_VERIFY | ||
167 | Do not check the content digest. | ||
168 | .El | ||
169 | .Pp | ||
170 | One application of | ||
171 | .Dv CMS_NOINTERN | ||
172 | is to only accept messages signed by a small number of certificates. | ||
173 | The acceptable certificates would be passed in the | ||
174 | .Fa certs | ||
175 | parameter. | ||
176 | In this case, if the signer is not one of the certificates supplied in | ||
177 | .Fa certs , | ||
178 | then the verify will fail because the signer cannot be found. | ||
179 | .Pp | ||
180 | In some cases the standard techniques for looking up and validating | ||
181 | certificates are not appropriate: for example an application may wish to | ||
182 | lookup certificates in a database or perform customised verification. | ||
183 | This can be achieved by setting and verifying the signers certificates | ||
184 | manually using the signed data utility functions. | ||
185 | .Pp | ||
186 | Care should be taken when modifying the default verify behaviour, for | ||
187 | example setting | ||
188 | .Dv CMS_NO_CONTENT_VERIFY | ||
189 | will totally disable all content verification and any modified content | ||
190 | will be considered valid. | ||
191 | This combination is however useful if one merely wishes to write the | ||
192 | content to | ||
193 | .Fa out | ||
194 | and its validity is not considered important. | ||
195 | .Pp | ||
196 | Chain verification should arguably be performed using the signing time | ||
197 | rather than the current time. | ||
198 | However since the signing time is supplied by the signer it cannot be | ||
199 | trusted without additional evidence (such as a trusted timestamp). | ||
200 | .Sh RETURN VALUES | ||
201 | .Fn CMS_verify | ||
202 | returns 1 for a successful verification or zero if an error occurred. | ||
203 | .Pp | ||
204 | .Fn CMS_get0_signers | ||
205 | returns all signers or | ||
206 | .Dv NULL | ||
207 | if an error occurred. | ||
208 | .Pp | ||
209 | The error can be obtained from | ||
210 | .Xr ERR_get_error 3 . | ||
211 | .Sh SEE ALSO | ||
212 | .Xr CMS_sign 3 | ||
213 | .Sh HISTORY | ||
214 | .Fn CMS_verify | ||
215 | was added to OpenSSL 0.9.8. | ||
216 | .Sh BUGS | ||
217 | The trusted certificate store is not searched for the signing certificate. | ||
218 | This is primarily due to the inadequacies of the current | ||
219 | .Vt X509_STORE | ||
220 | functionality. | ||
221 | .Pp | ||
222 | The lack of single pass processing means that the signed content must | ||
223 | all be held in memory if it is not detached. | ||
diff --git a/src/lib/libcrypto/man/CMS_verify_receipt.3 b/src/lib/libcrypto/man/CMS_verify_receipt.3 new file mode 100644 index 0000000000..33bb43ed8d --- /dev/null +++ b/src/lib/libcrypto/man/CMS_verify_receipt.3 | |||
@@ -0,0 +1,104 @@ | |||
1 | .\" $OpenBSD: CMS_verify_receipt.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt CMS_VERIFY_RECEIPT 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_verify_receipt | ||
56 | .Nd verify a CMS signed receipt | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft int | ||
60 | .Fo CMS_verify_receipt | ||
61 | .Fa "CMS_ContentInfo *rcms" | ||
62 | .Fa "CMS_ContentInfo *ocms" | ||
63 | .Fa "STACK_OF(X509) *certs" | ||
64 | .Fa "X509_STORE *store" | ||
65 | .Fa "unsigned int flags" | ||
66 | .Fc | ||
67 | .Sh DESCRIPTION | ||
68 | .Fn CMS_verify_receipt | ||
69 | verifies a CMS signed receipt. | ||
70 | .Fa rcms | ||
71 | is the signed receipt to verify. | ||
72 | .Fa ocms | ||
73 | is the original SignedData structure containing the receipt request. | ||
74 | .Fa certs | ||
75 | is a set of certificates in which to search for the signing certificate. | ||
76 | .Fa store | ||
77 | is a trusted certificate store (used for chain verification). | ||
78 | .Pp | ||
79 | .Fa flags | ||
80 | is an optional set of flags, which can be used to modify the verify | ||
81 | operation. | ||
82 | .Pp | ||
83 | This functions behaves in a similar way to | ||
84 | .Xr CMS_verify 3 | ||
85 | except the flag values | ||
86 | .Dv CMS_DETACHED , | ||
87 | .Dv CMS_BINARY , | ||
88 | .Dv CMS_TEXT , | ||
89 | and | ||
90 | .Dv CMS_STREAM | ||
91 | are not supported since they do not make sense in the context of signed | ||
92 | receipts. | ||
93 | .Sh RETURN VALUES | ||
94 | .Fn CMS_verify_receipt | ||
95 | returns 1 for a successful verification or zero if an error occurred. | ||
96 | .Pp | ||
97 | The error can be obtained from | ||
98 | .Xr ERR_get_error 3 . | ||
99 | .Sh SEE ALSO | ||
100 | .Xr CMS_sign_receipt 3 , | ||
101 | .Xr CMS_verify 3 | ||
102 | .Sh HISTORY | ||
103 | .Fn CMS_verify_receipt | ||
104 | was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 b/src/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 new file mode 100644 index 0000000000..ad1688ba14 --- /dev/null +++ b/src/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 | |||
@@ -0,0 +1,93 @@ | |||
1 | .\" $OpenBSD: PEM_write_bio_CMS_stream.3,v 1.1 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt PEM_WRITE_BIO_CMS_STREAM 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm PEM_write_bio_CMS_stream | ||
56 | .Nd output CMS_ContentInfo structure in PEM format | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft int | ||
60 | .Fo PEM_write_bio_CMS_stream | ||
61 | .Fa "BIO *out" | ||
62 | .Fa "CMS_ContentInfo *cms" | ||
63 | .Fa "BIO *data" | ||
64 | .Fa "int flags" | ||
65 | .Fc | ||
66 | .Sh DESCRIPTION | ||
67 | .Fn PEM_write_bio_CMS_stream | ||
68 | outputs a | ||
69 | .Vt CMS_ContentInfo | ||
70 | structure in PEM format. | ||
71 | .Pp | ||
72 | It is otherwise identical to the function | ||
73 | .Xr SMIME_write_CMS 3 . | ||
74 | .Pp | ||
75 | This function is effectively a version of | ||
76 | .Xr PEM_write_bio_CMS 3 | ||
77 | supporting streaming. | ||
78 | .Sh RETURN VALUES | ||
79 | .Fn PEM_write_bio_CMS_stream | ||
80 | returns 1 for success or 0 for failure. | ||
81 | .Sh SEE ALSO | ||
82 | .Xr CMS_decrypt 3 , | ||
83 | .Xr CMS_encrypt 3 , | ||
84 | .Xr CMS_sign 3 , | ||
85 | .Xr CMS_verify 3 , | ||
86 | .Xr ERR_get_error 3 , | ||
87 | .Xr i2d_CMS_bio_stream 3 , | ||
88 | .Xr PEM_write 3 , | ||
89 | .Xr SMIME_write_CMS 3 | ||
90 | .Sh HISTORY | ||
91 | The | ||
92 | .Fn PEM_write_bio_CMS_stream | ||
93 | function was added in OpenSSL 1.0.0. | ||
diff --git a/src/lib/libcrypto/man/SMIME_read_CMS.3 b/src/lib/libcrypto/man/SMIME_read_CMS.3 new file mode 100644 index 0000000000..17f60b11ec --- /dev/null +++ b/src/lib/libcrypto/man/SMIME_read_CMS.3 | |||
@@ -0,0 +1,146 @@ | |||
1 | .\" $OpenBSD: SMIME_read_CMS.3,v 1.1 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt SMIME_READ_CMS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm SMIME_read_CMS | ||
56 | .Nd parse S/MIME message | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft CMS_ContentInfo * | ||
60 | .Fo SMIME_read_CMS | ||
61 | .Fa "BIO *in" | ||
62 | .Fa "BIO **bcont" | ||
63 | .Fc | ||
64 | .Sh DESCRIPTION | ||
65 | .Fn SMIME_read_CMS | ||
66 | parses a message in S/MIME format. | ||
67 | .Pp | ||
68 | .Fa in | ||
69 | is a | ||
70 | .Vt BIO | ||
71 | to read the message from. | ||
72 | .Pp | ||
73 | If cleartext signing is used, then the content is saved in a memory BIO | ||
74 | which is written to | ||
75 | .Pf * Fa bcont ; | ||
76 | otherwise | ||
77 | .Pf * Fa bcont | ||
78 | is set to | ||
79 | .Dv NULL . | ||
80 | .Pp | ||
81 | The parsed | ||
82 | .Vt CMS_ContentInfo | ||
83 | structure is returned, or | ||
84 | .Dv NULL | ||
85 | if an error occurred. | ||
86 | .Pp | ||
87 | If | ||
88 | .Pf * Fa bcont | ||
89 | is not | ||
90 | .Dv NULL , | ||
91 | then the message is clear text signed. | ||
92 | .Pf * Fa bcont | ||
93 | can then be passed to | ||
94 | .Xr CMS_verify 3 | ||
95 | with the | ||
96 | .Dv CMS_DETACHED | ||
97 | flag set. | ||
98 | .Pp | ||
99 | Otherwise the type of the returned structure can be determined using | ||
100 | .Xr CMS_get0_type 3 . | ||
101 | .Pp | ||
102 | To support future functionality if | ||
103 | .Fa bcont | ||
104 | is not | ||
105 | .Dv NULL , | ||
106 | .Pf * Fa bcont | ||
107 | should be initialized to | ||
108 | .Dv NULL . | ||
109 | For example: | ||
110 | .Bd -literal -offset indent | ||
111 | BIO *cont = NULL; | ||
112 | CMS_ContentInfo *cms; | ||
113 | |||
114 | cms = SMIME_read_CMS(in, &cont); | ||
115 | .Ed | ||
116 | .Sh RETURN VALUES | ||
117 | .Fn SMIME_read_CMS | ||
118 | returns a valid | ||
119 | .Vt CMS_ContentInfo | ||
120 | structure or | ||
121 | .Dv NULL | ||
122 | if an error occurred. | ||
123 | The error can be obtained from | ||
124 | .Xr ERR_get_error 3 . | ||
125 | .Sh SEE ALSO | ||
126 | .Xr CMS_decrypt 3 , | ||
127 | .Xr CMS_encrypt 3 , | ||
128 | .Xr CMS_sign 3 , | ||
129 | .Xr CMS_type 3 , | ||
130 | .Xr CMS_verify 3 , | ||
131 | .Xr SMIME_write_CMS 3 | ||
132 | .Sh BUGS | ||
133 | The MIME parser used by | ||
134 | .Fn SMIME_read_CMS | ||
135 | is somewhat primitive. | ||
136 | While it will handle most S/MIME messages, more complex compound formats | ||
137 | may not work. | ||
138 | .Pp | ||
139 | The parser assumes that the | ||
140 | .Vt CMS_ContentInfo | ||
141 | structure is always base64 encoded and will not handle the case | ||
142 | where it is in binary format or uses quoted printable format. | ||
143 | .Pp | ||
144 | The use of a memory BIO to hold the signed content limits the size of | ||
145 | message which can be processed due to memory restraints: a streaming | ||
146 | single pass option should be available. | ||
diff --git a/src/lib/libcrypto/man/SMIME_write_CMS.3 b/src/lib/libcrypto/man/SMIME_write_CMS.3 new file mode 100644 index 0000000000..c9afa5e5a5 --- /dev/null +++ b/src/lib/libcrypto/man/SMIME_write_CMS.3 | |||
@@ -0,0 +1,133 @@ | |||
1 | .\" $OpenBSD: SMIME_write_CMS.3,v 1.1 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt SMIME_WRITE_CMS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm SMIME_write_CMS | ||
56 | .Nd convert CMS structure to S/MIME format | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft int | ||
60 | .Fo SMIME_write_CMS | ||
61 | .Fa "BIO *out" | ||
62 | .Fa "CMS_ContentInfo *cms" | ||
63 | .Fa "BIO *data" | ||
64 | .Fa "int flags" | ||
65 | .Fc | ||
66 | .Sh DESCRIPTION | ||
67 | .Fn SMIME_write_CMS | ||
68 | adds the appropriate MIME headers to a CMS structure to produce an | ||
69 | S/MIME message. | ||
70 | .Pp | ||
71 | .Fa out | ||
72 | is the | ||
73 | .Vt BIO | ||
74 | to write the data to. | ||
75 | .Fa cms | ||
76 | is the appropriate | ||
77 | .Vt CMS_ContentInfo | ||
78 | structure. | ||
79 | If streaming is enabled, then the content must be supplied in the | ||
80 | .Fa data | ||
81 | argument. | ||
82 | .Fa flags | ||
83 | is an optional set of flags. | ||
84 | .Pp | ||
85 | The following flags can be passed in the | ||
86 | .Fa flags | ||
87 | parameter: | ||
88 | .Bl -tag -width Ds | ||
89 | .It Dv CMS_DETACHED | ||
90 | Use cleartext signing. | ||
91 | This option only makes sense for SignedData where | ||
92 | .Dv CMS_DETACHED | ||
93 | is also set when | ||
94 | .Xr CMS_sign 3 | ||
95 | is called. | ||
96 | .Pp | ||
97 | If cleartext signing is used and | ||
98 | .Dv CMS_STREAM | ||
99 | is not set, then the data must be read twice: | ||
100 | once to compute the signature in | ||
101 | .Xr CMS_sign 3 | ||
102 | and once to output the S/MIME message. | ||
103 | .It Dv CMS_TEXT | ||
104 | Add MIME headers for type text/plain to the content. | ||
105 | This only makes sense if | ||
106 | .Dv CMS_DETACHED | ||
107 | is also set. | ||
108 | .It Dv CMS_STREAM | ||
109 | Perform streaming. | ||
110 | This flag should only be set if | ||
111 | .Dv CMS_STREAM | ||
112 | was also set in the previous call to a | ||
113 | .Vt CMS_ContentInfo | ||
114 | creation function. | ||
115 | .Pp | ||
116 | If streaming is performed, the content is output in BER format using | ||
117 | indefinite length constructed encoding except in the case of signed data | ||
118 | with detached content where the content is absent and DER format is | ||
119 | used. | ||
120 | .El | ||
121 | .Sh RETURN VALUES | ||
122 | .Fn SMIME_write_CMS | ||
123 | returns 1 for success or 0 for failure. | ||
124 | .Sh SEE ALSO | ||
125 | .Xr CMS_decrypt 3 , | ||
126 | .Xr CMS_encrypt 3 , | ||
127 | .Xr CMS_sign 3 , | ||
128 | .Xr CMS_verify 3 , | ||
129 | .Xr ERR_get_error 3 | ||
130 | .Sh BUGS | ||
131 | .Fn SMIME_write_CMS | ||
132 | always base64 encodes CMS structures. | ||
133 | There should be an option to disable this. | ||
diff --git a/src/lib/libcrypto/man/i2d_CMS_bio_stream.3 b/src/lib/libcrypto/man/i2d_CMS_bio_stream.3 new file mode 100644 index 0000000000..3615c01ccb --- /dev/null +++ b/src/lib/libcrypto/man/i2d_CMS_bio_stream.3 | |||
@@ -0,0 +1,95 @@ | |||
1 | .\" $OpenBSD: i2d_CMS_bio_stream.3,v 1.1 2019/08/10 23:41:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: August 10 2019 $ | ||
52 | .Dt I2D_CMS_BIO_STREAM 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm i2d_CMS_bio_stream | ||
56 | .Nd output CMS_ContentInfo structure in BER format | ||
57 | .Sh SYNOPSIS | ||
58 | .In openssl/cms.h | ||
59 | .Ft int | ||
60 | .Fo i2d_CMS_bio_stream | ||
61 | .Fa "BIO *out" | ||
62 | .Fa "CMS_ContentInfo *cms" | ||
63 | .Fa "BIO *data" | ||
64 | .Fa "int flags" | ||
65 | .Fc | ||
66 | .Sh DESCRIPTION | ||
67 | .Fn i2d_CMS_bio_stream | ||
68 | outputs a | ||
69 | .Vt CMS_ContentInfo | ||
70 | structure in BER format. | ||
71 | .Pp | ||
72 | It is otherwise identical to the function | ||
73 | .Xr SMIME_write_CMS 3 . | ||
74 | .Pp | ||
75 | This function is effectively a version of | ||
76 | .Xr i2d_CMS_bio 3 | ||
77 | supporting streaming. | ||
78 | .Sh RETURN VALUES | ||
79 | .Fn i2d_CMS_bio_stream | ||
80 | returns 1 for success or 0 for failure. | ||
81 | .Sh SEE ALSO | ||
82 | .Xr CMS_decrypt 3 , | ||
83 | .Xr CMS_encrypt 3 , | ||
84 | .Xr CMS_sign 3 , | ||
85 | .Xr CMS_verify 3 , | ||
86 | .Xr ERR_get_error 3 , | ||
87 | .Xr PEM_write_bio_CMS_stream 3 , | ||
88 | .Xr SMIME_write_CMS 3 | ||
89 | .Sh HISTORY | ||
90 | The | ||
91 | .Fn i2d_CMS_bio_stream | ||
92 | function was added in OpenSSL 1.0.0. | ||
93 | .Sh BUGS | ||
94 | The prefix "i2d" is arguably wrong because the function outputs BER | ||
95 | format. | ||