Patch rats refactor #1
No need to call this out
No need to re-export it, if anything I want it to be known it's coming from chain, that way people know where to look for it.
For example here:
sev::attestation::verifier::sev::chain::infer_generation
Let's me know we are inferring from the chain and not from some native sev function
Hey Katherine,
Thank you for the PR — I've been thinking about it all day.
I think moving the TryFrom impl to the verifier was the right call; great catch on your part. I'm less sure about replacing TryFrom with infer_generation.
My concern is that anyone already using Generation::try_from(&chain) would have to migrate to infer_generation. Losing the idiomatic Rust conversion feels worse to me than the silent disappearance of the trait when verifier isn't enabled.
After thinking about it more, I assume this is mostly used internally and in tests. Ideally we'd move this behavior into the test layer altogether. The function verifies a CEK against our built-in ASKs to infer the generation — if someone is doing that in production, they probably have a bigger problem. It feels like automation glue, not something people should rely on.
So changing TryFrom to infer_generation is OK for now; I think we're the only ones consuming it anyway.
I don't want to spend much time on legacy SEV — it's not what we're developing for anymore, and I'm not looking to polish that API further. Since this looks internal-only, I'm fine with the rename for now, even though I'm generally not a fan of changes that might break downstream behavior.
Same with the reqwest change: I don't think many users care, because I don't think anyone runs dangerous_hw_tests outside our CI. Not a big deal to change it, but probably low impact either way.
One small request: please drop the re-export of infer_generation from verifier/sev/mod.rs. If someone uses it, I'd rather they import it from the chain module explicitly. Also remove the comment in endorser about where infer_generation lives — I don't think we need that.
Otherwise, great work on the CI fixes. Even if we're the main consumers of those tests, we should still lint them properly — I definitely missed things there.
If you can make those two quick fixes, I'll merge into my branch and apply the other changes we discussed.
Removed, but also changed mod chain; to pub(crate) mod chain; since a private module isn't reachable from a sibling, and pub(crate) mod reopens it crate-internally without duplicating the function's cfg gate on a re-export, so util::cached_chain can use it.
Since this is kind of weird, I'm also ok with keeping it where it is but changing it back from infer_generation to TryFrom.
Ok this was my bad, small hiccup in my general understanding on rust visibility. I'm ok with the re-export in this scenario. So we can add back the pub use self::chain::infer_generation. Sorry for the confusion!
Or keep the try_From I'm ok with either
DGonzalezVillal
amd-kkin
Remove circular dependency for verifier-sev path
endorserandverifierwere mutually dependent:impl TryFrom<&cert::Chain> for Generationlived inendorserbut called.verify()from the verifier'sVerifiabletrait. Because neither role could build without the other,lib.rscarried acompile_error!forcing consumers to enable both, and firmware/platform needed quadruple #[cfg] gates. Moving the impl toverifier/sev/chain.rsfromendorsermakes the dependency one-way (verifier → endorser). Also, endorser = ["evidence"] was spurious in the original PR; endorser never referenced evidence in code, only in doc comments. This commit let's endorser = [] drop its spurious evidence edge, and collapses the gates.Clean up builds requiring different features
The previous commit made endorser-only builds reachable for the first time, which helped discover that they were broken. The moved impl was still feature-gated, so
Generation::try_from(&chain)silently vanished withoutverifier, failing with an unsatisfied trait bound on a type the caller never wrote. Replaces it withverifier::sev::infer_generation(), so a missing feature yields an unresolved path naming the module to enable. Also dropstype Error = ()for a realio::Error, and repairscached_chain.rs, which had a stale import predating this work.Add feature isolation tests
Nothing in CI ever compiled a role by itself; every job enabled
evidence,verifier,endorser,referencetogether, so cross-role reaches stayed invisible, which is also howcached_chain.rsrotted unnoticed. Adds a feature-isolation job covering each role alone (19 combos × 2 toolchains). Building the matrix surfaced a live bug: launch::sev requiresverifier, but launch/linux/sev.rswas gated on sev alone, sosev,launch,endorserfailed with an unresolved import — now a clear compile_error!.Use rustls for reqwest so crypto-rust builds without OpenSSL
The clippy-crypto-rust CI job did not build at all.
dangerous_hw_testspulls inreqwest, whose defaultnative-tlslinksopenssl-sys— dragging OpenSSL into the very build that job exists to prove is OpenSSL-free. Switching to default-features = false + rustls-tls removes openssl-sys from the graph entirely.Fix test cfg gates and extend feature isolation to all targets
The isolation job ran --lib, because tests/ was itself broken — leaving the same class of bug uncovered there. Four files had #[cfg] gates that didn't match their imports: measurement.rs and id-block.rs used reference without requiring it; certs.rs gated on any-of-five-roles while needing both endorser and verifier; snp_launch.rs imported PageType from launch instead of launch::snp. With those fixed, the job moves to
--all-targets, so test-gate drift now fails CI. Test name lists are unchanged in all six CI configurations — the gates exclude only what genuinely needs the missing feature.