Browse Source

Rearranged src code files and edited makefile.

dettanym 2 years ago
parent
commit
8418edd53f

+ 0 - 0
LAInitiator_Protobuf.cpp → LAInitiator/LA.cpp


+ 12 - 12
Initiator_Transforms.cpp → LAInitiator/Transforms.cpp

@@ -1,5 +1,5 @@
-#include "Initiator_Transforms.h"
-int Initiator_Transforms::fit_32_into_uint8_t(google::protobuf::uint32 temp32, uint8_t* temp8)
+#include "Transforms.h"
+int Transforms::fit_32_into_uint8_t(google::protobuf::uint32 temp32, uint8_t* temp8)
     {
         if(temp32 > UINT8_MAX)
             return -1;
@@ -11,7 +11,7 @@ int Initiator_Transforms::fit_32_into_uint8_t(google::protobuf::uint32 temp32, u
         }
     }
 
-int Initiator_Transforms::fit_32_into_uint16_t(google::protobuf::uint32 temp32, uint16_t* temp16)
+int Transforms::fit_32_into_uint16_t(google::protobuf::uint32 temp32, uint16_t* temp16)
     {
         if(temp32 > UINT16_MAX)
             return -1;
@@ -23,7 +23,7 @@ int Initiator_Transforms::fit_32_into_uint16_t(google::protobuf::uint32 temp32,
         }
     }
 
-void Initiator_Transforms::encode_ec256_public_key_to_protobuf(protobuf_sgx_ec256_public_t* protobuf_g_a , sgx_ec256_public_t* g_a)
+void Transforms::encode_ec256_public_key_to_protobuf(protobuf_sgx_ec256_public_t* protobuf_g_a , sgx_ec256_public_t* g_a)
     {
         printf("\n ec256 public key gx and gy \n");
         int counter; google::protobuf::uint32 temp32;
@@ -39,13 +39,13 @@ void Initiator_Transforms::encode_ec256_public_key_to_protobuf(protobuf_sgx_ec25
         printf("\n");
     }
 
-void Initiator_Transforms::encode_attributes_to_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
+void Transforms::encode_attributes_to_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
     {
         protobuf_attributes->set_flags(attributes->flags); // 64 bit
         protobuf_attributes->set_xfrm(attributes->xfrm); // 64 bit
     }
 
-void Initiator_Transforms::encode_report_to_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
+void Transforms::encode_report_to_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
     {
         printf("\n report \n key id \n");
         int counter; google::protobuf::uint32 temp32;
@@ -124,7 +124,7 @@ void Initiator_Transforms::encode_report_to_protobuf(protobuf_sgx_report_t* prot
         }
     }
 
-int Initiator_Transforms::decode_attributes_from_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
+int Transforms::decode_attributes_from_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
     {
         attributes->flags = protobuf_attributes->flags();
         printf("\n flags %" PRIu64 " \n", attributes->flags);
@@ -133,7 +133,7 @@ int Initiator_Transforms::decode_attributes_from_protobuf(protobuf_sgx_attribute
         return 0;
     }
 
-int Initiator_Transforms::decode_report_from_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
+int Transforms::decode_report_from_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
     {
         int counter; google::protobuf::uint32 temp32;
         printf("\n----------------------Decoding received msg3 ------------------------\n");
@@ -245,7 +245,7 @@ int Initiator_Transforms::decode_report_from_protobuf(protobuf_sgx_report_t* pro
         return 0;
     }
 
-int Initiator_Transforms::print_initialized_msg1( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1)
+int Transforms::print_initialized_msg1( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1)
     {
         int counter;
         printf("gx\n");
@@ -285,7 +285,7 @@ int Initiator_Transforms::print_initialized_msg1( protobuf_sgx_dh_msg1_t& protob
         return 0;
     }
 
-int Initiator_Transforms::decode_msg1_from_protobuf( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1, sgx_dh_msg1_t* native_dhmsg1)
+int Transforms::decode_msg1_from_protobuf( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1, sgx_dh_msg1_t* native_dhmsg1)
     {
         int counter; google::protobuf::uint32 temp32;// google::protobuf::uint64 temp64;
 
@@ -326,7 +326,7 @@ int Initiator_Transforms::decode_msg1_from_protobuf( protobuf_sgx_dh_msg1_t& pro
         return 0;
     }
 
-int Initiator_Transforms::decode_msg3_from_protobuf(protobuf_sgx_dh_msg3_t& protobuf_dhmsg3, sgx_dh_msg3_t* native_dhmsg3)
+int Transforms::decode_msg3_from_protobuf(protobuf_sgx_dh_msg3_t& protobuf_dhmsg3, sgx_dh_msg3_t* native_dhmsg3)
     {
         int counter; google::protobuf::uint32 temp32;
         for(counter=0;counter<SGX_DH_MAC_SIZE;counter++)
@@ -347,7 +347,7 @@ int Initiator_Transforms::decode_msg3_from_protobuf(protobuf_sgx_dh_msg3_t& prot
         return 0;
     }
 
-void Initiator_Transforms::encode_msg2_to_protobuf( protobuf_sgx_dh_msg2_t& protobuf_dhmsg2, sgx_dh_msg2_t* native_dhmsg2)
+void Transforms::encode_msg2_to_protobuf( protobuf_sgx_dh_msg2_t& protobuf_dhmsg2, sgx_dh_msg2_t* native_dhmsg2)
     {
         int counter; google::protobuf::uint32 temp32; //google::protobuf::uint64 temp64;
         printf("\n msg2 cmac \n");

+ 13 - 6
Makefile

@@ -32,21 +32,28 @@ all:	verifier ${OBJECTS}
 clean:
 	${RM} *.obj *~* ${OBJECTS} verifier #${LocalAttestationCode_objects} ${LocalAttestationCode_ipc_objects} ${LocalAttestationCode_serialization_objects}
 
-Sgx%.o: Sgx%.cpp
+#DeploymentStageLogic.o: DeploymentStageLogic.cpp
+#	${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
+
+LAInitiator/%.o: LAInitiator/%.cpp
 	${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
 
-Protobuf%.o: Protobuf%.cpp
+PostLA/%.o: PostLA/%.cpp
+	${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
+
+ProtobufAutogenerated/%.o: ProtobufAutogenerated/%.cpp
 	${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
 
-system%.o: system%.cpp
-	${CXX} -I./include -I/usr/lib/jvm/java-8-openjdk-amd64/include/ -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux/ ${CXX_FLAGS} -c $^ -o $@
+%.o: %.cpp
+	${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
+	#-I/usr/lib/jvm/java-8-openjdk-amd64/include/ -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux/
 
 crypto.o: crypto.cpp 
 	${CXX} -I${Openssl_Path}/include ${CXX_FLAGS} -c $^ -o $@
 
-verifier:  systemMain.o systemSealerWrapper.o SgxSealer.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
+verifier:  systemMain.o DeploymentStageLogic.o systemSealerWrapper.o SgxSealer.o LAInitiator/LA.o LAInitiator/Transforms.o PostLA/PostLAMessaging.o ProtobufAutogenerated/ProtobufLAMessages.pb.o ProtobufMessageRW.o crypto.o
 #	echo $(system_obj)
-	${CXX} -Wl,--no-undefined systemMain.o systemSealerWrapper.o SgxSealer.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o   -L${Openssl_Path}/lib -lcrypto -lssl -L./ -l$(Service_Library_Name) -l$(Crypto_Library_Name) -L/home/m2mazmud/linux-sgx-trts-modified/build/linux -lsgx_tstdc -lsgx_trts ${LD_FLAGS} -lprotobuf  -o $@ 
+	${CXX} -Wl,--no-undefined systemMain.o DeploymentStageLogic.o systemSealerWrapper.o SgxSealer.o LAInitiator/LA.o LAInitiator/Transforms.o PostLA/PostLAMessaging.o ProtobufAutogenerated/ProtobufLAMessages.pb.o ProtobufMessageRW.o crypto.o  -L${Openssl_Path}/lib -lcrypto -lssl -L./ -l$(Service_Library_Name) -l$(Crypto_Library_Name) -L/home/m2mazmud/linux-sgx-trts-modified/build/linux -lsgx_tstdc -lsgx_trts ${LD_FLAGS} -lprotobuf  -o $@
 #-L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm  
 #-L/home/m2mazmud/linux-sgx-trts-modified/build/linux -lsgx_tstdc -lsgx_trts ${LD_FLAGS} -o $@ 
 

+ 0 - 0
PostLAMessaging.cpp → PostLA/PostLAMessaging.cpp


+ 0 - 0
ProtobufLAMessages.pb.cpp → ProtobufAutogenerated/ProtobufLAMessages.pb.cpp


+ 0 - 0
find_pixy_class_file_locations.sh → Scripts_etc/find_pixy_class_file_locations.sh


+ 0 - 0
helloworld_jni_interface.cpp → Scripts_etc/helloworld_jni_interface.cpp


+ 0 - 0
jni_compiling_linking.sh → Scripts_etc/jni_compiling_linking.sh


+ 0 - 0
pal-sgx-sign → Scripts_etc/pal-sgx-sign


+ 0 - 0
Initiator_Transforms.h → include/Initiator_Transforms.h


+ 0 - 0
LAInitiator_Protobuf.h → include/LAInitiator_Protobuf.h


+ 0 - 0
PostLAMessaging.h → include/PostLAMessaging.h


+ 0 - 0
ProtobufMessageRW.h → include/ProtobufMessageRW.h