mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-24 05:00:45 -04:00
mbedtls_ssl_set_hostname tests: add tests with CA callback
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
1f6864b174
commit
da0e32e2fb
@ -6089,6 +6089,18 @@ run_test "Authentication: hostname match, client required" \
|
||||
-C "! mbedtls_ssl_handshake returned" \
|
||||
-C "X509 - Certificate verification failed"
|
||||
|
||||
run_test "Authentication: hostname match, client required, CA callback" \
|
||||
"$P_SRV" \
|
||||
"$P_CLI auth_mode=required server_name=localhost debug_level=3 ca_callback=1" \
|
||||
0 \
|
||||
-C "does not match with the expected CN" \
|
||||
-C "Certificate verification without having set hostname" \
|
||||
-C "Certificate verification without CN verification" \
|
||||
-c "use CA callback for X.509 CRT verification" \
|
||||
-C "x509_verify_cert() returned -" \
|
||||
-C "! mbedtls_ssl_handshake returned" \
|
||||
-C "X509 - Certificate verification failed"
|
||||
|
||||
run_test "Authentication: hostname mismatch (wrong), client required" \
|
||||
"$P_SRV" \
|
||||
"$P_CLI auth_mode=required server_name=wrong-name debug_level=1" \
|
||||
@ -6209,6 +6221,34 @@ run_test "Authentication: hostname unset, client required, historical config" \
|
||||
-C "! mbedtls_ssl_handshake returned" \
|
||||
-C "X509 - Certificate verification failed"
|
||||
|
||||
requires_config_disabled MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME
|
||||
run_test "Authentication: hostname unset, client required, secure config, CA callback" \
|
||||
"$P_SRV" \
|
||||
"$P_CLI auth_mode=required set_hostname=no debug_level=3 ca_callback=1" \
|
||||
1 \
|
||||
-C "does not match with the expected CN" \
|
||||
-c "Certificate verification without having set hostname" \
|
||||
-C "Certificate verification without CN verification" \
|
||||
-c "get_hostname_for_verification() returned -" \
|
||||
-C "use CA callback for X.509 CRT verification" \
|
||||
-C "x509_verify_cert() returned -" \
|
||||
-c "! mbedtls_ssl_handshake returned" \
|
||||
-C "X509 - Certificate verification failed"
|
||||
|
||||
requires_config_enabled MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME
|
||||
run_test "Authentication: hostname unset, client required, historical config, CA callback" \
|
||||
"$P_SRV" \
|
||||
"$P_CLI auth_mode=required set_hostname=no debug_level=3 ca_callback=1" \
|
||||
0 \
|
||||
-C "does not match with the expected CN" \
|
||||
-c "Certificate verification without having set hostname" \
|
||||
-c "Certificate verification without CN verification" \
|
||||
-C "get_hostname_for_verification() returned -" \
|
||||
-c "use CA callback for X.509 CRT verification" \
|
||||
-C "x509_verify_cert() returned -" \
|
||||
-C "! mbedtls_ssl_handshake returned" \
|
||||
-C "X509 - Certificate verification failed"
|
||||
|
||||
run_test "Authentication: hostname unset, client optional" \
|
||||
"$P_SRV" \
|
||||
"$P_CLI auth_mode=optional set_hostname=no debug_level=2" \
|
||||
|
Loading…
x
Reference in New Issue
Block a user