diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/rusoto/Cargo.toml | 14 | ||||
-rw-r--r-- | net/rusoto/src/aws_transcriber/packet/mod.rs | 11 |
2 files changed, 13 insertions, 12 deletions
diff --git a/net/rusoto/Cargo.toml b/net/rusoto/Cargo.toml index 60722e899..7247a7648 100644 --- a/net/rusoto/Cargo.toml +++ b/net/rusoto/Cargo.toml @@ -14,16 +14,16 @@ bytes = "1.0" futures = "0.3" gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } -rusoto_core = "0.46" -rusoto_s3 = "0.46" -rusoto_credential = "0.46" -rusoto_signature = "0.46" +rusoto_core = "0.47" +rusoto_s3 = "0.47" +rusoto_credential = "0.47" +rusoto_signature = "0.47" url = "2" percent-encoding = "2" tokio = { version = "1.0", features = [ "rt-multi-thread" ] } -async-tungstenite = { version = "0.13", features = ["tokio", "tokio-runtime", "tokio-native-tls"] } -nom = "6" -crc = "1.8.1" +async-tungstenite = { version = "0.14", features = ["tokio", "tokio-runtime", "tokio-native-tls"] } +nom = "7" +crc = "2" byteorder = "1.3.4" once_cell = "1.0" serde = "1" diff --git a/net/rusoto/src/aws_transcriber/packet/mod.rs b/net/rusoto/src/aws_transcriber/packet/mod.rs index 01581f418..8bbbba439 100644 --- a/net/rusoto/src/aws_transcriber/packet/mod.rs +++ b/net/rusoto/src/aws_transcriber/packet/mod.rs @@ -16,7 +16,6 @@ // Boston, MA 02110-1335, USA. use byteorder::{BigEndian, WriteBytesExt}; -use crc::crc32; use nom::{ self, bytes::complete::take, combinator::map_res, multi::many0, number::complete::be_u16, number::complete::be_u32, number::complete::be_u8, sequence::tuple, IResult, @@ -24,6 +23,8 @@ use nom::{ use std::borrow::Cow; use std::io::{self, Write}; +const CRC: crc::Crc<u32> = crc::Crc::<u32>::new(&crc::CRC_32_BZIP2); + #[derive(Debug)] struct Prelude { total_bytes: u32, @@ -87,11 +88,11 @@ pub fn encode_packet(payload: &[u8], headers: &[Header]) -> Result<Vec<u8>, io:: (&mut res[0..4]).write_u32::<BigEndian>(total_length as u32)?; // Rewrite the prelude crc since we replaced the lengths - let prelude_crc = crc32::checksum_ieee(&res[0..8]); + let prelude_crc = CRC.checksum(&res[0..8]); (&mut res[8..12]).write_u32::<BigEndian>(prelude_crc)?; // Message CRC - let message_crc = crc32::checksum_ieee(&res); + let message_crc = CRC.checksum(&res); res.write_u32::<BigEndian>(message_crc)?; Ok(res) @@ -101,7 +102,7 @@ fn parse_prelude(input: &[u8]) -> IResult<&[u8], Prelude> { map_res( tuple((be_u32, be_u32, be_u32)), |(total_bytes, header_bytes, prelude_crc)| { - let sum = crc32::checksum_ieee(&input[0..8]); + let sum = CRC.checksum(&input[0..8]); if prelude_crc != sum { return Err(nom::Err::Error(( "Prelude CRC doesn't match", @@ -148,7 +149,7 @@ pub fn parse_packet(input: &[u8]) -> IResult<&[u8], Packet> { let (remainder, prelude) = parse_prelude(input)?; // Check the crc of the whole input - let sum = crc32::checksum_ieee(&input[..input.len() - 4]); + let sum = CRC.checksum(&input[..input.len() - 4]); let (_, msg_crc) = be_u32(&input[input.len() - 4..])?; if msg_crc != sum { |