From 3ed2a4c2a82c8457ce2be7f080f6d6a311657f9b Mon Sep 17 00:00:00 2001 From: Tim Bruijnzeels Date: Fri, 15 Feb 2019 15:58:09 +0100 Subject: [PATCH] Fixing issues after updating rpki-rs and bcder-rs. Note there is some cloning added to the identity certificate building. That should be looked at again when generating rpki certs and objects stabalises. --- src/krilld/config.rs | 1 + src/pubc/apiclient.rs | 1 + src/remote/builder.rs | 10 +++++----- src/remote/id.rs | 4 ++-- src/remote/rfc8181.rs | 1 + src/remote/rfc8183.rs | 1 + src/util/test.rs | 1 + 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/krilld/config.rs b/src/krilld/config.rs index 2f2caece..7381998b 100644 --- a/src/krilld/config.rs +++ b/src/krilld/config.rs @@ -3,6 +3,7 @@ use std::io; use std::io::Read; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::path::PathBuf; +use std::str::FromStr; use clap::{App, Arg}; use log::LevelFilter; use rpki::uri; diff --git a/src/pubc/apiclient.rs b/src/pubc/apiclient.rs index db08ba30..fe282bf7 100644 --- a/src/pubc/apiclient.rs +++ b/src/pubc/apiclient.rs @@ -1,5 +1,6 @@ //! Publication Client that uses the JSON/Rest API use std::path::PathBuf; +use std::str::FromStr; use clap::{App, Arg, SubCommand}; use rpki::uri; use crate::api::publication_data; diff --git a/src/remote/builder.rs b/src/remote/builder.rs index 6a00f4d5..dbe98dd9 100644 --- a/src/remote/builder.rs +++ b/src/remote/builder.rs @@ -96,7 +96,7 @@ impl RpkiTbsCertificate { ( self.validity.encode(), self.subject.encode(), - self.subject_public_key_info.encode(), + self.subject_public_key_info.clone().encode(), id_ext.encode() ) )) @@ -330,7 +330,7 @@ impl SignedMessageBuilder { let encap_content_info = encode::sequence( ( oid::PROTOCOL_CONTENT_TYPE.encode(), - Constructed::new(Tag::CTX_0, self.content.encode()) + Constructed::new(Tag::CTX_0, self.content.clone().encode()) ) ); @@ -437,7 +437,7 @@ impl SignedAttributes { ( oid::MESSAGE_DIGEST.encode(), encode::set( - self.digest.encode() + self.digest.clone().encode() ) ) ), @@ -501,7 +501,7 @@ impl SignedSignerInfo { // We MUST use the SubjectKeyIdentifier from the EE certificate. // I.e. the hashed thing in an OctetString, rather than the full // X509 Extension. - let sid = self.key_id.encode_as(Tag::CTX_0); + let sid = self.key_id.clone().encode_as(Tag::CTX_0); // digestAlgorithm DigestAlgorithmIdentifier, let digest_algo = DigestAlgorithm.encode(); @@ -521,7 +521,7 @@ impl SignedSignerInfo { ), ( SignatureAlgorithm.cms_encode(), - self.signature.encode() + self.signature.clone().encode() ) ) ) diff --git a/src/remote/id.rs b/src/remote/id.rs index 5f0a5360..490d64a6 100644 --- a/src/remote/id.rs +++ b/src/remote/id.rs @@ -523,8 +523,8 @@ impl IdExtensions { encode::sequence( ( self.basic_ca.as_ref().map(|s| s.encode()), - self.subject_key_id.encode(), - self.authority_key_id.as_ref().map(|s| s.encode()) + self.subject_key_id.clone().encode(), + self.authority_key_id.clone().map(|s| s.encode()) ) ) ) diff --git a/src/remote/rfc8181.rs b/src/remote/rfc8181.rs index d3870cbf..bb8d1199 100644 --- a/src/remote/rfc8181.rs +++ b/src/remote/rfc8181.rs @@ -893,6 +893,7 @@ mod tests { use super::*; use std::str; + use std::str::FromStr; use rpki::uri::Rsync; use crate::api::EncodedHash; diff --git a/src/remote/rfc8183.rs b/src/remote/rfc8183.rs index b58ee2ae..f39cb5c5 100644 --- a/src/remote/rfc8183.rs +++ b/src/remote/rfc8183.rs @@ -444,6 +444,7 @@ impl From for RepositoryResponseError { #[cfg(test)] mod tests { use std::str; + use std::str::FromStr; use rpki::x509::Time; use super::*; diff --git a/src/util/test.rs b/src/util/test.rs index decbacb6..d578e10f 100644 --- a/src/util/test.rs +++ b/src/util/test.rs @@ -1,6 +1,7 @@ use std::fs::File; use std::io::Write; use std::path::PathBuf; +use std::str::FromStr; use bytes::Bytes; use rpki::uri; use rpki::crypto::{PublicKeyFormat, Signer};