aboutsummaryrefslogtreecommitdiffstats
path: root/src/server.rs
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-06-03 01:43:09 -0400
committerbnewbold <bnewbold@robocracy.org>2016-06-03 01:43:09 -0400
commit6f8284e3158d360d9c251ef93021eef40861276b (patch)
tree82616ec272521140bbecbbdde9c1e14d95c67e33 /src/server.rs
parentf68ff03d06a489114989b501e7e82cba1525f99e (diff)
downloaducp-6f8284e3158d360d9c251ef93021eef40861276b.tar.gz
ucp-6f8284e3158d360d9c251ef93021eef40861276b.zip
try AES stream crypto (NO INTEGRITY)aes_crypto_experiment
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server.rs b/src/server.rs
index ca75664..84ac2ec 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -18,7 +18,7 @@ use getopts::Options;
use udt::{self, UdtSocket, UdtStatus};
use crypto::{SecretStream, key2string, string2key, nonce2string, string2nonce};
use udt_extras::{UdtStream};
-use sodiumoxide::crypto::secretbox;
+use sodiumoxide::crypto::stream::aes128ctr;
pub fn get_local_ip() -> Result<net::IpAddr, String> {
let ip_str = match env::var("SSH_CONNECTION") {
@@ -82,9 +82,9 @@ fn run_server(path: &str, is_recv: bool, recursive: bool, daemonize: bool, no_cr
// This is the hack; we'll rebind below
let listen_port = listen_port + 1;
- let secret_key = secretbox::gen_key();
- let read_nonce = secretbox::gen_nonce();
- let write_nonce = secretbox::gen_nonce();
+ let secret_key = aes128ctr::gen_key();
+ let read_nonce = aes128ctr::gen_nonce();
+ let write_nonce = aes128ctr::gen_nonce();
/* XXX: DEBUG:
assert!(secret_key == string2key(&key2string(&secret_key)).unwrap());