Skip to content

Commit

Permalink
message: treat pcks7::smt::Unknown as encrypted
Browse files Browse the repository at this point in the history
GMime isn't more specific, so let's assume it's encrypted; better than
nothing.

Fixes #2784.
  • Loading branch information
djcb committed Nov 10, 2024
1 parent 9d960d0 commit fa59040
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/message/mu-message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,15 @@ maybe_handle_pkcs7(const MimeObject& obj, Message::Private& info)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-enum"
// CompressedData, CertsOnly, Unknown
switch (smime.smime_type()) {
const auto smtype{smime.smime_type()};
switch (smtype) {
case Mu::MimeApplicationPkcs7Mime::SecureMimeType::SignedData:
info.flags |= Flags::Signed;
break;
case Mu::MimeApplicationPkcs7Mime::SecureMimeType::EnvelopedData:
case Mu::MimeApplicationPkcs7Mime::SecureMimeType::Unknown:
/* The "Unknown" case... GMIME doesn't give us anything
* more specific, so assume it's encrypted for now */
info.flags |= Flags::Encrypted;
break;
default:
Expand Down

0 comments on commit fa59040

Please sign in to comment.