Skip to main content

RestoreCommitter

Trait RestoreCommitter 

Source
pub trait RestoreCommitter: Sync {
    // Required methods
    fn prepare<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        secrets: &'life1 RestoredSecrets<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result<PreparedCommit, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn commit<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        secrets: &'life1 RestoredSecrets<'life2>,
        prepared: PreparedCommit,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn abort<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

How a target adopts a restored seed. The seam between this crate and the deployment: SeedStoreCommitter for plain and hardened VTAs, and an enclave implementation in vta-service that seals the seed under KMS.

The two steps are split so the staged restore can record what prepare produced before anything changes which seed the next boot sees.

Required Methods§

Source

fn prepare<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, secrets: &'life1 RestoredSecrets<'life2>, ) -> Pin<Box<dyn Future<Output = Result<PreparedCommit, AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Validate that the target can adopt secrets and compute anything the stage must bind to. Must not change what the next boot starts from.

Source

fn commit<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, secrets: &'life1 RestoredSecrets<'life2>, prepared: PreparedCommit, ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Make the restored seed the one the next boot starts from. After this returns the staged restore opens, and the next boot applies it.

Provided Methods§

Source

fn abort<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The import failed after Self::prepare and before a successful Self::commit: undo whatever prepare did to the running VTA (an enclave freezes its integrity sealer there). The VTA carries on as it was.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§