Skip to content

Commit

Permalink
fixup! base64 encode the session before passing to libolm/goolm
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <sumner@beeper.com>
  • Loading branch information
sumnerevans committed Jan 17, 2024
1 parent ce6b911 commit 9c0136a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/keybackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9c0136a

Please sign in to comment.