fix: Don't panic when receiving PDUs with illegal auth events

Apparently some servers do this??
This commit is contained in:
timedout
2026-08-18 17:50:18 +01:00
parent 1cdf369a80
commit 7b3e3a26bb
2 changed files with 8 additions and 7 deletions
@@ -170,12 +170,13 @@ pub async fn handle_outlier_pdu<'a, Pdu>(
.expect("we just checked that we have all auth events")
.to_owned();
let key = auth_event.kind().with_state_key(
auth_event
.state_key
.clone()
.expect("all auth events must have state keys"),
);
let Some(state_key) = auth_event.state_key() else {
self.reject_and_persist(event_id, &incoming_pdu);
return Err!(Request(Forbidden(debug_warn!(
"Event references non-state event as an auth event: {id}",
))));
};
let key = auth_event.kind().with_state_key(state_key);
match auth_events_by_key.entry(key) {
| hash_map::Entry::Vacant(v) => {
v.insert(auth_event);
+1 -1
View File
@@ -7,7 +7,7 @@
routing::{get, on},
};
use conduwuit_api::client_ip::ClientIp;
use conduwuit_core::{config::TermsDocument, info, warn};
use conduwuit_core::{config::TermsDocument, warn};
use conduwuit_service::{
mailer::messages,
registration_tokens::ValidToken,