aboutsummaryrefslogtreecommitdiffstats
path: root/src/cipherstring.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-05-03 03:07:36 -0400
committerJesse Luehrs <doy@tozt.net>2020-05-03 03:07:36 -0400
commit78bace42e03f1b17af751fa5f6b935706661beb1 (patch)
treee028938c75efef4a039c3222acc2bb5b37f15601 /src/cipherstring.rs
parent20ac7d3d39cc81eee8bcd8dd5caad44fc1cab82d (diff)
downloadrbw-78bace42e03f1b17af751fa5f6b935706661beb1.tar.gz
rbw-78bace42e03f1b17af751fa5f6b935706661beb1.zip
fix some unwraps
Diffstat (limited to 'src/cipherstring.rs')
-rw-r--r--src/cipherstring.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cipherstring.rs b/src/cipherstring.rs
index 7ba64ca..94284d5 100644
--- a/src/cipherstring.rs
+++ b/src/cipherstring.rs
@@ -158,8 +158,8 @@ impl CipherString {
let pkey = openssl::pkey::PKey::private_key_from_pkcs8(
private_key.private_key(),
)
- .unwrap(); // XXX
- let rsa = pkey.rsa().unwrap(); // XXX
+ .context(crate::error::OpenSSL)?;
+ let rsa = pkey.rsa().context(crate::error::OpenSSL)?;
let mut res = crate::locked::Vec::new();
res.extend(std::iter::repeat(0).take(rsa.size() as usize));
@@ -170,7 +170,7 @@ impl CipherString {
res.data_mut(),
openssl::rsa::Padding::PKCS1_OAEP,
)
- .unwrap(); // XXX
+ .context(crate::error::OpenSSL)?;
res.truncate(bytes);
Ok(res)