Skip to content

Commit

Permalink
core: Add optional password entropy checks
Browse files Browse the repository at this point in the history
  • Loading branch information
felinira committed Aug 25, 2024
1 parent 495bc8f commit 165a8e1
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 14 deletions.
186 changes: 186 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ thiserror = "1.0.24"
time = "0.3.7"
trycmd = "0.15"
url = "2.2.2"
zxcvbn = "3.1.0"

[package]
name = "magic-wormhole"
Expand Down Expand Up @@ -100,6 +101,7 @@ thiserror = { workspace = true }
futures = { workspace = true }
url = { workspace = true, features = ["serde"] }
percent-encoding = { workspace = true }
zxcvbn = { workspace = true, optional = true }

# Transit dependencies

Expand Down Expand Up @@ -143,6 +145,8 @@ eyre = { workspace = true }

[features]

# Check the entropy of custom codes. Will fail for any weak passwords.
entropy = ["zxcvbn"]
transfer = ["transit", "dep:tar", "dep:rmp-serde"]
transit = [
"dep:noise-rust-crypto",
Expand Down
6 changes: 4 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async-std = { workspace = true, features = ["attributes", "unstable"] }
rand = { workspace = true }

# CLI specific dependencies
magic-wormhole = { path = "..", version = "0.7", features = ["all"] }
magic-wormhole = { path = "..", version = "0.7", features = ["all", "entropy"] }
clap = { workspace = true, features = ["cargo", "derive", "help"] }
clap_complete = { workspace = true }
env_logger = { workspace = true }
Expand All @@ -39,7 +39,9 @@ color-eyre = { workspace = true }
number_prefix = { workspace = true }
ctrlc = { workspace = true }
qr2term = { workspace = true }
arboard = { workspace = true, features = ["wayland-data-control"] } # Wayland by default, fallback to X11.
arboard = { workspace = true, features = [
"wayland-data-control",
] } # Wayland by default, fallback to X11.

[dev-dependencies]
trycmd = { workspace = true }
Expand Down
Loading

0 comments on commit 165a8e1

Please sign in to comment.