xref: /openbsd-src/lib/libcrypto/man/CMS_uncompress.3 (revision 569a59c8635a26efce16814257adc7cd2bc8e48d)
1*569a59c8Sschwarze.\" $OpenBSD: CMS_uncompress.3,v 1.7 2019/11/02 15:39:46 schwarze Exp $
254c85986Sschwarze.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
354c85986Sschwarze.\"
454c85986Sschwarze.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
554c85986Sschwarze.\" Copyright (c) 2008 The OpenSSL Project.  All rights reserved.
654c85986Sschwarze.\"
754c85986Sschwarze.\" Redistribution and use in source and binary forms, with or without
854c85986Sschwarze.\" modification, are permitted provided that the following conditions
954c85986Sschwarze.\" are met:
1054c85986Sschwarze.\"
1154c85986Sschwarze.\" 1. Redistributions of source code must retain the above copyright
1254c85986Sschwarze.\"    notice, this list of conditions and the following disclaimer.
1354c85986Sschwarze.\"
1454c85986Sschwarze.\" 2. Redistributions in binary form must reproduce the above copyright
1554c85986Sschwarze.\"    notice, this list of conditions and the following disclaimer in
1654c85986Sschwarze.\"    the documentation and/or other materials provided with the
1754c85986Sschwarze.\"    distribution.
1854c85986Sschwarze.\"
1954c85986Sschwarze.\" 3. All advertising materials mentioning features or use of this
2054c85986Sschwarze.\"    software must display the following acknowledgment:
2154c85986Sschwarze.\"    "This product includes software developed by the OpenSSL Project
2254c85986Sschwarze.\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
2354c85986Sschwarze.\"
2454c85986Sschwarze.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
2554c85986Sschwarze.\"    endorse or promote products derived from this software without
2654c85986Sschwarze.\"    prior written permission. For written permission, please contact
2754c85986Sschwarze.\"    openssl-core@openssl.org.
2854c85986Sschwarze.\"
2954c85986Sschwarze.\" 5. Products derived from this software may not be called "OpenSSL"
3054c85986Sschwarze.\"    nor may "OpenSSL" appear in their names without prior written
3154c85986Sschwarze.\"    permission of the OpenSSL Project.
3254c85986Sschwarze.\"
3354c85986Sschwarze.\" 6. Redistributions of any form whatsoever must retain the following
3454c85986Sschwarze.\"    acknowledgment:
3554c85986Sschwarze.\"    "This product includes software developed by the OpenSSL Project
3654c85986Sschwarze.\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
3754c85986Sschwarze.\"
3854c85986Sschwarze.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
3954c85986Sschwarze.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4054c85986Sschwarze.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
4154c85986Sschwarze.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
4254c85986Sschwarze.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4354c85986Sschwarze.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4454c85986Sschwarze.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
4554c85986Sschwarze.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4654c85986Sschwarze.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
4754c85986Sschwarze.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
4854c85986Sschwarze.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
4954c85986Sschwarze.\" OF THE POSSIBILITY OF SUCH DAMAGE.
5054c85986Sschwarze.\"
51*569a59c8Sschwarze.Dd $Mdocdate: November 2 2019 $
5254c85986Sschwarze.Dt CMS_UNCOMPRESS 3
5354c85986Sschwarze.Os
5454c85986Sschwarze.Sh NAME
5554c85986Sschwarze.Nm CMS_uncompress
5654c85986Sschwarze.Nd uncompress a CMS CompressedData structure
5754c85986Sschwarze.Sh SYNOPSIS
5854c85986Sschwarze.In openssl/cms.h
5954c85986Sschwarze.Ft int
6054c85986Sschwarze.Fo CMS_uncompress
6154c85986Sschwarze.Fa "CMS_ContentInfo *cms"
6254c85986Sschwarze.Fa "BIO *dcont"
6354c85986Sschwarze.Fa "BIO *out"
6454c85986Sschwarze.Fa "unsigned int flags"
6554c85986Sschwarze.Fc
6654c85986Sschwarze.Sh DESCRIPTION
6754c85986Sschwarze.Fn CMS_uncompress
68693ccf89Sschwarzeextracts and uncompresses the content of a CMS
69693ccf89Sschwarze.Vt CompressedData
7054c85986Sschwarzestructure
71693ccf89Sschwarze.Fa cms
72693ccf89Sschwarzeand writes it to
73693ccf89Sschwarze.Fa out .
7454c85986Sschwarze.Pp
75693ccf89SschwarzeIn the rare case where the compressed content is detached,
76693ccf89Sschwarzepass it in via
77693ccf89Sschwarze.Fa dcont .
78693ccf89SschwarzeFor normal use, set
7954c85986Sschwarze.Fa dcont
80693ccf89Sschwarzeto
8154c85986Sschwarze.Dv NULL .
8254c85986Sschwarze.Pp
8354c85986SschwarzeThe only currently supported compression algorithm is zlib: if the
8454c85986Sschwarzestructure indicates the use of any other algorithm, an error is returned.
85693ccf89SschwarzeIf zlib support is not compiled in,
8654c85986Sschwarze.Fn CMS_uncompress
87693ccf89Sschwarzealways returns an error.
8854c85986Sschwarze.Pp
8954c85986SschwarzeIf the
9054c85986Sschwarze.Dv CMS_TEXT
91693ccf89Sschwarzebit is set in
92693ccf89Sschwarze.Fa flags ,
93693ccf89SschwarzeMIME headers for type text/plain are deleted from the content.
9454c85986SschwarzeIf the content is not of type text/plain, an error is returned.
9554c85986Sschwarze.Sh RETURN VALUES
9654c85986Sschwarze.Fn CMS_uncompress
97693ccf89Sschwarzereturns 1 for success or 0 for failure.
9854c85986SschwarzeThe error can be obtained from
9954c85986Sschwarze.Xr ERR_get_error 3 .
10054c85986Sschwarze.Sh SEE ALSO
10185bbda65Sschwarze.Xr CMS_compress 3 ,
10285bbda65Sschwarze.Xr CMS_ContentInfo_new 3
103693ccf89Sschwarze.Sh STANDARDS
104693ccf89SschwarzeRFC 3274: Compressed Data Content Type for Cryptographic Message Syntax (CMS)
10554c85986Sschwarze.Sh HISTORY
10654c85986Sschwarze.Fn CMS_uncompress
10766a3cb98Sschwarzefirst appeared in OpenSSL 0.9.8h
10866a3cb98Sschwarzeand has been available since
109*569a59c8Sschwarze.Ox 6.7 .
11054c85986Sschwarze.Sh BUGS
11154c85986SschwarzeThe lack of single pass processing and the need to hold all data in
11254c85986Sschwarzememory as mentioned in
11354c85986Sschwarze.Xr CMS_verify 3
11454c85986Sschwarzealso applies to
11554c85986Sschwarze.Fn CMS_uncompress .
116