Browse Source

Made some header files into a common folder and renamed the .h autogenerated protobuf file to .pb.h

dettanym 2 years ago
parent
commit
ea6e42ac95
6 changed files with 3 additions and 96 deletions
  1. 0 26
      include/LA.h
  2. 1 0
      include/LA.h
  3. 0 19
      include/ProtobufMessageRW.h
  4. 1 0
      include/ProtobufMessageRW.h
  5. 0 51
      include/Transforms.h
  6. 1 0
      include/Transforms.h

+ 0 - 26
include/LA.h

@@ -1,26 +0,0 @@
-//
-// Created by miti on 2019-12-21.
-//
-#ifndef VERIFIER_LA_H
-#define VERIFIER_LA_H
-#include "ProtobufMessageRW.h"
-#include "ProtobufLAMessages.h"
-
-struct _sgx_dh_session_t;
-typedef _sgx_dh_session_t sgx_dh_session_t;
-
-class LA {
-    sgx_dh_session_t* sgx_dh_session;
-    // dh_session_t global_session_info;
-    ProtobufMessageRW protobufReaderWriter;
-    uint8_t key[16];
-    uint32_t process_protobuf_dh_msg3(protobuf_sgx_dh_msg3_t& protobuf_msg3);
-    uint32_t process_protobuf_dh_msg1_generate_protobuf_dh_msg2(protobuf_sgx_dh_msg1_t& protobuf_msg1, protobuf_sgx_dh_msg2_t& protobuf_msg2);
-public:
-    uint32_t conduct_la(int fd);
-    void get_la_symmetric_key(uint8_t* key);
-};
-// TODO: Get them to take in lists as inputs and change verifier's code too to put in elements into a list.
-// TODO: Revert php code back by two commits (before rollback) and edit from there.
-// TODO: Also get the decryptor codebase in sync with this format of sgx/protobuf files.
-#endif //LAINITIATOR_PROTOBUFINTERFACE_H

+ 1 - 0
include/LA.h

@@ -0,0 +1 @@
+../../commonVerifierPHPfiles/header_files/LA.h

+ 0 - 19
include/ProtobufMessageRW.h

@@ -1,19 +0,0 @@
-//
-// Created by miti on 2019-12-24.
-//
-
-#ifndef VERIFIER_PROTOBUFMESSAGERW_H
-#define VERIFIER_PROTOBUFMESSAGERW_H
-//using namespace google::protobuf;
-#include <google/protobuf/message_lite.h>
-
-class ProtobufMessageRW {
-    int fd;
-public:
-    int read_msg(google::protobuf::MessageLite& message);
-    int write_msg(google::protobuf::MessageLite& message);
-    void set_fd(int fd);
-};
-
-
-#endif //VERIFIER_PROTOBUFMESSAGERW_H

+ 1 - 0
include/ProtobufMessageRW.h

@@ -0,0 +1 @@
+../../commonVerifierPHPfiles/header_files/ProtobufMessageRW.h

+ 0 - 51
include/Transforms.h

@@ -1,51 +0,0 @@
-//
-// Created by miti on 2019-12-21.
-//
-
-#ifndef VERIFIER_INITIATOR_TRANSFORMS_H
-#define VERIFIER_INITIATOR_TRANSFORMS_H
-#include "sgx_eid.h"
-#include "error_codes.h"
-#include "datatypes.h"
-#include "sgx_urts.h"
-#include "sgx_dh.h"
-
-// For msg1
-#define SGX_TARGET_INFO_RESERVED1_BYTES 4
-#define SGX_TARGET_INFO_RESERVED2_BYTES 456
-#define SGX_ECP256_KEY_SIZE 32
-#define SGX_HASH_SIZE 32 /* SHA256 */
-// For msg2
-#define SGX_REPORT_DATA_SIZE 64
-#define SGX_KEYID_SIZE 32
-#define SGX_DH_MAC_SIZE 16
-#define SGX_REPORT_BODY_RESERVED1 28
-#define SGX_REPORT_BODY_RESERVED2 32
-#define SGX_REPORT_BODY_RESERVED3 96
-#define SGX_REPORT_BODY_RESERVED4 60
-
-
-#include <stdio.h>
-// For google protobufs and deserialization/serialization
-#include "ProtobufLAMessages.h"
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
-using namespace google::protobuf::io;
-#include <inttypes.h>
-
-
-class Transforms {
-    static int fit_32_into_uint8_t(google::protobuf::uint32 temp32, uint8_t* temp8);
-    static int fit_32_into_uint16_t(google::protobuf::uint32 temp32, uint16_t* temp16);
-    static void  encode_ec256_public_key_to_protobuf(protobuf_sgx_ec256_public_t* protobuf_g_a , sgx_ec256_public_t* g_a);
-    static void  encode_attributes_to_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes);
-    static void  encode_report_to_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report);
-    static int decode_attributes_from_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes);
-    static int decode_report_from_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report);
-    static int print_initialized_msg1( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1);
-public:
-    static int decode_msg1_from_protobuf( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1, sgx_dh_msg1_t* native_dhmsg1);
-    static int decode_msg3_from_protobuf(protobuf_sgx_dh_msg3_t& protobuf_dhmsg3, sgx_dh_msg3_t* native_dhmsg3);
-    static void  encode_msg2_to_protobuf( protobuf_sgx_dh_msg2_t& protobuf_dhmsg2, sgx_dh_msg2_t* native_dhmsg2);
-};
-#endif //VERIFIER_INITIATOR_TRANSFORMS_H

+ 1 - 0
include/Transforms.h

@@ -0,0 +1 @@
+../../commonVerifierPHPfiles/header_files/Transforms.h