Skip to content

Commit 06ead55

Browse files
committed
Do not add an error if the message is encrypted but not signed
Services like Lacre [1] on Disroot and Inbound Encryption on Posteo [2] offer to encrypt all incoming messages with the provided OpenPGP public key. Resulting messages are encrypted, but not end-to-end encrypted and not signed by the sender, therefore should not have a padlock displayed. However, such encrypted and unsigned message is also not an indication of an error on ongoing attack, so we shoud not report this as a problem to the user. [1] https://lacre.io/ [2] https://posteo.de/en/help/how-do-i-activate-inbound-encryption-with-my-public-pgp-key
1 parent 7c34341 commit 06ead55

File tree

4 files changed

+65
-5
lines changed

4 files changed

+65
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
### API-Changes
99

1010
### Fixes
11+
- Do not add an error if the message is encrypted but not signed #3860
1112

1213

1314
## 1.104.0

src/mimeparser.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,6 @@ impl MimeMessage {
391391
// part.error = Some("Seems like DKIM failed, this either is an attack or (more likely) a bug in Authentication-Results checking. Please tell us about this at https://support.delta.chat.".to_string());
392392
// }
393393
// }
394-
if encrypted && parser.signatures.is_empty() {
395-
for part in parser.parts.iter_mut() {
396-
part.error = Some("No valid signature".to_string());
397-
}
398-
}
399394

400395
if parser.is_mime_modified {
401396
parser.decoded_data = mail_raw;

src/receive_imf/tests.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3075,6 +3075,26 @@ async fn test_thunderbird_autocrypt_unencrypted() -> Result<()> {
30753075
Ok(())
30763076
}
30773077

3078+
/// Alice receives an encrypted, but unsigned message.
3079+
///
3080+
/// Test that the message is displayed without any errors,
3081+
/// but also without a padlock.
3082+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
3083+
async fn test_thunderbird_unsigned() -> Result<()> {
3084+
let alice = TestContext::new_alice().await;
3085+
alice.set_config(Config::ShowEmails, Some("2")).await?;
3086+
3087+
// Alice receives an unsigned message from Bob.
3088+
let raw = include_bytes!("../../test-data/message/thunderbird_encrypted_unsigned.eml");
3089+
receive_imf(&alice, raw, false).await?;
3090+
3091+
let msg = alice.get_last_msg().await;
3092+
assert!(!msg.get_showpadlock());
3093+
assert!(msg.error().is_none());
3094+
3095+
Ok(())
3096+
}
3097+
30783098
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
30793099
async fn test_mua_user_adds_member() -> Result<()> {
30803100
let t = TestContext::new_alice().await;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Message-ID: <[email protected]>
2+
Date: Fri, 23 Dec 2022 13:00:00 +0000
3+
MIME-Version: 1.0
4+
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
5+
Thunderbird/102.6.1
6+
Content-Language: en-US
7+
To: Alice <[email protected]>
8+
From: Bob <[email protected]>
9+
Subject: ...
10+
Content-Type: multipart/encrypted;
11+
protocol="application/pgp-encrypted";
12+
boundary="------------LXsQ1GfDj60OyJAdRFaJ9eSx"
13+
14+
This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)
15+
--------------LXsQ1GfDj60OyJAdRFaJ9eSx
16+
Content-Type: application/pgp-encrypted
17+
Content-Description: PGP/MIME version identification
18+
19+
Version: 1
20+
21+
--------------LXsQ1GfDj60OyJAdRFaJ9eSx
22+
Content-Type: application/octet-stream; name="encrypted.asc"
23+
Content-Description: OpenPGP encrypted message
24+
Content-Disposition: inline; filename="encrypted.asc"
25+
26+
-----BEGIN PGP MESSAGE-----
27+
28+
wV4D5tq63hTeebASAQdAgKVFSZ8p8RyNRongu8xc0qnEl54jbOTjrow1rYHECFUw
29+
44bDFHvaSjFYMFcFmumYZQ+hFcjaoIEv78Wx6GmEGTFzFcs8mBKUGbRDFeLJebbU
30+
0sE8AcETwB3nrhR4WvUYlmqt87EAJfigMYX3Cmod0Pz9cFPdE13NIoOotZXEcxHq
31+
aGefenHJUYF1/FX9iuGRMt/qo41stlSJ6Z575mxUKnHexJVnvoDgFLTwS2dGTNlt
32+
0VBk7NOeaCmbxm8u4uJ3kt2vPG7ViYsSvHMGdYciIkGMsyHpJPzrOHzyoXZuuea1
33+
t8QTZym3FhHH9gbTRCnfnIX60G1Qu9hSMRAQandA6J2to9IahmlahFP9XoUin3fK
34+
ikeCHoNs9kTFFXarU0q99O6byhQqwSehoMhx4BLEFXvMp49jD9LzHUGJmR3Pdcqb
35+
lBgU9mPYWflfiQ8wj2Awyj94+YR3ovaOuc75LE+JylJ9BLk3axZou2HI6hDCoZJg
36+
XQkF46JMPV4NArOtPxP1N5/Gvo9TGvH7H4LdMhsI1Wc8Lfiks6UdcGXUblAlEfcN
37+
rQfywPIH4n+H8cTqk1v2ON3OsD9sFluggWUHEWLP3Eqtr1RO2YQURv+N+pcqvLyq
38+
kPIP9JQ5rfSMjbRNBmN5RReflomYcq9Dt8iobMWXt2fokiyJueaRwZSst2d/pG6H
39+
oYqzzxM7DXnxaJvZELGwJ2tGlQPL5JtSZL+jgL+Zd7+Z7czuRLLoVqf0Q6tgQPKE
40+
s8cpgxVDW0hp5T3ukNvL03SxK+v+dqBPFLd9FYcxMA==
41+
=Wl0m
42+
-----END PGP MESSAGE-----
43+
44+
--------------LXsQ1GfDj60OyJAdRFaJ9eSx--

0 commit comments

Comments
 (0)