improvement: maybe cross signing really works now

This commit is contained in:
Timo Kösters 2023-08-07 13:55:44 +02:00
parent acfe381dd3
commit c1e2ffc0cd
No known key found for this signature in database
GPG key ID: 0B25E636FBA7E4CB
7 changed files with 35 additions and 15 deletions

View file

@ -132,6 +132,7 @@ pub async fn upload_signing_keys_route(
master_key,
&body.self_signing_key,
&body.user_signing_key,
true, // notify so that other users see the new keys
)?;
}
@ -375,6 +376,10 @@ pub(crate) async fn get_keys_helper<F: Fn(&UserId) -> bool>(
}
let json = serde_json::to_value(master_key).expect("to_value always works");
let raw = serde_json::from_value(json).expect("Raw::from_value always works");
services().users.add_cross_signing_keys(
&user, &raw, &None, &None,
false, // Dont notify. A notification would trigger another key request resulting in an endless loop
)?;
master_keys.insert(user, raw);
}

View file

@ -20,9 +20,8 @@ use ruma::{
StateEventType, TimelineEventType,
},
serde::Raw,
uint, DeviceId, OwnedDeviceId, OwnedEventId, OwnedUserId, RoomId, UInt, UserId,
uint, DeviceId, OwnedDeviceId, OwnedUserId, RoomId, UInt, UserId,
};
use serde::Deserialize;
use std::{
collections::{hash_map::Entry, BTreeMap, BTreeSet, HashMap, HashSet},
sync::Arc,

View file

@ -55,7 +55,7 @@ use std::{
time::{Duration, Instant, SystemTime},
};
use tracing::{debug, error, info, warn};
use tracing::{debug, error, warn};
/// Wraps either an literal IP address plus port, or a hostname plus complement
/// (colon-plus-port if it was specified).
@ -917,6 +917,7 @@ pub async fn send_transaction_message_route(
&master_key,
&self_signing_key,
&None,
true,
)?;
}
}