mirror of
https://github.com/NLnetLabs/domain.git
synced 2026-09-23 18:24:59 +02:00
Remove incorrect compose_len from rrsig (#313)
ProtoRrsig is used to produce the data that is signed. According to RFC 4034, this serialization begins with the first rdata field which is type_covered, however ProtoRrsig is inserting a length at the beginning. As such, signatures produced by SortedRecords::sign() are invalid. Fix this by removing that length from the serialization.
This commit is contained in:
@@ -505,22 +505,10 @@ impl<Name: ToName> ProtoRrsig<Name> {
|
||||
self.signer_name.compose_canonical(target)
|
||||
}
|
||||
|
||||
fn compose_len(&self) -> u16 {
|
||||
Rtype::COMPOSE_LEN
|
||||
+ SecAlg::COMPOSE_LEN
|
||||
+ u8::COMPOSE_LEN
|
||||
+ u32::COMPOSE_LEN
|
||||
+ Timestamp::COMPOSE_LEN
|
||||
+ Timestamp::COMPOSE_LEN
|
||||
+ u16::COMPOSE_LEN
|
||||
+ self.signer_name.compose_len()
|
||||
}
|
||||
|
||||
fn compose_head<Target: Composer + ?Sized>(
|
||||
&self,
|
||||
target: &mut Target,
|
||||
) -> Result<(), Target::AppendError> {
|
||||
self.compose_len().compose(target)?;
|
||||
self.type_covered.compose(target)?;
|
||||
self.algorithm.compose(target)?;
|
||||
self.labels.compose(target)?;
|
||||
|
||||
Reference in New Issue
Block a user