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

crypto(feat): Key distribution errors for pin violations #3662

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions crates/matrix-sdk-crypto/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,35 @@ pub enum OlmError {
have a valid Olm session with us"
)]
MissingSession,

#[error(transparent)]
/// The room key that was to be shared was not shared because the sharing
/// strategy could not be fulfilled.
RoomKeySharingStrategyError(RoomKeySharingStrategyError),
Copy link
Member

Choose a reason for hiding this comment

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

#3810 added a "SessionRecipientCollectionError" which I think we should be using here, rather than adding a new error type.

}

/// Depending on the sharing strategy for room keys, the distribution of the
/// room key could fail.
#[derive(Error, Debug)]
pub enum RoomKeySharingStrategyError {
/// When encrypting using the IdentityBased strategy, and there are changed
/// user identities that have not been confirmed by the user. The
/// application should display identity changes to the user as soon as
/// possible to avoid hitting this case. If this happens the app might just
/// retry automatically after the identity change has been notified, or
/// offer option to cancel.
#[error("Encryption failed because changed user identities have not been confirmed, please confirm or verify the problematic user identities")]
UnconfirmedIdentities(Vec<OwnedUserId>),

/// Cross-signing is required for encryption with invisible crypto
#[error("Encryption failed because cross-signing is not setup on your account")]
CrossSigningNotSetup,

/// The current device needs to be verified when encrypting using the
/// IdentityBased strategy. Apps should prevent sending in the UI to
/// avoid hitting this case.
#[error("Encryption failed because your device is not verified")]
SendingFromUnverifiedDevice,
}

/// Error representing a failure during a group encryption operation.
Expand Down
Loading