mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-06 12:40:02 +00:00
Fix PSK-only mode doing less than it should
Don't add a certificate requirement when PSK is enabled. Do command line requirement detection after the injection of PSK into the command line in PSK-only mode. Otherwise certificate requirements would be added even in PSK-only mode. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
ae3dc17e50
commit
4f0986487d
@ -489,6 +489,7 @@ detect_required_features() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case "$CMD_LINE" in
|
case "$CMD_LINE" in
|
||||||
|
*[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK
|
||||||
*/server5*|\
|
*/server5*|\
|
||||||
*/server7*|\
|
*/server7*|\
|
||||||
*/dir-maxpath*)
|
*/dir-maxpath*)
|
||||||
@ -524,6 +525,7 @@ detect_required_features() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case "$CMD_LINE" in
|
case "$CMD_LINE" in
|
||||||
|
*[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK
|
||||||
*/server1*|\
|
*/server1*|\
|
||||||
*/server2*|\
|
*/server2*|\
|
||||||
*/server7*)
|
*/server7*)
|
||||||
@ -1755,14 +1757,14 @@ run_test() {
|
|||||||
TLS_VERSION="TLS12"
|
TLS_VERSION="TLS12"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If we're in a PSK-only build and the test can be adapted to PSK, do that.
|
||||||
|
maybe_adapt_for_psk "$@"
|
||||||
|
|
||||||
# If the client or server requires certain features that can be detected
|
# If the client or server requires certain features that can be detected
|
||||||
# from their command-line arguments, check whether they're enabled.
|
# from their command-line arguments, check whether they're enabled.
|
||||||
detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@"
|
detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@"
|
||||||
detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@"
|
detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@"
|
||||||
|
|
||||||
# If we're in a PSK-only build and the test can be adapted to PSK, do that.
|
|
||||||
maybe_adapt_for_psk "$@"
|
|
||||||
|
|
||||||
# should we skip?
|
# should we skip?
|
||||||
if [ "X$SKIP_NEXT" = "XYES" ]; then
|
if [ "X$SKIP_NEXT" = "XYES" ]; then
|
||||||
SKIP_NEXT="NO"
|
SKIP_NEXT="NO"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user