Skip to content
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

Backport 2.28: Re-enable 5 tests disabled because of an old OpenSSL bug #5990

Merged
merged 3 commits into from
Aug 16, 2022

Conversation

zhangsenWang
Copy link
Contributor

@zhangsenWang zhangsenWang commented Jun 29, 2022

Description

Re-enable 5 tests disabled because of an old OpenSSL bug (#5077)

Backport of #5985

Status

READY

Steps to test or reproduce

with openssl 1.1.1a or higher version
export OPENSSL_NEXT=/path/to/openssl
./tests/ssl-opt.sh -f "DTLS fragmenting: 3d, openssl"
./tests/ssl-opt.sh -f "DTLS proxy: 3d, openssl"

Signed-off-by: Zhangsen Wang <zhangsen.wang@arm.com>
@zhangsenWang zhangsenWang reopened this Jun 29, 2022
@zhangsenWang zhangsenWang linked an issue Jun 29, 2022 that may be closed by this pull request
@zhangsenWang zhangsenWang marked this pull request as ready for review June 29, 2022 07:39
@minosgalanakis minosgalanakis added bug size-s Estimated task size: small (~2d) component-test Test framework and CI scripts priority-low Low priority - this may not receive review soon labels Jun 29, 2022
@gilles-peskine-arm gilles-peskine-arm changed the title Re-enable 7 tests disabled in mbedtls-2.28 because of an old OpenSSL bug Backport 2.28: Re-enable 7 tests disabled because of an old OpenSSL bug Jun 30, 2022
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch enables two test cases that were documented as failing, and they're passing. We need to understand why.

I think I know what's going on with the test with an openssl client: the bug is only on the server side, and this test case should not have been disabled since it doesn't use an openssl server. For the other one, which does use an openssl server, I have a conjecture, which is that only certain seed values trigger the bug. We need to check whether this is the case.

"$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \
0 \
-c "HTTP/1.0 200 OK"

skip_next_test # see above
requires_openssl_next
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only makes sense to call requires_openssl_next if the test case calls $O_NEXT_CLI or $O_NEXT_SRV. So please call $O_NEXT_SRV.

Why is the CI passing with the default OpenSSL version though? This test case is supposed to run into the OpenSSL bug. Maybe the OpenSSL bug is only triggered with certain seed values? In which case we should probably diversify this test case so that it exercises more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re “seed values” — in “3d” tests the UDP proxy pseudorandomly drops/duplicates/delays packets, based on the parameters passed to $P_PXY (which is programs/test/udp_proxy). The pseudorandomness uses rand(), with a seed that is the $SEED variable or --seed option passed to ssl-opt.sh.

The openssl bug was only triggered for a certain sequence of messages, so it's likely that it's only triggered for certain seed values. The CI always uses the same seed so that CI runs are easily reproducible, and I guess this seed value doesn't trigger the bug in this particular test case.

To confirm this guess, we should try running the current code with different seeds (hopefully the seed value in the old bug description should still work).

tests/ssl-opt.sh Outdated
@@ -9242,7 +9239,7 @@ run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \
-c "fragmenting handshake message" \
-C "error"

skip_next_test
requires_openssl_next
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding requires_openssl_next doesn't do anything on its own, except for skipping the test. requires_openssl_next should only be used when the test case calls $O_NEXT_CLI or $O_NEXT_SRV. (In fact ssl-opt.sh could be improved to detect calls to $O_NEXT_xxx and not have to explicitly call requires_openssl_next; same for many other requires_xxx.)

So now the test case is running with the default OpenSSL version, not the “next” version. And it's passing.

I think that the bug was only with an OpenSSL server, and this test case uses an OpenSSL client against an Mbed TLS client. So it was a mistake to disable it at the time. And now we should fix this by removing skip_next_test, not by adding a requirement on openssl_next.

Also applies to development.

…ed due to an openssl bug

Signed-off-by: Zhangsen Wang <zhangsen.wang@arm.com>
@zhangsenWang zhangsenWang changed the title Backport 2.28: Re-enable 7 tests disabled because of an old OpenSSL bug Backport 2.28: Re-enable 5 tests disabled because of an old OpenSSL bug Aug 4, 2022
@zhangsenWang zhangsenWang added needs-review Every commit must be reviewed by at least two team members, and removed needs-work labels Aug 4, 2022
Copy link
Contributor

@xkqian xkqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhangsenWang zhangsenWang added approved Design and code approved - may be waiting for CI or backports and removed needs-review Every commit must be reviewed by at least two team members, labels Aug 10, 2022
@xkqian xkqian added the needs-review Every commit must be reviewed by at least two team members, label Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports bug component-test Test framework and CI scripts needs-review Every commit must be reviewed by at least two team members, priority-low Low priority - this may not receive review soon size-s Estimated task size: small (~2d)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-enable tests disable dued to old OpenSSL bug
5 participants