12345678910111213141516171819202122232425262728293031323334 |
- #include <sys/socket.h>
- #include <stdlib.h>
- #include <netinet/in.h>
- #include <string.h>
- #include <errno.h>
- #include <unistd.h>
- #include <stdio.h>
- #include "ProtobufLAMessages.pb.h"
- #include <google/protobuf/io/coded_stream.h>
- #include <google/protobuf/io/zero_copy_stream_impl.h>
- using namespace google::protobuf::io;
- #include "protobufLAInitiator.h"
- #include "../Decryptor/Decryptor_u.h"
- #include <iostream>
- class LocalAttestationUntrusted {
- static uint32_t session_id;
- static protobuf_sgx_dh_msg1_t protobuf_msg1;
- static int decrypt_client_data(uint32_t own_enclave_id, int apache_fd);
- static uint32_t local_attestation_msg2_msg3(uint32_t own_enclave_id, int accept_fd);
- // uint32_t LocalAttestationUntrusted::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);
- };
|