From f5d5196bf50e1aea24ae2fb3a9a891b0dd1af08b Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 17 Mar 2026 16:08:39 +0000 Subject: [PATCH] Fix cross-signing bootstrap by passing UIA password auth The homeserver requires User-Interactive Authentication before accepting cross-signing keys. Pass the bot's password so bootstrap succeeds. Co-Authored-By: Claude Opus 4.6 (1M context) --- server/src/matrix/bot.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/server/src/matrix/bot.rs b/server/src/matrix/bot.rs index aed0044..ba4aa16 100644 --- a/server/src/matrix/bot.rs +++ b/server/src/matrix/bot.rs @@ -136,8 +136,21 @@ pub async fn run_bot( slog!("[matrix-bot] Logged in as {bot_user_id} (device: {})", login_response.device_id); // Bootstrap cross-signing keys for E2EE verification support. - if let Err(e) = client.encryption().bootstrap_cross_signing(None).await { - slog!("[matrix-bot] Cross-signing bootstrap note: {e}"); + // Pass the bot's password for UIA (User-Interactive Authentication) — + // the homeserver requires proof of identity before accepting cross-signing keys. + { + use matrix_sdk::ruma::api::client::uiaa; + let password_auth = uiaa::AuthData::Password(uiaa::Password::new( + uiaa::UserIdentifier::UserIdOrLocalpart(config.username.clone()), + config.password.clone(), + )); + if let Err(e) = client + .encryption() + .bootstrap_cross_signing(Some(password_auth)) + .await + { + slog!("[matrix-bot] Cross-signing bootstrap note: {e}"); + } } // Self-sign own device keys so other clients don't show