Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data_type to EncryptedData and switch to binary channel payload encoding #2097

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

texuf
Copy link
Contributor

@texuf texuf commented Jan 20, 2025

this ended up being a large change - but mostly to just get the persistence layer changed over.

Olm still encrypts and decrypts strings…

For new encrypted data code where dataType.length > 0

  • accept bytes to encode, use bin_toHex to convert to string before encrypting
  • after decrypting, convert back to bytes with bin_fromHex before returning

For old data

  • after decrypting, convert to bytes with text encoder,
  • for strings (usernames etc) textDecoder will convert back in the rest of the codebase
  • for channel payloads, handle this case because dataType is unset

…ncoding

this ended up being a large change - but mostly to just get the persistence layer changed over.

Olm still encrypts and decrypts strings…

For new encrypted data code where `dataType.length > 0`
- accept bytes to encode, use bin_toHex to convert to string before encrypting
- after decrypting, convert back to bytes with bin_fromHex before returning

For old data
- after decrypting, convert to bytes with text encoder,
- for strings (usernames etc) textDecoder will convert back in the rest of the codebase
- for channel payloads, handle this case because `dataType` is unset
@texuf texuf requested a review from andreyz January 20, 2025 23:54
Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
river-sample-app ⬜️ Ignored (Inspect) Visit Preview Jan 20, 2025 11:54pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants