X-Git-Url: http://git.euphorik.ch/?p=crypto_lab1.git;a=blobdiff_plain;f=src%2Fmain.rs;h=64aef28e128a89381fd18f561f08c422dd12ef8e;hp=1fae4c1838621f1c2456490b87d6455f25733a74;hb=c9318a07ce0ec00f999ff17943b83048d536ecd1;hpb=911f8410c05d3d16922587a59266096f3c6899e1 diff --git a/src/main.rs b/src/main.rs index 1fae4c1..64aef28 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,11 +11,19 @@ use end_point::{ Client, Server }; mod crypto; mod packet; mod end_point; +mod oracle_machine; const PORT: u16 = 4221; fn print_usage() { - println!("{} | | ...", os::args()[0]); + println!( + r"{} genkey | tests | oracle-weak | oracle-fixed + genkey: Generate a 256 bits key + tests: launch some tests between a client and a weak server + oracle-weak: launch a padding oracle attack against a weak server + oracle-fixed: launch a padding oracle attack against a fixed server", + os::args()[0] + ); } fn main() { @@ -35,7 +43,9 @@ fn main() { Ok(mut server) => { println!("Server started"); - Client::start_tests("::1", PORT); + if args.len() > 1 && args[1].as_slice() == "tests" { + Client::start_tests("::1", PORT); + } println!("Press any key to quit"); io::stdin().read_line().ok().expect("Failed to read line");