#include #include #include #include #include #include #include #include "ProtobufLAMessages.pb.h" #include #include using namespace google::protobuf::io; #include "protobufLAInitiator.h" #include "../Decryptor/Decryptor_u.h" #include class LocalAttestationUntrusted { static uint32_t session_id; static protobuf_sgx_dh_msg1_t protobuf_msg1; static uint8_t* output_ciphertext_plus_tag; static int decrypt_client_data(uint32_t own_enclave_id, int apache_fd, uint8_t* output_ciphertext_plus_tag, uint8_t* input_ciphertext_plus_tag, int time_fd); static uint32_t local_attestation_msg2_msg3(uint32_t own_enclave_id, int accept_fd); static int write_protobuf_msg_to_fd(int accept_fd, google::protobuf::MessageLite& message); static int read_protobuf_msg_from_fd(int accept_fd, google::protobuf::MessageLite& message); static int set_up_socket(int port, sockaddr_in* address); public: static int setup_socket_for_local_attestation_requests(int port); static int prepare_local_attestation_as_responder_msg1(uint32_t own_enclave_id); static int local_attestation_as_responder_msg2_msg3(uint32_t own_enclave_id, int server_fd, int * accept_fd); static int post_local_attestation_with_verifier(uint32_t own_enclave_id, int apache_fd); static int post_local_attestation_with_apache(uint32_t own_enclave_id, int apache_fd); };