Skip to content

Commit

Permalink
fixup! (DO NOT MERGE) crypto: allow run goolm side-by-side with libolm
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Jan 17, 2025
1 parent 0ea4a16 commit f4a44df
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crypto/sql_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,9 @@ func (store *SQLCryptoStore) PutAccount(ctx context.Context, account *OlmAccount
if err != nil {
return err
}
goolmBytes, err := account.InternalGoolm.Pickle(store.PickleKey)
err = account.InternalGoolm.Unpickle(pickled, store.PickleKey)
if err != nil {
panic(fmt.Errorf("pickling goolm account errored %w", err))
}
if !bytes.Equal(pickled, goolmBytes) {
panic("libolm and goolm pickled to different values")
panic(fmt.Sprintf("failed to unpickle account using goolm: %+v", err))
}
_, err = store.DB.Exec(ctx, `
INSERT INTO crypto_account (device_id, shared, sync_token, account, account_id, key_backup_version) VALUES ($1, $2, $3, $4, $5, $6)
Expand Down

0 comments on commit f4a44df

Please sign in to comment.