Skip to content

Proposal: optee-utee: support no-std net. #162

@ivila

Description

@ivila

Background

Currently, Teaclave has a net module provided by mssun (#31) four years ago, which can only be accessed in a std environment. However, during my development, I frequently perform HTTP requests to the REE (some services inside Kubernetes) from within the TEE. At present, I am using unsafe and optee_utee_sys directly. However, I believe it would be more elegant for Teaclave to officially support no_std TcpStream and hide the unsafe code and optee_utee_sys from developers.

Proposal

The changes are quite small, so I'll just summarize them:

  1. Introduced SocketError: an enum that encompasses all the error values returned by the GP TEE Sockets API.
  2. Introduced Socket struct and SocketAdapter trait: The Socket struct handles socket operations (open, send, recv), while SocketAdapter accommodates various implementations of the GP TEE Sockets API.
  3. Introduced TcpAdapter and UdpAdapter for OP-TEE: using them to construct TcpStream and UdpSocket.

You can check this commit at my fork for details

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions