-
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
driver-only ECDSA: add ssl-opt.sh testing with testing parity #7082
Conversation
43280d7
to
882759c
Compare
882759c
to
6d64a42
Compare
|
a2f2469
to
8a15c4c
Compare
(Changed the base twice just to force-refresh github's list of commits. Now it no longer lists the commits from 7064 as being added by this PR.) |
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 pretty good generally, mostly just one point about sometimes using a stronger requirement than necessary.
8a15c4c
to
133f9b0
Compare
Here is the result of the |
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.
Thanks for addressing my comments. It seems that there is no correct way to skip tests other than ECDSA in ssl-opt, so we need to keep all enabled.
LGTM.
I think Manuel and Przemysław are both reviewing, hence removing the needs-reviewer label. |
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.
(I'm running out of time for today, just releasing the one comment I have so far, will continue my review tomorrow.)
@@ -2833,6 +2833,7 @@ requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE | |||
requires_config_enabled MBEDTLS_DEBUG_C | |||
requires_config_enabled MBEDTLS_SSL_CLI_C | |||
requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | |||
requires_pk_alg ECDSA |
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.
Question: I don't understand why this case needs this but the next one apparently doesn't? The only differences I can see between the command lines is that the next one has sig_algs=ecdsa_secp256r1_sha256
and this one doesn't, but that would suggest the next once needs ECDSA (too).
Can you clarify the reasoning that led to adding this here?
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.
You're absolutely right, this is a redundant requirement (which probably belongs to the initial steps for this PR) that now is automatically satisfied by the changes in detect_required_features()
.
I'll fix this and all other redundancies.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
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.
Looking pretty good to me. I now think all the dependencies are correct, but that (1) some of them are redundant with what detect_required_feature
does thanks to your extension, and (2) some would become redundant with a simple extra extension (detect server7 too).
@@ -2158,7 +2158,8 @@ component_test_psa_crypto_config_accel_ecdsa_use_psa () { | |||
msg "test: MBEDTLS_PSA_CRYPTO_CONFIG with accelerated ECDSA + USE_PSA" | |||
make test | |||
|
|||
# TODO: ssl-opt.sh (currently doesn't pass) - #6861 | |||
msg "test: ssl-opt.sh" |
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.
I understand the concern for reducing the load, but until we have a solid mechanism for selecting cases, I'd really prefer to run the whole thing. Otherwise it's very hard to be confident we didn't miss anything.
tests/ssl-opt.sh
Outdated
@@ -3691,6 +3717,7 @@ run_test "Session resume using tickets: session copy" \ | |||
-c "a session has been resumed" | |||
|
|||
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | |||
requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
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.
Ah right, I missed the things implied by $O_SRV
, right. Thanks for clarifying.
Though, isn't that automatically handled by your extension to detect_required_features
? (Same question for the bunch with $G_SRV
below.)
tests/ssl-opt.sh
Outdated
@@ -5535,6 +5595,7 @@ run_test "Authentication: openssl client no cert, server optional" \ | |||
|
|||
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | |||
requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | |||
requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
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 line above becomes redundant when adding this one. (Also, it looks to me like this would be auto-detected too.)
tests/ssl-opt.sh
Outdated
@@ -9448,7 +9521,8 @@ run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ | |||
|
|||
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | |||
requires_config_enabled MBEDTLS_RSA_C | |||
requires_config_enabled MBEDTLS_ECDSA_C | |||
requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT | |||
requires_pk_alg "ECDSA" |
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.
This one and the next few look like they could be auto-detected based on loading a server7 certificate.
tests/ssl-opt.sh
Outdated
@@ -11473,6 +11557,7 @@ requires_config_enabled MBEDTLS_DEBUG_C | |||
requires_config_enabled MBEDTLS_SSL_CLI_C | |||
requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ | |||
MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED | |||
requires_pk_alg "ECDSA" |
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.
I think for this case, and probably all the other TLS 1.3 cases until the end of the files, detect_require_features
already does the job so don't need this explicit declaration.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This was a leftover from some debug activity that unfortunately ended up in previous commits. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
There were some dependencies that are now automatically satisfied by the detect_required_features() function. After this check there should be no redundant requirement for: - requires_pk_alg "ECDSA" - requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT - requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
I checked
and removed all redundancies which are automatically satisfied by |
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.
Thanks for addressing my feedback. Looks all good to me now as long as the CI agrees :)
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.
Delta Review ok. Only one typo found.
# detect_required_features() function), it does NOT guarantee that the | ||
# result is accurate. It does not check other conditions, such as: | ||
# - MBEDTLS_SSL_PROTO_TLS1_x can be disabled to selectively remove | ||
# TLS 1.2/1.3 suppport |
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.
typo: support
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.
Ops, sorry for this. In case this PR does not require any change, I will fix this in the following one (#7117)
# Note: the function "detect_required_features()" is not able to detect more than | ||
# one "force_ciphersuite" per client/server and it only picks the 2nd one. | ||
# Therefore the 1st one is added explicitly here |
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.
I don't understand this comment: detect_required_features
runs independently on the client command line and on the server command line. If they have different force_ciphersuite
options, this should lead to skipping the test case unless both TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256
and TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256
are enabled. So the explicit requirement on MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
should not be necessary. What am I missing?
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.
I just had a look and I don't think you're missing anything. @valeriosetti wdyt?
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.
It's been some time since I did this change, so I'm trying to remember the exact reason for it. I looked at the code and I think the problem with these tests:
SSL async private: cancel after start then fall back to transparent key
SSL async private: sign, error in resume then fall back to transparent key
is that they define 2 different ciphersuites for the client (because the client is run twice).
In the scenario you described (which is the most used case) we have 1 ciphersuite for the server and 1 for the client, so detect_required_features
works well. Here the problem is that we are running the client twice, with different ciphersuites in each case, but detect_required_features()
only picks the 2nd one (ignoring ECDHE-ECDSA
). That's why I enforced that in those tests.
I agree that a better approach would have been to extend detect_required_features()
in order to support multiple ciphersuites, but it was only a matter of 2 tests, so that's why I didn't try to do so.
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.
Oh duh, yes, I see, it's because we run the client twice. I agree with not making the detection code more complex just for two test cases. Thanks for the explanation.
Description
The goal of this PR is to re-enable
ssl-opt.sh
tests when running accelerated ECDSA coverage analysis.Resolves #6861
Depends on #7064Gatekeeper checklist