From 849f248a94dc9d0c337257e06edb7e8e4a487748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 28 Jul 2020 09:34:31 +0300 Subject: [PATCH] Update to sha-1 0.9 --- Cargo.toml | 2 +- src/handshake/mod.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e6c5a1df..d5b7bd98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ httparse = "1.3.4" input_buffer = "0.3.0" log = "0.4.8" rand = "0.7.2" -sha-1 = "0.8.1" +sha-1 = "0.9" url = "2.1.0" utf-8 = "0.7.5" diff --git a/src/handshake/mod.rs b/src/handshake/mod.rs index 39836901..ce6b4dd7 100644 --- a/src/handshake/mod.rs +++ b/src/handshake/mod.rs @@ -118,9 +118,9 @@ fn convert_key(input: &[u8]) -> Result { // ... with the string "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" (RFC 6455) const WS_GUID: &[u8] = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; let mut sha1 = Sha1::default(); - sha1.input(input); - sha1.input(WS_GUID); - Ok(base64::encode(&sha1.result())) + sha1.update(input); + sha1.update(WS_GUID); + Ok(base64::encode(&sha1.finalize())) } #[cfg(test)]