aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-10-26 23:37:08 -0400
committerJesse Luehrs <doy@tozt.net>2021-10-27 00:47:03 -0400
commitca14e569f7b5bfc929646a9e13028ba8bc534b47 (patch)
tree28bc23996158c8ef9d47f56d8886cb4fca41f327 /src
parenta3da3774a3befda7b45ec19e197e5029a3c291b2 (diff)
downloadrbw-ca14e569f7b5bfc929646a9e13028ba8bc534b47.tar.gz
rbw-ca14e569f7b5bfc929646a9e13028ba8bc534b47.zip
update deps
Diffstat (limited to 'src')
-rw-r--r--src/cipherstring.rs5
-rw-r--r--src/error.rs3
2 files changed, 6 insertions, 2 deletions
diff --git a/src/cipherstring.rs b/src/cipherstring.rs
index 73eeeb6..7a12915 100644
--- a/src/cipherstring.rs
+++ b/src/cipherstring.rs
@@ -4,6 +4,7 @@ use block_modes::BlockMode as _;
use block_padding::Padding as _;
use hmac::{Mac as _, NewMac as _};
use rand::RngCore as _;
+use rsa::pkcs8::FromPrivateKey as _;
use zeroize::Zeroize as _;
pub enum CipherString {
@@ -186,8 +187,8 @@ impl CipherString {
let privkey_data = private_key.private_key();
let privkey_data = block_padding::Pkcs7::unpad(privkey_data)
.map_err(|_| Error::Padding)?;
- let pkey = rsa::RSAPrivateKey::from_pkcs8(privkey_data)
- .map_err(|source| Error::Rsa { source })?;
+ let pkey = rsa::RsaPrivateKey::from_pkcs8_der(privkey_data)
+ .map_err(|source| Error::RsaPkcs8 { source })?;
let mut bytes = pkey
.decrypt(
rsa::padding::PaddingScheme::new_oaep::<sha1::Sha1>(),
diff --git a/src/error.rs b/src/error.rs
index bc97087..eb9f5c1 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -150,6 +150,9 @@ pub enum Error {
#[error("failed to decrypt")]
Rsa { source: rsa::errors::Error },
+ #[error("failed to decrypt")]
+ RsaPkcs8 { source: rsa::pkcs8::Error },
+
#[error("failed to save config to {}", .file.display())]
SaveConfig {
source: std::io::Error,