From 387adc7c4fc9645404349f4afa11afff3583ec04 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Mon, 24 Aug 2020 12:09:20 +0200 Subject: [PATCH] Remove the useless calls to `map_err` --- acme_common/src/crypto/openssl_keys.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/acme_common/src/crypto/openssl_keys.rs b/acme_common/src/crypto/openssl_keys.rs index ab491a3..c69f7d0 100644 --- a/acme_common/src/crypto/openssl_keys.rs +++ b/acme_common/src/crypto/openssl_keys.rs @@ -174,15 +174,13 @@ impl KeyPair { } fn gen_rsa_pair(nb_bits: u32) -> Result, Error> { - // TODO: check if map_err is required - let priv_key = Rsa::generate(nb_bits).map_err(|_| Error::from(""))?; + let priv_key = Rsa::generate(nb_bits)?; let pk = PKey::from_rsa(priv_key).map_err(|_| Error::from(""))?; Ok(pk) } fn gen_ec_pair(nid: Nid) -> Result, Error> { - // TODO: check if map_err is required - let mut group = EcGroup::from_curve_name(nid).map_err(|_| Error::from(""))?; + let mut group = EcGroup::from_curve_name(nid)?; // Use NAMED_CURVE format; OpenSSL 1.0.1 and 1.0.2 default to EXPLICIT_CURVE which won't work (see #9) group.set_asn1_flag(Asn1Flag::NAMED_CURVE);