CMS_UNCOMPRESS(3SSL)

πŸ’– CMS_UNCOMPRESS πŸ’–

okay bestie, this page is all about CMS_uncompress, a lil function from the OpenSSL manual, section 3SSL ✨ it takes a CMS CompressedData thing and un-squishes it. that's the whole vibe. let's go 🫢


πŸŽ€ NAME πŸŽ€

CMS_uncompress β€” uncompress a CMS CompressedData structure πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/cms.h>

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

✨ DESCRIPTION ✨

so CMS_uncompress() grabs the content out of a CMS CompressedData structure β€” that's your cms β€” and uncompresses it. no cap. πŸ¦‹

out is a BIO, and that's where the content gets written. and flags is an optional little set of flags, no big deal. πŸ’–

now, about dcont: that parameter is for the rare case where the compressed content is detached. like, rare rare. normally you just set it to NULL and move on with your life. πŸ™ˆ


πŸ’œ NOTES πŸ’œ

The only compression algorithm supported rn is zlib. if the structure is giving any other algorithm, you get an error. periodt. πŸ’€

and if zlib support wasn't compiled into OpenSSL? then CMS_uncompress() will always return an error. literally always. 😭

the following flags can be passed in the flags parameter:

  • CMS_TEXT β€” if this is set, the MIME headers for type text/plain are deleted from the content. but bestie, if the content isn't of type text/plain, you get an error instead. so know your content ok 🌸

🫢 RETURN VALUES 🫢

CMS_uncompress() returns either 1 for success or 0 for failure. and you can grab the error with ERR_get_error(3). slay πŸ’…


😭 BUGS 😭

the lack of single pass processing, plus the need to hold all the data in memory β€” the stuff mentioned over in CMS_verify() β€” also applies to CMS_decompress(). so yeah. that's still a thing. πŸ’€


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


okay that's the whole page, you ate that πŸ“ version 4.0.3, dated 2026-09-29 β€” mwah, iconic, bye bestie πŸ’œπŸ§š

πŸ“¦ where this page comes from