2023-06-14 17:55:47 +00:00
|
|
|
abstract class OmemoError {}
|
2022-12-25 21:13:08 +00:00
|
|
|
|
2022-08-03 14:41:33 +00:00
|
|
|
/// Triggered during X3DH if the signature if the SPK does verify to the actual SPK.
|
2023-06-14 17:55:47 +00:00
|
|
|
class InvalidSignatureException extends OmemoError implements Exception {
|
2023-06-12 17:20:43 +00:00
|
|
|
String errMsg() =>
|
|
|
|
'The signature of the SPK does not match the provided signature';
|
2022-08-02 13:40:26 +00:00
|
|
|
}
|
2023-06-12 17:20:43 +00:00
|
|
|
|
2022-08-04 12:01:50 +00:00
|
|
|
/// Triggered by the Double Ratchet if the computed HMAC does not match the attached HMAC.
|
2023-06-14 17:55:47 +00:00
|
|
|
class InvalidMessageHMACError extends OmemoError {}
|
2022-08-03 14:44:18 +00:00
|
|
|
|
|
|
|
/// Triggered by the Double Ratchet if skipping messages would cause skipping more than
|
|
|
|
/// MAXSKIP messages
|
2023-06-14 17:55:47 +00:00
|
|
|
class SkippingTooManyKeysError extends OmemoError {}
|
2022-08-04 12:01:50 +00:00
|
|
|
|
|
|
|
/// Triggered by the Session Manager if the message key is not encrypted for the device.
|
2023-06-14 17:55:47 +00:00
|
|
|
class NotEncryptedForDeviceError extends OmemoError {}
|
2022-08-04 12:01:50 +00:00
|
|
|
|
|
|
|
/// Triggered by the Session Manager when there is no key for decrypting the message.
|
2023-06-14 17:55:47 +00:00
|
|
|
class NoDecryptionKeyException extends OmemoError implements Exception {
|
2022-08-04 12:01:50 +00:00
|
|
|
String errMsg() => 'No key available for decrypting the message';
|
|
|
|
}
|
2022-08-08 13:48:09 +00:00
|
|
|
|
|
|
|
/// Triggered by the Session Manager when the identifier of the used Signed Prekey
|
|
|
|
/// is neither the current SPK's identifier nor the old one's.
|
2023-06-14 17:55:47 +00:00
|
|
|
class UnknownSignedPrekeyError extends OmemoError {}
|
2022-10-02 12:56:20 +00:00
|
|
|
|
2022-10-02 17:23:58 +00:00
|
|
|
/// Triggered by the Session Manager when the received Key Exchange message does not meet
|
|
|
|
/// the requirement that a key exchange, given that the ratchet already exists, must be
|
|
|
|
/// sent after its creation.
|
2023-06-14 17:55:47 +00:00
|
|
|
class InvalidKeyExchangeException extends OmemoError implements Exception {
|
2022-10-02 17:23:58 +00:00
|
|
|
String errMsg() => 'The key exchange was sent before the last kex finished';
|
2022-10-02 12:56:20 +00:00
|
|
|
}
|
2022-10-02 15:03:39 +00:00
|
|
|
|
2022-12-27 00:32:23 +00:00
|
|
|
/// Triggered by the OmemoManager when we could not encrypt a message as we have
|
|
|
|
/// no key material available. That happens, for example, when we want to create a
|
|
|
|
/// ratchet session with a JID we had no session with but fetching the device bundle
|
|
|
|
/// failed.
|
2023-06-14 19:59:59 +00:00
|
|
|
class NoKeyMaterialAvailableError extends OmemoError {}
|
2023-06-14 17:55:47 +00:00
|
|
|
|
|
|
|
/// A non-key-exchange message was received that was encrypted for our device, but we have no ratchet with
|
|
|
|
/// the device that sent the message.
|
|
|
|
class NoSessionWithDeviceError extends OmemoError {}
|