Update rsa to v0.8 (#852)

This commit is contained in:
Paolo Barbolini
2023-01-24 10:26:25 +01:00
committed by GitHub
parent 750573d38b
commit cc25223914
2 changed files with 3 additions and 6 deletions

View File

@@ -66,7 +66,7 @@ tokio1_boring = { package = "tokio-boring", version = "2.1.4", optional = true }
## dkim
sha2 = { version = "0.10", optional = true, features = ["oid"] }
rsa = { version = "0.7", optional = true }
rsa = { version = "0.8", optional = true }
ed25519-dalek = { version = "1.0.1", optional = true }
# email formats

View File

@@ -7,7 +7,7 @@ use std::{
};
use ed25519_dalek::Signer;
use rsa::{pkcs1::DecodeRsaPrivateKey, PaddingScheme, RsaPrivateKey};
use rsa::{pkcs1::DecodeRsaPrivateKey, pkcs1v15::Pkcs1v15Sign, RsaPrivateKey};
use sha2::{Digest, Sha256};
use crate::message::{
@@ -392,10 +392,7 @@ fn dkim_sign_fixed_time(message: &mut Message, dkim_config: &DkimConfig, timesta
let signature = match &dkim_config.private_key.0 {
InnerDkimSigningKey::Rsa(private_key) => crate::base64::encode(
private_key
.sign(
PaddingScheme::new_pkcs1v15_sign::<Sha256>(),
&hashed_headers,
)
.sign(Pkcs1v15Sign::new::<Sha256>(), &hashed_headers)
.unwrap(),
),
InnerDkimSigningKey::Ed25519(private_key) => {