mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 08:16:33 +01:00
Merge smarter certificate selection for pre-TLS-1.2 clients
This commit is contained in:
commit
e522d0fa57
7 changed files with 142 additions and 39 deletions
|
|
@ -1404,6 +1404,60 @@ run_test "Authentication: client no cert, ssl3" \
|
|||
-C "! ssl_handshake returned" \
|
||||
-S "X509 - Certificate verification failed"
|
||||
|
||||
# Tests for certificate selection based on SHA verson
|
||||
|
||||
run_test "Certificate hash: client TLS 1.2 -> SHA-2" \
|
||||
"$P_SRV crt_file=data_files/server5.crt \
|
||||
key_file=data_files/server5.key \
|
||||
crt_file2=data_files/server5-sha1.crt \
|
||||
key_file2=data_files/server5.key" \
|
||||
"$P_CLI force_version=tls1_2" \
|
||||
0 \
|
||||
-c "signed using.*ECDSA with SHA256" \
|
||||
-C "signed using.*ECDSA with SHA1"
|
||||
|
||||
run_test "Certificate hash: client TLS 1.1 -> SHA-1" \
|
||||
"$P_SRV crt_file=data_files/server5.crt \
|
||||
key_file=data_files/server5.key \
|
||||
crt_file2=data_files/server5-sha1.crt \
|
||||
key_file2=data_files/server5.key" \
|
||||
"$P_CLI force_version=tls1_1" \
|
||||
0 \
|
||||
-C "signed using.*ECDSA with SHA256" \
|
||||
-c "signed using.*ECDSA with SHA1"
|
||||
|
||||
run_test "Certificate hash: client TLS 1.0 -> SHA-1" \
|
||||
"$P_SRV crt_file=data_files/server5.crt \
|
||||
key_file=data_files/server5.key \
|
||||
crt_file2=data_files/server5-sha1.crt \
|
||||
key_file2=data_files/server5.key" \
|
||||
"$P_CLI force_version=tls1" \
|
||||
0 \
|
||||
-C "signed using.*ECDSA with SHA256" \
|
||||
-c "signed using.*ECDSA with SHA1"
|
||||
|
||||
run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \
|
||||
"$P_SRV crt_file=data_files/server5.crt \
|
||||
key_file=data_files/server5.key \
|
||||
crt_file2=data_files/server6.crt \
|
||||
key_file2=data_files/server6.key" \
|
||||
"$P_CLI force_version=tls1_1" \
|
||||
0 \
|
||||
-c "serial number.*09" \
|
||||
-c "signed using.*ECDSA with SHA256" \
|
||||
-C "signed using.*ECDSA with SHA1"
|
||||
|
||||
run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \
|
||||
"$P_SRV crt_file=data_files/server6.crt \
|
||||
key_file=data_files/server6.key \
|
||||
crt_file2=data_files/server5.crt \
|
||||
key_file2=data_files/server5.key" \
|
||||
"$P_CLI force_version=tls1_1" \
|
||||
0 \
|
||||
-c "serial number.*0A" \
|
||||
-c "signed using.*ECDSA with SHA256" \
|
||||
-C "signed using.*ECDSA with SHA1"
|
||||
|
||||
# tests for SNI
|
||||
|
||||
run_test "SNI: no SNI callback" \
|
||||
|
|
@ -1956,7 +2010,7 @@ run_test "PSK callback: psk, no callback" \
|
|||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||
psk_identity=foo psk=abc123" \
|
||||
0 \
|
||||
-S "SSL - The server has no ciphersuites in common" \
|
||||
-S "SSL - None of the common ciphersuites is usable" \
|
||||
-S "SSL - Unknown identity received" \
|
||||
-S "SSL - Verification of the message MAC failed"
|
||||
|
||||
|
|
@ -1965,7 +2019,7 @@ run_test "PSK callback: no psk, no callback" \
|
|||
"$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 - None of the common ciphersuites is usable" \
|
||||
-S "SSL - Unknown identity received" \
|
||||
-S "SSL - Verification of the message MAC failed"
|
||||
|
||||
|
|
@ -1974,7 +2028,7 @@ run_test "PSK callback: callback overrides other settings" \
|
|||
"$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 - None of the common ciphersuites is usable" \
|
||||
-s "SSL - Unknown identity received" \
|
||||
-S "SSL - Verification of the message MAC failed"
|
||||
|
||||
|
|
@ -1983,7 +2037,7 @@ run_test "PSK callback: first id matches" \
|
|||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||
psk_identity=abc psk=dead" \
|
||||
0 \
|
||||
-S "SSL - The server has no ciphersuites in common" \
|
||||
-S "SSL - None of the common ciphersuites is usable" \
|
||||
-S "SSL - Unknown identity received" \
|
||||
-S "SSL - Verification of the message MAC failed"
|
||||
|
||||
|
|
@ -1992,7 +2046,7 @@ run_test "PSK callback: second id matches" \
|
|||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||
psk_identity=def psk=beef" \
|
||||
0 \
|
||||
-S "SSL - The server has no ciphersuites in common" \
|
||||
-S "SSL - None of the common ciphersuites is usable" \
|
||||
-S "SSL - Unknown identity received" \
|
||||
-S "SSL - Verification of the message MAC failed"
|
||||
|
||||
|
|
@ -2001,7 +2055,7 @@ run_test "PSK callback: no match" \
|
|||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||
psk_identity=ghi psk=beef" \
|
||||
1 \
|
||||
-S "SSL - The server has no ciphersuites in common" \
|
||||
-S "SSL - None of the common ciphersuites is usable" \
|
||||
-s "SSL - Unknown identity received" \
|
||||
-S "SSL - Verification of the message MAC failed"
|
||||
|
||||
|
|
@ -2010,7 +2064,7 @@ run_test "PSK callback: wrong key" \
|
|||
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
||||
psk_identity=abc psk=beef" \
|
||||
1 \
|
||||
-S "SSL - The server has no ciphersuites in common" \
|
||||
-S "SSL - None of the common ciphersuites is usable" \
|
||||
-S "SSL - Unknown identity received" \
|
||||
-s "SSL - Verification of the message MAC failed"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue