Skip to content

Commit 65ec00d

Browse files
authored
Merge pull request #465 from tox-rs/upgrade_sha2
Update sha2 dependency
2 parents e86f233 + 107a945 commit 65ec00d

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

tox_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ lru = "0.7"
3232
bitflags = "1.3"
3333
itertools = "0.10"
3434
rand = "0.8"
35-
sha2 = "0.9"
35+
sha2 = "0.10"
3636
xsalsa20poly1305 = "0.9"
3737
crypto_box = "0.8"
3838

tox_core/src/onion/onion_announce.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
use std::net::{IpAddr, SocketAddr};
55
use std::time::{Duration, Instant, SystemTime};
66
use sha2::{Digest, Sha256};
7-
use sha2::digest::generic_array::typenum::marker_traits::Unsigned;
7+
use sha2::digest::typenum::Unsigned;
8+
use sha2::digest::OutputSizeUser;
89
use rand::{CryptoRng, Rng};
910
use thiserror::Error;
1011

@@ -31,7 +32,7 @@ pub const PING_ID_TIMEOUT: Duration = Duration::from_secs(300);
3132
pub const ONION_ANNOUNCE_TIMEOUT: Duration = Duration::from_secs(300);
3233

3334
/// Create onion ping id filled with zeros.
34-
pub const INITIAL_PING_ID: PingId = [0; <Sha256 as Digest>::OutputSize::USIZE];
35+
pub const INITIAL_PING_ID: PingId = [0; <Sha256 as OutputSizeUser>::OutputSize::USIZE];
3536

3637
/// Error that can happen when handling data request.
3738
#[derive(Clone, Debug, Eq, PartialEq, Error)]

tox_packet/src/dht/cookie.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use nom::number::complete::be_u64;
66
use nom::combinator::eof;
77
use nom::bytes::complete::take;
88
use sha2::{Digest, Sha512};
9-
use sha2::digest::generic_array::typenum::marker_traits::Unsigned;
10-
use sha2::digest::crypto_common::OutputSizeUser;
9+
use sha2::digest::typenum::Unsigned;
10+
use sha2::digest::OutputSizeUser;
1111
use xsalsa20poly1305::{XSalsa20Poly1305, aead::{Aead, Error as AeadError}};
1212
use rand::{CryptoRng, Rng};
1313

tox_packet/src/dht/crypto_handshake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use super::*;
55

66
use crypto_box::{SalsaBox, aead::{Aead, AeadCore, Error as AeadError}};
77
use sha2::Sha512;
8-
use sha2::digest::generic_array::typenum::marker_traits::Unsigned;
9-
use sha2::digest::crypto_common::OutputSizeUser;
8+
use sha2::digest::typenum::Unsigned;
9+
use sha2::digest::OutputSizeUser;
1010
use tox_binary_io::*;
1111
use tox_crypto::*;
1212
use crate::dht::cookie::EncryptedCookie;

tox_packet/src/onion/onion_announce_request.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use nom::{
1313
bytes::complete::{take, tag}
1414
};
1515
use sha2::Sha256;
16-
use sha2::digest::generic_array::typenum::marker_traits::Unsigned;
17-
use sha2::digest::crypto_common::OutputSizeUser;
16+
use sha2::digest::typenum::Unsigned;
17+
use sha2::digest::OutputSizeUser;
1818

1919
/// The type of onion ping ID which is SHA256 hash.
2020
pub type PingId = [u8; <Sha256 as OutputSizeUser>::OutputSize::USIZE];

0 commit comments

Comments
 (0)