From 9e52627655e5ee62da2f73176a9090423b0a242e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 28 Mar 2022 11:21:12 +0200 Subject: [PATCH] Update serde_big_array --- Cargo.toml | 2 +- src/crypto.rs | 3 +-- src/dnscrypt_certs.rs | 3 +-- src/main.rs | 6 +----- src/resolver.rs | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 19c5b0f..896d6a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ rand = "0.8.4" rustc-hash = "1.1.0" serde = "1.0.136" serde_derive = "1.0.136" -serde-big-array = "0.3.2" +serde-big-array = "0.4.1" siphasher = "0.3.9" tokio = { version = "1.16.1", features = [ "net", diff --git a/src/crypto.rs b/src/crypto.rs index 3231c7d..5da78ae 100644 --- a/src/crypto.rs +++ b/src/crypto.rs @@ -1,6 +1,7 @@ use crate::errors::*; use libsodium_sys::*; +use serde_big_array::BigArray; use siphasher::sip::SipHasher13; use std::ffi::CStr; use std::hash::Hasher; @@ -23,8 +24,6 @@ impl Signature { } } -big_array! { BigArray; crypto_sign_SECRETKEYBYTES as usize } - #[derive(Serialize, Deserialize, Derivative, Clone)] #[derivative(Default)] pub struct SignSK( diff --git a/src/dnscrypt_certs.rs b/src/dnscrypt_certs.rs index f8a84c1..1229d2a 100644 --- a/src/dnscrypt_certs.rs +++ b/src/dnscrypt_certs.rs @@ -8,6 +8,7 @@ use byteorder::{BigEndian, ByteOrder}; use clockpro_cache::ClockProCache; use parking_lot::Mutex; use rand::prelude::*; +use serde_big_array::BigArray; use std::mem; use std::slice; use std::sync::Arc; @@ -39,8 +40,6 @@ impl DNSCryptCertInner { } } -big_array! { BigArray; 64 } - #[derive(Derivative, Serialize, Deserialize)] #[derivative(Debug, Default, Clone)] #[repr(C, packed)] diff --git a/src/main.rs b/src/main.rs index 0657438..d7d9e9a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,16 +9,12 @@ #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; -#[macro_use] -extern crate clap; #[macro_use] extern crate derivative; #[macro_use] extern crate log; #[macro_use] extern crate serde_derive; -#[macro_use] -extern crate serde_big_array; #[cfg(feature = "metrics")] #[macro_use] extern crate prometheus; @@ -509,7 +505,7 @@ fn main() -> Result<(), Error> { crypto::init()?; let time_updater = coarsetime::Updater::new(1000).start()?; - let matches = app_from_crate!() + let matches = clap::command!() .arg( Arg::new("config") .long("config") diff --git a/src/resolver.rs b/src/resolver.rs index 1719329..5f54598 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -76,7 +76,7 @@ pub async fn resolve_udp( pub async fn resolve_tcp( globals: &Globals, - packet: &mut Vec, + packet: &mut [u8], packet_qname: &[u8], tid: u16, ) -> Result, Error> {