1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-24 15:17:02 +01:00

* gpgkeys_ldap.c (main): Fix build problem with non-OpenLDAP LDAP

libraries that have TLS.
This commit is contained in:
David Shaw 2006-03-03 21:55:38 +00:00
parent 78904c691c
commit 9523139ee7
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2006-03-03 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_ldap.c (main): Fix build problem with non-OpenLDAP LDAP
libraries that have TLS.
2006-02-23 David Shaw <dshaw@jabberwocky.com> 2006-02-23 David Shaw <dshaw@jabberwocky.com>
* ksutil.c (init_ks_options): Default include-revoked and * ksutil.c (init_ks_options): Default include-revoked and

View File

@ -1928,7 +1928,8 @@ main(int argc,char *argv[])
return KEYSERVER_INTERNAL_ERROR; return KEYSERVER_INTERNAL_ERROR;
} }
#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS_CACERTFILE) #if defined(LDAP_OPT_X_TLS_CACERTFILE) && defined(HAVE_LDAP_SET_OPTION)
if(opt->ca_cert_file) if(opt->ca_cert_file)
{ {
err=ldap_set_option(NULL,LDAP_OPT_X_TLS_CACERTFILE,opt->ca_cert_file); err=ldap_set_option(NULL,LDAP_OPT_X_TLS_CACERTFILE,opt->ca_cert_file);
@ -1940,7 +1941,7 @@ main(int argc,char *argv[])
goto fail; goto fail;
} }
} }
#endif /* HAVE_LDAP_SET_OPTION && LDAP_OPT_X_TLS_CACERTFILE */ #endif /* LDAP_OPT_X_TLS_CACERTFILE && HAVE_LDAP_SET_OPTION */
/* SSL trumps TLS */ /* SSL trumps TLS */
if(use_ssl) if(use_ssl)
@ -2104,6 +2105,8 @@ main(int argc,char *argv[])
int ver=LDAP_VERSION3; int ver=LDAP_VERSION3;
err=ldap_set_option(ldap,LDAP_OPT_PROTOCOL_VERSION,&ver); err=ldap_set_option(ldap,LDAP_OPT_PROTOCOL_VERSION,&ver);
#ifdef LDAP_OPT_X_TLS
if(err==LDAP_SUCCESS) if(err==LDAP_SUCCESS)
{ {
if(opt->flags.check_cert) if(opt->flags.check_cert)
@ -2112,9 +2115,11 @@ main(int argc,char *argv[])
ver=LDAP_OPT_X_TLS_NEVER; ver=LDAP_OPT_X_TLS_NEVER;
err=ldap_set_option(ldap,LDAP_OPT_X_TLS_REQUIRE_CERT,&ver); err=ldap_set_option(ldap,LDAP_OPT_X_TLS_REQUIRE_CERT,&ver);
}
#endif
if(err==LDAP_SUCCESS) if(err==LDAP_SUCCESS)
err=ldap_start_tls_s(ldap,NULL,NULL); err=ldap_start_tls_s(ldap,NULL,NULL);
}
if(err!=LDAP_SUCCESS) if(err!=LDAP_SUCCESS)
{ {
@ -2128,7 +2133,7 @@ main(int argc,char *argv[])
goto fail; goto fail;
} }
} }
else if(err==LDAP_SUCCESS && opt->verbose>1) else if(opt->verbose>1)
fprintf(console,"gpgkeys: TLS started successfully.\n"); fprintf(console,"gpgkeys: TLS started successfully.\n");
#else #else
if(use_tls>=2) if(use_tls>=2)