pub enum WireError {
NotAnEncryptedLeaf,
Base64 {
field: &'static str,
},
UnknownDatatype(String),
AeadOpen,
DatatypeMismatch {
ty: &'static str,
},
DataKeyLength(usize),
MacMismatch,
MacUndecryptable,
NonStringKey,
BadSelectorRegex {
pattern: String,
reason: String,
},
SelfDefeatingCommentRegex,
Randomness(String),
}Expand description
Everything that can go wrong inside the wire border.
Note what is absent: there is no Other(String) arm and no
#[from] anyhow::Error. A new failure mode has to be named here, which is
what keeps a caller’s match honest.
Variants§
NotAnEncryptedLeaf
The value is not in ENC[AES256_GCM,…] form at all.
Base64
One of the three base64 fields did not decode.
UnknownDatatype(String)
The type: tag is not one sops can produce or consume.
AeadOpen
AES-GCM refused to open the leaf. Deliberately carries no detail: the distinction between “wrong key” and “tampered bytes” is exactly the oracle an attacker wants.
DatatypeMismatch
The recovered bytes are not a valid rendering of the declared type.
DataKeyLength(usize)
The data key is not 32 bytes.
MacMismatch
The MAC recorded in the file does not match the recomputed one.
MacUndecryptable
The MAC field itself would not decrypt, which usually means the data key
is wrong or lastmodified was edited by hand.
NonStringKey
A mapping key was not a string. sops cannot represent one.
BadSelectorRegex
A selector regex from the metadata did not compile.
SelfDefeatingCommentRegex
An encrypted comment would match unencrypted_comment_regex, which would
make the file permanently undecryptable. Upstream refuses too.
Randomness(String)
No randomness available for an IV.
Trait Implementations§
impl Eq for WireError
Source§impl Error for WireError
impl Error for WireError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()