Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ readme = "README.md"
[dependencies]
byteorder = "1.0"
fallible-iterator = "0.1"
hex = "0.2"
md5 = "0.2"
md5 = "0.3"
memchr = "1.0"
5 changes: 2 additions & 3 deletions src/authentication.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Authentication protocol support.
use hex::ToHex;
use md5::Context;

/// Hashes authentication information in a way suitable for use in response
Expand All @@ -14,9 +13,9 @@ pub fn md5_hash(username: &[u8], password: &[u8], salt: [u8; 4]) -> String {
context.consume(username);
let output = context.compute();
context = Context::new();
context.consume(output.to_hex().as_bytes());
context.consume(format!("{:x}", output));
context.consume(&salt);
format!("md5{}", context.compute().to_hex())
format!("md5{:x}", context.compute())
}

#[cfg(test)]
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#![warn(missing_docs)]
extern crate byteorder;
extern crate fallible_iterator;
extern crate hex;
extern crate md5;
extern crate memchr;

Expand Down