#![deny(missing_docs)]
+// const_slice_from_raw_parts was stabilized in 1.64, however we support building on 1.63 as well.
+// Luckily, it seems to work fine in 1.63 with the feature flag (and RUSTC_BOOTSTRAP=1) enabled.
+#![cfg_attr(feature = "validation", allow(stable_features))]
+#![cfg_attr(feature = "validation", feature(const_slice_from_raw_parts))]
+
extern crate alloc;
pub mod rr;
pub mod ser;
pub mod query;
+#[cfg(feature = "validation")]
+mod base32;
+#[cfg(feature = "validation")]
+mod crypto;
#[cfg(feature = "validation")]
pub mod validation;
mod test {
use super::*;
- use crate::validation::{parse_rr_stream, verify_rr_stream};
+ use crate::ser::parse_rr_stream;
+ use crate::validation::verify_rr_stream;
use minreq;
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn test_lookup_a() {
- let ns = "4.4.4.4:53".parse().unwrap();
+ let ns = "9.9.9.9:53".parse().unwrap();
let listener = tokio::net::TcpListener::bind("127.0.0.1:17493").await
.expect("Failed to bind to socket");
tokio::spawn(imp::run_server(listener, ns));
assert_eq!(resp.status_code, 200);
let rrs = parse_rr_stream(resp.as_bytes()).unwrap();
let verified_rrs = verify_rr_stream(&rrs).unwrap();
- assert_eq!(verified_rrs.verified_rrs.len(), 1);
+ assert!(verified_rrs.verified_rrs.len() >= 1);
}
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]