rust/pv_core: Attestation support

Add functionality for:

* sending attestation requests to the uvdevice and retrieve the
  response
* create/read the attestation exchange format file format

Acked-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Steffen Eiden
2024-02-23 16:31:55 +01:00
parent e152b554f5
commit b7765993e2
6 changed files with 356 additions and 12 deletions
+13 -1
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
//
// Copyright IBM Corp. 2023
// Copyright IBM Corp. 2023, 2024
/// Result type for this crate
pub type Result<T, E = Error> = std::result::Result<T, E>;
@@ -49,6 +49,18 @@ pub enum Error {
#[error("Input contains unsupported user-data type: {0:#06x}")]
UnsupportedUserData(u16),
#[error("The input has not the correct format: {field} is too large. Maximal size {max_size}")]
AttDataSizeLarge { field: &'static str, max_size: u32 },
#[error("The input has not the correct format: {field} is too small. Minimal size {min_size}")]
AttDataSizeSmall { field: &'static str, min_size: u32 },
#[error("The attestation request has an unknown algorithm type (.0)")]
BinArcbInvAlgorithm(u32),
#[error("The attestation request does not specify a measurement size or measurement data.")]
BinArcbNoMeasurement,
// errors from other crates
#[error(transparent)]
Io(#[from] std::io::Error),