diff --git a/Cargo.toml b/Cargo.toml index e6c5a1d..d5b7bd9 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 3983690..ce6b4dd 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)]