-
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 some test cases that weren't getting executed #3463
Fix some test cases that weren't getting executed #3463
Conversation
The test case was never executed. Signed-off-by: Gilles Peskine <[email protected]>
The test cases were never executed. Signed-off-by: Gilles Peskine <[email protected]>
The metadata tests depend on the corresponding feature because there is no guarantee that the metadata is correct if the feature is disabled. There are metadata test cases for some algorithms and key types that are declared but not supported. These test cases are present but can never run. It is debatable whether having these test cases is a good thing in case they become runnable in the future, or a bad thing because they're dead code. We're working on detecting test cases that are never executed for accidental reasons (e.g. typo in a dependency or missing configuration on the CI), and having test cases that are deliberately never executed messes this up. So remove these test cases. If we do implement the corresponding feature, it'll be easy to add the corresponding metadata test cases. The features that had metadata tests but no implementations were: * SHA-512/256 and SHA-512/224 (hypothetical dependency: MBEDTLS_SHA512_256) * DSA (hypothetical dependency: MBEDTLS_DSA_C) * SHA-3 and HMAC-SHA-3 (hypothetical dependency: MBEDTLS_SHA3_C) Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
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, except for a harmless typo.
tests/ssl-opt.sh
Outdated
;; | ||
esac | ||
|
||
unset cmd ciphersuite |
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.
Minor: this function doesn't set cmd
so it probably doesn't need to unset 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.
Accidental leftover from an earlier draft that used cmd
. Since this was the last commit, I amended it to fully remove cmd
.
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.
Ok, thanks!
Test cases that force a specific ciphersuites are only executed if this ciphersuite is enabled. But there are test cases (for RC4) whose goal is to check that the ciphersuite is not used. These test cases must run even if (or only if) the ciphersuite is disable, so add an exception for these test cases. Signed-off-by: Gilles Peskine <[email protected]>
5645a77
to
0d72165
Compare
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
These are bug fixes that should be backported where applicable, but it turns out that all of them are in new code that didn't exist in 2.16. |
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 some test cases that weren't getting executed for one reason or another. See this analysis for background. This is not intended to fix all cases, just some that are easy to fix.
The check for test cases that are never executed (informational in #3458, mandatory in a follow-up that is yet to come) will ensure that these bug don't come back.
None of the changes here apply to 2.16 or 2.7. All the changes in unit tests are for new cases added since 2.16, and the bug fix in
ssl-opt.sh
is caused byrequires_ciphersuite
which was added after 2.16.