mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-23 04:15:43 +01:00
Add test for PSK without a key
This commit is contained in:
parent
dc019b9559
commit
10c3c9fda8
@ -1263,11 +1263,21 @@ run_test "DHM parameters #1 (other parameters)" \
|
|||||||
|
|
||||||
# Tests for PSK callback
|
# Tests for PSK callback
|
||||||
|
|
||||||
run_test "PSK callback #0 (reference)" \
|
run_test "PSK callback #0a (psk, no callback)" \
|
||||||
"$P_SRV psk=abc123 psk_identity=foo" \
|
"$P_SRV psk=abc123 psk_identity=foo" \
|
||||||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||||
psk_identity=foo psk=abc123" \
|
psk_identity=foo psk=abc123" \
|
||||||
0 \
|
0 \
|
||||||
|
-S "SSL - The server has no ciphersuites in common" \
|
||||||
|
-S "SSL - Unknown identity received" \
|
||||||
|
-S "SSL - Verification of the message MAC failed"
|
||||||
|
|
||||||
|
run_test "PSK callback #0b (no psk, no callback)" \
|
||||||
|
"$P_SRV" \
|
||||||
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||||
|
psk_identity=foo psk=abc123" \
|
||||||
|
1 \
|
||||||
|
-s "SSL - The server has no ciphersuites in common" \
|
||||||
-S "SSL - Unknown identity received" \
|
-S "SSL - Unknown identity received" \
|
||||||
-S "SSL - Verification of the message MAC failed"
|
-S "SSL - Verification of the message MAC failed"
|
||||||
|
|
||||||
@ -1276,6 +1286,7 @@ run_test "PSK callback #1 (callback overrides other settings)" \
|
|||||||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||||
psk_identity=foo psk=abc123" \
|
psk_identity=foo psk=abc123" \
|
||||||
1 \
|
1 \
|
||||||
|
-S "SSL - The server has no ciphersuites in common" \
|
||||||
-s "SSL - Unknown identity received" \
|
-s "SSL - Unknown identity received" \
|
||||||
-S "SSL - Verification of the message MAC failed"
|
-S "SSL - Verification of the message MAC failed"
|
||||||
|
|
||||||
@ -1284,6 +1295,7 @@ run_test "PSK callback #2 (first id matches)" \
|
|||||||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||||
psk_identity=abc psk=dead" \
|
psk_identity=abc psk=dead" \
|
||||||
0 \
|
0 \
|
||||||
|
-S "SSL - The server has no ciphersuites in common" \
|
||||||
-S "SSL - Unknown identity received" \
|
-S "SSL - Unknown identity received" \
|
||||||
-S "SSL - Verification of the message MAC failed"
|
-S "SSL - Verification of the message MAC failed"
|
||||||
|
|
||||||
@ -1292,6 +1304,7 @@ run_test "PSK callback #3 (second id matches)" \
|
|||||||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||||
psk_identity=def psk=beef" \
|
psk_identity=def psk=beef" \
|
||||||
0 \
|
0 \
|
||||||
|
-S "SSL - The server has no ciphersuites in common" \
|
||||||
-S "SSL - Unknown identity received" \
|
-S "SSL - Unknown identity received" \
|
||||||
-S "SSL - Verification of the message MAC failed"
|
-S "SSL - Verification of the message MAC failed"
|
||||||
|
|
||||||
@ -1300,6 +1313,7 @@ run_test "PSK callback #4 (no match)" \
|
|||||||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||||
psk_identity=ghi psk=beef" \
|
psk_identity=ghi psk=beef" \
|
||||||
1 \
|
1 \
|
||||||
|
-S "SSL - The server has no ciphersuites in common" \
|
||||||
-s "SSL - Unknown identity received" \
|
-s "SSL - Unknown identity received" \
|
||||||
-S "SSL - Verification of the message MAC failed"
|
-S "SSL - Verification of the message MAC failed"
|
||||||
|
|
||||||
@ -1308,6 +1322,7 @@ run_test "PSK callback #5 (wrong key)" \
|
|||||||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||||
psk_identity=abc psk=beef" \
|
psk_identity=abc psk=beef" \
|
||||||
1 \
|
1 \
|
||||||
|
-S "SSL - The server has no ciphersuites in common" \
|
||||||
-S "SSL - Unknown identity received" \
|
-S "SSL - Unknown identity received" \
|
||||||
-s "SSL - Verification of the message MAC failed"
|
-s "SSL - Verification of the message MAC failed"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user