-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: automatically install test-certificate and validate they are installed on LocalMachine for signtool-verify
tasks
#232
Open
wmmc88
wants to merge
12
commits into
microsoft:main
Choose a base branch
from
wmmc88:stricter-signing-verification
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
wmmc88
commented
Oct 8, 2024
wmmc88
commented
Oct 9, 2024
Signed-off-by: Melvin Wang <melvin.mc.wang@gmail.com>
wmmc88
changed the title
feat: use stricter verification policy for
feat: automatically install test-certificate and validate they are installed on LocalMachine for Oct 9, 2024
signtool-verify
task to align with Windows requirementssigntool-verify
tasks
wmmc88
commented
Oct 12, 2024
pub fn install_certificate_condition_script() -> anyhow::Result<()> { | ||
condition_script(|| { | ||
if is_wdrlocaltestcert_installed()? { | ||
let cargo_make_task_name = env::var(CARGO_MAKE_CURRENT_TASK_NAME_ENV_VAR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cargo make needs uprev to min 0.37.22 to get bugfix
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.
Users often make the mistake of installing the test-signed certificate to
Current User
store instead ofLocal Machine
. Thesigntool-verify
cargo-make tasks were originally added to help diagnose these issues.Using
/kp
withsigntool
to validate kernel signing policy is not possible since the test-cert will terminate at a root that isn't trusted by windows: https://learn.microsoft.com/en-us/windows-hardware/drivers/install/test-signing . Using/pa
is not sufficient since it will pass even when the certificate is only installed inCurrent User
. Additional checks were added to make sure that on top of/pa
passing, the certificate is also installed in theLocal Machine
storesCertificate Management Enhancements:
rust-driver-makefile.toml
file. This includes theinstall-certificate
andvalidate-certificate-installed
tasks, which ensure that theWDRLocalTestCert
certificate is correctly installed and validated per Windows requirements. (crates/wdk-build/rust-driver-makefile.toml
) [1] [2]cargo_make.rs
for handling certificate installation, validation, and checking if the process is running with admin privileges. (crates/wdk-build/src/cargo_make.rs
)README.md
to include instructions for installing and validating certificates. (README.md
)Workflow and Utility Enhancements:
WDK_BUILD_ENABLE_SIGNTOOL_VERIFY
for signature verification. (.github/workflows/build.yaml
)utils.rs
for checking admin privileges using Windows APIs. (crates/wdk-build/src/utils.rs
)closes microsoft/Windows-rust-driver-samples#30