Also activate PSK-only mode when PSK-ephemeral key exchanges are available

The point of PSK-only mode is to transform certificate-based command lines
into PSK-based command lines, when the certificates are not relevant to what
is being tested. So it makes sense to do that in with PSK-ephemeral key
exchanges too.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh
index d97b372..cbeedcf 100755
--- a/tests/ssl-opt.sh
+++ b/tests/ssl-opt.sh
@@ -598,15 +598,19 @@
     adapt_cmd_for_psk SRV_CMD "$SRV_CMD"
 }
 
-# PSK_PRESENT="YES" if at least one protocol versions supports pure-PSK.
+# PSK_PRESENT="YES" if at least one protocol versions supports at least
+# one PSK key exchange mode.
 PSK_PRESENT="NO"
-# PSK_ONLY="YES" if no key exchange is enabled except pure-PSK.
+# PSK_ONLY="YES" if all the available key exchange modes are PSK-based
+# (pure-PSK or PSK-ephemeral, possibly both).
 PSK_ONLY=""
 for c in $CONFIGS_ENABLED; do
     case $c in
         MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) PSK_PRESENT="YES";;
+        MBEDTLS_KEY_EXCHANGE_PSK_*_ENABLED) PSK_PRESENT="YES";;
         MBEDTLS_KEY_EXCHANGE_*_ENABLED) PSK_ONLY="NO";;
         MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) PSK_PRESENT="YES";;
+        MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_*_ENABLED) PSK_PRESENT="YES";;
         MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_*_ENABLED) PSK_ONLY="NO";;
     esac
 done