From 5bc6ab7e9d9c34ab6393472219a53547106b2b5a Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 20 Mar 2023 10:56:50 +0100 Subject: openpgp: Small cleanups in the Botan backend. - Remove development remnants, actually use the creation time when importing RSA keys. --- openpgp/src/crypto/backend/botan.rs | 2 -- openpgp/src/crypto/backend/botan/asymmetric.rs | 4 ++-- openpgp/src/crypto/backend/botan/ecdh.rs | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/openpgp/src/crypto/backend/botan.rs b/openpgp/src/crypto/backend/botan.rs index 30f42a67..02ec4268 100644 --- a/openpgp/src/crypto/backend/botan.rs +++ b/openpgp/src/crypto/backend/botan.rs @@ -3,9 +3,7 @@ use crate::types::*; pub mod aead; -#[allow(unused_variables)] pub mod asymmetric; -#[allow(unused_variables)] pub mod ecdh; pub mod hash; pub mod symmetric; diff --git a/openpgp/src/crypto/backend/botan/asymmetric.rs b/openpgp/src/crypto/backend/botan/asymmetric.rs index 4cc2da5b..bf9b53c6 100644 --- a/openpgp/src/crypto/backend/botan/asymmetric.rs +++ b/openpgp/src/crypto/backend/botan/asymmetric.rs @@ -188,7 +188,7 @@ impl Decryptor for KeyPair { } fn decrypt(&mut self, ciphertext: &mpi::Ciphertext, - plaintext_len: Option) + _plaintext_len: Option) -> Result { fn bad(e: impl ToString) -> anyhow::Error { @@ -474,7 +474,7 @@ impl Key4 let (public, secret) = rsa_rfc4880(secret)?; Self::with_secret( - crate::now(), + ctime.into().unwrap_or_else(crate::now), PublicKeyAlgorithm::RSAEncryptSign, public, secret.into()) } diff --git a/openpgp/src/crypto/backend/botan/ecdh.rs b/openpgp/src/crypto/backend/botan/ecdh.rs index e798503c..87eab757 100644 --- a/openpgp/src/crypto/backend/botan/ecdh.rs +++ b/openpgp/src/crypto/backend/botan/ecdh.rs @@ -1,10 +1,7 @@ //! Elliptic Curve Diffie-Hellman. -#[allow(unused_imports)] - use botan::{ RandomNumberGenerator, - //Pubkey, Privkey, }; -- cgit v1.2.3