diff options
Diffstat (limited to 'src/cipherstring.rs')
-rw-r--r-- | src/cipherstring.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cipherstring.rs b/src/cipherstring.rs index 6de4d6c..c1bd80d 100644 --- a/src/cipherstring.rs +++ b/src/cipherstring.rs @@ -76,9 +76,15 @@ impl CipherString { .context(crate::error::InvalidBase64)?; Ok(Self::Asymmetric { ciphertext }) } - _ => Err(Error::UnimplementedCipherStringType { - ty: ty.to_string(), - }), + _ => { + if ty < 6 { + Err(Error::TooOldCipherStringType { ty: ty.to_string() }) + } else { + Err(Error::UnimplementedCipherStringType { + ty: ty.to_string(), + }) + } + } } } |