Skip to content

[protocol] Convert key_rotation to use the new compact error format - #290

Open
esnguyen wants to merge 1 commit into
google:mainfrom
esnguyen:convert_key_rotation
Open

[protocol] Convert key_rotation to use the new compact error format#290
esnguyen wants to merge 1 commit into
google:mainfrom
esnguyen:convert_key_rotation

Conversation

@esnguyen

@esnguyen esnguyen commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Ellis Sarza-Nguyen <sarzanguyen@google.com>
Comment thread protocol/key_rotation.c
command, 0, rlen);
return KEY_ROTATION_ERR_INVALID_RESPONSE_SIZE;
return LIBHOTH_ERR_CONSTRUCT(HOTH_CTX_CMD_EXEC, HOTH_HOST_SPACE_LIBHOTH,
LIBHOTH_ERR_FAIL);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we add another HOTH_RES_INVALID_RESPONSE_SIZE and return that here? There is a HOTH_RES_RESPONSE_TOO_BIG but it is not generic enough. The response could be smaller than expected

Comment thread protocol/key_rotation.c
"bytes, got %zu\n",
sizeof(*record_version), rlen);
return KEY_ROTATION_ERR_INVALID_RESPONSE_SIZE;
return LIBHOTH_ERR_CONSTRUCT(HOTH_CTX_CMD_EXEC, HOTH_HOST_SPACE_LIBHOTH,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we add another HOTH_RES_INVALID_RESPONSE_SIZE and return that here? There is a HOTH_RES_RESPONSE_TOO_BIG but it is not generic enough. The response could be smaller than expected

Comment thread protocol/key_rotation.c
"bytes, got %zu\n",
sizeof(*record_status), rlen);
return KEY_ROTATION_ERR_INVALID_RESPONSE_SIZE;
return LIBHOTH_ERR_CONSTRUCT(HOTH_CTX_CMD_EXEC, HOTH_HOST_SPACE_LIBHOTH,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above, HOTH_RES_INVALID_RESPONSE_SIZE

Comment thread protocol/key_rotation.c
sizeof(*payload_status), rlen);
return KEY_ROTATION_ERR_INVALID_RESPONSE_SIZE;
return LIBHOTH_ERR_CONSTRUCT(HOTH_CTX_CMD_EXEC, HOTH_HOST_SPACE_LIBHOTH,
LIBHOTH_ERR_FAIL);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above, HOTH_RES_INVALID_RESPONSE_SIZE

Comment thread protocol/key_rotation.c
if (init_err != HOTH_SUCCESS) {
fprintf(stderr, "Failed to initiate key rotation.\n");
return KEY_ROTATION_INITIATE_FAIL;
return init_err;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would make sense to add either KEY_ROTATION_INITIATE_FAIL or generic HTOOL_CMD_INITIATE_FAIL and return that here. Generic one can be reused for payload update as well

Comment thread protocol/key_rotation.c
if (commit_err != HOTH_SUCCESS) {
fprintf(stderr, "Failed to commit key rotation.\n");
return KEY_ROTATION_COMMIT_FAIL;
return commit_err;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as initiate fail, could add commit fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants