openmls/group/public_group/
errors.rs1use openmls_traits::types::Ciphersuite;
2use thiserror::Error;
3
4use crate::{
5 error::LibraryError,
6 extensions::errors::InvalidExtensionError,
7 treesync::errors::{LeafNodeValidationError, TreeSyncFromNodesError},
8};
9
10#[derive(Error, Debug, PartialEq, Clone)]
12pub enum CreationFromExternalError<StorageError> {
13 #[error(transparent)]
15 LibraryError(#[from] LibraryError),
16 #[error(transparent)]
18 TreeSyncError(#[from] TreeSyncFromNodesError),
19 #[error("Sender not found in tree.")]
21 UnknownSender,
22 #[error("The signature on the GroupInfo is not valid.")]
24 InvalidGroupInfoSignature,
25 #[error("The computed tree hash does not match the one in the GroupInfo.")]
27 TreeHashMismatch,
28 #[error("We don't support the version of the group we are trying to join.")]
30 UnsupportedMlsVersion,
31 #[error("Ciphersuite {0:?} is not supported by the crypto provider.")]
33 UnsupportedCiphersuite(Ciphersuite),
34 #[error(transparent)]
36 LeafNodeValidation(#[from] LeafNodeValidationError),
37 #[error("Error writing to storage: {0}")]
39 WriteToStorageError(StorageError),
40 #[error("A parent node has an unmerged leaf that is not a descendant of the node")]
42 UnmergedLeafNotADescendant,
43 #[error("Found a path from a parent with an unmerged leaf to the leaf with nodes that do not have that as a leaf")]
45 IntermediateNodeMissingUnmergedLeaf,
46 #[error("The ratchet tree contains duplcate encryption keys")]
48 DuplicateEncryptionKey,
49 #[error("The ratchet tree contains duplcate signature keys")]
51 DuplicateSignatureKey,
52}
53
54#[derive(Error, Debug, PartialEq, Clone)]
56pub enum PublicGroupBuildError {
57 #[error(transparent)]
59 LibraryError(#[from] LibraryError),
60 #[error("Invalid extensions set in configuration")]
62 InvalidExtensions(#[from] InvalidExtensionError),
63}
64
65#[cfg(feature = "extensions-draft")]
67#[derive(Error, Debug, PartialEq, Clone)]
68pub enum ApplyAppDataUpdateError {
69 #[error("Found AppDataUpdate proposals, but was not provided the updated values")]
71 MissingAppDataUpdates,
72 #[error("No AppDataUpdate proposals found, but was provided updated values")]
74 SuperfluousAppDataUpdates,
75 #[error(transparent)]
77 LibraryError(#[from] LibraryError),
78}