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:
- Introduced SocketError: an enum that encompasses all the error values returned by the GP TEE Sockets API.
- 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.
- Introduced TcpAdapter and UdpAdapter for OP-TEE: using them to construct TcpStream and UdpSocket.
You can check this commit at my fork for details
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:
You can check this commit at my fork for details