Fix IMDSv2 attestation: pass non-null clientPayload to AttestKeyGuardImportKey#6022
Closed
RyAuld wants to merge 1 commit into
Closed
Fix IMDSv2 attestation: pass non-null clientPayload to AttestKeyGuardImportKey#6022RyAuld wants to merge 1 commit into
RyAuld wants to merge 1 commit into
Conversation
The native AttestationClientLib.dll now requires a non-null clientPayload
parameter (at minimum an empty JSON object) when calling
AttestKeyGuardImportKey. Passing null results in error code -8
(ERRORINVALIDINPUTPARAMETER) with the native log message:
'Error parsing the client payload Json'.
This was confirmed by direct P/Invoke testing on the MSIV2 VM where
passing '{}' succeeds while null fails.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a regression in the Key Attestation interop used by IMDSv2 managed identity (mTLS PoP with attestation) by ensuring the native attestation call receives a non-null JSON payload, matching updated AttestationClientLib.dll input requirements.
Changes:
- Pass
"{}"(minimal valid JSON) instead ofnullfor theclientPayloadparameter when callingAttestKeyGuardImportKey.
Member
|
Hmm, strange. That contract was tested extensively. Let's have @gladjohn have a look. |
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.
Problem
All 4 ManagedIdentityImdsV2Tests (mTLS PoP with attestation) have been failing since May 20 with:
AADSTS1000901: certificate 'token_not_after' extension has expired
Root Cause
The native AttestationClientLib.dll now requires the clientPayload parameter to be a valid JSON string (at minimum "{}"). Passing null causes error code -8 (ERRORINVALIDINPUTPARAMETER) with native log: "Error parsing the client payload Json"
Confirmed by direct P/Invoke testing on the MSIV2 VM:
Fix
Pass "{}" instead of null for the clientPayload parameter in AttestationClient.Attest().
Testing
Verified on MSIV2 VM as dcadmin (same user as ADO agent) - attestation succeeds and returns a valid token with correct timestamps.