Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Worker key refresh policy implementation #671

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

manju956
Copy link

@manju956 manju956 commented Sep 1, 2020

This feature initiates refresh of worker encryption key pair based on
number of work orders processed in case of Singleton worker or number of
pre-processed work orders in case of KME worker.
A new pair of encryption key is generated in the enclave and the updated
enclave signup details are stored in the KvStorage in workers table.

Worker encryption key signature is re-computed when encryption key gets refreshed.

When a worker key gets refreshed during the work order submission,
a specific error code is returned to client to indicate worker key refresh.
On receiving this error code, client retrieves the updated worker details and
does work order submission again.

Signed-off-by: manju956 [email protected]

@lgtm-com
Copy link

lgtm-com bot commented Sep 1, 2020

This pull request introduces 5 alerts when merging 1df89b3 into ed424e7 - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 1 for Syntax error

@lgtm-com
Copy link

lgtm-com bot commented Sep 1, 2020

This pull request introduces 1 alert when merging 48318d2 into ed424e7 - view on LGTM.com

new alerts:

  • 1 for Unused import

@danintel danintel changed the title Worker key refresh policy implemenation Worker key refresh policy implementation Sep 1, 2020
Copy link
Contributor

@danintel danintel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after minor changes and questions.

@@ -42,7 +42,9 @@ typedef enum {
TCF_ERR_SYSTEM_BUSY = -10,
TCF_ERR_CRYPTO = -11,
/** Invalid workload ID */
TCF_ERR_INVALID_WORKLOAD = -12
TCF_ERR_INVALID_WORKLOAD = -12,
/* Enclave key refresh error */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this comment Doxygen-friendly. Change
/* Enclave key refresh error */
to
/** Enclave key refresh error */

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

worker_info = EnclaveManager.create_json_worker(
self._enclave_info, self._config)
logger.info(
"Persiting updated worker details after key refresh - %s",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change Persiting to Persisting.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -349,12 +375,13 @@ namespace tcf {
}
// Calculate final hash
std::string final_hash_string = ByteArrayToString(hash_1);
if(!hash_in_data_str.empty()) {

//if(!hash_in_data_str.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is commented out and not deleted?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its irrelevant change. Deleted it

}
if(!hash_out_data_str.empty()) {
//}
//if(!hash_out_data_str.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here--why not delete it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its irrelevant change. Deleted it

Copy link
Contributor

@danintel danintel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are some LGTM warnings that were added (4 new unused imports, 1 new syntax error)

This feature initiates refresh of worker encryption key pair based on
number of work orders processed in case of Singleton worker or number of
pre-processed work orders in case of KME worker.
A new pair of encryption key is generated in the enclave and the updated
enclave signup details are stored in the KvStorage in workers table.

Worker encryption key signature is re-computed when encryption key gets refreshed.

When a worker key gets refreshed during the work order submission,
a specific error code is returned to client to indicate worker key refresh.
On receiving this error code, client retrieves the updated worker details and
does work order submission again.

Signed-off-by: manju956 <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants