summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2023-03-20 10:56:50 +0100
committerJustus Winter <justus@sequoia-pgp.org>2023-03-20 10:56:50 +0100
commit5bc6ab7e9d9c34ab6393472219a53547106b2b5a (patch)
treeb719d78afc45b9f2876e2a474e0570278d7c3ae7
parent8e6e7a080dc4b581504b7c71357678bb5ece7a8d (diff)
openpgp: Small cleanups in the Botan backend.
- Remove development remnants, actually use the creation time when importing RSA keys.
-rw-r--r--openpgp/src/crypto/backend/botan.rs2
-rw-r--r--openpgp/src/crypto/backend/botan/asymmetric.rs4
-rw-r--r--openpgp/src/crypto/backend/botan/ecdh.rs3
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<usize>)
+ _plaintext_len: Option<usize>)
-> Result<SessionKey>
{
fn bad(e: impl ToString) -> anyhow::Error {
@@ -474,7 +474,7 @@ impl<R> Key4<SecretParts, R>
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,
};