Skip to content
Merged
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
24 changes: 12 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,30 +944,30 @@ async fn generate_kernel_hash() -> Result<(), std::io::Error> {

copy(&mut file, &mut hasher)?;
let hash_bytes = hasher.finalize();
let slice_len = hash_bytes.as_slice().len();
let slice_len = hash_bytes.len();

Lazy::force_mut(&mut dyn_image_measure).kernel_hashes[i][0..slice_len]
.copy_from_slice(hash_bytes.as_slice());
.copy_from_slice(hash_bytes.as_ref());
}
SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA_384 => {
let mut hasher = Sha384::new();

copy(&mut file, &mut hasher)?;
let hash_bytes = hasher.finalize();
let slice_len = hash_bytes.as_slice().len();
let slice_len = hash_bytes.len();

Lazy::force_mut(&mut dyn_image_measure).kernel_hashes[i][0..slice_len]
.copy_from_slice(hash_bytes.as_slice());
.copy_from_slice(hash_bytes.as_ref());
}
SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA_512 => {
let mut hasher = Sha512::new();

copy(&mut file, &mut hasher)?;
let hash_bytes = hasher.finalize();
let slice_len = hash_bytes.as_slice().len();
let slice_len = hash_bytes.len();

Lazy::force_mut(&mut dyn_image_measure).kernel_hashes[i][0..slice_len]
.copy_from_slice(hash_bytes.as_slice());
.copy_from_slice(hash_bytes.as_ref());
}
_ => continue,
};
Expand Down Expand Up @@ -1008,30 +1008,30 @@ async fn generate_app_hash() -> Result<(), std::io::Error> {

copy(&mut file, &mut hasher)?;
let hash_bytes = hasher.finalize();
let slice_len = hash_bytes.as_slice().len();
let slice_len = hash_bytes.len();

Lazy::force_mut(&mut dyn_image_measure).app_hashes[i][0..slice_len]
.copy_from_slice(hash_bytes.as_slice());
.copy_from_slice(hash_bytes.as_ref());
}
SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA_384 => {
let mut hasher = Sha384::new();

copy(&mut file, &mut hasher)?;
let hash_bytes = hasher.finalize();
let slice_len = hash_bytes.as_slice().len();
let slice_len = hash_bytes.len();

Lazy::force_mut(&mut dyn_image_measure).app_hashes[i][0..slice_len]
.copy_from_slice(hash_bytes.as_slice());
.copy_from_slice(hash_bytes.as_ref());
}
SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA_512 => {
let mut hasher = Sha512::new();

copy(&mut file, &mut hasher)?;
let hash_bytes = hasher.finalize();
let slice_len = hash_bytes.as_slice().len();
let slice_len = hash_bytes.len();

Lazy::force_mut(&mut dyn_image_measure).app_hashes[i][0..slice_len]
.copy_from_slice(hash_bytes.as_slice());
.copy_from_slice(hash_bytes.as_ref());
}
_ => continue,
};
Expand Down
Loading