CMS_UNCOMPRESS(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’– CMS_UNCOMPRESS β€” bestie, let's unzip that CMS thing πŸ’–

okay so first things first: this is the 3ossl page from the OpenSSL crew, and we're talking about CMS_uncompress, a little function with main character energy that takes a CMS CompressedData structure and, well… uncompresses it. slay.


✨ NAME ✨

CMS_uncompress β€” literally the "uncompress a CMS CompressedData structure" girlie πŸŽ€


✨ SYNOPSIS ✨

#include <openssl/cms.h>

int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: CMS_uncompress() extracts and uncompresses the content from a CMS CompressedData structure, which you pass in as cms. 🫢

The prose calls the write-to BIO data β€” in the synopsis up there that's out, the BIO you're writing the content to. And flags is an optional set of flags, no big deal, just flags.

Now, dcont β€” that one's the rare-case parameter πŸ‘‘. It's for when the compressed content is detached. Normally you're gonna set it to NULL and move on with your life, iykyk.


🌸 NOTES 🌸

the tea on algorithms: the only currently supported compression algorithm is zlib. if the structure indicates the use of any other algorithm, an error is returned. no zlib, no service. πŸ’…

also, if zlib support is not compiled into OpenSSL, then CMS_uncompress() will always return an error. like, always always. 😭

These are the flags you can pass in the flags parameter:

  • CMS_TEXT β€” if this is set, MIME headers for type text/plain are deleted from the content. but if the content is not of type text/plain, an error is returned. read the room, content. πŸ™ˆ

⭐ RETURN VALUES ⭐

CMS_uncompress() returns either 1 for success or 0 for failure. that's it, that's the whole spectrum πŸŽ€

Need the actual error? Grab it with ERR_get_error(3).


πŸ’€ BUGS πŸ’€

the lack of single pass processing and the need to hold all data in memory β€” as mentioned over in CMS_verify() β€” also applies to CMS_decompress(). so yeah, it's giving "everything in RAM at once." noted. 😭


🌈 SEE ALSO 🌈


Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page bestie 🫢 this little gem is from OpenSSL version 3.5.6, dated 2026-04-07, page name CMS_UNCOMPRESS(3ossl) β€” go forth and uncompress responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from