remove all deprecated usages of Signer for SigSigner
This commit is contained in:
parent
926f286c0a
commit
eb46623d30
@ -57,6 +57,7 @@ impl From<TSigner> for Signer {
|
||||
}
|
||||
|
||||
impl MessageFinalizer for Signer {
|
||||
#[allow(unreachable_patterns)]
|
||||
fn finalize_message(
|
||||
&self,
|
||||
message: &Message,
|
||||
@ -69,6 +70,7 @@ impl MessageFinalizer for Signer {
|
||||
#[cfg(feature = "dnssec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "dnssec")))]
|
||||
Signer::TSIG(tsig) => tsig.finalize_message(message, time),
|
||||
_ => unreachable!("the feature `dnssec` is required for Message signing"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ use serde::Deserialize;
|
||||
use crate::client::error::ParseResult;
|
||||
use crate::client::rr::dnssec::Algorithm;
|
||||
#[cfg(any(feature = "dns-over-tls", feature = "dnssec"))]
|
||||
use crate::client::rr::dnssec::{KeyFormat, KeyPair, Private, Signer};
|
||||
use crate::client::rr::dnssec::{KeyFormat, KeyPair, Private, SigSigner};
|
||||
#[cfg(feature = "dnssec")]
|
||||
use crate::client::rr::domain::IntoName;
|
||||
use crate::client::rr::domain::Name;
|
||||
@ -148,7 +148,7 @@ impl KeyConfig {
|
||||
/// Tries to read the defined key into a Signer
|
||||
#[cfg(feature = "dnssec")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "dnssec")))]
|
||||
pub fn try_into_signer<N: IntoName>(&self, signer_name: N) -> Result<Signer, String> {
|
||||
pub fn try_into_signer<N: IntoName>(&self, signer_name: N) -> Result<SigSigner, String> {
|
||||
let signer_name = signer_name
|
||||
.into_name()
|
||||
.map_err(|e| format!("error loading signer name: {}", e))?;
|
||||
@ -254,7 +254,7 @@ impl TlsCertConfig {
|
||||
/// same directory has the zone $file:
|
||||
/// keys = [ "my_rsa_2048|RSASHA256", "/path/to/my_ed25519|ED25519" ]
|
||||
#[cfg(feature = "dnssec")]
|
||||
fn load_key(zone_name: Name, key_config: &KeyConfig) -> Result<Signer, String> {
|
||||
fn load_key(zone_name: Name, key_config: &KeyConfig) -> Result<SigSigner, String> {
|
||||
use log::info;
|
||||
|
||||
use chrono::Duration;
|
||||
@ -295,7 +295,7 @@ fn load_key(zone_name: Name, key_config: &KeyConfig) -> Result<Signer, String> {
|
||||
let dnskey = key
|
||||
.to_dnskey(algorithm)
|
||||
.map_err(|e| format!("error converting to dnskey: {}", e))?;
|
||||
Ok(Signer::dnssec(dnskey, key, name, Duration::weeks(52)))
|
||||
Ok(SigSigner::dnssec(dnskey, key, name, Duration::weeks(52)))
|
||||
}
|
||||
|
||||
/// Load a Certificate from the path (with openssl)
|
||||
|
@ -532,7 +532,7 @@ impl InMemoryAuthority {
|
||||
#[cfg(feature = "dnssec")]
|
||||
fn sign_rrset(
|
||||
rr_set: &mut RecordSet,
|
||||
secure_keys: &[Signer],
|
||||
secure_keys: &[SigSigner],
|
||||
zone_ttl: u32,
|
||||
zone_class: DNSClass,
|
||||
) -> DnsSecResult<()> {
|
||||
@ -1143,7 +1143,7 @@ impl Authority for InMemoryAuthority {
|
||||
///
|
||||
/// * `signer` - Signer with associated private key
|
||||
#[cfg(feature = "dnssec")]
|
||||
fn add_zone_signing_key(&mut self, signer: Signer) -> DnsSecResult<()> {
|
||||
fn add_zone_signing_key(&mut self, signer: SigSigner) -> DnsSecResult<()> {
|
||||
// also add the key to the zone
|
||||
let zone_ttl = self.minimum_ttl();
|
||||
let dnskey = signer.key().to_dnskey(signer.algorithm())?;
|
||||
|
@ -9,7 +9,7 @@ use futures_executor::block_on;
|
||||
use trust_dns_client::op::update_message;
|
||||
use trust_dns_client::op::{Message, Query, ResponseCode};
|
||||
use trust_dns_client::proto::rr::{DNSClass, Name, RData, Record, RecordSet, RecordType};
|
||||
use trust_dns_client::rr::dnssec::{Algorithm, Signer, SupportedAlgorithms, Verifier};
|
||||
use trust_dns_client::rr::dnssec::{Algorithm, SigSigner, SupportedAlgorithms, Verifier};
|
||||
use trust_dns_client::serialize::binary::{BinDecodable, BinEncodable, BinSerializable};
|
||||
use trust_dns_server::authority::{
|
||||
AuthLookup, Authority, LookupError, MessageRequest, UpdateResult,
|
||||
@ -17,7 +17,7 @@ use trust_dns_server::authority::{
|
||||
|
||||
fn update_authority<A: Authority<Lookup = AuthLookup>>(
|
||||
mut message: Message,
|
||||
key: &Signer,
|
||||
key: &SigSigner,
|
||||
authority: &mut A,
|
||||
) -> UpdateResult<bool> {
|
||||
message.finalize(key, 1).expect("failed to sign message");
|
||||
@ -27,7 +27,7 @@ fn update_authority<A: Authority<Lookup = AuthLookup>>(
|
||||
authority.update(&request)
|
||||
}
|
||||
|
||||
pub fn test_create<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[Signer]) {
|
||||
pub fn test_create<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[SigSigner]) {
|
||||
let name = Name::from_str("create.example.com.").unwrap();
|
||||
for key in keys {
|
||||
let name = Name::from_str(key.algorithm().as_str())
|
||||
@ -67,7 +67,7 @@ pub fn test_create<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test_create_multi<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[Signer]) {
|
||||
pub fn test_create_multi<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[SigSigner]) {
|
||||
let name = Name::from_str("create-multi.example.com.").unwrap();
|
||||
for key in keys {
|
||||
let name = Name::from_str(key.algorithm().as_str())
|
||||
@ -107,7 +107,7 @@ pub fn test_create_multi<A: Authority<Lookup = AuthLookup>>(mut authority: A, ke
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test_append<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[Signer]) {
|
||||
pub fn test_append<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[SigSigner]) {
|
||||
let name = Name::from_str("append.example.com.").unwrap();
|
||||
for key in keys {
|
||||
let name = Name::from_str(key.algorithm().as_str())
|
||||
@ -189,7 +189,7 @@ pub fn test_append<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test_append_multi<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[Signer]) {
|
||||
pub fn test_append_multi<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[SigSigner]) {
|
||||
let name = Name::from_str("append-multi.example.com.").unwrap();
|
||||
for key in keys {
|
||||
let name = Name::from_str(key.algorithm().as_str())
|
||||
@ -260,7 +260,10 @@ pub fn test_append_multi<A: Authority<Lookup = AuthLookup>>(mut authority: A, ke
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test_compare_and_swap<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[Signer]) {
|
||||
pub fn test_compare_and_swap<A: Authority<Lookup = AuthLookup>>(
|
||||
mut authority: A,
|
||||
keys: &[SigSigner],
|
||||
) {
|
||||
let name = Name::from_str("compare-and-swap.example.com.").unwrap();
|
||||
for key in keys {
|
||||
let name = Name::from_str(key.algorithm().as_str())
|
||||
@ -329,7 +332,7 @@ pub fn test_compare_and_swap<A: Authority<Lookup = AuthLookup>>(mut authority: A
|
||||
|
||||
pub fn test_compare_and_swap_multi<A: Authority<Lookup = AuthLookup>>(
|
||||
mut authority: A,
|
||||
keys: &[Signer],
|
||||
keys: &[SigSigner],
|
||||
) {
|
||||
let name = Name::from_str("compare-and-swap-multi.example.com.").unwrap();
|
||||
for key in keys {
|
||||
@ -410,7 +413,10 @@ pub fn test_compare_and_swap_multi<A: Authority<Lookup = AuthLookup>>(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test_delete_by_rdata<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[Signer]) {
|
||||
pub fn test_delete_by_rdata<A: Authority<Lookup = AuthLookup>>(
|
||||
mut authority: A,
|
||||
keys: &[SigSigner],
|
||||
) {
|
||||
let name = Name::from_str("test-delete-by-rdata.example.com.").unwrap();
|
||||
for key in keys {
|
||||
let name = Name::from_str(key.algorithm().as_str())
|
||||
@ -467,7 +473,7 @@ pub fn test_delete_by_rdata<A: Authority<Lookup = AuthLookup>>(mut authority: A,
|
||||
|
||||
pub fn test_delete_by_rdata_multi<A: Authority<Lookup = AuthLookup>>(
|
||||
mut authority: A,
|
||||
keys: &[Signer],
|
||||
keys: &[SigSigner],
|
||||
) {
|
||||
let name = Name::from_str("test-delete-by-rdata-multi.example.com.").unwrap();
|
||||
for key in keys {
|
||||
@ -541,7 +547,7 @@ pub fn test_delete_by_rdata_multi<A: Authority<Lookup = AuthLookup>>(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test_delete_rrset<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[Signer]) {
|
||||
pub fn test_delete_rrset<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[SigSigner]) {
|
||||
let name = Name::from_str("compare-and-swap-multi.example.com.").unwrap();
|
||||
for key in keys {
|
||||
let name = Name::from_str(key.algorithm().as_str())
|
||||
@ -597,7 +603,7 @@ pub fn test_delete_rrset<A: Authority<Lookup = AuthLookup>>(mut authority: A, ke
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test_delete_all<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[Signer]) {
|
||||
pub fn test_delete_all<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys: &[SigSigner]) {
|
||||
let name = Name::from_str("compare-and-swap-multi.example.com.").unwrap();
|
||||
for key in keys {
|
||||
let name = Name::from_str(key.algorithm().as_str())
|
||||
@ -661,7 +667,7 @@ pub fn test_delete_all<A: Authority<Lookup = AuthLookup>>(mut authority: A, keys
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_auth<A: Authority<Lookup = AuthLookup>>(authority: &mut A) -> Vec<Signer> {
|
||||
pub fn add_auth<A: Authority<Lookup = AuthLookup>>(authority: &mut A) -> Vec<SigSigner> {
|
||||
use trust_dns_client::rr::rdata::key::KeyUsage;
|
||||
use trust_dns_server::config::dnssec::*;
|
||||
|
||||
@ -670,7 +676,7 @@ pub fn add_auth<A: Authority<Lookup = AuthLookup>>(authority: &mut A) -> Vec<Sig
|
||||
.append_domain(&authority.origin().to_owned().into())
|
||||
.unwrap();
|
||||
|
||||
let mut keys = Vec::<Signer>::new();
|
||||
let mut keys = Vec::<SigSigner>::new();
|
||||
|
||||
// TODO: support RSA signing with ring
|
||||
// rsa
|
||||
|
@ -199,7 +199,7 @@ pub fn create_secure_example() -> InMemoryAuthority {
|
||||
let rsa = Rsa::generate(2048).unwrap();
|
||||
let key = KeyPair::from_rsa(rsa).unwrap();
|
||||
let dnskey = key.to_dnskey(Algorithm::RSASHA256).unwrap();
|
||||
let signer = Signer::dnssec(
|
||||
let signer = SigSigner::dnssec(
|
||||
dnskey,
|
||||
key,
|
||||
authority.origin().clone().into(),
|
||||
|
@ -13,7 +13,7 @@ use tokio::runtime::Runtime;
|
||||
use trust_dns_client::client::Signer;
|
||||
use trust_dns_client::op::{Message, MessageType, OpCode, Query, ResponseCode};
|
||||
#[cfg(feature = "dnssec")]
|
||||
use trust_dns_client::rr::dnssec::Signer as SigSigner;
|
||||
use trust_dns_client::rr::dnssec::SigSigner;
|
||||
#[cfg(feature = "dnssec")]
|
||||
use trust_dns_client::rr::Record;
|
||||
use trust_dns_client::rr::{DNSClass, Name, RData, RecordSet, RecordType};
|
||||
|
Loading…
Reference in New Issue
Block a user