-
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 dead code in mbedtls_mpi_exp_mod() #2317
Conversation
pending CLA |
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 change looks good. Let's wait for the second review.
retest |
CI fails only on the BSD timing test, which can be considered a pass. @Patater - I think this needs one of your team to approve before I can mark it as 'ready for merge'. You also need to decide if you need backporting. Please confirm. |
Both backports have been fully approved, so removing the "needs backports" label |
In mbedtls_mpi_exp_mod(), the limit check on wsize is never true when MBEDTLS_MPI_WINDOW_SIZE is at least 6. Wrap in a preprocessor guard to remove the dead code and resolve a Coverity finding from the DEADCODE checker. Change-Id: Ice7739031a9e8249283a04de11150565b613ae89
There were no tests for a non-default MPI window size. Add one. Change-Id: Ic08fbc9161d0b3ee67eb3c91f9baf602646c9dfe
60c6da2
Rebased to account for the structural changes in all.sh (#2325). Only the second patch had merge conflicts. |
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.
@pkolbus Thanks for the rebase! Looks good.
@pkolbus Thank you for another contribution! Even though it's a small fix, could you please add an entry to the ChangeLog describing the change and crediting yourself? Suggestion:
|
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.
ChangeLog entry requested. Looks good otherwise, thanks @pkolbus!
@hanno-arm Thanks for suggesting the change log entries. I have added them in the backport PRs. |
@hanno-arm Thanks for the suggested text. Added. @k-stachowiak Commented in the backports - only thing is that my employer (Garmin) should get a mention as well. |
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.
@pkolbus Thanks for the quick update. I applied appropriate changes to the backports.
Description
Address a finding from Coverity's DEADCODE checker in bignum.c when the default MBEDTLS_MPI_WINDOW_SIZE is used. This doesn't result in incorrect code, but depending on the compiler there may be a very tiny ROM and performance improvement. It also makes for one less finding that users of Coverity & mbed TLS need to look at.
Resolves #2309
Status
READY
Requires Backporting
NO
Migrations
NO
Additional comments
n/a
Todos
Steps to test or reproduce
Existing tests cover the default window size. Added test to all.sh for coverage in the case a different size is used.