Skip to content

Commit

Permalink
Fix serde for Key and add Key generation methods
Browse files Browse the repository at this point in the history
  • Loading branch information
moubctez committed Dec 11, 2024
1 parent fbb88ee commit 323da00
Show file tree
Hide file tree
Showing 9 changed files with 149 additions and 109 deletions.
124 changes: 77 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "defguard_wireguard_rs"
version = "0.5.5"
version = "0.6.0"
edition = "2021"
description = "A unified multi-platform high-level API for managing WireGuard interfaces"
license = "Apache-2.0"
Expand All @@ -14,11 +14,12 @@ categories = ["network-programming"]
base64 = "0.22"
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
thiserror = "2.0"
x25519-dalek = { version = "2.0", features = ["getrandom", "static_secrets"] }

[dev-dependencies]
env_logger = "0.11"
x25519-dalek = { version = "2.0", features = ["getrandom", "static_secrets"] }
serde_test = "1.0"

[target.'cfg(target_os = "freebsd")'.dependencies]
libc = { version = "0.2", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions src/bsd/nvlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub enum NvValue<'a> {
// NvListAUp,
}

impl<'a> NvValue<'a> {
impl NvValue<'_> {
/// Return number of bytes this value occupies when packed.
#[must_use]
pub fn byte_size(&self) -> usize {
Expand Down Expand Up @@ -162,7 +162,7 @@ pub struct NvList<'a> {
is_big_endian: bool,
}

impl<'a> Default for NvList<'a> {
impl Default for NvList<'_> {
fn default() -> Self {
Self::new()
}
Expand Down
7 changes: 3 additions & 4 deletions src/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ pub(crate) fn check_external_dependencies() -> Result<(), WireguardInterfaceErro
});

if let Some(cmd) = missing {
return Err(WireguardInterfaceError::MissingDependency(format!(
"Command `{}` required by wireguard-rs couldn't be found. The following directories were checked: {paths:?}",
cmd
)));
Err(WireguardInterfaceError::MissingDependency(format!(
"Command `{cmd}` required by wireguard-rs couldn't be found. The following directories were checked: {paths:?}"
)))
} else {
debug!("All commands required by wireguard-rs are available");
Ok(())
Expand Down
Loading

0 comments on commit 323da00

Please sign in to comment.