From 78bace42e03f1b17af751fa5f6b935706661beb1 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 3 May 2020 03:07:36 -0400 Subject: fix some unwraps --- src/cipherstring.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cipherstring.rs') 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) -- cgit v1.2.3-54-g00ecf