Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image-rs: use ring in unit test #510

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion image-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ttrpc-codegen = { workspace = true, optional = true }
cfg-if.workspace = true
filetime = "0.2"
nix = "0.26"
openssl.workspace = true
ring.workspace = true
rstest.workspace = true
serial_test = "2.0.0"
strum.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions image-rs/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ async fn channel_processing(
#[cfg(test)]
mod tests {
use super::*;
use openssl::rand::rand_bytes;
use ring::rand::SecureRandom;
use std::fs::File;
use std::io::BufReader;
use tar::{Builder, Header};

#[tokio::test]
async fn test_channel_processing() {
let mut data = [0; 100000];
rand_bytes(&mut data).unwrap();
ring::rand::SystemRandom::new().fill(&mut data[..]).unwrap();
let data_digest = sha2::Sha256::digest(data.as_slice());

let mut ar = Builder::new(Vec::new());
Expand Down Expand Up @@ -169,7 +169,7 @@ mod tests {
#[tokio::test]
async fn test_stream_processing() {
let mut data = [0; 100000];
rand_bytes(&mut data).unwrap();
ring::rand::SystemRandom::new().fill(&mut data[..]).unwrap();

let mut ar = Builder::new(Vec::new());
let mut header = Header::new_gnu();
Expand Down
Loading