diff options
author | schwarze <> | 2019-08-15 11:42:53 +0000 |
---|---|---|
committer | schwarze <> | 2019-08-15 11:42:53 +0000 |
commit | 2aae7c8bfc5593665f39dabf982e6e684e7029f0 (patch) | |
tree | 3374ff5e1d998a254da30720bfba4942db6e3ac9 /src | |
parent | 2e4e17f1a824885679165c9dd3263455ddc830c4 (diff) | |
download | openbsd-2aae7c8bfc5593665f39dabf982e6e684e7029f0.tar.gz openbsd-2aae7c8bfc5593665f39dabf982e6e684e7029f0.tar.bz2 openbsd-2aae7c8bfc5593665f39dabf982e6e684e7029f0.zip |
some cleanup:
* do not jump back and forth between different arguments
* display the flags in a proper list
* add the missing STANDARDS section
* mark up ASN.1 type names
* and minor wording improvements
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/CMS_compress.3 | 113 |
1 files changed, 61 insertions, 52 deletions
diff --git a/src/lib/libcrypto/man/CMS_compress.3 b/src/lib/libcrypto/man/CMS_compress.3 index 0b3b105c16..8948618d3a 100644 --- a/src/lib/libcrypto/man/CMS_compress.3 +++ b/src/lib/libcrypto/man/CMS_compress.3 | |||
@@ -1,7 +1,24 @@ | |||
1 | .\" $OpenBSD: CMS_compress.3,v 1.4 2019/08/11 12:46:38 schwarze Exp $ | 1 | .\" $OpenBSD: CMS_compress.3,v 1.5 2019/08/15 11:42:53 schwarze Exp $ |
2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | 2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 |
3 | .\" | 3 | .\" |
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | 4 | .\" This file is a derived work. |
5 | .\" The changes are covered by the following Copyright and license: | ||
6 | .\" | ||
7 | .\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org> | ||
8 | .\" | ||
9 | .\" Permission to use, copy, modify, and distribute this software for any | ||
10 | .\" purpose with or without fee is hereby granted, provided that the above | ||
11 | .\" copyright notice and this permission notice appear in all copies. | ||
12 | .\" | ||
13 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
14 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
15 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
16 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
17 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
18 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
19 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
20 | .\" | ||
21 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | 22 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. |
6 | .\" | 23 | .\" |
7 | .\" Redistribution and use in source and binary forms, with or without | 24 | .\" Redistribution and use in source and binary forms, with or without |
@@ -48,7 +65,7 @@ | |||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
50 | .\" | 67 | .\" |
51 | .Dd $Mdocdate: August 11 2019 $ | 68 | .Dd $Mdocdate: August 15 2019 $ |
52 | .Dt CMS_COMPRESS 3 | 69 | .Dt CMS_COMPRESS 3 |
53 | .Os | 70 | .Os |
54 | .Sh NAME | 71 | .Sh NAME |
@@ -64,77 +81,67 @@ | |||
64 | .Fc | 81 | .Fc |
65 | .Sh DESCRIPTION | 82 | .Sh DESCRIPTION |
66 | .Fn CMS_compress | 83 | .Fn CMS_compress |
67 | creates and returns a CMS CompressedData structure. | 84 | creates and returns a CMS |
85 | .Vt CompressedData | ||
86 | structure. | ||
87 | .Pp | ||
68 | .Fa comp_nid | 88 | .Fa comp_nid |
69 | is the compression algorithm to use or | 89 | is the compression algorithm to use or |
70 | .Dv NID_undef | 90 | .Dv NID_undef |
71 | to use the default algorithm (zlib compression). | 91 | to use the default algorithm. |
72 | .Fa in | 92 | Currently, the default algorithm |
73 | is the content to be compressed. | 93 | .Dv NID_zlib_compression |
74 | .Fa flags | 94 | is the only supported algorithm. |
75 | is an optional set of flags. | 95 | If zlib support is not compiled in, |
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 | 96 | .Fn CMS_compress |
82 | will return an error. | 97 | always returns an error. |
83 | .Pp | 98 | .Pp |
84 | If the | 99 | .Fa in |
85 | .Dv CMS_TEXT | 100 | provides the content to be compressed. |
86 | flag is set, MIME headers for type text/plain are prepended to the data. | ||
87 | .Pp | 101 | .Pp |
88 | Normally the supplied content is translated into MIME canonical format | 102 | Any of the following flags (OR'ed together) can be passed in the |
89 | (as required by the S/MIME specifications); if | 103 | .Fa flags |
90 | .Dv CMS_BINARY | 104 | parameter: |
91 | is set, no translation occurs. | 105 | .Bl -tag -width Ds |
106 | .It Dv CMS_TEXT | ||
107 | Prepend MIME headers for type text/plain to the data. | ||
108 | .It Dv CMS_BINARY | ||
109 | Do not translate the supplied content into MIME canonical format, | ||
110 | even though that is required by the S/MIME specifications. | ||
92 | This option should be used if the supplied data is in binary format. | 111 | This option should be used if the supplied data is in binary format. |
93 | Otherwise, the translation will corrupt it. | 112 | Otherwise, the translation will corrupt it. |
94 | If | 113 | If |
95 | .Dv CMS_BINARY | 114 | .Dv CMS_BINARY |
96 | is set then | 115 | is set, |
97 | .Dv CMS_TEXT | 116 | .Dv CMS_TEXT |
98 | is ignored. | 117 | is ignored. |
99 | .Pp | 118 | .It Dv CMS_STREAM |
100 | If the | 119 | Return a partial |
101 | .Dv CMS_STREAM | ||
102 | flag is set, a partial | ||
103 | .Vt CMS_ContentInfo | 120 | .Vt CMS_ContentInfo |
104 | structure is returned suitable for streaming I/O: no data is read from | 121 | structure suitable for streaming I/O: no data is read from |
105 | the BIO | ||
106 | .Fa in . | 122 | .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 | 123 | Several functions including |
128 | .Xr SMIME_write_CMS 3 , | 124 | .Xr SMIME_write_CMS 3 , |
129 | .Xr i2d_CMS_bio_stream 3 , | 125 | .Xr i2d_CMS_bio_stream 3 , |
130 | and | 126 | or |
131 | .Xr PEM_write_bio_CMS_stream 3 | 127 | .Xr PEM_write_bio_CMS_stream 3 |
132 | finalize the structure. | 128 | can be used to finalize the structure. |
133 | Alternatively finalization can be performed by obtaining the streaming | 129 | Alternatively, finalization can be performed by obtaining the streaming |
134 | ASN1 | 130 | ASN1 |
135 | .Vt BIO | 131 | .Vt BIO |
136 | directly using | 132 | directly using |
137 | .Xr BIO_new_CMS 3 . | 133 | .Xr BIO_new_CMS 3 . |
134 | Outputting the contents of the | ||
135 | .Vt CMS_ContentInfo | ||
136 | structure via a function that does not | ||
137 | properly finalize it will give unpredictable results. | ||
138 | .It Dv CMS_DETACHED | ||
139 | Do not include the compressed data in the | ||
140 | .Vt CMS_ContentInfo | ||
141 | structure. | ||
142 | This is rarely used in practice and is not supported by | ||
143 | .Xr SMIME_write_CMS 3 . | ||
144 | .El | ||
138 | .Pp | 145 | .Pp |
139 | Additional compression parameters such as the zlib compression level | 146 | Additional compression parameters such as the zlib compression level |
140 | cannot currently be set. | 147 | cannot currently be set. |
@@ -149,6 +156,8 @@ The error can be obtained from | |||
149 | .Xr ERR_get_error 3 . | 156 | .Xr ERR_get_error 3 . |
150 | .Sh SEE ALSO | 157 | .Sh SEE ALSO |
151 | .Xr CMS_uncompress 3 | 158 | .Xr CMS_uncompress 3 |
159 | .Sh STANDARDS | ||
160 | RFC 3274: Compressed Data Content Type for Cryptographic Message Syntax (CMS) | ||
152 | .Sh HISTORY | 161 | .Sh HISTORY |
153 | .Fn CMS_compress | 162 | .Fn CMS_compress |
154 | first appeared in OpenSSL 0.9.8h | 163 | first appeared in OpenSSL 0.9.8h |