Skip to content

WIP: crypto: Add a native feature flag#3520

Draft
smalis-msft wants to merge 2 commits into
microsoft:mainfrom
smalis-msft:crypto-native
Draft

WIP: crypto: Add a native feature flag#3520
smalis-msft wants to merge 2 commits into
microsoft:mainfrom
smalis-msft:crypto-native

Conversation

@smalis-msft
Copy link
Copy Markdown
Contributor

Binaries who care about having specifically the native backend need a way to ensure a different backend isn't being silently chosen instead.

Copilot AI review requested due to automatic review settings May 19, 2026 16:26
@smalis-msft smalis-msft requested a review from a team as a code owner May 19, 2026 16:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 native feature in support/crypto, and updates build.rs backend-selection logic to account for it.
  • Updates several crates to enable crypto/native (and in some cases vendored) explicitly.
  • Adjusts openvmm_entry to depend on crypto with native enabled 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 like native), or alternatively make native a default feature in support/crypto/Cargo.toml so 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"] }
Comment thread vm/devices/firmware/firmware_uefi/Cargo.toml
@smalis-msft smalis-msft marked this pull request as draft May 20, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants