Open
Conversation
Add new quote module (src/migtd/src/quote.rs) that centralizes TD quote generation with exponential backoff retry (5s initial, up to 9 attempts). This handles the race where an impactless security update invalidates a TD REPORT generated before the update then sent for quote generation. Replace direct attestation::get_quote + tdcall_report calls with quote::get_quote_with_retry in three call sites: - mig_policy.rs: local TCB info initialization - ratls/server_client.rs: RA-TLS quote generation - spdm/mod.rs: SPDM quote generation, also changed error return to MigrationAttestationError for failed quote generation, consistent with RA-TLS. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
jyao1
reviewed
Mar 18, 2026
| const INITIAL_DELAY_MS: u64 = 5000; | ||
|
|
||
| /// Maximum number of attempts before giving up | ||
| const MAX_ATTEMPTS: u32 = 9; // Total wait time up to ~21 minutes with 5s initial delay |
Contributor
There was a problem hiding this comment.
@bodzhang , please review this and ensure 21 minutes is OK.
jyao1
reviewed
Mar 18, 2026
| e, | ||
| delay_ms | ||
| ); | ||
| delay_milliseconds(delay_ms); |
Contributor
There was a problem hiding this comment.
I am OK with the retry.
@haitaohuang, Question on validation: Do we have test to trigger the retry flow, and ensure it works as expected?
Contributor
Author
There was a problem hiding this comment.
I did test on a lab blade where getQuote fails and the mechanism worked as expected. Also had a mock test that add a forced failure on first try in my branch but took out because I did not want to mix with production code and make it harder to read. If you want, I can add back.
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.
Add new quote module (src/migtd/src/quote.rs) that centralizes TD quote generation with exponential backoff retry (5s initial, up to 9 attempts). This handles the race where an impactless security update invalidates a TD REPORT generated before the update then sent for quote generation.
Replace direct attestation::get_quote + tdcall_report calls with quote::get_quote_with_retry in three call sites: