From f7027514fb130a5cbc8301c1f53654cff4f7fb4e Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 23 Oct 2018 15:27:39 +0100 Subject: [PATCH] Add tests to ssl-opt.sh exercising client-side opaque PSK --- tests/ssl-opt.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index ce9aee28a..41fbf7c28 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -3830,6 +3830,62 @@ run_test "PSK callback: psk, no callback" \ -S "SSL - Unknown identity received" \ -S "SSL - Verification of the message MAC failed" +requires_config_enabled MBEDTLS_USE_PSA_CRYPTO +run_test "PSK callback: opaque psk on client, no callback" \ + "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ + "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ + psk_identity=foo psk=abc123 psk_slot=1" \ + 0 \ + -c "skip PMS generation for opaque PSK"\ + -S "skip PMS generation for opaque PSK"\ + -C "using extended master secret"\ + -S "using extended master secret"\ + -S "SSL - None of the common ciphersuites is usable" \ + -S "SSL - Unknown identity received" \ + -S "SSL - Verification of the message MAC failed" + +requires_config_enabled MBEDTLS_USE_PSA_CRYPTO +run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ + "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ + "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ + psk_identity=foo psk=abc123 psk_slot=1" \ + 0 \ + -c "skip PMS generation for opaque PSK"\ + -S "skip PMS generation for opaque PSK"\ + -C "using extended master secret"\ + -S "using extended master secret"\ + -S "SSL - None of the common ciphersuites is usable" \ + -S "SSL - Unknown identity received" \ + -S "SSL - Verification of the message MAC failed" + +requires_config_enabled MBEDTLS_USE_PSA_CRYPTO +run_test "PSK callback: opaque psk on client, no callback, EMS" \ + "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ + "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ + psk_identity=foo psk=abc123 psk_slot=1" \ + 0 \ + -c "skip PMS generation for opaque PSK"\ + -S "skip PMS generation for opaque PSK"\ + -c "using extended master secret"\ + -s "using extended master secret"\ + -S "SSL - None of the common ciphersuites is usable" \ + -S "SSL - Unknown identity received" \ + -S "SSL - Verification of the message MAC failed" + +requires_config_enabled MBEDTLS_USE_PSA_CRYPTO +run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ + "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ + "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ + psk_identity=foo psk=abc123 psk_slot=1" \ + 0 \ + -c "skip PMS generation for opaque PSK"\ + -S "skip PMS generation for opaque PSK"\ + -c "using extended master secret"\ + -s "using extended master secret"\ + -S "SSL - None of the common ciphersuites is usable" \ + -S "SSL - Unknown identity received" \ + -S "SSL - Verification of the message MAC failed" + run_test "PSK callback: no psk, no callback" \ "$P_SRV" \ "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \