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

fix(crypto): migration failure due to optimized handling of &[u8] #4500

Closed

Conversation

BillCarsonFr
Copy link
Member

Fix migration bug caused by #4450 when &[u8] serialization is optimized.

=> Migration bug was causing messages to fail to decrypt and the sync to fail with the following errors

matrix_sdk_crypto::machine: Failed to decrypt a room event: invalid type: byte array, expected a base64 string or an array of 32 bytes
ERROR matrix_sdk::sync: Received an invalid response: failed to read or write to the crypto store invalid type: byte array, expected a base64 string or an array of 32 bytes
  • Public API changes documented in changelogs (optional)

Signed-off-by:

@BillCarsonFr BillCarsonFr requested review from a team as code owners January 10, 2025 10:10
@BillCarsonFr BillCarsonFr requested review from jmartinesp and poljar and removed request for a team January 10, 2025 10:10
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.36%. Comparing base (7ec384c) to head (1319808).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...x-sdk-crypto/src/olm/group_sessions/sender_data.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4500      +/-   ##
==========================================
- Coverage   85.37%   85.36%   -0.01%     
==========================================
  Files         284      284              
  Lines       31885    31892       +7     
==========================================
+ Hits        27222    27226       +4     
- Misses       4663     4666       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if I understood the issue correctly 😅 . Left a small comment, and I think we should wait for confirmation from @poljar .

E: de::Error,
{
if v.len() == Ed25519PublicKey::LENGTH {
let mut buf = [0u8; 32];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use [0u8; Ed25519PublicKey::LENGTH] here too I think, to it's more explicit.

@BillCarsonFr
Copy link
Member Author

Closed. The test was added to the existing PR #4499

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