
#use wml::openssl-macros area=docs page=CMS_uncompress

<title>Documents, CMS_uncompress(3)</title>

<h1>CMS_uncompress(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#BUGS">BUGS</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<PRE> CMS_uncompress - uncompress a CMS CompressedData structure
</PRE>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/cms.h&gt;
</PRE>
<PRE> int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>CMS_uncompress()</CODE> extracts and uncompresses the content from a
CMS CompressedData structure <STRONG>cms</STRONG>. <STRONG>data</STRONG> is a BIO to write the content to and
<STRONG>flags</STRONG> is an optional set of flags.

</P>
<P>
The <STRONG>dcont</STRONG> parameter is used in the rare case where the compressed content is
detached. It will normally be set to NULL.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
The only currently supported compression algorithm is zlib: if the
structure indicates the use of any other algorithm an error is returned.

</P>
<P>
If zlib support is not compiled into OpenSSL then
<CODE>CMS_uncompress()</CODE> will always return an error.

</P>
<P>
The following flags can be passed in the <STRONG>flags</STRONG> parameter.

</P>
<P>
If the <STRONG>CMS_TEXT</STRONG> flag is set MIME headers for type <STRONG>text/plain</STRONG> are deleted from the content. If the content is not of type <STRONG>text/plain</STRONG> then an error is returned.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>CMS_uncompress()</CODE> returns either 1 for success or 0 for
failure. The error can be obtained from <CODE>ERR_get_error(3)</CODE>

</P>
<P>
<HR>
<H1><A NAME="BUGS">BUGS</A></H1>
<P>
The lack of single pass processing and the need to hold all data in memory
as mentioned in <CODE>CMS_verify()</CODE> also applies to
<CODE>CMS_decompress().</CODE>

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/ERR_get_error.html#">ERR_get_error(3)</A>, <A HREF="../crypto/CMS_compress.html#">CMS_compress(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
<CODE>CMS_uncompress()</CODE> was added to OpenSSL 0.9.8

</P>
:}


