-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding notion of a recovery owner for network recovery #6705
base: main
Are you sure you want to change the base?
Changes from 48 commits
07b152f
7cd6011
580670c
4df08bd
491aed2
41e16fd
90cbdfb
1c1bda9
2f7ff7f
7d0fe02
607b8a4
986138a
0ae745c
33b736b
96838b7
7104982
7639bf9
8bd2d95
e5021f1
0dcc258
e0bc7a7
b28b452
8dc3f06
01df49a
7546e41
754adc3
123387b
1228c1d
12d965d
32aa899
8c931b4
ff6ba59
476636f
a2f79a9
cab53eb
d5ffb66
5f56142
02e7df9
8416064
f78144c
ae6f19a
4691ac8
9b18e9f
2b90ece
b5c3c6a
d9f1308
9f48285
969aaae
fd8ee6a
5a5d5fa
b9e2292
c01904b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,11 +130,14 @@ namespace ccf::gov::endpoints | |
params["share"].template get<std::string>()); | ||
|
||
size_t submitted_shares_count = 0; | ||
bool full_key_submitted = false; | ||
try | ||
{ | ||
submitted_shares_count = share_manager.submit_recovery_share( | ||
ctx.tx, member_id, raw_recovery_share); | ||
|
||
full_key_submitted = ShareManager::is_full_key(raw_recovery_share); | ||
|
||
OPENSSL_cleanse( | ||
raw_recovery_share.data(), raw_recovery_share.size()); | ||
} | ||
|
@@ -164,8 +167,13 @@ namespace ccf::gov::endpoints | |
submitted_shares_count, | ||
threshold); | ||
|
||
if (submitted_shares_count >= threshold) | ||
if (submitted_shares_count >= threshold || full_key_submitted) | ||
{ | ||
if (full_key_submitted) | ||
{ | ||
message += "\nFull recovery key successfully submitted"; | ||
} | ||
Comment on lines
+172
to
+175
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't add as suggestion because it affects the untouched lines above, but suggest that this is a replacement for the "x/n" message above when Something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we want to change this then I'd suggest we tweak it to: "Full recovery key successfully submitted" as we say 'full recovery key' in cchost_config.json also. |
||
|
||
message += "\nEnd of recovery procedure initiated"; | ||
GOV_INFO_FMT("{} - initiating recovery", message); | ||
|
||
|
@@ -196,6 +204,7 @@ namespace ccf::gov::endpoints | |
response_body["message"] = message; | ||
response_body["submittedCount"] = submitted_shares_count; | ||
response_body["recoveryThreshold"] = threshold; | ||
response_body["fullKeySubmitted"] = full_key_submitted; | ||
|
||
ctx.rpc_ctx->set_response_json(response_body, HTTP_STATUS_OK); | ||
return; | ||
|
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.
There's also a
checkEnum()
that will be slightly more precise (and prevent a much-later error, if C++ code tries to deserialise an unknown/badly-cased string). It doesn't have the?
optional syntax, so I think it would be something like:(I'm not completely sure of the semantics here - should
recovery_role
benull
or"NonParticipant"
?)