CMS_UNCOMPRESS(3)
π CMS_UNCOMPRESS(3) π
okay so real talk bestie, we're in the Library Functions Manual today and the star of the show is CMS_uncompress β yes it's giving crypto, yes it's giving compressed, and yes you're gonna get it. π«Ά
β¨ NAME β¨
CMS_uncompress β uncompress a CMS CompressedData structure π
π¦ SYNOPSIS π¦
library βlibcryptoβ #include <openssl/cms.h>
int
CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
unsigned int flags);
πΈ DESCRIPTION πΈ
so CMS_uncompress() does exactly what it says on the tin, no cap: it extracts and uncompresses the content of a CMS CompressedData structure β that's your cms β and writes it all out to out. iconic behaviour honestly. β¨
now, the rare case π β if the compressed content is detached, you pass it in through dcont. for normal use though? just set dcont to NULL and move on with your life. simple as.
the only currently supported compression algorithm is zlib. literally the only one. so if the structure indicates the use of any other algorithm, an error is returned, periodt. and heads up β if zlib support is not compiled in, CMS_uncompress() always returns an error. like, every time. π
one more thing π if the CMS_TEXT bit is set in flags, MIME headers for type text/plain are deleted from the content. slay. but if the content is not of type text/plain? error. sorry bestie, vibe check failed. π
π RETURN VALUES π
1β success, we ate π0β failure, not the vibe
the error can be obtained from ERR_get_error(3). go get it, detective. π₯
π SEE ALSO π
β STANDARDS β
RFC 3274: Compressed Data Content Type for Cryptographic Message Syntax (CMS)
π§ HISTORY π§
CMS_uncompress() first appeared in OpenSSL 0.9.8h and has been available since OpenBSD 6.7. she's been around, she's got lore. π
π BUGS π
okay so the lack of single pass processing and the need to hold all data in memory as mentioned in CMS_verify(3) also applies to CMS_uncompress(). yep, same energy, same caveat. fr fr keep that in mind. π
Debian πΈ June 8, 2025 β and that's the whole page bestie, mwah ππ
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2008 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms