From a0d4d2aeba9a91c955a36f0126f713ef2b911fa6 Mon Sep 17 00:00:00 2001 From: Avril Date: Sun, 10 Apr 2022 00:00:06 +0100 Subject: [PATCH] [Austen Adler]: Update `async` feature targets to tokio-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumped major version as this is a breaking change. Patch by: https://austenadler.com/ Fortune for cryptohelpers's current commit: Small curse − 小凶 --- Cargo.toml | 4 ++-- src/aes.rs | 11 +++++------ src/crc.rs | 6 +++--- src/rsa/crypt.rs | 11 +++++------ src/rsa/private.rs | 11 +++++------ src/rsa/public.rs | 11 +++++------ src/rsa/sign.rs | 8 +++----- src/sha256.rs | 6 +++--- 8 files changed, 31 insertions(+), 37 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7cabfaa..86acab3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cryptohelpers" -version = "1.8.2" +version = "2.0.0" license= "MIT" description = "Collection of helpers and simplifying functions for cryptography things" authors = ["Avril "] @@ -17,7 +17,7 @@ getrandom = {version = "0.1", optional = true } crc = {version = "1.8", optional = true } hex-literal = {version = "0.3", optional = true } libc = "0.2" -tokio = {version = "0.2", features=["io-util"], optional=true} +tokio = { version = "^1.17", features = ["io-util"], optional = true } serde_derive = {version = "1.0", optional = true} serde = {version = "1.0", optional = true} futures = {version = "0.3.8", optional=true} diff --git a/src/aes.rs b/src/aes.rs index b4fbec5..83d0b32 100644 --- a/src/aes.rs +++ b/src/aes.rs @@ -14,12 +14,11 @@ use openssl::{ }, }; #[cfg(feature="async")] -use tokio::{ - io::{ - AsyncRead, - AsyncWrite, - }, - prelude::*, +use tokio::io::{ + AsyncRead, + AsyncReadExt, + AsyncWrite, + AsyncWriteExt, }; use getrandom::getrandom; diff --git a/src/crc.rs b/src/crc.rs index f8d6c7f..3a45752 100644 --- a/src/crc.rs +++ b/src/crc.rs @@ -11,9 +11,9 @@ use crc::{ Hasher64, }; #[cfg(feature="async")] -use tokio::{ - prelude::*, - io::AsyncRead, +use tokio::io::{ + AsyncRead, + AsyncReadExt, }; use consts::BUFFER_SIZE; diff --git a/src/rsa/crypt.rs b/src/rsa/crypt.rs index 8e0c517..da3ec30 100644 --- a/src/rsa/crypt.rs +++ b/src/rsa/crypt.rs @@ -13,12 +13,11 @@ use openssl::{ pkey::HasPrivate, }; #[cfg(feature="async")] -use tokio::{ - io::{ - AsyncWrite, - AsyncRead, - }, - prelude::*, +use tokio::io::{ + AsyncWrite, + AsyncWriteExt, + AsyncRead, + AsyncReadExt, }; use consts::RSA_PADDING_NEEDS as PADDING_NEEDS; diff --git a/src/rsa/private.rs b/src/rsa/private.rs index aeeb4ae..6039820 100644 --- a/src/rsa/private.rs +++ b/src/rsa/private.rs @@ -37,12 +37,11 @@ use openssl::{ symm::Cipher, }; #[cfg(feature="async")] -use tokio::{ - io::{ - AsyncWrite, - AsyncRead, - }, - prelude::*, +use tokio::io::{ + AsyncWrite, + AsyncWriteExt, + AsyncRead, + AsyncReadExt, }; /// Container for the private & public parts of an RSA key diff --git a/src/rsa/public.rs b/src/rsa/public.rs index eccfaa7..92a853d 100644 --- a/src/rsa/public.rs +++ b/src/rsa/public.rs @@ -33,12 +33,11 @@ use openssl::{ }, }; #[cfg(feature="async")] -use tokio::{ - io::{ - AsyncWrite, - AsyncRead, - }, - prelude::*, +use tokio::io::{ + AsyncWrite, + AsyncWriteExt, + AsyncRead, + AsyncReadExt, }; /// Container for RSA public key components diff --git a/src/rsa/sign.rs b/src/rsa/sign.rs index fb3246a..1741a14 100644 --- a/src/rsa/sign.rs +++ b/src/rsa/sign.rs @@ -27,11 +27,9 @@ use openssl::{ }, }; #[cfg(feature="async")] -use tokio::{ - io::{ - AsyncRead, - }, - prelude::*, +use tokio::io::{ + AsyncRead, + AsyncReadExt, }; use consts::RSA_SIG_SIZE as SIZE; use consts::BUFFER_SIZE; diff --git a/src/sha256.rs b/src/sha256.rs index 50b8ecd..abd1b51 100644 --- a/src/sha256.rs +++ b/src/sha256.rs @@ -10,9 +10,9 @@ use sha2::{ Digest, Sha256, }; #[cfg(feature="async")] -use tokio::{ - io::AsyncRead, - prelude::*, +use tokio::io::{ + AsyncRead, + AsyncReadExt, }; pub const SIZE: usize = consts::SHA256_SIZE;