Browse Source

Update crate used for md5 computation.

wip
Titouan Rigoudy 4 years ago
parent
commit
1b700974f5
3 changed files with 17 additions and 66 deletions
  1. +12
    -60
      Cargo.lock
  2. +1
    -1
      proto/Cargo.toml
  3. +4
    -5
      proto/src/server/credentials.rs

+ 12
- 60
Cargo.lock View File

@ -314,12 +314,6 @@ dependencies = [
"slab 0.4.3",
]
[[package]]
name = "gcc"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
[[package]]
name = "generic-array"
version = "0.14.4"
@ -450,6 +444,17 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
[[package]]
name = "md-5"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15"
dependencies = [
"block-buffer",
"digest",
"opaque-debug",
]
[[package]]
name = "memchr"
version = "2.4.0"
@ -635,29 +640,6 @@ dependencies = [
"proc-macro2",
]
[[package]]
name = "rand"
version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c"
dependencies = [
"libc",
"rand 0.4.6",
]
[[package]]
name = "rand"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
dependencies = [
"fuchsia-cprng",
"libc",
"rand_core 0.3.1",
"rdrand",
"winapi",
]
[[package]]
name = "rand"
version = "0.6.5"
@ -845,25 +827,6 @@ version = "0.6.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]]
name = "rust-crypto"
version = "0.2.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a"
dependencies = [
"gcc",
"libc",
"rand 0.3.23",
"rustc-serialize",
"time",
]
[[package]]
name = "rustc-serialize"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
[[package]]
name = "rustc_version"
version = "0.2.3"
@ -1012,8 +975,8 @@ dependencies = [
"env_logger",
"futures",
"log",
"md-5",
"parking_lot 0.8.0",
"rust-crypto",
"serde",
"serde_json",
"thiserror",
@ -1084,17 +1047,6 @@ dependencies = [
"num_cpus",
]
[[package]]
name = "time"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
dependencies = [
"libc",
"wasi",
"winapi",
]
[[package]]
name = "tinyvec"
version = "1.2.0"


+ 1
- 1
proto/Cargo.toml View File

@ -11,8 +11,8 @@ encoding_rs = "^0.8"
env_logger = "^0.8"
futures = "^0.3"
log = "^0.4"
md-5 = "^0.9"
parking_lot = "^0.8"
rust-crypto = "^0.2.34"
serde = { version = "1.0", features = ["derive"] }
thiserror = "^1.0"
tokio = { version = "1", features = ["full"] }


+ 4
- 5
proto/src/server/credentials.rs View File

@ -1,7 +1,6 @@
//! Defines the `Credentials` struct, for use when logging in to a server.
use crypto::digest::Digest;
use crypto::md5::Md5;
use md5::{Digest, Md5};
use crate::server::{LoginRequest, Version};
@ -23,9 +22,9 @@ impl Credentials {
}
let mut hasher = Md5::new();
hasher.input_str(&user_name);
hasher.input_str(&password);
let digest = hasher.result_str();
hasher.update(&user_name);
hasher.update(&password);
let digest = format!("{:x}", hasher.finalize());
Some(Credentials {
user_name,


Loading…
Cancel
Save