|
@@ -104,11 +104,10 @@ int local_attestation_initiator(int port)
|
|
|
protobuf_sgx_dh_msg2_t protobuf_msg2;
|
|
|
protobuf_sgx_dh_msg3_t protobuf_msg3;
|
|
|
uint32_t protobuf_sgx_ret;
|
|
|
- uint8_t encrypted_hash[32]; uint8_t encrypted_tag[16]; size_t post_la_bytes_written;
|
|
|
+ uint8_t encrypted_hash_and_tag[48];// uint8_t encrypted_tag[16];
|
|
|
+size_t post_la_bytes_written;
|
|
|
// For socket to listen to the Apache enclave.
|
|
|
-// int server_fd=0; int accept_fd = 0;
|
|
|
-// struct sockaddr_in own_addr;
|
|
|
-// struct sockaddr_storage apache_addr; socklen_t apache_addr_size = sizeof(apache_addr);
|
|
|
+
|
|
|
uint32_t session_id;
|
|
|
// int counter;
|
|
|
|
|
@@ -141,8 +140,8 @@ 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);
|
|
|
- protobuf_sgx_ret=generate_encrypted_rsa_keypair_hash(encrypted_hash, encrypted_tag);
|
|
|
+ memset(encrypted_hash_and_tag, 0, 48);
|
|
|
+ protobuf_sgx_ret=generate_encrypted_rsa_keypair_hash(encrypted_hash_and_tag, encrypted_hash_and_tag + 32);
|
|
|
if(protobuf_sgx_ret==0)
|
|
|
{
|
|
|
printf("Done encryption of hash.\n"); fflush(stdout);
|
|
@@ -153,10 +152,9 @@ int local_attestation_initiator(int port)
|
|
|
}
|
|
|
|
|
|
|
|
|
- post_la_bytes_written = write(decryptor_fd, encrypted_hash, 32);
|
|
|
- post_la_bytes_written = write(decryptor_fd, encrypted_tag, 16);
|
|
|
+ post_la_bytes_written = write(decryptor_fd, encrypted_hash_and_tag, 48);
|
|
|
|
|
|
- if(post_la_bytes_written != 16)
|
|
|
+ if(post_la_bytes_written != 48)
|
|
|
{
|
|
|
printf("Not all of the post-LA message was written\n"); fflush(stdout); return 0xfe;
|
|
|
|