mirror of
https://gitlab.redox-os.org/CoffeeCode/redox-ssh.git
synced 2025-12-28 13:22:19 +01:00
Update dependencies & fix compilation
This commit is contained in:
parent
2307ab591e
commit
be02f2a25f
7 changed files with 157 additions and 56 deletions
168
Cargo.lock
generated
168
Cargo.lock
generated
|
|
@ -4,9 +4,9 @@ version = 3
|
|||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.1.0"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
|
|
@ -16,9 +16,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|||
|
||||
[[package]]
|
||||
name = "byteorder"
|
||||
version = "1.4.3"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
||||
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
|
|
@ -39,59 +39,83 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.140"
|
||||
name = "getrandom"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
|
||||
dependencies = [
|
||||
"log 0.4.17",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
|
||||
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.159"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
||||
|
||||
[[package]]
|
||||
name = "num-bigint"
|
||||
version = "0.4.3"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f"
|
||||
checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.45"
|
||||
version = "0.1.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
|
||||
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.15"
|
||||
version = "0.2.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
|
||||
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
version = "0.2.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
|
||||
dependencies = [
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.86"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.37"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.3.23"
|
||||
|
|
@ -115,6 +139,27 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rand_chacha",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_chacha"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
||||
dependencies = [
|
||||
"ppv-lite86",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.3.1"
|
||||
|
|
@ -130,6 +175,15 @@ version = "0.4.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rdrand"
|
||||
version = "0.4.0"
|
||||
|
|
@ -145,9 +199,9 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"byteorder",
|
||||
"libc",
|
||||
"log 0.3.9",
|
||||
"log",
|
||||
"num-bigint",
|
||||
"rand 0.3.23",
|
||||
"rand 0.8.5",
|
||||
"redox_syscall",
|
||||
"rust-crypto",
|
||||
"rustc-serialize",
|
||||
|
|
@ -177,9 +231,20 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rustc-serialize"
|
||||
version = "0.3.20"
|
||||
version = "0.3.25"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c11e5465fcfde38cd9068f031d9eae19d2530bee91b129fed44f2b122697749"
|
||||
checksum = "fe834bc780604f4674073badbad26d7219cadfb4a2275802db12cbae17498401"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.77"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
|
|
@ -188,16 +253,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"wasi",
|
||||
"wasi 0.10.0+wasi-snapshot-preview1",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.10.0+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.11.0+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
|
|
@ -219,3 +296,24 @@ name = "winapi-x86_64-pc-windows-gnu"
|
|||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.7.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.7.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
|
|
|||
12
Cargo.toml
12
Cargo.toml
|
|
@ -23,12 +23,12 @@ path = "src/bin/ssh-keygen.rs"
|
|||
doc = false
|
||||
|
||||
[dependencies]
|
||||
byteorder = "^1.0"
|
||||
log = "^0.3"
|
||||
num-bigint = "0.4"
|
||||
rand = "^0.3"
|
||||
rust-crypto = "^0.2"
|
||||
rustc-serialize = "=0.3.20"
|
||||
byteorder = "^1.5.0"
|
||||
log = "^0.4.22"
|
||||
num-bigint = "0.4.6"
|
||||
rand = "^0.8.5"
|
||||
rust-crypto = "^0.2.36"
|
||||
rustc-serialize = "^0.3.25"
|
||||
|
||||
[target.'cfg(not(target_os = "redox"))'.dependencies]
|
||||
libc = "^0.2.26"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use std::io::{self, Write};
|
|||
use std::process;
|
||||
use std::str::FromStr;
|
||||
|
||||
use log::{LogLevelFilter, LogMetadata, LogRecord};
|
||||
use log::{LevelFilter, Metadata, Record};
|
||||
|
||||
use ssh::{Server, ServerConfig};
|
||||
use ssh::public_key::ED25519;
|
||||
|
|
@ -15,20 +15,24 @@ use ssh::public_key::ED25519;
|
|||
struct StdErrLogger;
|
||||
|
||||
impl log::Log for StdErrLogger {
|
||||
fn enabled(&self, _: &LogMetadata) -> bool {
|
||||
fn enabled(&self, _: &Metadata) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn log(&self, record: &LogRecord) {
|
||||
fn log(&self, record: &Record) {
|
||||
if self.enabled(record.metadata()) {
|
||||
writeln!(io::stderr(), "{} - {}", record.level(), record.args())
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn flush(&self) {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let mut verbosity = LogLevelFilter::Warn;
|
||||
let mut verbosity = LevelFilter::Warn;
|
||||
let mut foreground = false;
|
||||
|
||||
let key_pair = File::open("server.key").and_then(
|
||||
|
|
@ -51,9 +55,9 @@ pub fn main() {
|
|||
while let Some(arg) = args.next() {
|
||||
match arg.as_ref()
|
||||
{
|
||||
"-v" => verbosity = LogLevelFilter::Info,
|
||||
"-vv" => verbosity = LogLevelFilter::Debug,
|
||||
"-vvv" => verbosity = LogLevelFilter::Trace,
|
||||
"-v" => verbosity = LevelFilter::Info,
|
||||
"-vv" => verbosity = LevelFilter::Debug,
|
||||
"-vvv" => verbosity = LevelFilter::Trace,
|
||||
"-f" => foreground = true,
|
||||
"-p" => {
|
||||
config.port =
|
||||
|
|
@ -65,10 +69,8 @@ pub fn main() {
|
|||
}
|
||||
}
|
||||
|
||||
log::set_logger(|max_log_level| {
|
||||
max_log_level.set(verbosity);
|
||||
Box::new(StdErrLogger)
|
||||
}).unwrap();
|
||||
log::set_logger(&StdErrLogger).unwrap();
|
||||
log::set_max_level(verbosity);
|
||||
|
||||
if !foreground {
|
||||
use ssh::sys::fork;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use key_exchange::{KexResult, KeyExchange};
|
|||
use mac::{Hmac, MacAlgorithm};
|
||||
use message::MessageType;
|
||||
use packet::{Packet, ReadPacketExt, WritePacketExt};
|
||||
use rand::distributions::Standard;
|
||||
use server::ServerConfig;
|
||||
|
||||
#[derive(PartialEq)]
|
||||
|
|
@ -405,7 +406,7 @@ impl<'a> Connection {
|
|||
// Create a random 16 byte cookie
|
||||
use rand::Rng;
|
||||
let mut rng = rand::thread_rng();
|
||||
let cookie: Vec<u8> = rng.gen_iter::<u8>().take(16).collect();
|
||||
let cookie: Vec<u8> = rng.sample_iter(Standard).take(16).collect();
|
||||
|
||||
let mut packet = Packet::new(MessageType::KexInit);
|
||||
packet.write_raw_bytes(cookie.as_slice())?;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use key_exchange::{KexResult, KeyExchange};
|
|||
use message::MessageType;
|
||||
use num_bigint::{BigInt, Sign};
|
||||
use packet::{Packet, ReadPacketExt, WritePacketExt};
|
||||
use rand::Rng;
|
||||
use rand::RngCore;
|
||||
|
||||
const ECDH_KEX_INIT: u8 = 30;
|
||||
const ECDH_KEX_REPLY: u8 = 31;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::io::ErrorKind::InvalidData;
|
|||
|
||||
use crypto::ed25519;
|
||||
use public_key::{CryptoSystem, KeyPair};
|
||||
use rand::Rng;
|
||||
use rand::{Rng, RngCore};
|
||||
|
||||
pub static ED25519: CryptoSystem = CryptoSystem {
|
||||
id: "ed25519",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ extern crate rand;
|
|||
|
||||
use std::io::Cursor;
|
||||
|
||||
use rand::Rng;
|
||||
use rand::{Rng, RngCore};
|
||||
use ssh::public_key::{self, CryptoSystem, KeyPair};
|
||||
|
||||
fn test_export_import(keypair: &Box<KeyPair>) -> Box<KeyPair> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue