Skip to content

Commit 59ea9bd

Browse files
authored
Fix serde for Key and add Key generation methods (#82)
1 parent fbb88ee commit 59ea9bd

14 files changed

+232
-137
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ on:
55
branches:
66
- main
77
paths-ignore:
8-
- 'LICENSE'
8+
- "LICENSE"
99
pull_request:
1010
branches:
1111
- main
1212
paths-ignore:
13-
- 'LICENSE'
13+
- "LICENSE"
1414

1515
env:
1616
CARGO_TERM_COLOR: always
1717

1818
jobs:
1919
test:
2020
runs-on: [self-hosted, Linux]
21-
container: rust:1.75
21+
container: rust:1.80
2222

2323
steps:
2424
- name: Debug

Cargo.lock

+77-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
22
name = "defguard_wireguard_rs"
3-
version = "0.5.5"
3+
version = "0.6.0"
44
edition = "2021"
5+
rust-version = "1.80"
56
description = "A unified multi-platform high-level API for managing WireGuard interfaces"
67
license = "Apache-2.0"
78
readme = "README.md"
@@ -13,12 +14,13 @@ categories = ["network-programming"]
1314
[dependencies]
1415
base64 = "0.22"
1516
log = "0.4"
16-
serde = { version = "1.0", features = ["derive"] }
17-
thiserror = "1.0"
17+
serde = { version = "1.0", features = ["derive"], optional = true }
18+
thiserror = "2.0"
19+
x25519-dalek = { version = "2.0", features = ["getrandom", "static_secrets"] }
1820

1921
[dev-dependencies]
2022
env_logger = "0.11"
21-
x25519-dalek = { version = "2.0", features = ["getrandom", "static_secrets"] }
23+
serde_test = "1.0"
2224

2325
[target.'cfg(target_os = "freebsd")'.dependencies]
2426
libc = { version = "0.2", default-features = false }
@@ -40,6 +42,11 @@ netlink-packet-utils = "0.5"
4042
netlink-packet-wireguard = "0.2"
4143
netlink-sys = "0.8"
4244

45+
[features]
46+
default = ["serde"]
47+
check_dependencies = []
48+
serde = ["dep:serde"]
49+
4350
[profile.release]
4451
lto = "thin"
4552
strip = "symbols"

src/bsd/nvlist.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub enum NvValue<'a> {
7878
// NvListAUp,
7979
}
8080

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

165-
impl<'a> Default for NvList<'a> {
165+
impl Default for NvList<'_> {
166166
fn default() -> Self {
167167
Self::new()
168168
}

0 commit comments

Comments
 (0)