Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "wiretun"
description = "WireGuard Library"
version = "0.5.0"
authors = ["zarvd <jialun.cai@pm.me>"]
version = "0.5.1"
authors = ["Jialun Cai <jialun.cai@pm.me>"]
keywords = ["wireguard", "networking"]
repository = "https://github.com/clnv/wiretun"
homepage = "https://github.com/clnv/wiretun"
Expand Down Expand Up @@ -30,7 +30,10 @@ async-trait = "0.1"
tokio = { version = "1.37", features = ["full"] }
tokio-util = "0.7"
chacha20poly1305 = "0.10"
x25519-dalek = { version = "2.0", features = ["reusable_secrets", "static_secrets"] }
x25519-dalek = { version = "2.0", features = [
"reusable_secrets",
"static_secrets",
] }
blake2 = "0.10"
hmac = "0.12"
ip_network = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# WireTun

[<img alt="github" height="20" src="https://img.shields.io/badge/github-zarvd/wiretun-8da0cb?style=for-the-badge&labelColor=555555&logo=github">](https://github.com/zarvd/wiretun)
[<img alt="github" height="20" src="https://img.shields.io/badge/github-clnv/wiretun-8da0cb?style=for-the-badge&labelColor=555555&logo=github">](https://github.com/clnv/wiretun)
[<img alt="crates.io" height="20" src="https://img.shields.io/crates/v/wiretun.svg?style=for-the-badge&color=fc8d62&logo=rust">](https://crates.io/crates/wiretun)
[<img alt="docs.rs" height="20" src="https://img.shields.io/docsrs/wiretun?style=for-the-badge">](https://docs.rs/wiretun)
[<img alt="build status" height="20" src="https://img.shields.io/github/actions/workflow/status/zarvd/wiretun/ci.yml?branch=master&style=for-the-badge">](https://github.com/zarvd/wiretun/actions?query%3Amaster)
[<img alt="dependency status" height="20" src="https://deps.rs/repo/github/zarvd/wiretun/status.svg?style=for-the-badge&t=0">](https://deps.rs/repo/github/zarvd/wiretun)
[<img alt="build status" height="20" src="https://img.shields.io/github/actions/workflow/status/clnv/wiretun/ci.yml?branch=master&style=for-the-badge">](https://github.com/clnv/wiretun/actions?query%3Amaster)
[<img alt="dependency status" height="20" src="https://deps.rs/repo/github/clnv/wiretun/status.svg?style=for-the-badge&t=0">](https://deps.rs/repo/github/clnv/wiretun)

This library provides a cross-platform, asynchronous (with [Tokio](https://tokio.rs/)) [WireGuard](https://www.wireguard.com/) implementation.

Expand Down
8 changes: 4 additions & 4 deletions src/noise/handshake/cookie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ impl Cookie {
// Refresh the secret if it's expired.
fn refresh_secret(&self) -> [u8; 32] {
let mut secret = self.secret.lock().unwrap();
if let Some(v) = secret.as_ref() {
if v.1.elapsed() < COOKIE_LIFETIME {
return v.0;
}
if let Some(v) = secret.as_ref()
&& v.1.elapsed() < COOKIE_LIFETIME
{
return v.0;
}

let mut rv = [0u8; 32];
Expand Down
Loading