WIP: crypto: Add a native feature flag#3520
Draft
smalis-msft wants to merge 2 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a crypto/native feature flag intended to prevent consumers from accidentally building against an unintended crypto backend by requiring an explicit backend choice.
Changes:
- Introduces a new
nativefeature insupport/crypto, and updatesbuild.rsbackend-selection logic to account for it. - Updates several crates to enable
crypto/native(and in some casesvendored) explicitly. - Adjusts
openvmm_entryto depend oncryptowithnativeenabled and updates metadata comments accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vm/vmgs/vmgstool/Cargo.toml | Extends the encryption feature to force crypto/native (and vendored). |
| vm/vmgs/vmgs_lib/Cargo.toml | Enables crypto/native (and vendored) on the crypto dependency. |
| vm/devices/firmware/firmware_uefi/Cargo.toml | Pins crypto to the native feature and adds a TODO comment. |
| support/crypto/build.rs | Adds native to backend feature detection and changes backend-selection failure behavior. |
| support/crypto/Cargo.toml | Defines the new native feature. |
| openvmm/openvmm_entry/Cargo.toml | Makes crypto non-optional and enables native; updates a metadata comment. |
Comments suppressed due to low confidence (1)
support/crypto/build.rs:1
- This changes the contract from 'no backend selected => pick platform default' to 'no backend selected => hard error'. That’s a breaking behavior change (especially for transitive dependents) and is stricter than the PR description implies (it asks for a way for binaries that care, not a new requirement for everyone). Consider restoring the previous default-selection behavior when
backend_count == 0(treat it likenative), or alternatively makenativea default feature insupport/crypto/Cargo.tomlso existing dependents continue to build without needing an explicit feature.
// Copyright (c) Microsoft Corporation.
|
|
||
| [dependencies] | ||
| crypto = { workspace = true, features = ["vendored"] } | ||
| crypto = { workspace = true, features = ["native", "vendored"] } |
| clap_dyn_complete.workspace = true | ||
| console_relay.workspace = true | ||
| crypto = { workspace = true, optional = true } | ||
| crypto = { workspace = true, features = ["native"] } |
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.
Binaries who care about having specifically the native backend need a way to ensure a different backend isn't being silently chosen instead.