mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-22 01:14:54 +02:00
Merge branch 'master' into child-ca
This commit is contained in:
+14
-13
@@ -333,7 +333,7 @@ impl TrustAnchorLocator {
|
||||
/// Creates a new TAL, panics when the provided Cert is not a TA cert.
|
||||
pub fn new(uris: Vec<uri::Https>, cert: &Cert) -> Self {
|
||||
if cert.authority_key_identifier().is_some() {
|
||||
panic!("Trying to create TrustAnchorLocator for a non-TA certificate.")
|
||||
panic!("Trying to create TAL for a non-TA certificate.")
|
||||
}
|
||||
let encoded_ski = cert.subject_public_key_info().to_info_bytes();
|
||||
TrustAnchorLocator { uris, encoded_ski }
|
||||
@@ -385,7 +385,7 @@ impl RepoInfo {
|
||||
pub fn ca_repository(&self, name_space: &str) -> uri::Rsync {
|
||||
match name_space {
|
||||
"" => self.base_uri.clone(),
|
||||
_ => uri::Rsync::from_string(format!("{}{}/", self.base_uri.to_string(), name_space)).unwrap()
|
||||
_ => self.base_uri.join(name_space.as_ref()).join(b"/")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,7 +420,8 @@ impl RepoInfo {
|
||||
|
||||
impl PartialEq for RepoInfo {
|
||||
fn eq(&self, other: &RepoInfo) -> bool {
|
||||
self.base_uri == other.base_uri && self.rpki_notify.as_str() == other.rpki_notify.as_str()
|
||||
self.base_uri == other.base_uri &&
|
||||
self.rpki_notify.as_str() == other.rpki_notify.as_str()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,10 +956,10 @@ pub struct ResourceSet {
|
||||
}
|
||||
|
||||
impl ResourceSet {
|
||||
pub fn from_strs(asns: &str, ipv4: &str, ipv6: &str) -> Result<Self, ResourceSetError> {
|
||||
let asn = AsResources::from_str(asns).map_err(|_| ResourceSetError::AsnParsing)?;
|
||||
let v4 = Ipv4Resources::from_str(ipv4).map_err(|_| ResourceSetError::Ipv4Parsing)?;
|
||||
let v6 = Ipv6Resources::from_str(ipv6).map_err(|_| ResourceSetError::Ipv6Parsing)?;
|
||||
pub fn from_strs(asn: &str, v4: &str, v6: &str) -> Result<Self, ResSetErr> {
|
||||
let asn = AsResources::from_str(asn).map_err(|_| ResSetErr::Asn)?;
|
||||
let v4 = Ipv4Resources::from_str(v4).map_err(|_| ResSetErr::V4)?;
|
||||
let v6 = Ipv6Resources::from_str(v6).map_err(|_| ResSetErr::V6)?;
|
||||
Ok(ResourceSet { asn , v4, v6 })
|
||||
}
|
||||
|
||||
@@ -1115,21 +1116,21 @@ impl TrustAnchorInfo {
|
||||
}
|
||||
}
|
||||
|
||||
//------------ ResourceSetError ----------------------------------------------
|
||||
//------------ ResSetErr -----------------------------------------------------
|
||||
|
||||
#[derive(Clone, Debug, Display, Eq, PartialEq)]
|
||||
pub enum ResourceSetError {
|
||||
pub enum ResSetErr {
|
||||
#[display(fmt="Cannot parse ASN resources")]
|
||||
AsnParsing,
|
||||
Asn,
|
||||
|
||||
#[display(fmt="Cannot parse IPv4 resources")]
|
||||
Ipv4Parsing,
|
||||
V4,
|
||||
|
||||
#[display(fmt="Cannot parse IPv6 resources")]
|
||||
Ipv6Parsing,
|
||||
V6,
|
||||
|
||||
#[display(fmt="Mixed Address Families in configured resource set")]
|
||||
MixedFamilies,
|
||||
Mix,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user