1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: AGPL-3.0-or-later
use thiserror::Error;
/// Custom error types for `SecretGroup`.
#[derive(Error, Debug)]
#[allow(missing_copy_implementations)]
pub enum SecretGroupError {
/// Commit messages and new long-term secrets can only be created by group owners.
#[error("this method can only be used by group owners")]
NotOwner,
/// MLS commit message was expected to contain a welcome message as well.
#[error("commit does not contain welcome message")]
WelcomeMissing,
/// Long-term secret does not match current secret group.
#[error("long-term secret has an invalid group id")]
LTSInvalidGroupID,
/// User data could not be decrypted since long-term secret is missing.
#[error("can not decrypt long-term secret since key material is missing")]
LTSSecretMissing,
/// LTS secret encoding failed.
#[error("could not encode long-term secret")]
LTSEncodingError,
/// LTS secret decoding failed. Maybe the data was corrupted or invalid?
#[error("could not decode long-term secret")]
LTSDecodingError,
/// Member's public key cannot be decoded as an Ed25519 public key.
#[error("member's public key is not a valid Ed25519 public key")]
InvalidMemberPublicKey,
/// Decoding failed with unknown value.
#[error("unknown value found during decoding")]
UnknownValue,
/// Error coming from `mls` sub-module.
#[error(transparent)]
MlsError(#[from] crate::secret_group::mls::MlsError),
/// Error coming from `lts` sub-module.
#[error(transparent)]
LTSError(#[from] crate::secret_group::lts::LongTermSecretError),
}