---
name: "libressl-CMS_uncompress"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-CMS_uncompress"
---

# libressl-CMS\_uncompress(3)

uncompress a CMS CompressedData structure

## NAME

**CMS\_uncompress** – uncompress a CMS CompressedData structure

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/cms.h\>**

*int*\

**CMS\_uncompress**(*CMS\_ContentInfo \*cms*, *BIO \*dcont*, *BIO \*out*, *unsigned int flags*);

## DESCRIPTION

**CMS\_uncompress**() extracts and uncompresses the content of a CMS *CompressedData* structure *cms* and writes it to *out*.

In the rare case where the compressed content is detached, pass it in via *dcont*. For normal use, set *dcont* to NULL.

The only currently supported compression algorithm is zlib: if the structure indicates the use of any other algorithm, an error is returned. If zlib support is not compiled in, **CMS\_uncompress**() always returns an error.

If the CMS\_TEXT bit is set in *flags*, MIME headers for type text/plain are deleted from the content. If the content is not of type text/plain, an error is returned.

## RETURN VALUES

**CMS\_uncompress**() returns 1 for success or 0 for failure. The error can be obtained from ERR\_get\_error(3).

## SEE ALSO

CMS\_compress(3), CMS\_ContentInfo\_new(3)

## STANDARDS

RFC 3274: Compressed Data Content Type for Cryptographic Message Syntax (CMS)

## HISTORY

**CMS\_uncompress**() first appeared in OpenSSL 0.9.8h and has been available since OpenBSD 6.7.

## BUGS

The lack of single pass processing and the need to hold all data in memory as mentioned in CMS\_verify(3) also applies to **CMS\_uncompress**().
