-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Warn to use a constant-time comparison for MAC and AEAD tag #9461
base: development
Are you sure you want to change the base?
Warn to use a constant-time comparison for MAC and AEAD tag #9461
Conversation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
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.
I can't Approve, but looks good to me with a suggestion.
* | ||
* \param ctx The ChaCha20-Poly1305 context to use. This must be initialized. | ||
* \param mac The buffer to where the 128-bit (16 bytes) MAC is written. | ||
* \param mac The buffer to where the 128-bit (16 bytes) authentication |
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.
Tiny nit: I might say "(16-byte)"
@@ -270,8 +275,8 @@ int mbedtls_chachapoly_finish(mbedtls_chachapoly_context *ctx, | |||
* This pointer can be \c NULL if `ilen == 0`. | |||
* \param output The buffer to where the encrypted or decrypted data | |||
* is written. This pointer can be \c NULL if `ilen == 0`. | |||
* \param tag The buffer to where the computed 128-bit (16 bytes) MAC | |||
* is written. This must not be \c NULL. | |||
* \param tag The buffer to where the computed 128-bit (16 bytes) |
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
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
@@ -230,13 +230,18 @@ int mbedtls_chachapoly_update(mbedtls_chachapoly_context *ctx, | |||
|
|||
/** | |||
* \brief This function finished the ChaCha20-Poly1305 operation and |
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.
Typo: should be "finishes" (and then "generates the authentication tag" below).
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.
Documentation improvements related to MAC and AEAD:
mbedtls_ct_memcmp()
in the documentation of functions that return an authentication tag. Closes mbedtls should provide a constant time MD / HMAC check function #3040.mbedtls_ccm_xxx
(but notmbedtls_cipher_xxx
). We forgot to remove the notes that say that it isn't implemented yet.PR checklist
Notes for the submitter
Please refer to the contributing guidelines, especially the
checklist for PR contributors.
Help make review efficient: