Browse Source

Working commit with old libraries

dettanym 4 years ago
parent
commit
5a98fd13e3
8 changed files with 7 additions and 6 deletions
  1. 2 2
      Makefile
  2. 2 2
      ProtobufLAInitiator.cpp
  3. 2 1
      crypto.cpp
  4. BIN
      libsgx_tcrypto.a
  5. BIN
      libsgx_trts.a
  6. BIN
      libsgx_tservice.a
  7. BIN
      libsgx_tstdc.a
  8. 1 1
      systemMain.cpp

+ 2 - 2
Makefile

@@ -14,7 +14,7 @@ protobuf_obj := $(patsubst %.cpp,%.o,$(wildcard Protobuf*))
 system_obj := $(patsubst %.cpp,%.o,$(wildcard system*))
 OBJECTS := systemMain.o systemSealerWrapper.o SgxSealer.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o 
 
-SGX_SDK := /home/m2mazmud/sgx2.1_installation/sgxsdk
+SGX_SDK := /opt/intel/sgxsdk#/home/m2mazmud/sgx2.1_installation/sgxsdk
 SGX_COMMON_CFLAGS := -m64
 SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
 Trts_Library_Name := sgx_trts
@@ -44,4 +44,4 @@ crypto.o: crypto.cpp
 
 verifier:  systemMain.o systemSealerWrapper.o SgxSealer.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
 #	echo $(system_obj)
-	${CXX} ${CXX_FLAGS} -Wl,--no-undefined  -Wl,-rpath,$(SGX_SDK)/lib64  systemMain.o systemSealerWrapper.o SgxSealer.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o -L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive  -L$(SGX_LIBRARY_PATH) -l$(Service_Library_Name) -l$(Crypto_Library_Name) -l$(Uae_Library_Name) -lsgx_tstdc -lsgx_urts -lprotobuf -lsgx_tstdcxx  -L${Openssl_Path}/lib -lssl -lcrypto   -Wl,--verbose -o $@
+	${CXX} ${CXX_FLAGS} -Wl,--no-undefined  -Wl,-rpath,$(SGX_SDK)/lib64  systemMain.o systemSealerWrapper.o SgxSealer.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o -L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive  -L$(SGX_LIBRARY_PATH) -l$(Service_Library_Name) -l$(Crypto_Library_Name) -lsgx_tstdc  -lprotobuf  -L${Openssl_Path}/lib -lssl -lcrypto   -Wl,--verbose -o $@

+ 2 - 2
ProtobufLAInitiator.cpp

@@ -141,7 +141,7 @@ int local_attestation_initiator(int port)
   {
       printf("Error in process_protobuf_dh_msg3: 0x%x", protobuf_sgx_ret); fflush(stdout); return protobuf_sgx_ret;
   }
-/*  memset(encrypted_hash,0, 32); memset(encrypted_tag, 0, 16);
+  memset(encrypted_hash,0, 32); memset(encrypted_tag, 0, 16);
   protobuf_sgx_ret=generate_encrypted_rsa_keypair_hash(encrypted_hash, encrypted_tag); 
   if(protobuf_sgx_ret==0)
   {
@@ -162,7 +162,7 @@ int local_attestation_initiator(int port)
 
    }
    printf("Wrote the hash and the tag to the decryptor socket.\n"); fflush(stdout); 
-*/
+
    if(close(decryptor_fd)!= 0)
    {
 	printf("Error in closing the socket connection.\n"); fflush(stdout); return 0xfd; 

+ 2 - 1
crypto.cpp

@@ -82,7 +82,8 @@ uint32_t generate_rsa_keypair(FILE* fp, std::string& priv_key_str, std::string&
 //   pub_key_str=std::string(pub_key_der, pub_key_der_encoded_len);  
 */
 //	BIO* bio_rsa;
-    rc = PEM_write_RSA_PUBKEY(fp, rsa); // doesn't work
+	//    rc = PEM_write_RSA_PUBKEY(fp, rsa); 
+    rc=	PEM_write_RSAPrivateKey(fp, rsa, NULL, NULL, 0, NULL, NULL); 
     if(rc != 1) 
 	return 0x3;
     fflush(fp); 

BIN
libsgx_tcrypto.a


BIN
libsgx_trts.a


BIN
libsgx_tservice.a


BIN
libsgx_tstdc.a


+ 1 - 1
systemMain.cpp

@@ -14,7 +14,7 @@
 //#include "crypto.h"
 using namespace std;
 
-#define DECRYPTOR_PORT 3825
+#define DECRYPTOR_PORT 3824
 #define SGX_HASH_SIZE 32
 int __ImageBase=0;
 int verify_apache(std::string& path, std::string& keypair) {return 0; }