CMS_UNCOMPRESS(3ossl)
π 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
zlibsupport isn't compiled into OpenSSL, thenCMS_uncompress()will always return an error. no zlib, no slay. π
also, these flags can be passed in the flags parameter:
- if the
CMS_TEXTflag is set, MIME headers for typetext/plainare deleted from the content. but β and this is the important part β if the content is not of typetext/plain, then you get an error. so don't be out here settingCMS_TEXTon 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 π
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
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms