Include the resolver-provided TTL in the response
[dnssec-prover] / src / query.rs
index 901f37e16334be4f4baaa04708cd37a6bae93c26..8ce551955cf0f03497c2918f221c99b50611b383 100644 (file)
@@ -83,8 +83,8 @@ fn handle_response(resp: &[u8], proof: &mut Vec<u8>) -> Result<Option<RRSig>, Er
        // Only read the answers (skip authorities and additional) as that's all we care about.
        let mut rrsig_opt = None;
        for _ in 0..answers {
-               let rr = emap(parse_wire_packet_rr(&mut read, &resp))?;
-               write_rr(&rr, 0, proof);
+               let (rr, ttl) = emap(parse_wire_packet_rr(&mut read, &resp))?;
+               write_rr(&rr, ttl, proof);
                if let RR::RRSig(rrsig) = rr { rrsig_opt = Some(rrsig); }
        }
        Ok(rrsig_opt)