Skip to content

Fixed session intitialization#16

Merged
UnluckyBird merged 1 commit intomainfrom
fix_initialization
May 15, 2025
Merged

Fixed session intitialization#16
UnluckyBird merged 1 commit intomainfrom
fix_initialization

Conversation

@UnluckyBird
Copy link
Contributor

Fixed initialization
Implemented deniable identity store
Started key ids from 1 instead of 0

Fixed initialization
Implemented deniable identity store
Started key ids from 1 instead of 0
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces support for a deniable identity key store alongside existing identity flows, adjusts key ID initialization to start from 1, and adds a helper to extract a contact’s display name from a processed envelope.

  • Added try_get_name_as_string to ProcessedEnvelope for easier contact name retrieval.
  • Implemented new save/is_trusted/get_deniable_identity methods and wired a DeniableIdentityKeyStore through the storage stack and client.
  • Changed default key ID start value in KeyManager from 0 to 1 and updated related tests.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
common/src/envelope.rs Added try_get_name_as_string, unwraps first contact display.
client/src/storage/in_memory.rs Forwarding methods for deniable identity operations.
client/src/storage/generic.rs Introduced deniable_identity_key_store in ProtocolStore.
client/src/storage/device.rs SQL table CRUD for deniable identities; new trait impls.
client/src/storage/database.rs Expanded ClientDB trait with deniable identity methods; new DeniableIdentityKeyStore.
client/src/main.rs Removed old name map, updated login/register to include alias, updated receive/display logic.
client/src/key_manager.rs Changed initial key counters to 1 and updated tests accordingly.
client/src/client.rs Added alias to Client, populated contact lists, wired deniable identity store in encryption/decryption paths.
client/client_db/migrations/02-denim/* Created/dropped DeniableDeviceIdentityKeyStore table.
Comments suppressed due to low confidence (3)

client/src/storage/device.rs:490

  • Calling .expect on a database operation can panic in production. It would be safer to propagate or map this error to SignalProtocolError instead of unconditionally panicking.
.await.expect("This function cannot return err")

client/src/storage/device.rs:565

  • The try_into()? conversion error isn't mapped to SignalProtocolError, which may lead to an unexpected error type. Consider wrapping this in .map_err(...) to return a consistent error variant.
.as_slice().try_into()?,

client/src/storage/device.rs:443

  • No unit tests cover save_deniable_identity, is_trusted_deniable_identity, or get_deniable_identity. Adding tests would ensure new database logic is verified and prevent regressions.
async fn save_deniable_identity(

Copy link
Contributor

@andreasalstrup andreasalstrup left a comment

Choose a reason for hiding this comment

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

LGTM

@UnluckyBird UnluckyBird merged commit 9bbd58d into main May 15, 2025
1 check passed
@UnluckyBird UnluckyBird deleted the fix_initialization branch May 15, 2025 12:28
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