-
Notifications
You must be signed in to change notification settings - Fork 93
Worker key refresh policy implementation #671
base: main
Are you sure you want to change the base?
Conversation
This pull request introduces 5 alerts when merging 1df89b3 into ed424e7 - view on LGTM.com new alerts:
|
1df89b3
to
48318d2
Compare
This pull request introduces 1 alert when merging 48318d2 into ed424e7 - view on LGTM.com new alerts:
|
48318d2
to
730cab4
Compare
There was a problem hiding this 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.
common/cpp/tcf_error.h
Outdated
@@ -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 */ |
There was a problem hiding this comment.
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 */
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change Persiting to Persisting.
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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)
730cab4
to
f34c32a
Compare
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]>
f34c32a
to
8869f61
Compare
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]