diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/error.rs b/src/error.rs index 8116de2..db0503a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -4,14 +4,10 @@ pub enum Error { ConfigMissingEmail, #[error("failed to create block mode decryptor")] - CreateBlockMode { - source: block_modes::InvalidKeyIvLength, - }, + CreateBlockMode { source: aes::cipher::InvalidLength }, #[error("failed to create block mode decryptor")] - CreateHmac { - source: hmac::crypto_mac::InvalidKeyLength, - }, + CreateHmac { source: aes::cipher::InvalidLength }, #[error("failed to create directory at {}", .file.display())] CreateDirectory { @@ -19,12 +15,18 @@ pub enum Error { file: std::path::PathBuf, }, + #[error("failed to create reqwest client")] + CreateReqwestClient { source: reqwest::Error }, + #[error("failed to decrypt")] - Decrypt { source: block_modes::BlockModeError }, + Decrypt { source: block_padding::UnpadError }, #[error("failed to parse pinentry output ({out:?})")] FailedToParsePinentry { out: String }, + #[error("failed to read from stdin: {err}")] + FailedToReadFromStdin { err: std::io::Error }, + #[error( "failed to run editor {}: {err}", .editor.to_string_lossy(), @@ -116,6 +118,18 @@ pub enum Error { file: std::path::PathBuf, }, + #[error("failed to load device id from {}", .file.display())] + LoadDeviceId { + source: tokio::io::Error, + file: std::path::PathBuf, + }, + + #[error("failed to load client cert from {}", .file.display())] + LoadClientCert { + source: tokio::io::Error, + file: std::path::PathBuf, + }, + #[error("invalid padding")] Padding, @@ -125,6 +139,12 @@ pub enum Error { #[error("pbkdf2 requires at least 1 iteration (got 0)")] Pbkdf2ZeroIterations, + #[error("failed to run pbkdf2")] + Pbkdf2, + + #[error("failed to run argon2")] + Argon2, + #[error("pinentry cancelled")] PinentryCancelled, @@ -207,6 +227,9 @@ pub enum Error { #[error("error writing to pinentry stdin")] WriteStdin { source: tokio::io::Error }, + + #[error("invalid kdf type: {ty}")] + InvalidKdfType { ty: String }, } pub type Result<T> = std::result::Result<T, Error>; |