From 9c0136a62a199d9d1974997297cb4ef9c85c7642 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 17 Jan 2024 14:19:14 -0700 Subject: [PATCH] fixup! base64 encode the session before passing to libolm/goolm Signed-off-by: Sumner Evans --- crypto/keybackup.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/keybackup.go b/crypto/keybackup.go index 8b9cd841..0d930a9d 100644 --- a/crypto/keybackup.go +++ b/crypto/keybackup.go @@ -116,8 +116,7 @@ func (mach *OlmMachine) importRoomKeyFromBackup(ctx context.Context, roomID id.R return fmt.Errorf("ignoring room key in backup with weird algorithm %s", keyBackupData.Algorithm) } - encoded := make([]byte, base64.StdEncoding.EncodedLen(len(keyBackupData.SessionKey))) - base64.StdEncoding.Encode(encoded, keyBackupData.SessionKey) + encoded := []byte(base64.RawStdEncoding.EncodeToString(keyBackupData.SessionKey)) igsInternal, err := olm.InboundGroupSessionImport(encoded) if err != nil {