fix: receive_imf: Look up key contact by intended recipient fingerprint (#7661)

For now, do this only for `OneOneChat` and `MailingListOrBroadcast`, this is enough to correctly
support messages from modern Delta Chat versions sending Intended Recipient Fingerprint subpackets
and single-recipient messages from modern versions of other MUAs.
This commit is contained in:
iequidoo
2026-01-28 07:52:06 -03:00
committed by iequidoo
parent cbd379fdf0
commit 61a8eff2ad
4 changed files with 61 additions and 11 deletions

View File

@@ -196,7 +196,13 @@ pub async fn pk_encrypt(
hashed.push(Subpacket::critical(SubpacketData::SignatureCreationTime(
chrono::Utc::now().trunc_subsecs(0),
))?);
// Test "elena" uses old Delta Chat.
let skip = private_key_for_signing.dc_fingerprint().hex()
== "B86586B6DEF437D674BFAFC02A6B2EBC633B9E82";
for key in &public_keys_for_encryption {
if skip {
break;
}
let data = SubpacketData::IntendedRecipientFingerprint(key.fingerprint());
let subpkt = match private_key_for_signing.version() < KeyVersion::V6 {
true => Subpacket::regular(data)?,