Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Dispatch MAC operations through the driver interface #4247
Dispatch MAC operations through the driver interface #4247
Changes from 1 commit
675501d
f4248f2
61398ec
3c8dd63
d13a70f
77e2cc5
82c66b6
e680419
6e7f291
a5b860a
7515e75
4fdf060
d1955af
939102e
c7f0a57
02fc62a
ba9a5bf
a4638e7
36876a0
dd1a915
ac8d82a
d1ed1d9
a6df604
094a77e
dcd0811
8f37004
3409b02
f45f071
a2058a7
c112315
72f736a
2f60f20
02865f5
0c23965
b29902a
d1a68f1
ae3ec52
8af5c5c
9e15fb7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
As Ronald noted in https://github.com/ARMmbed/mbedtls/pull/4247/files#r629107039, it's surprising to check for
mac_size == 0
when we know that it would implymac_size < operation->mac_size
since the operation setup guarantees thatoperation->mac_size > 0
. You make a good point that this avoids false positives from static analyzers about cases that can only happen ifmac_size == 0
. However, it still warrants a comment, otherwise the next person who works on the code might decide to remove this apparently superfluous check.How about changing the code to this?
A static analyzer should be just as happy, a compiler will only have a couple of instructions more to generate, this adds a bit of robustness, and the code looks less surprising.
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.
Done
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.
mac_verify_setup
andmac_sign_setup
are now identical. Why not callmac_setup
directly?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.
done