RFC: crypto: Rework backend selection to be more strict#3569
Open
smalis-msft wants to merge 12 commits into
Open
RFC: crypto: Rework backend selection to be more strict#3569smalis-msft wants to merge 12 commits into
smalis-msft wants to merge 12 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens support/crypto backend selection so builds explicitly choose a crypto backend, while introducing an escape hatch to keep workspace-wide developer/CI workflows workable.
Changes:
- Added
crypto/nativeandcrypto/allow-multiple-backendsfeatures, and reworkedsupport/crypto/build.rsto enforce explicit backend selection (with a warning-based fallback when multiple backends are allowed). - Updated select crates to explicitly choose backends (e.g.,
openvmm_entryusesnative, UEFI fuzz usesrust) and adjusted VMGS-related crates to include backend + vendoring features. - Updated Flowey/CI configuration to account for the stricter backend selection and renamed CI test labels from “none” to “native”; added
rust-analyzer.tomlto enable the multi-backend escape hatch for analysis.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| xtask/src/tasks/fuzz/html_coverage.rs | Tweaks coverage filtering for fuzz HTML report generation. |
| vm/vmgs/vmgstool/Cargo.toml | Makes encryption feature select a crypto backend (native) and vendoring. |
| vm/vmgs/vmgs_lib/Cargo.toml | Pins crypto dependency to native + vendored. |
| vm/devices/firmware/firmware_uefi/fuzz/Cargo.toml | Switches fuzz target to the crypto/rust backend. |
| support/crypto/Cargo.toml | Adds allow-multiple-backends and native features; clarifies Linux “native” backend note. |
| support/crypto/build.rs | Implements strict backend selection logic and new escape hatch behavior. |
| rust-analyzer.toml | Ensures rust-analyzer enables crypto/allow-multiple-backends for workspace analysis. |
| openvmm/openvmm_entry/Cargo.toml | Forces openvmm_entry to select the native crypto backend; updates unused-deps note. |
| flowey/flowey_lib_hvlite/src/build_nextest_unit_tests.rs | Adjusts nextest feature sets to accommodate stricter crypto backend selection. |
| flowey/flowey_lib_hvlite/src/_jobs/check_clippy.rs | Adjusts clippy feature sets and removes special-case exclusion of crypto. |
| ci-flowey/openvmm-pr.yaml | Updates pipeline labeling from crypto “none” to “native”. |
| .github/workflows/openvmm-pr.yaml | Regenerated workflow reflecting updated crypto test labeling. |
| .github/workflows/openvmm-pr-release.yaml | Regenerated workflow reflecting updated crypto test labeling. |
| .github/workflows/openvmm-ci.yaml | Regenerated workflow reflecting updated crypto test labeling. |
|
|
||
| // If no backends are enabled, abort. Binaries must choose a backend. | ||
| if backend_count == 0 { | ||
| panic!("No crypto backend enabled. Enable one in your binary's dependencies."); |
Contributor
Author
There was a problem hiding this comment.
Yeah I know, thinking about this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this PR I'm trying to thread the needle between two slightly contradictory goals:
To accomplish this I've come up with the following protocol:
cargo build --workspacecan still succeed. Nothing depends on this crate, and nothing ever should.I'm hoping that this flow will allow all common developer commands to continue working, while ensuring that we don't accidentally produce an insecure binary.