From 87738477be87afb639509f5ebdf5da979ba0bd04 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 14 Apr 2024 22:50:59 +0530 Subject: fix: special-case AEAD failure Fixes #2974 Fixes #2963 Fixes #2921 Fixes #2924 Fixes #2653 Fixes #2461 Fixes #2586 Fixes #2179 --- .../main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crypto/common') diff --git a/crypto/common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt b/crypto/common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt index eb64541e..c2d3ca4d 100644 --- a/crypto/common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt +++ b/crypto/common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt @@ -41,8 +41,13 @@ public sealed class CryptoHandlerException(message: String? = null, cause: Throw /** The passphrase provided for decryption was incorrect. */ public class IncorrectPassphraseException(cause: Throwable) : CryptoHandlerException(null, cause) +/** The encrypted material is using an incompatible variant of PGP's AEAD standard. */ +public class NonStandardAEAD(cause: Throwable) : + CryptoHandlerException("GnuPG's AEAD implementation is non-standard and unsupported", cause) + /** No keys were passed to the encrypt/decrypt operation. */ public data object NoKeysProvidedException : CryptoHandlerException(null, null) /** An unexpected error that cannot be mapped to a known type. */ -public class UnknownError(cause: Throwable) : CryptoHandlerException(null, cause) +public class UnknownError(cause: Throwable, message: String? = null) : + CryptoHandlerException(message, cause) -- cgit v1.2.3