mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
fix: allow other verified group recipients to be unverified
We may not have a verified key for other members because we lost a gossip message. Still, if the message is signed with a verified key of the sender, there is no reason to replace it with an error.
This commit is contained in:
@@ -2326,13 +2326,7 @@ async fn has_verified_encryption(
|
|||||||
|
|
||||||
let contact = Contact::get_by_id(context, from_id).await?;
|
let contact = Contact::get_by_id(context, from_id).await?;
|
||||||
|
|
||||||
for (to_addr, mut is_verified) in rows {
|
for (to_addr, is_verified) in rows {
|
||||||
info!(
|
|
||||||
context,
|
|
||||||
"has_verified_encryption: {:?} self={:?}.",
|
|
||||||
to_addr,
|
|
||||||
context.is_self_addr(&to_addr).await
|
|
||||||
);
|
|
||||||
let peerstate = Peerstate::from_addr(context, &to_addr).await?;
|
let peerstate = Peerstate::from_addr(context, &to_addr).await?;
|
||||||
|
|
||||||
// mark gossiped keys (if any) as verified
|
// mark gossiped keys (if any) as verified
|
||||||
@@ -2357,16 +2351,10 @@ async fn has_verified_encryption(
|
|||||||
contact.get_addr().to_owned(),
|
contact.get_addr().to_owned(),
|
||||||
)?;
|
)?;
|
||||||
peerstate.save_to_db(&context.sql).await?;
|
peerstate.save_to_db(&context.sql).await?;
|
||||||
is_verified = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !is_verified {
|
|
||||||
return Ok(NotVerified(format!(
|
|
||||||
"{to_addr} is not a member of this protected chat member list {to_ids:?}",
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Ok(Verified)
|
Ok(Verified)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user