()
| 533 | } |
| 534 | |
| 535 | fn read_vsock_port() -> Result<u32> { |
| 536 | let content = match fs::read_to_string(TDX_ATTEST_CONFIG_PATH) { |
| 537 | Ok(c) => c, |
| 538 | Err(_) => return Ok(0), |
| 539 | }; |
| 540 | |
| 541 | for line in content.lines() { |
| 542 | let line = line.trim(); |
| 543 | if line.starts_with('#') { |
| 544 | continue; |
| 545 | } |
| 546 | if let Some(rest) = line.strip_prefix("port") { |
| 547 | let rest = rest.trim_start(); |
| 548 | if let Some(rest) = rest.strip_prefix('=') { |
| 549 | let port_str = rest.trim(); |
| 550 | if let Ok(port) = port_str.parse::<u32>() { |
| 551 | return Ok(port); |
| 552 | } |
| 553 | } |
| 554 | } |
| 555 | } |
| 556 | |
| 557 | Ok(0) |
| 558 | } |
| 559 | |
| 560 | /// Build QGS get_quote request message |
| 561 | /// |
no outgoing calls
no test coverage detected