mirror of
https://github.com/arampoire/onetun.git
synced 2026-01-16 10:00:23 -05:00
update
This commit is contained in:
parent
9f53198f17
commit
f212e85c41
4 changed files with 33 additions and 1069 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,3 +1,6 @@
|
||||||
|
.vscode/
|
||||||
|
.VSCodeCounter/
|
||||||
|
Cargo.lock
|
||||||
/target
|
/target
|
||||||
/.idea
|
/.idea
|
||||||
.envrc
|
.envrc
|
||||||
|
|
|
||||||
1060
Cargo.lock
generated
1060
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
30
Cargo.toml
30
Cargo.toml
|
|
@ -14,22 +14,40 @@ repository = "https://github.com/aramperes/onetun"
|
||||||
boringtun = { version = "0.4.0", default-features = false }
|
boringtun = { version = "0.4.0", default-features = false }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
tokio = { version = "1", features = [ "rt", "sync", "io-util", "net", "time", "fs", "macros" ] }
|
tokio = { version = "1", features = [
|
||||||
|
"rt",
|
||||||
|
"sync",
|
||||||
|
"io-util",
|
||||||
|
"net",
|
||||||
|
"time",
|
||||||
|
"fs",
|
||||||
|
"macros",
|
||||||
|
] }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
nom = "7"
|
nom = "7"
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
priority-queue = "1.3.0"
|
priority-queue = "1.3"
|
||||||
smoltcp = { version = "0.8.2", default-features = false, features = ["std", "log", "medium-ip", "proto-ipv4", "proto-ipv6", "socket-udp", "socket-tcp"] }
|
smoltcp = { version = "0.8.2", default-features = false, features = [
|
||||||
|
"std",
|
||||||
|
"log",
|
||||||
|
"medium-ip",
|
||||||
|
"proto-ipv4",
|
||||||
|
"proto-ipv6",
|
||||||
|
"socket-udp",
|
||||||
|
"socket-tcp",
|
||||||
|
] }
|
||||||
bytes = "1"
|
bytes = "1"
|
||||||
base64 = "0.13"
|
base64 = "0.21"
|
||||||
|
|
||||||
# forward boringtuns tracing events to log
|
# forward boringtuns tracing events to log
|
||||||
tracing = { version = "0.1", default-features = false, features = ["log"] }
|
tracing = { version = "0.1", default-features = false, features = ["log"] }
|
||||||
|
|
||||||
# bin-only dependencies
|
# bin-only dependencies
|
||||||
clap = { version = "2.34", default-features = false, features = ["suggestions"], optional = true }
|
clap = { version = "2.34", default-features = false, features = [
|
||||||
pretty_env_logger = { version = "0.4", optional = true }
|
"suggestions",
|
||||||
|
], optional = true }
|
||||||
|
pretty_env_logger = { version = "0.5", optional = true }
|
||||||
async-recursion = "1.0"
|
async-recursion = "1.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,10 @@ fn parse_public_key(s: Option<&str>) -> anyhow::Result<X25519PublicKey> {
|
||||||
|
|
||||||
fn parse_preshared_key(s: Option<&str>) -> anyhow::Result<Option<[u8; 32]>> {
|
fn parse_preshared_key(s: Option<&str>) -> anyhow::Result<Option<[u8; 32]>> {
|
||||||
if let Some(s) = s {
|
if let Some(s) = s {
|
||||||
let psk = base64::decode(s).with_context(|| "Invalid pre-shared key")?;
|
use base64::{engine::general_purpose, Engine as _};
|
||||||
|
let psk = general_purpose::STANDARD
|
||||||
|
.decode(s)
|
||||||
|
.with_context(|| "Invalid pre-shared key")?;
|
||||||
Ok(Some(psk.try_into().map_err(|_| {
|
Ok(Some(psk.try_into().map_err(|_| {
|
||||||
anyhow::anyhow!("Unsupported pre-shared key")
|
anyhow::anyhow!("Unsupported pre-shared key")
|
||||||
})?))
|
})?))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue