Bumped version of `chacha20stream` to 2.0: Added support for `Read` and `AsyncRead` en/decryption.

Fortune for rsh's current commit: Future small blessing − 末小吉
exchange-unsafe
Avril 3 years ago
parent 7216f0f8de
commit 7f8acbba7f
Signed by: flanchan
GPG Key ID: 284488987C31F630

6
Cargo.lock generated

@ -106,16 +106,18 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chacha20stream"
version = "1.0.3"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a91f983a237d46407e744f0b9c5d2866f018954de5879905d7af6bf06953aea"
checksum = "3a27e1b4a96dea2045de11b4c72d5717f84acd73de7133f3ee6005244d838d56"
dependencies = [
"base64 0.13.0",
"getrandom 0.2.3",
"libc",
"openssl",
"pin-project",
"rustc_version",
"smallvec",
"stackalloc",
"tokio 0.2.25",
]

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
bytes = { version = "1.0.1", features = ["serde"] }
chacha20stream = { version = "1.0.3", features = ["async"] }
chacha20stream = { version = "2.0", features = ["async"] }
color-eyre = "0.5.11"
cryptohelpers = { version = "1.8.1" , features = ["serialise", "full"] }
futures = "0.3.16"

@ -59,7 +59,7 @@ impl<R: AsyncRead + ?Sized> AsyncRead for ReverseSink<R>
}
}
alloc_local_bytes(buf.len(), |temp_buf| -> Poll<io::Result<usize>> {
//XXX: Does this work? I dunno... Maybe just pin and poll a local `async{}` block.
//XXX: Does this work? I dunno... Maybe just pin and poll a local `async{}` block (this doesn't work, because `raw` needs to be `Unpin`... sigh....).
// Read encrypted bytes into `temp_buf`.
let filled_buffer: &[u8] = try_ready!(proj.raw.poll_read(cx, temp_buf).map_ok(|read| {

Loading…
Cancel
Save