[Assignment-7] .

This commit is contained in:
Sascha Tommasone 2024-07-06 15:02:27 +02:00 committed by saschato
parent f573b0c28a
commit 05ea23459f

View file

@ -168,12 +168,15 @@ sgx_status_t generate_key_pair(uint8_t *sealed, uint32_t sealed_size) {
// create ecc keypair // create ecc keypair
if((status = sgx_ecc256_create_key_pair(&private, &public, ecc_handle)) != SGX_SUCCESS) { if((status = sgx_ecc256_create_key_pair(&private, &public, ecc_handle)) != SGX_SUCCESS) {
sgx_ecc256_close_context(ecc_handle); goto exit;
return status;
} }
// return status of sealing // seal keypair
return seal_key_pair(&private, &public, &sealed); status = seal_key_pair(&private, &public, &sealed);
exit: ;
sgx_ecc256_close_context(ecc_handle);
return status;
} }
sgx_status_t get_public_key(const uint8_t *sealed, uint32_t sealed_size, uint8_t *public) { sgx_status_t get_public_key(const uint8_t *sealed, uint32_t sealed_size, uint8_t *public) {