commit e331f41341590cf0de1644c9cab8a2972face3cf
parent 2f5acc36d3a79e0b8d82341994274fc1c62ee2f0
Author: MTRNord <MTRNord@users.noreply.github.com>
Date: Sat, 4 Apr 2026 02:22:59 +0200
another try
Signed-off-by: MTRNord <MTRNord@users.noreply.github.com>
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/apps/talos_cluster/matrix-backup/backup-tool/main.go b/apps/talos_cluster/matrix-backup/backup-tool/main.go
@@ -43,8 +43,7 @@ import (
"golang.org/x/crypto/pbkdf2"
"maunium.net/go/mautrix"
"maunium.net/go/mautrix/crypto/backup"
- _ "maunium.net/go/mautrix/crypto/goolm" // registers goolm implementations for olm package
- "maunium.net/go/mautrix/crypto/olm"
+ "maunium.net/go/mautrix/crypto/goolm/session"
"maunium.net/go/mautrix/crypto/ssss"
"maunium.net/go/mautrix/event"
"maunium.net/go/mautrix/id"
@@ -503,7 +502,7 @@ type exportedSessionEntry struct {
}
// megolmSessions maps session IDs to live inbound sessions ready to decrypt.
-type megolmSessions map[id.SessionID]olm.InboundGroupSession
+type megolmSessions map[id.SessionID]*session.MegolmInboundSession
// fetchAndExportKeyBackup derives the Megolm backup private key from SSSS,
// decrypts every backed-up session, and uploads both a raw JSON archive and a
@@ -593,7 +592,7 @@ func fetchAndExportKeyBackup(ctx context.Context, client *mautrix.Client, recove
}
// Build the in-memory session for history decryption.
- if sess, err := olm.InboundGroupSessionImport([]byte(sessionData.SessionKey)); err == nil {
+ if sess, err := session.NewMegolmInboundSessionFromExport([]byte(sessionData.SessionKey)); err == nil {
sessions[id.SessionID(sessionID)] = sess
} else {
slog.Warn("Failed to import Megolm session", "session_id", sessionID, "error", err)