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

driver-only ECC: BN.TLS testing #8008

Merged
merged 5 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions library/ssl_tls13_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,7 @@ int mbedtls_ssl_tls13_read_public_xxdhe_share(mbedtls_ssl_context *ssl,
return 0;
}

#if defined(PSA_WANT_ALG_FFDH)
static psa_status_t mbedtls_ssl_get_psa_ffdh_info_from_tls_id(
uint16_t tls_id, size_t *bits, psa_key_type_t *key_type)
{
Expand Down Expand Up @@ -1549,6 +1550,7 @@ static psa_status_t mbedtls_ssl_get_psa_ffdh_info_from_tls_id(
return PSA_ERROR_NOT_SUPPORTED;
}
}
#endif /* PSA_WANT_ALG_FFDH */

int mbedtls_ssl_tls13_generate_and_write_xxdh_key_exchange(
mbedtls_ssl_context *ssl,
Expand Down
16 changes: 7 additions & 9 deletions tests/scripts/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2656,10 +2656,8 @@ component_test_psa_crypto_config_reference_ecc_no_ecp_at_all () {
# - component_test_psa_crypto_config_reference_ecc_no_bignum
config_psa_crypto_config_accel_ecc_no_bignum() {
DRIVER_ONLY="$1"
# start with full config for maximum coverage (also enables USE_PSA),
# but keep TLS and key exchanges disabled
# start with full config for maximum coverage (also enables USE_PSA)
helper_libtestdriver1_adjust_config "full"
scripts/config.py unset MBEDTLS_SSL_TLS_C

if [ "$DRIVER_ONLY" -eq 1 ]; then
# Disable modules that are accelerated
Expand Down Expand Up @@ -2712,7 +2710,7 @@ config_psa_crypto_config_accel_ecc_no_bignum() {
#
# Keep in sync with component_test_psa_crypto_config_reference_ecc_no_bignum()
component_test_psa_crypto_config_accel_ecc_no_bignum () {
msg "build: full + accelerated EC algs + USE_PSA - ECP"
msg "build: full + accelerated EC algs + USE_PSA - ECP - BIGNUM"

# Algorithms and key types to accelerate
loc_accel_list="ALG_ECDSA ALG_DETERMINISTIC_ECDSA \
Expand Down Expand Up @@ -2754,12 +2752,12 @@ component_test_psa_crypto_config_accel_ecc_no_bignum () {
# Run the tests
# -------------

msg "test suites: full + accelerated EC algs + USE_PSA - ECP"
msg "test suites: full + accelerated EC algs + USE_PSA - ECP - BIGNUM"
make test

# The following will be enabled in #7756
#msg "ssl-opt: full + accelerated EC algs + USE_PSA - ECP"
#tests/ssl-opt.sh
msg "ssl-opt: full + accelerated EC algs + USE_PSA - ECP - BIGNUM"
tests/ssl-opt.sh
}

# Reference function used for driver's coverage analysis in analyze_outcomes.py
Expand All @@ -2776,8 +2774,8 @@ component_test_psa_crypto_config_reference_ecc_no_bignum () {
make test

# The following will be enabled in #7756
#msg "ssl-opt: full + non accelerated EC algs + USE_PSA"
#tests/ssl-opt.sh
msg "ssl-opt: full + non accelerated EC algs + USE_PSA"
tests/ssl-opt.sh
}

# Helper function used in:
Expand Down
10 changes: 10 additions & 0 deletions tests/scripts/analyze_outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,16 @@ def do_analyze_driver_vs_reference(outcome_file, args):
'ASN.1 Write mpi, 255*8-1 bits',
'ASN.1 Write mpi, 256*8-1 bits',
],
'test_suite_debug': [
# Following tests depends on BIGNUM_C
'Debug print mbedtls_mpi #2: 3 bits',
'Debug print mbedtls_mpi: 0 (empty representation)',
'Debug print mbedtls_mpi: 0 (non-empty representation)',
'Debug print mbedtls_mpi: 49 bits',
'Debug print mbedtls_mpi: 759 bits',
'Debug print mbedtls_mpi: 764 bits #1',
'Debug print mbedtls_mpi: 764 bits #2',
],
}
}
},
Expand Down
7 changes: 7 additions & 0 deletions tests/ssl-opt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,13 @@ detect_required_features() {
;;
esac

case "$CMD_LINE" in
*server2*|\
*server7*)
# server2 and server7 certificates use RSA encryption
requires_config_enabled "MBEDTLS_RSA_C"
esac

unset tmp
}

Expand Down