Browse Source

Runs sgx_seal_data with null arguments in the session_request - rightly returns an error. Modified veify_peer_enclave_trust in decryptor.cpp to not run sgx_create_rsa_key_pair

dettanym 5 years ago
parent
commit
62fddb71db
2 changed files with 4 additions and 3 deletions
  1. 2 1
      Decryptor/Decryptor.cpp
  2. 2 2
      LocalAttestationCode/EnclaveMessageExchange.cpp

+ 2 - 1
Decryptor/Decryptor.cpp

@@ -262,7 +262,7 @@ extern "C" uint32_t verify_peer_enclave_trust(sgx_dh_session_enclave_identity_t*
 //#include "sgx_tcrypto.h"
 //int create_rsa_key_pair_for_signing_manifest(/*std::string& priv_key, std::string& pub_key*/) 
 //{
-        uint32_t ret_sgx;
+/*        uint32_t ret_sgx;
         uint8_t* n=(uint8_t*)malloc(384); 
         uint8_t* d=(uint8_t*)malloc(384); 
         uint8_t* p=(uint8_t*)malloc(192); 
@@ -275,6 +275,7 @@ extern "C" uint32_t verify_peer_enclave_trust(sgx_dh_session_enclave_identity_t*
         ret_sgx=sgx_create_rsa_key_pair(384, 4, n, d, (unsigned char*)&e, p, q, dmp1, dmq1, iqmp);
         free(n); free(d); free(p); free(q); free(dmp1); free(dmq1); free(iqmp);
         return ret_sgx;
+*/ return SGX_SUCCESS;
 //}
 
 

+ 2 - 2
LocalAttestationCode/EnclaveMessageExchange.cpp

@@ -108,11 +108,11 @@ ATTESTATION_STATUS session_request(sgx_dh_msg1_t *dh_msg1,
         return status;
     }
     memcpy(&global_session_info.in_progress.dh_session, &sgx_dh_session, sizeof(sgx_dh_session_t));
-//    return sgx_seal_data(0, NULL, 0, NULL, 0, NULL); 
+    return sgx_seal_data(0, NULL, 0, NULL, 0, NULL); 
     //Store the session information under the correspoding source enlave id key
     //    g_dest_session_info_map.insert(std::pair<sgx_enclave_id_t, dh_session_t>(src_enclave_id, session_info));
 
-    return status;
+//    return status;
 }
 
 //Verify Message 2, generate Message3 and exchange Message 3 with Source Enclave