From fa59040ebc565a9c6a54da8a20f2e24eaac02bca Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 10 Nov 2024 11:07:15 +0200 Subject: [PATCH] message: treat pcks7::smt::Unknown as encrypted GMime isn't more specific, so let's assume it's encrypted; better than nothing. Fixes #2784. --- lib/message/mu-message.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/message/mu-message.cc b/lib/message/mu-message.cc index 111eef9fc..ee5929805 100644 --- a/lib/message/mu-message.cc +++ b/lib/message/mu-message.cc @@ -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: