-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prefer encryption for the peer if the message is encrypted or signed …
…with the known key (#3844) Note that if the message is encrypted, we don't check whether it's signed with an attached key currently, otherwise a massive refactoring of the code is needed because for encrypted messages a signature is checked and discarded first now.
- Loading branch information
Showing
8 changed files
with
370 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5359,7 +5359,13 @@ Reply from different address | |
|
||
let raw = include_bytes!("../test-data/message/thunderbird_with_autocrypt_unencrypted.eml"); | ||
receive_imf(&t, raw, false).await?; | ||
let peerstate = Peerstate::from_addr(&t, "[email protected]") | ||
.await? | ||
.unwrap(); | ||
assert_eq!(peerstate.prefer_encrypt, EncryptPreference::Mutual); | ||
|
||
let raw = include_bytes!("../test-data/message/thunderbird_signed_unencrypted.eml"); | ||
receive_imf(&t, raw, false).await?; | ||
let peerstate = Peerstate::from_addr(&t, "[email protected]") | ||
.await? | ||
.unwrap(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
From - Thu, 15 Dec 2022 14:45:17 GMT | ||
X-Mozilla-Status: 0801 | ||
X-Mozilla-Status2: 00000000 | ||
Message-ID: <[email protected]> | ||
Date: Thu, 15 Dec 2022 11:45:16 -0300 | ||
MIME-Version: 1.0 | ||
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 | ||
Thunderbird/102.5.1 | ||
Content-Language: en-US | ||
To: [email protected] | ||
From: Alice <[email protected]> | ||
Subject: test message 15:53 | ||
X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0; | ||
attachmentreminder=0; deliveryformat=0 | ||
X-Identity-Key: id3 | ||
Fcc: imap://alice%[email protected]/Sent | ||
Content-Type: multipart/signed; micalg=pgp-sha256; | ||
protocol="application/pgp-signature"; | ||
boundary="------------iX39J1p7DOgblwacjo0e7jX7" | ||
|
||
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) | ||
--------------iX39J1p7DOgblwacjo0e7jX7 | ||
Content-Type: multipart/mixed; boundary="------------WD4DG7TcI4p4lbzyM4toRaDw"; | ||
protected-headers="v1" | ||
From: Alice <[email protected]> | ||
To: [email protected] | ||
Message-ID: <[email protected]> | ||
Subject: test message 15:53 | ||
--------------WD4DG7TcI4p4lbzyM4toRaDw | ||
Content-Type: text/plain; charset=UTF-8; format=flowed | ||
Content-Transfer-Encoding: base64 | ||
DQo= | ||
--------------WD4DG7TcI4p4lbzyM4toRaDw-- | ||
|
||
--------------iX39J1p7DOgblwacjo0e7jX7 | ||
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" | ||
Content-Description: OpenPGP digital signature | ||
Content-Disposition: attachment; filename="OpenPGP_signature" | ||
-----BEGIN PGP SIGNATURE----- | ||
|
||
wsD5BAABCAAjFiEEFKs/ZfwnS721+naMJfAHJFnkeuIFAmObMvwFAwAAAAAACgkQJfAHJFnkeuLM | ||
TgwAnAADX93HE5vXmuBcAbRN2HKIwMzBtRtUF4FNPKchffUvvhSNpHkW2jW7A4hOHNgVSDQdqIUn | ||
+62NgkaKrT1bZqozOZNHXMECHtKBwXWTkIAVqcBdvscCztVIgGby56OPnzZ5y09BsRaqqE5AhDgN | ||
wGCLa6ipu5FYSF6+KzdO0GIPMY5aGRgVhtl4N01v4S3+r/Yu60MkN87nd15Eaqsrs60P9RmKJTt4 | ||
hDie35kKvHnPzLNs8+xLfqPuO/P7ZbPQgkgCwMAMsMDRUYOv+k5c/bL3PKiOENuDpQ7dkKJ2OzSn | ||
nTcg8qhDf17vWe26C/QBhFiGEsrHNBQ1KW5by+cqjIUBJgXElFnPl35S5L3fn6JHZLcz6q+wQuJu | ||
vGT1mJuP//jLFkMHSexukFIVXzn41rWPLd05rBqMgwRcOHMIyzE9zaO1aa8MF2TirPaZ5lH9rx/y | ||
9DCU/d2sqbbYt8TGqj4hM3pqg5K22eq4KT1W7y8+28I5QfjZumLLrHBdYTnR | ||
=6JTB | ||
-----END PGP SIGNATURE----- | ||
|
||
--------------iX39J1p7DOgblwacjo0e7jX7-- |
Oops, something went wrong.