Compare commits

...

9 Commits

Author SHA1 Message Date
_ 2732e03763 Merge branch 'fltk-repro' 2022-05-26 01:00:43 +00:00
_ 68932e00de Merge remote-tracking branch 'external/main' 2022-05-26 01:00:02 +00:00
_ 2c47be3cf8 Merge remote-tracking branch 'external/2022-05May-25-tls-patch' 2022-05-26 00:52:35 +00:00
_ e03ddc2539 🐛 bug: fix TLS issue in ptth_multi_call_server
PTTH is supposed to pack its own PKI roots. We did this for ptth_server
but a discrepancy in the Cargo.toml files for the PTTH_QUIC server
caused Cargo to accidentally turn off that feature in reqwest
2022-05-25 14:17:02 -05:00
_ 097c9cf313 add diceware subcommand 2022-04-22 11:53:19 -05:00
_ 820c5aeef4 bring tests up to date
I definitely remember doing this already. I must have left the changes on
my home PC.
2022-04-22 11:37:20 -05:00
_ 94c5b0117f Merge remote-tracking branch 'employer/main' into main 2022-04-22 11:28:37 -05:00
_ c992da0a8c update Rust used for build 2022-04-12 09:19:08 -05:00
_ f99c4e8488 reproducing a crash in FL_Flex 2021-10-10 21:55:51 +00:00
7 changed files with 37 additions and 4 deletions

1
Cargo.lock generated
View File

@ -1243,6 +1243,7 @@ dependencies = [
"ptth_file_server",
"ptth_server",
"quic_demo",
"rand",
"reqwest",
"rusty_ulid",
"sha2",

View File

@ -19,6 +19,7 @@ hex = "0.4.3"
ptth_file_server = { path = "../ptth_file_server_bin" }
ptth_server = { path = "../ptth_server" }
quic_demo = { path = "../../prototypes/quic_demo" }
rand = "0.8.4"
rusty_ulid = "0.10.1"
sha2 = "0.9.8"
tokio = { version = "1.8.1", features = ["full"] }

View File

@ -0,0 +1,23 @@
use rand::Rng;
pub fn main () {
let wordlist = include_str! ("eff_short_wordlist_1.txt");
let words: Vec <_> = wordlist.split ('\n').take (1253).collect ();
assert_eq! (words.len (), 1253);
assert_eq! (words [0], "acid");
assert_eq! (words [600], "large");
assert_eq! (words [1252], "zoom");
let mut rng = rand::thread_rng ();
let random_words: Vec <&str> = (0..8)
.map (|_| {
words [rng.gen_range (0..words.len ())]
})
.collect ();
let passphrase = random_words.join (" ");
println! ("{}", passphrase);
}

View File

@ -5,11 +5,13 @@ use std::{
use tokio::sync::watch;
mod diceware;
mod download;
mod ulid;
#[derive (Clone, Copy, Debug, PartialEq)]
enum Subcommand {
Diceware,
Download,
PtthServer,
PtthFileServer,
@ -27,6 +29,7 @@ async fn main () -> anyhow::Result <()> {
let (subcommand, args) = parse_args (&args)?;
match subcommand {
Diceware => Ok (diceware::main ()),
Download => download::main (&args).await,
PtthServer => ptth_server::executable::main (&args).await,
PtthFileServer => ptth_file_server::main (&args).await,
@ -50,6 +53,7 @@ fn parse_subcommand (arg: &str) -> Option <Subcommand>
use Subcommand::*;
let map = vec! [
("diceware", Diceware),
("download", Download),
("ptth_server", PtthServer),
("ptth_file_server", PtthFileServer),

View File

@ -70,7 +70,7 @@ fn file_server () {
let files_root = PathBuf::from ("./");
let dirs_roots = Default::default ();
let file_server_root = internal::FileRoots {
let roots = internal::FileRoots {
files: &files_root,
dirs: &dirs_roots,
};
@ -96,7 +96,7 @@ fn file_server () {
})),
] {
let resp = internal::serve_all (
file_server_root,
roots,
Method::Get,
uri_path,
&headers,
@ -113,7 +113,7 @@ fn file_server () {
}),
] {
let resp = internal::serve_all (
file_server_root,
roots,
Method::Get,
uri_path,
&headers,

View File

@ -17,9 +17,13 @@ hyper = { version = "0.14.4", features = ["http1", "server", "stream", "tcp"] }
quinn = "0.7.2"
rand = "0.8.4"
rcgen = "0.8.11"
reqwest = "0.11.4"
rmp-serde = "0.15.5"
structopt = "0.3.20"
tokio = { version = "1.8.1", features = ["full"] }
tracing-subscriber = "0.2.16"
tracing = "0.1.25"
[dependencies.reqwest]
version = "0.11.10"
default-features = false
features = ["stream", "rustls-tls", "hyper-rustls"]