summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2019-08-15 11:42:53 +0000
committerschwarze <>2019-08-15 11:42:53 +0000
commit2aae7c8bfc5593665f39dabf982e6e684e7029f0 (patch)
tree3374ff5e1d998a254da30720bfba4942db6e3ac9 /src
parent2e4e17f1a824885679165c9dd3263455ddc830c4 (diff)
downloadopenbsd-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.3113
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
67creates and returns a CMS CompressedData structure. 84creates and returns a CMS
85.Vt CompressedData
86structure.
87.Pp
68.Fa comp_nid 88.Fa comp_nid
69is the compression algorithm to use or 89is the compression algorithm to use or
70.Dv NID_undef 90.Dv NID_undef
71to use the default algorithm (zlib compression). 91to use the default algorithm.
72.Fa in 92Currently, the default algorithm
73is the content to be compressed. 93.Dv NID_zlib_compression
74.Fa flags 94is the only supported algorithm.
75is an optional set of flags. 95If zlib support is not compiled in,
76.Pp
77The only currently supported compression algorithm is zlib using the NID
78.Dv NID_zlib_compression .
79.Pp
80If zlib support is not compiled in, then
81.Fn CMS_compress 96.Fn CMS_compress
82will return an error. 97always returns an error.
83.Pp 98.Pp
84If the 99.Fa in
85.Dv CMS_TEXT 100provides the content to be compressed.
86flag is set, MIME headers for type text/plain are prepended to the data.
87.Pp 101.Pp
88Normally the supplied content is translated into MIME canonical format 102Any 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 104parameter:
91is set, no translation occurs. 105.Bl -tag -width Ds
106.It Dv CMS_TEXT
107Prepend MIME headers for type text/plain to the data.
108.It Dv CMS_BINARY
109Do not translate the supplied content into MIME canonical format,
110even though that is required by the S/MIME specifications.
92This option should be used if the supplied data is in binary format. 111This option should be used if the supplied data is in binary format.
93Otherwise, the translation will corrupt it. 112Otherwise, the translation will corrupt it.
94If 113If
95.Dv CMS_BINARY 114.Dv CMS_BINARY
96is set then 115is set,
97.Dv CMS_TEXT 116.Dv CMS_TEXT
98is ignored. 117is ignored.
99.Pp 118.It Dv CMS_STREAM
100If the 119Return a partial
101.Dv CMS_STREAM
102flag is set, a partial
103.Vt CMS_ContentInfo 120.Vt CMS_ContentInfo
104structure is returned suitable for streaming I/O: no data is read from 121structure suitable for streaming I/O: no data is read from
105the BIO
106.Fa in . 122.Fa in .
107.Pp
108The compressed data is included in the
109.Vt CMS_ContentInfo
110structure unless
111.Dv CMS_DETACHED
112is set, in which case it is omitted.
113This is rarely used in practice and is not supported by
114.Xr SMIME_write_CMS 3 .
115.Pp
116If the flag
117.Dv CMS_STREAM
118is set, the returned
119.Vt CMS_ContentInfo
120structure is
121.Em not
122complete and outputting its contents via a function that does not
123properly finalize the
124.Vt CMS_ContentInfo
125structure will give unpredictable results.
126.Pp
127Several functions including 123Several 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 ,
130and 126or
131.Xr PEM_write_bio_CMS_stream 3 127.Xr PEM_write_bio_CMS_stream 3
132finalize the structure. 128can be used to finalize the structure.
133Alternatively finalization can be performed by obtaining the streaming 129Alternatively, finalization can be performed by obtaining the streaming
134ASN1 130ASN1
135.Vt BIO 131.Vt BIO
136directly using 132directly using
137.Xr BIO_new_CMS 3 . 133.Xr BIO_new_CMS 3 .
134Outputting the contents of the
135.Vt CMS_ContentInfo
136structure via a function that does not
137properly finalize it will give unpredictable results.
138.It Dv CMS_DETACHED
139Do not include the compressed data in the
140.Vt CMS_ContentInfo
141structure.
142This is rarely used in practice and is not supported by
143.Xr SMIME_write_CMS 3 .
144.El
138.Pp 145.Pp
139Additional compression parameters such as the zlib compression level 146Additional compression parameters such as the zlib compression level
140cannot currently be set. 147cannot 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
160RFC 3274: Compressed Data Content Type for Cryptographic Message Syntax (CMS)
152.Sh HISTORY 161.Sh HISTORY
153.Fn CMS_compress 162.Fn CMS_compress
154first appeared in OpenSSL 0.9.8h 163first appeared in OpenSSL 0.9.8h