CMS_UNCOMPRESS(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… CMS_UNCOMPRESS β€” bestie, let's un-squish some data

okay so this is a page from the OpenSSL manual, section 3ossl, and it's all about CMS_uncompress β€” the function that takes a CMS CompressedData structure and, you guessed it, un-squishes it. it's giving "unzip but make it cryptography" πŸ’–


✨ NAME ✨

CMS_uncompress β€” literally just: uncompress a CMS CompressedData structure. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <openssl/cms.h>

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

no cap, that's the whole signature. one function, four args, zero drama (well… mostly). 🫢


🌸 DESCRIPTION 🌸

so CMS_uncompress() does two things in one iconic move: it extracts the content out of a CMS CompressedData structure (cms), and then it uncompresses it. two-for-one, main character energy fr fr. ✨

data is a BIO to write the content to, and flags is an optional set of flags β€” as in, you can pass 0 and nobody will be mad at you.

now the dcont parameter β€” this one is lowkey special-occasion only. it's for the rare case where the compressed content is detached. in normal life you'll set it to NULL and move on with your day. πŸ’…


πŸ‘‘ NOTES πŸ‘‘

  • the only compression algorithm currently supported is zlib. if the structure says "bestie I used something else", you get an error. periodt.
  • if zlib support isn't compiled into OpenSSL, then CMS_uncompress() will always return an error. no zlib, no slay. 😭

also, these flags can be passed in the flags parameter:

  • if the CMS_TEXT flag is set, MIME headers for type text/plain are deleted from the content. but β€” and this is the important part β€” if the content is not of type text/plain, then you get an error. so don't be out here setting CMS_TEXT on random content, iykyk. πŸ™ˆ

⭐ RETURN VALUES ⭐

CMS_uncompress() returns either 1 for success or 0 for failure. that's it, that's the whole scale β€” no in-between, no "kind of worked".

if it flopped, you can grab the error from ERR_get_error(3). go get your diagnostics, bestie. πŸ”₯


πŸ’€ BUGS πŸ’€

okay so remember how CMS_verify() has that whole thing about the lack of single pass processing and the need to hold all data in memory? yeah. that also applies to CMS_decompress(). so the whole thing has to sit in memory. not ideal, but that's the situation. 🫠


🌈 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 page!! 🧚 this version is 3.5.0, dated 2026-09-25, and it's the CMS_UNCOMPRESS(3ossl) page β€” go forth and uncompress responsibly, bestie. mwah πŸ’œπŸŽ€

πŸ“¦ where this page comes from