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