Skip to content

Commit

Permalink
Merge branch 'aws:main' into pcr-signer
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanjh authored Aug 2, 2024
2 parents 64f4947 + 40288e2 commit 8fae621
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: rustup install ${{ matrix.rust }}
- run: cargo +${{ matrix.rust }} build --verbose
- run: cargo +${{ matrix.rust }} test --verbose
- run: cargo +${{ matrix.rust }} build --workspace
- run: cargo +${{ matrix.rust }} test --workspace
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup component add clippy
- run: cargo clippy
- run: cargo clippy --workspace
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup component add rustfmt
- run: cargo fmt -- --check
- run: cargo fmt --all --check
2 changes: 1 addition & 1 deletion eif_build/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ pub fn build_eif(
let flags = match arch {
"aarch64" => EIF_HDR_ARCH_ARM64,
"x86_64" => 0,
_ => None.expect(format!("Invalid architecture {arch}").as_str()),
_ => panic!("Invalid architecture: {}", arch),
};

let mut build = EifBuilder::new(
Expand Down
6 changes: 3 additions & 3 deletions src/defs/eif_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ mod tests {
#[test]
fn invalid_block_size() {
let hasher = EifHasher::new(31, Sha256::new());
assert_eq!(hasher.is_err(), true);
assert!(hasher.is_err());

let hasher = EifHasher::new(63, Sha512::new());
assert_eq!(hasher.is_err(), true);
assert!(hasher.is_err());

let hasher = EifHasher::new(47, Sha384::new());
assert_eq!(hasher.is_err(), true)
assert!(hasher.is_err())
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/defs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ mod tests {
// so we get an invalid section to cause the error.
bytes[1] = 6;

assert_eq!(EifSectionHeader::from_be_bytes(&bytes).is_err(), true);
assert!(EifSectionHeader::from_be_bytes(&bytes).is_err());
}
}

Expand Down
9 changes: 5 additions & 4 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ use std::collections::BTreeMap;
/// - kernel_file
/// - cmdline string
/// - ramdisks files.
/// TODO:
/// - Unittests.
/// - Add support to write default_mem & default_cpus, flags.
/// - Various validity checks: E.g: kernel is a bzImage.
///
/// TODO:
/// - Unittests.
/// - Add support to write default_mem & default_cpus, flags.
/// - Various validity checks: E.g: kernel is a bzImage.
use std::ffi::CString;
use std::fmt::Debug;
use std::fs::File;
Expand Down

0 comments on commit 8fae621

Please sign in to comment.