Skip to content
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
58 changes: 35 additions & 23 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion ovmf-prebuilt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ repository = "https://github.com/rust-osdev/ovmf-prebuilt"
description = "Library to download and cache OVMF prebuilt binaries"

[dependencies]
base16ct = "1.0.0"
log = "0.4"
lzma-rs = "0.3"
sha2 = "0.10"
sha2 = "0.11"
tar = "0.4"
ureq.workspace = true
3 changes: 2 additions & 1 deletion ovmf-prebuilt/src/fetch.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{Error, Source};
use base16ct::HexDisplay;
use log::info;
use sha2::{Digest, Sha256};
use std::io::{self, Cursor, Read};
Expand Down Expand Up @@ -38,7 +39,7 @@ pub(crate) fn update_cache(source: Source, prebuilt_dir: &Path) -> Result<(), Er
let data = retry(MAX_DOWNLOAD_RETRIES, || download_url(&url))?;

// Validate the hash.
let actual_hash = format!("{:x}", Sha256::digest(&data));
let actual_hash = format!("{:x}", HexDisplay(&Sha256::digest(&data)));
if actual_hash != source.sha256 {
return Err(Error::HashMismatch {
actual: actual_hash,
Expand Down