Bump aws-nitro-enclaves-image-format to 0.7.0 to pick up sha2 0.10 - #260
Bump aws-nitro-enclaves-image-format to 0.7.0 to pick up sha2 0.10#260Matt (matt-evervault) wants to merge 1 commit into
Conversation
Alternative to #254, which got onto sha2 0.10 by dropping aws-nitro-enclaves-image-format and reimplementing EifHasher::tpm_extend_finalize_reset inline in get_cert_pcr. aws-nitro-enclaves-image-format 0.6.0 moved to sha2 0.10, so bumping the library gets us off sha2 0.9 without owning the PCR8 calculation ourselves. cert/mod.rs is unchanged. Upstream's eif_hasher.rs is byte-identical between 0.2.0 and 0.7.0 apart from an added FixedOutputReset trait bound (sha2 0.10 split Digest::finalize_reset into that trait), so PCR8 output does not change. Note: this cannot merge until attestation-doc-validation gains a catch-all arm in its CoseError match. 0.6.0+ enables the key_kms feature on aws-nitro-enclaves-cose, which adds three CoseError variants, and attestation-doc-validation matches exhaustively. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Vaultkeeper Commands Mention
You can also request |
|
The prerequisite fix is now up as a draft: evervault/attestation-doc-validation#202 — it adds the catch-all arm to the Once that lands and is released, this PR also needs That looked like it might be a painful three-minor-version jump, but the API surface we actually use is unchanged between 0.7.4 and 0.10.1 — |
Alternative to #254, following review feedback there.
Approach
#254 got us onto
sha20.10 by droppingaws-nitro-enclaves-image-formatand reimplementingEifHasher::tpm_extend_finalize_resetinline inget_cert_pcr. That means owning the PCR8 calculation ourselves, which is what we least want to hand-maintain.aws-nitro-enclaves-image-format0.6.0 (Feb 2026) moved tosha2 = "0.10", and 0.7.0 (Aug 2026) keeps it. Bumping the library gets us offsha20.9 with no changes to our hashing code at all.Changes
aws-nitro-enclaves-image-format:0.2.0→0.7.0sha2:0.9.9→0.10.9Cargo.lockregeneratedNo source changes —
crates/ev-enclave/src/cert/mod.rsis untouched.PCR8 output is unchanged
I diffed upstream's
src/defs/eif_hasher.rsbetween 0.2.0 and 0.7.0. The only differences:FixedOutputResettrait bound onEifHasher<T>, required becausesha20.10 splitDigest::finalize_resetout into that traitassert_eq!(x, true)→assert!(x)in upstream's own unit testsinitial_digest, the block accumulation inwrite, andtpm_extend_finalize_resetare byte-for-byte identical:new_without_cacheandtpm_extend_finalize_resetkeep the same signatures, soget_cert_pcrcompiles unchanged and produces identical PCR8 values.aws-nitro-enclaves-image-format0.6.0+ declares itsaws-nitro-enclaves-cosedependency withfeatures = ["key_kms"]. Cargo features are additive and unified across the dependency graph, so enabling it here enables it for every consumer ofaws-nitro-enclaves-cose. That adds three variants toCoseError, andattestation-doc-validationmatches on it exhaustively:I checked the published sources: both
0.7.4(what we pin) and0.10.1(latest) have the exhaustive match, so no released version compiles withkey_kmsenabled.The fix is one arm in
attestation-doc-validation/src/nsm/error.rs:I verified this is the only blocker: with a locally patched
attestation-doc-validation0.7.4 via[patch.crates-io],cargo buildandcargo nextest run -p ev-cli -p ev-enclaveboth pass on this branch. That patch is not committed here.So the sequence is:
attestation-doc-validationand release itattestation-doc-validationin this repo to the released versionDependency-tree tradeoff
The
key_kmsfeature pulls in the AWS SDK:aws-config,aws-sdk-kms,aws-sdk-sts/sso/ssooidc,aws-sigv4and theaws-smithy-*stack.Net effect on
Cargo.lockis 512 → 535 packages (+23). Not a pure addition — the bump also drops stale duplicates that 0.2.0 was holding:sha2 0.9.9,digest 0.9.0,block-buffer 0.9.0,clap 3.2.25,clap_lex 0.2.4,crc 1.8.1,build_const,os_str_bytes,strsim 0.10.0,termcolor,winapi-utilnum-derive0.3.3 → 0.4.2We lose the duplicate
clap 3andsha2/digest0.9 trees and gain the KMS SDK. If pulling the KMS SDK into the CLI is the bigger concern, that is worth weighing against #254's approach — happy to go either way.Version constraints checked
Three constraints in 0.7.0, all fine for us today:
rust-version = "1.94.1". Every CI job usestoolchain: stableand the workspace pins no MSRV; current stable is 1.97.x.litemap = "=0.7.4"andzerofrom = "=0.1.5". We already resolve to exactly those, so nothing moves.aws-config <=1.1andaws-sdk-kms <=1.20. We have no otheraws-sdk-*dependencies, so nothing conflicts.If 1.94.1 is too aggressive an MSRV, 0.6.0 is a drop-in fallback — it also uses
sha20.10 and declaresrust-version = "1.88". It enableskey_kmstoo, so the blocker above applies either way.Local verification
Run with
[patch.crates-io]pointingattestation-doc-validationat a locally patched 0.7.4 (the catch-all arm above). The patch is not part of this branch.cargo build— passescargo nextest run -p ev-cli -p ev-enclave --no-fail-fast— 81 tests, 78 passed, 3 failedThe 3 failures are
test_choose_output_dir,test_get_eif_sizeandtest_reproducible_enclave_builds_with_pinned_version. All three need a Docker daemon (test_get_eif_sizefails withDockerError(DaemonNotRunning)) and there is no Docker on the machine I ran this on. I confirmed they are pre-existing by checking out unmodifiedmainin the same worktree and running just those three: 0 passed, 3 failed, identical. CI provides Docker, so these should pass there.aws_nitro_enclaves_image_formatis imported in exactly one place in the workspace —crates/ev-enclave/src/cert/mod.rs:1— so nothing else in the tree touches the bumped library.