MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / tdx_quote

Method tdx_quote

guest-agent/src/rpc_service.rs:518–543  ·  view source on GitHub ↗
(self, request: TdxQuoteArgs)

Source from the content-addressed store, hash-verified

516 }
517
518 async fn tdx_quote(self, request: TdxQuoteArgs) -> Result<TdxQuoteResponse> {
519 let hash_algorithm = if request.hash_algorithm.is_empty() {
520 DEFAULT_HASH_ALGORITHM
521 } else {
522 &request.hash_algorithm
523 };
524 let prefix = if hash_algorithm == "raw" {
525 "".into()
526 } else {
527 QuoteContentType::AppData.tag().to_string()
528 };
529 let content_type = if request.prefix.is_empty() {
530 QuoteContentType::AppData
531 } else {
532 QuoteContentType::Custom(&request.prefix)
533 };
534 let report_data =
535 content_type.to_report_data_with_hash(&request.report_data, &request.hash_algorithm)?;
536 let response = self.state.quote_response(report_data)?;
537 Ok(TdxQuoteResponse {
538 quote: response.quote,
539 event_log: response.event_log,
540 hash_algorithm: hash_algorithm.to_string(),
541 prefix,
542 })
543 }
544
545 async fn raw_quote(self, request: RawQuoteArgs) -> Result<TdxQuoteResponse> {
546 self.tdx_quote(TdxQuoteArgs {

Callers 2

raw_quoteMethod · 0.45
quote_responseMethod · 0.45

Calls 4

tagMethod · 0.80
is_emptyMethod · 0.45
quote_responseMethod · 0.45

Tested by

no test coverage detected