diff --git a/src/tsig/mod.rs b/src/tsig/mod.rs index ecf937d6f..63f89d862 100644 --- a/src/tsig/mod.rs +++ b/src/tsig/mod.rs @@ -262,7 +262,7 @@ impl Key { } /// Checks whether the key in the record is this key. - fn check_tsig( + fn check_tsig( &self, tsig: &MessageTsig, ) -> Result<(), ValidationError> { @@ -494,7 +494,7 @@ impl> ClientTransaction { /// whether this record is a correct record for this transaction and if /// it correctly signs the answer for this transaction. If any of this /// fails, returns an error. - pub fn answer>( + pub fn answer + ?Sized>( &self, message: &mut Message, now: Time48, @@ -569,7 +569,7 @@ impl> ServerTransaction { ) -> Result, ServerError> where Store: KeyStore, - Octs: Octets + AsMut<[u8]>, + Octs: Octets + AsMut<[u8]> + ?Sized, { SigningContext::server_request(store, message, now).map(|context| { context.map(|context| ServerTransaction { context }) @@ -729,7 +729,7 @@ impl> ClientSequence { now: Time48, ) -> Result<(), ValidationError> where - Octs: Octets + AsMut<[u8]>, + Octs: Octets + AsMut<[u8]> + ?Sized, { if self.first { self.answer_first(message, now) @@ -760,7 +760,7 @@ impl> ClientSequence { now: Time48, ) -> Result<(), ValidationError> where - Octs: Octets + AsMut<[u8]>, + Octs: Octets + AsMut<[u8]> + ?Sized, { let tsig = match self.context.get_answer_tsig(message)? { Some(some) => some, @@ -796,7 +796,7 @@ impl> ClientSequence { now: Time48, ) -> Result<(), ValidationError> where - Octs: Octets + AsMut<[u8]>, + Octs: Octets + AsMut<[u8]> + ?Sized, { let tsig = match self.context.get_answer_tsig(message)? { Some(tsig) => tsig, @@ -892,7 +892,7 @@ impl> ServerSequence { ) -> Result, ServerError> where Store: KeyStore, - Octs: Octets + AsMut<[u8]>, + Octs: Octets + AsMut<[u8]> + ?Sized, { SigningContext::server_request(store, message, now).map(|context| { context.map(|context| ServerSequence { @@ -999,7 +999,7 @@ impl> SigningContext { ) -> Result, ServerError> where Store: KeyStore, - Octs: Octets + AsMut<[u8]>, + Octs: Octets + AsMut<[u8]> + ?Sized, { // 4.5 Server TSIG checks // @@ -1090,7 +1090,7 @@ impl> SigningContext { message: &'a Message, ) -> Result>, ValidationError> where - Octs: Octets, + Octs: Octets + ?Sized, { // Extract TSIG or bail out. let tsig = match MessageTsig::from_message(message) { @@ -1127,7 +1127,7 @@ impl> SigningContext { now: Time48, ) -> Result<(), ValidationError> where - Octs: Octets, + Octs: Octets + ?Sized, { if message.header().rcode() == Rcode::NotAuth && tsig.record.data().error() == TsigRcode::BadTime @@ -1293,7 +1293,7 @@ impl> SigningContext { //------------ MessageTsig --------------------------------------------------- /// The TSIG record of a message. -struct MessageTsig<'a, Octs: Octets + 'a> { +struct MessageTsig<'a, Octs: Octets + ?Sized + 'a> { /// The actual record. #[allow(clippy::type_complexity)] record: Record< @@ -1305,7 +1305,7 @@ struct MessageTsig<'a, Octs: Octets + 'a> { start: usize, } -impl<'a, Octs: Octets> MessageTsig<'a, Octs> { +impl<'a, Octs: Octets + ?Sized> MessageTsig<'a, Octs> { /// Get the TSIG record from a message. /// /// Checks that there is exactly one TSIG record in the additional @@ -1583,7 +1583,7 @@ impl fmt::Display for Algorithm { fn remove_tsig(original_id: u16, message: &mut Message) where - Octs: Octets + AsMut<[u8]>, + Octs: Octets + AsMut<[u8]> + ?Sized, { message.header_mut().set_id(original_id); message.remove_last_additional(); @@ -1640,7 +1640,7 @@ impl> ServerError { builder: MessageBuilder, ) -> Result, PushError> where - Octs: Octets, + Octs: Octets + ?Sized, Target: Composer, { let builder = builder.start_answer(msg, Rcode::NotAuth)?;