LAInitiator_Protobuf.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // Created by miti on 2019-12-21.
  3. //
  4. #ifndef VERIFIER_LAINITIATOR_PROTOBUFINTERFACE_H
  5. #define VERIFIER_LAINITIATOR_PROTOBUFINTERFACE_H
  6. #include "sgx_eid.h"
  7. #define __STDC_FORMAT_MACROS
  8. #include <inttypes.h>
  9. #include "ProtobufLAMessages.h"
  10. #include <stdio.h>
  11. #include "sgx_trts.h"
  12. #include "sgx_utils.h"
  13. #include "error_codes.h"
  14. #include "sgx_ecp_types.h"
  15. #include "sgx_thread.h"
  16. #include <map>
  17. #include "sgx_dh.h"
  18. #include "dh_session_protocol.h"
  19. #include "sgx_tcrypto.h"
  20. #include "datatypes.h"
  21. #include "Initiator_Transforms.h"
  22. #define MAX_SESSION_COUNT 16
  23. #define SGX_CAST(type, item) ((type)(item))
  24. #include <string.h>
  25. #include "crypto.h"
  26. #include "stdio.h"
  27. // For socket programming
  28. #include <arpa/inet.h>
  29. #include <sys/socket.h>
  30. #include <netinet/in.h>
  31. class LAInitiator_Protobuf {
  32. sgx_dh_session_t sgx_dh_session;
  33. dh_session_t global_session_info;
  34. ProtobufMessageRW protobufReaderWriter;
  35. uint32_t process_protobuf_dh_msg3(protobuf_sgx_dh_msg3_t& protobuf_msg3, uint32_t* session_id);
  36. uint32_t process_protobuf_dh_msg1_generate_protobuf_dh_msg2(protobuf_sgx_dh_msg1_t& protobuf_msg1, protobuf_sgx_dh_msg2_t& protobuf_msg2, uint32_t* session_id);
  37. public:
  38. uint32_t conduct_la();
  39. uint32_t get_la_symmetric_key(uint8_t* key);
  40. };
  41. // TODO: Get them to take in lists as inputs and change verifier's code too to put in elements into a list.
  42. // TODO: Revert php code back by two commits (before rollback) and edit from there.
  43. // TODO: Also get the decryptor codebase in sync with this format of sgx/protobuf files.
  44. #endif //LAINITIATOR_PROTOBUFINTERFACE_H