aboutsummaryrefslogtreecommitdiffstats
path: root/src/cipherstring.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-02 02:45:04 -0500
committerJesse Luehrs <doy@tozt.net>2021-03-02 02:45:04 -0500
commitd149a01bffd2bfdd16e471c8be55f7760c70dd69 (patch)
tree552b9f5a1288cf29ae88bf65a5e201692a29004a /src/cipherstring.rs
parentafde294f5922cead3efde54400c973e55004aa0a (diff)
downloadrbw-d149a01bffd2bfdd16e471c8be55f7760c70dd69.tar.gz
rbw-d149a01bffd2bfdd16e471c8be55f7760c70dd69.zip
suggest rotating the user's encryption key for old cipherstring types
Diffstat (limited to 'src/cipherstring.rs')
-rw-r--r--src/cipherstring.rs12
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(),
+ })
+ }
+ }
}
}