-
Notifications
You must be signed in to change notification settings - Fork 727
api: add key update request functionality #4453
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
Conversation
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 good to me. In terms of it being sparse, we already had all of the functionality in place for this feature; it just wasn't exposed in a public API.
POSIX_ENSURE_REF(conn); | ||
/* s2n-tls does not currently support requesting key updates from peers */ | ||
POSIX_ENSURE(!peer_update_requested, S2N_ERR_T_USAGE); | ||
s2n_atomic_flag_set(&conn->key_update_pending); |
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.
Maybe we should have another check to make sure that the handshake is complete?
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.
Theoretically not necessary? We just wouldn't send the update until after the handshake
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.
Well it'd be nice to be able to have the compliance comment about not sending this until the finished message has been sent, so I'll go ahead and add 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.
But this method doesn't send anything, so that'd be the wrong place for that compliance comment
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.
Yup, I'd add it as a test case in s2n_key_update_test.c
- return unimplemented err rather than generic type - explicitly mention that the key update message is not sent until s2n_send is called - explicitly mention that the method will fail is peer_update is set to false.
- switch err to a usage type - switch to uint8_t for the input
- use enum intead of uint8_t for the toggle parameter
- cleanup singular vs plural nouns in documentation
Description of changes:
This commit adds a new API which allows a customer to signal their desire for a key update.
Testing:
Unit tests were added to cover new functionality.
Testing was done locally with other implementations to confirm that they receive the new key update. at the signaled time.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.