From 6956ede561450393f52ebf1cfdd25f606e5a2de5 Mon Sep 17 00:00:00 2001 From: joalopez1206 Date: Mon, 9 Sep 2024 13:31:30 -0300 Subject: [PATCH] fix: RRSIGRdata to encode the signature as base64 not string utf8 --- src/message/rdata/rrsig_rdata.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/message/rdata/rrsig_rdata.rs b/src/message/rdata/rrsig_rdata.rs index 5b40dee4..fceb993c 100644 --- a/src/message/rdata/rrsig_rdata.rs +++ b/src/message/rdata/rrsig_rdata.rs @@ -1,7 +1,7 @@ use crate::message::resource_record::{FromBytes, ToBytes}; use crate::domain_name::DomainName; use crate::message::rrtype::Rrtype; - +use base64; use std::fmt; #[derive(Clone, Debug, PartialEq)] @@ -142,8 +142,9 @@ impl FromBytes> for RRSIGRdata { signature.push(bytes[i]); i += 1; } - let signature = String::from_utf8(signature).unwrap(); - rrsig_rdata.set_signature(signature); + let signature_b64 = base64::encode(signature); + //let signature = String::from_utf8(signature).unwrap(); + rrsig_rdata.set_signature(signature_b64); Ok(rrsig_rdata) }