Skip to content

handle PKCS#7 CompressedData #66

Closed

Description

@dkg

gmime currently has some commented out/unimplemented functions for handling PKCS#7 CompressedData messages. These should be implemented, so i'm just recording that as an open issue.

The functions in particular are:

  • g_mime_application_pkcs7_mime_compress
  • g_mime_application_pkcs7_mime_decompress

for specification reference, see § 3.6 of RFC 8551

Activity

  1. jstedfast commented on Dec 2, 2019

    @jstedfast
    Owner

    Yea, I think I aborted my efforts on support for this because I wasn't sure how to do it using GpgME.

  2. dkg commented on Dec 3, 2019

    @dkg
    ContributorAuthor

    I don't think it should require gpgme at all -- compression and decompression are completely unrelated to cryptography, they just happen to use the same PKCS#7 framing.

  3. added this to the 4.0 milestone on Dec 9, 2019
  4. jstedfast commented on Dec 9, 2019

    @jstedfast
    Owner

    Sure, but I was hoping gpgme supported it because otherwise I need to implement asn1 myself.

    Maybe I can use libksba, but that looks like it's missing some API that might be needed. Hard to tell right now.

    I'll also need to add new virtual methods for this (theoretically), so this may be best as a v4.0 API as well.

  5. sakwaa commented on Mar 27, 2020

    @sakwaa

    Are there any updates to the implementation for the compress/decompress? I ran into the same issue.. I have a multipart/signed part with a compressed message and I can't figure out how to decompress to get the message contents as readable text. Thanks!

  6. jstedfast commented on Mar 27, 2020

    @jstedfast
    Owner

    No updates. I haven't had enough free time to look into this yet.

  7. added a commit that references this issue on Oct 28, 2026
  8. jstedfast commented on Oct 28, 2026

    @jstedfast
    Owner

    Implemented in commit 3e12c5d on v4.0-dev. Adds RFC 3274 CMS CompressedData compression and DER/BER decompression using zlib, without requiring a crypto backend. Decompression requires an explicit expanded-size limit and validates nesting, checksums, truncation, and trailing data. Verified with regression tests, two-way OpenSSL interoperability, and sanitizer tests with and without crypto support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions