From e547fa64ce684211f8eb76738f133adfad296eaa Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 22 Jan 2018 01:12:07 -0800 Subject: WIP refactoring DatPeer - use Key in some more spots (instead of [u8]) - threaded Peer implementation, with chan for communication --- src/bin/geniza-net.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/bin') diff --git a/src/bin/geniza-net.rs b/src/bin/geniza-net.rs index 4b3fa30..b3a55ba 100644 --- a/src/bin/geniza-net.rs +++ b/src/bin/geniza-net.rs @@ -6,11 +6,13 @@ extern crate env_logger; #[macro_use] extern crate error_chain; extern crate geniza; +extern crate sodiumoxide; // TODO: more careful import use geniza::*; use std::path::Path; use clap::{App, SubCommand, Arg}; +use sodiumoxide::crypto::stream::Key; fn run() -> Result<()> { env_logger::init().unwrap(); @@ -59,7 +61,8 @@ fn run() -> Result<()> { let host_port = subm.value_of("host_port").unwrap(); let dat_key = subm.value_of("dat_key").unwrap(); let key_bytes = parse_dat_address(&dat_key)?; - DatConnection::connect(host_port, &key_bytes, false)?; + let key = Key::from_slice(&key_bytes).unwrap(); + DatConnection::connect(host_port, &key, false)?; println!("Done!"); } ("discovery-key", Some(subm)) => { -- cgit v1.2.3