mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 22:20:42 +00:00
wldap32: Skip over the TLS certificate check if not using TLS.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54772
This commit is contained in:
parent
b5ba4baa51
commit
12b5da66e9
|
@ -271,17 +271,17 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout )
|
||||||
if ((ret = ldap_get_option( CTX(ld), LDAP_OPT_X_TLS_SSL_CTX, &tls_context )))
|
if ((ret = ldap_get_option( CTX(ld), LDAP_OPT_X_TLS_SSL_CTX, &tls_context )))
|
||||||
return map_error( ret );
|
return map_error( ret );
|
||||||
|
|
||||||
if (QueryContextAttributesA( tls_context, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &cert ) != SEC_E_OK)
|
if (QueryContextAttributesA( tls_context, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &cert ) == SEC_E_OK)
|
||||||
return WLDAP32_LDAP_SERVER_DOWN;
|
|
||||||
|
|
||||||
if (cert_callback( ld, &cert ))
|
|
||||||
{
|
{
|
||||||
TRACE( "accepted\n" );
|
if (cert_callback( ld, &cert ))
|
||||||
}
|
{
|
||||||
else
|
TRACE( "accepted\n" );
|
||||||
{
|
}
|
||||||
WARN( "rejected\n" );
|
else
|
||||||
return WLDAP32_LDAP_SERVER_DOWN;
|
{
|
||||||
|
WARN( "rejected\n" );
|
||||||
|
return WLDAP32_LDAP_SERVER_DOWN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -586,6 +586,8 @@ static void test_opt_server_certificate(void)
|
||||||
ok( !ret, "ldap_set_optionA should succeed, got %#lx\n", ret );
|
ok( !ret, "ldap_set_optionA should succeed, got %#lx\n", ret );
|
||||||
ret = ldap_set_optionA( ld, LDAP_OPT_SERVER_CERTIFICATE, &verify_certificate );
|
ret = ldap_set_optionA( ld, LDAP_OPT_SERVER_CERTIFICATE, &verify_certificate );
|
||||||
ok( !ret, "ldap_set_optionA should succeed, got %#lx\n", ret );
|
ok( !ret, "ldap_set_optionA should succeed, got %#lx\n", ret );
|
||||||
|
ret = ldap_connect( ld, NULL );
|
||||||
|
ok( !ret, "ldap_connect should succeed, got %#lx\n", ret );
|
||||||
ret = ldap_start_tls_sA( ld, NULL, NULL, NULL, NULL );
|
ret = ldap_start_tls_sA( ld, NULL, NULL, NULL, NULL );
|
||||||
ok( ret == LDAP_LOCAL_ERROR, "ldap_start_tls_sA should fail, got %#lx\n", ret );
|
ok( ret == LDAP_LOCAL_ERROR, "ldap_start_tls_sA should fail, got %#lx\n", ret );
|
||||||
ldap_unbind( ld );
|
ldap_unbind( ld );
|
||||||
|
|
Loading…
Reference in a new issue