|
@@ -710,24 +710,24 @@ uint32_t unseal_signing_key_pair_from_disk(int fd, __attribute__((unused)) sgx_
|
|
|
*/
|
|
|
uint32_t create_and_seal_signing_key_pair_to_disk( __attribute__((unused)) int fd, __attribute__((unused)) sgx_ec256_public_t* pub_key, __attribute__((unused)) uint32_t* actual_sealed_msg_length)
|
|
|
{
|
|
|
- // uint32_t ret_status;
|
|
|
+ uint32_t ret_status;
|
|
|
// Generating a signing ECDSA key to sign the encryption key.
|
|
|
uint32_t length;
|
|
|
- Decryptor_calculate_sealed_data_size(e2_enclave_id, &length, 3*SGX_ECP256_KEY_SIZE); // sgx_calc_sealed_data_size(0,3*SGX_ECP256_KEY_SIZE);
|
|
|
+ Decryptor_calculate_sealed_data_size(e2_enclave_id, &length, SGX_ECP256_KEY_SIZE); // sgx_calc_sealed_data_size(0,3*SGX_ECP256_KEY_SIZE);
|
|
|
if(length == 0xFFFFFFFF)
|
|
|
return 0xFFFFFFFF;
|
|
|
- printf("0x%x input msg, 0x%x bytes for sealed msg in parameter value\n", 3*SGX_ECP256_KEY_SIZE, length); fflush(stdout);
|
|
|
-// uint8_t* sealed_data=(uint8_t*) malloc(*actual_sealed_msg_length);
|
|
|
+ printf("0x%x input msg, 0x%x bytes for sealed msg in parameter value\n", SGX_ECP256_KEY_SIZE, length); fflush(stdout);
|
|
|
+ uint8_t* sealed_data2=(uint8_t*) malloc(*actual_sealed_msg_length);
|
|
|
printf("Made call to sgx_calc_sealed_data_size\n"); fflush(stdout);
|
|
|
-/* Decryptor_create_and_seal_ecdsa_signing_key_pair(e2_enclave_id, &ret_status, pub_key, actual_sealed_msg_length, sealed_data);
|
|
|
+ Decryptor_create_and_seal_ecdsa_signing_key_pair(e2_enclave_id, &ret_status, pub_key, actual_sealed_msg_length, sealed_data2);
|
|
|
if(ret_status != SGX_SUCCESS)
|
|
|
{
|
|
|
printf("create_and_seal called returned an error: %x", ret_status);
|
|
|
- free(sealed_data);
|
|
|
+ free(sealed_data2);
|
|
|
return 0xFFFFFFFF;
|
|
|
}
|
|
|
printf("It returned sgx_success\n"); fflush(stdout);
|
|
|
-
|
|
|
+/*
|
|
|
ret_status = write_to_fd(fd, sealed_data, actual_sealed_msg_length);
|
|
|
free(sealed_data);
|
|
|
return ret_status;*/ return 0;
|