Skip to content

Fix RatlsError to MigrationResult conversion in RATLS setup#766

Open
haitaohuang wants to merge 2 commits intointel:mainfrom
haitaohuang:ratls_error
Open

Fix RatlsError to MigrationResult conversion in RATLS setup#766
haitaohuang wants to merge 2 commits intointel:mainfrom
haitaohuang:ratls_error

Conversation

@haitaohuang
Copy link
Contributor

Use the From for MigrationResult conversion instead of hardcoding SecureSessionError when ratls::client(), ratls::server(), and ratls::server_rebinding() fail. This ensures errors like GetQuote and TdxModule are mapped to MutualAttestationError and TdxModuleError respectively.

Also map RatlsError::InvalidPolicy to InvalidPolicyError instead of SecureSessionError.

Use the From<RatlsError> for MigrationResult conversion instead of
hardcoding SecureSessionError when ratls::client(), ratls::server(),
and ratls::server_rebinding() fail. This ensures errors like GetQuote
and TdxModule are mapped to MutualAttestationError and TdxModuleError
respectively.

Also map RatlsError::InvalidPolicy to InvalidPolicyError instead of
SecureSessionError.

Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
@haitaohuang haitaohuang requested a review from jyao1 as a code owner March 26, 2026 19:47
Change gen_quote_spdm() to return MutualAttestationError instead of
Unsupported when get_quote() fails, consistent with the RATLS path
where RatlsError::GetQuote maps to MutualAttestationError.

Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
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.

1 participant