Skip to content

Commit 9762ea0

Browse files
authored
chore: Update sha-1 to 0.9 (#72)
Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
1 parent c1e111a commit 9762ea0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ matrix:
99
- rust: beta
1010
- rust: nightly
1111
# minimum rustc version
12-
- rust: 1.39.0
12+
- rust: 1.41.0
1313
script: cargo build
1414

1515
script:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ base64 = "0.13"
2323
bitflags = "1.0"
2424
bytes = "1"
2525
mime = "0.3.14"
26-
sha-1 = "0.8"
26+
sha-1 = "0.9"
2727
time = "0.1.34"
2828

2929
[features]

src/common/sec_websocket_accept.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ impl From<SecWebsocketKey> for SecWebsocketAccept {
3737

3838
fn sign(key: &[u8]) -> SecWebsocketAccept {
3939
let mut sha1 = Sha1::default();
40-
sha1.input(key);
41-
sha1.input(&b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"[..]);
42-
let b64 = Bytes::from(base64::encode(&sha1.result()));
40+
sha1.update(key);
41+
sha1.update(&b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"[..]);
42+
let b64 = Bytes::from(base64::encode(&sha1.finalize()));
4343

4444
let val = ::HeaderValue::from_maybe_shared(b64).expect("base64 is a valid value");
4545

0 commit comments

Comments
 (0)