diff --git a/Cargo.lock b/Cargo.lock index f3a1c77ecffd09d4a4d8510ba9b676ce20282802..87594b010c62cf295171a431fe823909cd51300d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -332,10 +332,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "door" -version = "0.1.0" - [[package]] name = "door-async" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index c930a8a2888671b4bceff14e832b166a4838fa4e..b8173c9e0af29be8ac4eafaa6898fc4b91923c98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,3 @@ -[package] -name = "door" -version = "0.1.0" -edition = "2021" -license = "MPL-2.0" - [workspace] members = [ "sshproto", diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index e7a11a969c037e00a796aafeff6258501ec15e9a..0000000000000000000000000000000000000000 --- a/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world!"); -} diff --git a/sshproto/examples/kex1.rs b/sshproto/examples/kex1.rs deleted file mode 100644 index a2d34990c0ecea91723c40192687ca0547091ba9..0000000000000000000000000000000000000000 --- a/sshproto/examples/kex1.rs +++ /dev/null @@ -1,89 +0,0 @@ -#![allow(unused_imports)] - -use anyhow::{Context, Error, Result}; -use pretty_hex::PrettyHex; - -use door_sshproto::*; -use door_sshproto::packets::*; -use door_sshproto::sshwire::BinString; - -use simplelog::{TestLogger,self,LevelFilter}; - -fn main() -> Result<()> { - let _ = TestLogger::init(LevelFilter::Trace, simplelog::Config::default()); - // do_kexinit()?; - do_userauth()?; - Ok(()) -} - -fn do_userauth() -> Result<()> { - let p: Packet = packets::UserauthRequest { - username: "matt".into(), - service: "con", - method: AuthMethod::Password(packets::MethodPassword { change: false, password: "123".into() }), - }.into(); - - let mut buf = vec![0; 2000]; - let written = door_sshproto::sshwire::write_ssh(&mut buf, &p)?; - buf.truncate(written); - println!("buf {:?}", buf.hex_dump()); - - let ctx = ParseContext::new(); - let x: Packet = door_sshproto::sshwire::packet_from_bytes(&buf, &ctx)?; - println!("{x:?}"); - - Ok(()) - - -} - -fn do_kexinit() -> Result<()> { - - let k = KexInit { - // cookie: &[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], - cookie: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], - kex: "hello,more".try_into().unwrap(), - hostkey: "hello,more".try_into().unwrap(), - cipher_c2s: "hello,more".try_into().unwrap(), - cipher_s2c: "hello,more".try_into().unwrap(), - mac_c2s: "hi".try_into().unwrap(), - mac_s2c: "hello,more".try_into().unwrap(), - comp_c2s: "hello,more".try_into().unwrap(), - comp_s2c: "hello,more".try_into().unwrap(), - lang_c2s: "hello,more".try_into().unwrap(), - lang_s2c: "hello,more".try_into().unwrap(), - first_follows: false, - reserved: 0, - }; - let p = Packet::KexInit(k); - println!("p {p:?}"); - - let bs = BinString(&[0x11, 0x22, 0x33]); - let dhc: Packet = KexDHInit { q_c: bs }.into(); - println!("dhc1 {dhc:?}"); - - // if let SpecificPacket::KexInit(ref k2) = p.p { - // let t = toml::to_string(&k2)?; - // println!("as toml:\n{}", t); - - // } - // let k2: KexInit = toml::from_str(&t).context("deser")?; - // println!("kex2 {k:?}"); - - - let mut buf = vec![0; 2000]; - let written = door_sshproto::sshwire::write_ssh(&mut buf, &p)?; - buf.truncate(written); - println!("{:?}", buf.hex_dump()); - let ctx = ParseContext::new(); - let x: Packet = door_sshproto::sshwire::packet_from_bytes(&buf, &ctx)?; - println!("fetched {x:?}"); - - // let cli= Client::new(); - // let c = Conn::new_client(cli)?; - // let mut work = vec![0; 2000]; - // let mut r = conn::Runner::new(c, work.as_mut_slice())?; - // r.input(&buf)?; - Ok(()) - -} diff --git a/sshproto/src/test.rs b/sshproto/src/test.rs index b0ebe7e9568d6dbd29f41a4c96d98f0e6dd6bc36..14f0ff9adbd66183f2b48fd5afeffe4e65089723 100644 --- a/sshproto/src/test.rs +++ b/sshproto/src/test.rs @@ -36,7 +36,7 @@ mod tests { let k = KexInit { cookie: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], kex: "kex".try_into().unwrap(), - hostkey: "hostkey,another".try_into().unwrap(), + hostsig: "hostkey,another".try_into().unwrap(), cipher_c2s: "chacha20-poly1305@openssh.com,aes128-ctr".try_into().unwrap(), cipher_s2c: "blowfish".try_into().unwrap(), mac_c2s: "hmac-sha1".try_into().unwrap(),