Skip to content

Commit

Permalink
fix: RRSIGRdata to encode the signature as base64 not string utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
joalopez1206 committed Sep 9, 2024
1 parent 4657c5d commit 6956ede
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/message/rdata/rrsig_rdata.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down Expand Up @@ -142,8 +142,9 @@ impl FromBytes<Result<Self, &'static str>> 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)
}
Expand Down

0 comments on commit 6956ede

Please sign in to comment.