CMS_UNCOMPRESS(3ossl)

πŸ’– CMS_UNCOMPRESS(3ossl) β€” the OpenSSL girlies' guide πŸ’–

okay so bestie, welcome to the OpenSSL manual pages, part... whatever number. today's main character is CMS_uncompress, and honestly? she's giving "I take compressed blobs and make them whole again" energy. πŸ¦‹


✨ NAME ✨

CMS_uncompress β€” uncompress a CMS CompressedData structure

like. that's the whole job. she unzips. respectfully. πŸŽ€


✨ SYNOPSIS ✨

#include <openssl/cms.h>

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

that's it, that's the whole vibe check. πŸ’…


✨ DESCRIPTION ✨

so CMS_uncompress() goes into a CMS CompressedData structure β€” that's your cms β€” and extracts + uncompresses the content out of it. that's the mission. that's the assignment.

the page calls the output BIO data (which, okay, is a whole thing, since the parameter in the synopsis is literally named out β€” the manpage said what it said, iykyk πŸ™ˆ), and it's where the content gets written to. then flags is an optional little set of flags, no big deal, just vibes.

now. the dcont parameter. 🫢 she's for the rare case where the compressed content is detached. normally you just set her to NULL and move on with your day. she's a special occasion queen, not an everyday one. πŸ‘‘


✨ NOTES ✨

the compression algorithm support is not a buffet, bestie. there is exactly ONE thing on the menu.

the only compression algorithm supported rn is zlib. if the structure says it's using literally any other algorithm? error. returned. immediately. no negotiation. πŸ’€

and if zlib support wasn't compiled into OpenSSL at all? then CMS_uncompress() will always return an error. always. every time. she can't do the thing if the thing isn't there, and that's honestly so valid of her. 😭

now, the flags you can pass in the flags parameter:

  • CMS_TEXT β€” if this is set, the MIME headers for type text/plain get deleted from the content. slay, clean it up. ✨ but β€” and this is the important part β€” if the content is not of type text/plain, then you get an error. she will not be deleting headers off content that doesn't have those headers. periodt. πŸ’…

✨ RETURN VALUES ✨

  • 1 β†’ success πŸŽ‰
  • 0 β†’ failure 😭

and if you got a 0 and you're sitting there like "okay but why" β€” the error can be obtained from ERR_get_error(3). go ask her. she'll tell you. 🫢


✨ BUGS ✨

okay so this is the part where we keep it real. πŸ™ˆ

the lack of single pass processing, and the need to hold all data in memory, as mentioned in CMS_verify() β€” yeah. all of that also applies to CMS_decompress(). πŸ’€

so like. she's iconic but she is not streaming, bestie. she's holding everything. plan accordingly. 🌸


✨ SEE ALSO ✨

go read those too, they're literally right there, they're her siblings, they're family. πŸ‘‘


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>.


okay that's the whole page bestie, you ate, you understood the assignment, you're now certified in CMS decompression βœ¨πŸ’–βœ¨

and a lil sign-off for the girlies who care about metadata (me, I care, I'm obsessed): this was OpenSSL 3.5.9, dated 2026-09-29, page CMS_UNCOMPRESS(3ossl). mwah. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from