Enum core_crypto::CryptoError
source · pub enum CryptoError {
Show 67 variants
E2eiError(E2eIdentityError),
ConversationNotFound(ConversationId),
ConversationAlreadyExists(ConversationId),
ClientNotFound(ClientId),
PendingProposalNotFound(MlsProposalRef),
PendingCommitNotFound,
MalformedIdentifier(&'static str),
ClientSignatureNotFound,
IdentityAlreadyPresent,
NoProvisionalIdentityFound,
TooManyIdentitiesPresent,
LockPoisonError,
ImplementationError,
CredentialBundleConflict,
ConsumerError,
MlsProviderError(MlsProviderError),
KeyStoreError(CryptoKeystoreError),
MlsError(MlsError),
Utf8Error(Utf8Error),
StringUtf8Error(FromUtf8Error),
ParseIntError(ParseIntError),
ConvertIntError(TryFromIntError),
HexDecodeError(FromHexError),
InvalidByteArrayError(usize),
IoError(Error),
Unauthorized,
CallbacksNotSet,
UnauthorizedExternalAddProposal,
UnauthorizedExternalCommit,
InvalidHashReference,
DecryptionError,
StaleMessage,
WrongEpoch,
BufferedFutureMessage,
ProteusError(ProteusError),
CryptoboxMigrationError(CryptoboxMigrationError),
ProteusNotInitialized,
ProteusSupportNotEnabled(String),
MlsNotInitialized,
InvalidKeyPackage,
InvalidIdentity,
IdentityInitializationError,
ParentGroupNotFound,
MessageEpochTooOld,
E2eiEnrollmentNotDone,
CredentialNotFound(MlsCredentialType),
InternalMlsError,
DuplicateMessage,
ClearingPendingCommitError,
SelfCommitIgnored,
UnmergedPendingGroup,
X509CertDerError(Error),
PemError(PemError),
DomainNameNotFound,
DomainNamesDontMatch,
DuplicateDomainName,
InvalidCertificateChain,
EmptyTrustAnchorUpdate,
DuplicateCertificateChain,
OrphanWelcome,
InvalidClientId,
JsonError(Error),
StaleCommit,
StaleProposal,
MissingExternalSenderExtension,
Unsupported,
InvalidContext,
}
Expand description
CoreCrypto errors
Variants§
E2eiError(E2eIdentityError)
End to end identity error
ConversationNotFound(ConversationId)
This error is emitted when the requested conversation couldn’t be found in our store
ConversationAlreadyExists(ConversationId)
This error is emitted when the requested conversation already exists with the given if
ClientNotFound(ClientId)
This error is emitted when the requested client couldn’t be found in MLS group
PendingProposalNotFound(MlsProposalRef)
This error is emitted when a pending proposal couldn’t be found in MLS group
PendingCommitNotFound
This error is emitted when a pending commmit couldn’t be found in MLS group
MalformedIdentifier(&'static str)
This error is emitted when we find a malformed (i.e. not uuid) or empty identifier
ClientSignatureNotFound
The keystore has no knowledge of such client; this shouldn’t happen as Client::init is failsafe (find-else-create)
IdentityAlreadyPresent
The keystore already has a stored identity. As such, we cannot create a new raw identity
NoProvisionalIdentityFound
This error occurs when we cannot find any provisional keypair in the store, indicating that the generate_raw_keypair
method hasn’t been called.
TooManyIdentitiesPresent
This error occurs when during the MLS external client generation, we end up with more than one client identity in store.
This is usually not possible, unless there’s some kind of concurrency issue on the consumer (creating an ext-gen client AND a normal one at the same time for instance)
LockPoisonError
!!!! Something went very wrong and one of our locks has been poisoned by an in-thread panic !!!!
ImplementationError
We have done something terribly wrong
CredentialBundleConflict
Tried to insert an already existing CredentialBundle
ConsumerError
The consumer of this library has misused it
MlsProviderError(MlsProviderError)
Errors that are sent by our MLS Provider
KeyStoreError(CryptoKeystoreError)
Errors that are sent by our Keystore
MlsError(MlsError)
MLS Internal Errors
Utf8Error(Utf8Error)
Error when parsing str
s that are not valid UTF-8
StringUtf8Error(FromUtf8Error)
Error when parsing String
s that are not valid UTF-8
ParseIntError(ParseIntError)
Error when trying to coerce ints into Strings
ConvertIntError(TryFromIntError)
Error when trying to convert integer sizes - usually when they don’t fit
HexDecodeError(FromHexError)
Error when trying to decode an hex-encoded string. Usually that means that the length of the hex string is odd - should be always even
InvalidByteArrayError(usize)
Error when trying to coerce a Vec<u8>
into a [u8; N]
IoError(Error)
Standard I/O Error
Authorization error
CallbacksNotSet
Callbacks are not provided
External Add Proposal Validation failed
External Commit sender was not authorized to perform such
InvalidHashReference
A supplied [openmls::ciphersuite::hash_ref::HashReference
] is not of the expected size: 16
DecryptionError
Tried to decrypt a message in the wrong epoch
StaleMessage
Incoming message is from a prior epoch
WrongEpoch
Incoming message is from an epoch too far in the future to buffer.
BufferedFutureMessage
Incoming message is for a future epoch. We will buffer it until the commit for that epoch arrives
ProteusError(ProteusError)
Proteus Error Wrapper
CryptoboxMigrationError(CryptoboxMigrationError)
Cryptobox migration error wrapper
ProteusNotInitialized
The proteus client has been called but has not been initialized yet
ProteusSupportNotEnabled(String)
CoreCrypto hasn’t been built with the proteus
feature enabled, meaning proteus isn’t built in
MlsNotInitialized
A MLS operation was requested but MLS hasn’t been initialized on this instance
InvalidKeyPackage
Decrypted message uses an invalid KeyPackage (probably expired)
InvalidIdentity
Client presented an invalid identity
IdentityInitializationError
MLS Client was not initialized the right way
ParentGroupNotFound
Parent group cannot be found
MessageEpochTooOld
Message epoch is too old
E2eiEnrollmentNotDone
When looking for a X509 credential for a given ciphersuite and it has not been done
CredentialNotFound(MlsCredentialType)
A Credential was not found locally which is very likely an implementation error
InternalMlsError
The MLS group is in an invalid state for an unknown reason
DuplicateMessage
We already decrypted this message once
ClearingPendingCommitError
Happens when a client creates a commit, sends it to the DS which accepts it but then client clears this pending commit and creates another commit. This is triggered when the client tries to decrypt the original commit. This means something is very wrong in the client’s code and has to be fixed immediately
SelfCommitIgnored
Tried to decrypt a commit created by self which is likely to have been replayed by the DS
UnmergedPendingGroup
You tried to join with an external commit but did not merge it yet. We will reapply this message for you when you merge your external commit
X509CertDerError(Error)
see [x509_cert::der::Error
]
PemError(PemError)
see [pem::PemError
]
DomainNameNotFound
Domain name not found in the certificate
DomainNamesDontMatch
The provided domain name and the one found in the certificate don’t match
DuplicateDomainName
A trust anchor with the provided domain name already exists in the group’s context extensions
InvalidCertificateChain
The certificate chain is invalid or not complete
EmptyTrustAnchorUpdate
Emtpy trust anchor update
DuplicateCertificateChain
Adding a certificate chain already in the group’s context
OrphanWelcome
This happens when the DS cannot flag KeyPackages as claimed or not. It this scenario, a client requests their old KeyPackages to be deleted but one has already been claimed by another client to create a Welcome. In that case the only solution is that the client receiving such a Welcome tries to join the group with an External Commit instead
InvalidClientId
The encountered ClientId does not match Wire’s definition
JsonError(Error)
Json error
StaleCommit
The received commit is deemed stale and is from an older epoch
StaleProposal
The received proposal is deemed stale and is from an older epoch
MissingExternalSenderExtension
The group lacks an ExternalSender extension whereas it should have at least one
Unsupported
Not supported for the moment
InvalidContext
Invalid Context. This context has been finished and can no longer be used.
Implementations§
source§impl CryptoError
impl CryptoError
sourcepub fn proteus_error_code(&self) -> u32
pub fn proteus_error_code(&self) -> u32
Returns the proteus error code
Trait Implementations§
source§impl<UT> ConvertError<UT> for CryptoError
impl<UT> ConvertError<UT> for CryptoError
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
source§impl Debug for CryptoError
impl Debug for CryptoError
source§impl Display for CryptoError
impl Display for CryptoError
source§impl Error for CryptoError
impl Error for CryptoError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl<'_derivative_strum> From<&'_derivative_strum CryptoError> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum CryptoError> for &'static str
source§fn from(x: &'_derivative_strum CryptoError) -> &'static str
fn from(x: &'_derivative_strum CryptoError) -> &'static str
source§impl From<CryptoError> for &'static str
impl From<CryptoError> for &'static str
source§fn from(x: CryptoError) -> &'static str
fn from(x: CryptoError) -> &'static str
source§impl From<CryptoKeystoreError> for CryptoError
impl From<CryptoKeystoreError> for CryptoError
source§fn from(source: CryptoKeystoreError) -> Self
fn from(source: CryptoKeystoreError) -> Self
source§impl From<CryptoboxMigrationError> for CryptoError
impl From<CryptoboxMigrationError> for CryptoError
source§fn from(source: CryptoboxMigrationError) -> Self
fn from(source: CryptoboxMigrationError) -> Self
source§impl From<E2eIdentityError> for CryptoError
impl From<E2eIdentityError> for CryptoError
source§fn from(source: E2eIdentityError) -> Self
fn from(source: E2eIdentityError) -> Self
source§impl From<Error> for CryptoError
impl From<Error> for CryptoError
source§impl From<Error> for CryptoError
impl From<Error> for CryptoError
source§impl From<Error> for CryptoError
impl From<Error> for CryptoError
source§impl From<FromHexError> for CryptoError
impl From<FromHexError> for CryptoError
source§fn from(source: FromHexError) -> Self
fn from(source: FromHexError) -> Self
source§impl From<FromUtf8Error> for CryptoError
impl From<FromUtf8Error> for CryptoError
source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
source§impl From<MlsError> for CryptoError
impl From<MlsError> for CryptoError
source§impl From<MlsProviderError> for CryptoError
impl From<MlsProviderError> for CryptoError
source§fn from(source: MlsProviderError) -> Self
fn from(source: MlsProviderError) -> Self
source§impl From<ParseIntError> for CryptoError
impl From<ParseIntError> for CryptoError
source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
source§impl From<PemError> for CryptoError
impl From<PemError> for CryptoError
source§impl From<ProteusError> for CryptoError
impl From<ProteusError> for CryptoError
source§fn from(source: ProteusError) -> Self
fn from(source: ProteusError) -> Self
source§impl From<TryFromIntError> for CryptoError
impl From<TryFromIntError> for CryptoError
source§fn from(source: TryFromIntError) -> Self
fn from(source: TryFromIntError) -> Self
source§impl From<Utf8Error> for CryptoError
impl From<Utf8Error> for CryptoError
source§impl<UT> Lift<UT> for CryptoError
impl<UT> Lift<UT> for CryptoError
source§impl<UT> Lower<UT> for CryptoError
impl<UT> Lower<UT> for CryptoError
source§impl<UT> LowerError<UT> for CryptoError
impl<UT> LowerError<UT> for CryptoError
source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
source§impl<UT> TypeId<UT> for CryptoError
impl<UT> TypeId<UT> for CryptoError
const TYPE_ID_META: MetadataBuffer = _
Auto Trait Implementations§
impl Freeze for CryptoError
impl !RefUnwindSafe for CryptoError
impl Send for CryptoError
impl Sync for CryptoError
impl Unpin for CryptoError
impl !UnwindSafe for CryptoError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read moresource§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more