Skip to content

Remote Attestation Refactoring #2608

@jul-sh

Description

@jul-sh

There's some opportunity for refactoring our remote attestation implementation, this issue is meant to track aspects that could be improved. It's worth noting that we currently support remote attestation over both unary and bidi-streaming gRPC. We plan to remove support for attestations over bidi-streaming gRPC in the future. It'll be easiest to tackle these issues once that has happened.

Probable refactoring opportunities:

  • Overlap between the Handshaker & Encryptor struct, both of which can represent the same state. See discussion on Implement Server Side Unary Remote Attestation #2596: (relevant comment)
  • The Handshaker maintains duplicate handshake state in a transcript key and state enum, which are implicitly expected to have the same state. It'd be nice to deduplicate this, to increase resilience to future changes and prevent unexpected behavior.
  • Shared configuration state is cloned into each Handshaker. Cloning shared state may lead to issues down the road when state changes may not be in all clones. It'd be nice to use references instead. Ref: Stop cloning additional_info into each ServerHandshaker #2574
  • The handshaker exposes next_step method that optionally returns a next step (if not completed) and a is_completed method. They're expected to behave the same, if is_completed returns false next_step should return None. However with future changes that may not be the case, which would lead to infinite loops in our client implementation: link. It'd be nice to simplify the API of Handshaker in that regard. Ref Implement unary request client #2607
  • Attestation clients expose an inconsistent send method, which expects a proto instance as an argument but returns a serialized proto. See [this chat thread for more details], and also this PR: Implement unary request client #2607

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions