-
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
Fix parameter set but unused on psa_cipher_update_ecb #4938
Fix parameter set but unused on psa_cipher_update_ecb #4938
Conversation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This parameter was set but not used, which was pointless. Clang 14 detects this and legitimately complains. Remove the parameter. This is an internal function, only called once. The caller already has a sufficient check on the output buffer size which applies in more cases, so there is no real gain in robustness in adding the same check inside the internal function. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
803baa4
to
1716f32
Compare
Thanks Gilles for working on this fix |
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.
LGTM
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.
The fix for the warning looks good to me, but one point in the documentation looks suspect.
library/psa_crypto_cipher.c
Outdated
* it is stored in \p ctx for future processing. | ||
* \param output The buffer where the output is written. | ||
* \param output_size The size of \p output in bytes. | ||
* It must be at least `floor((p + input_length) / BS)` |
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.
That doesn't look right; did you mean to multiply by BS at the end?
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.
Oops. I started to write the size in blocks, but then thought that bytes would be clearer, but then I forgot to multiply.
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.
LGTM
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.
LGTM
Fix #4935. The only compiler known to complain so far is the development version of Clang (to be released as Clang 14), which oss-fuzz just switched to.
Needs backport: 2.x