From 966a14020bc5855bbc4f3aebaa157f5c6d4ae292 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 5 Jun 2008 23:25:18 +0200 Subject: [PATCH] Make cs_get_ssl return 0 if GNU TLS is enabled. Make sure cs_get_ssl return 0 if GNU TLS is enabled. GNU TLS and OpenSSL are not binary compatible so must ensure that only OpenSSL applications makes use of this (e.g. yaz-client). --- src/tcpip.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/tcpip.c b/src/tcpip.c index 1c5f780..45bde1e 100644 --- a/src/tcpip.c +++ b/src/tcpip.c @@ -1356,26 +1356,30 @@ int static tcpip_set_blocking(COMSTACK p, int flags) return 1; } -#if ENABLE_SSL -int cs_set_ssl_ctx(COMSTACK cs, void *ctx) +void *cs_get_ssl(COMSTACK cs) { +#if HAVE_OPENSSL_SSL_H struct tcpip_state *sp; if (!cs || cs->type != ssl_type) return 0; sp = (struct tcpip_state *) cs->cprivate; - if (sp->ctx_alloc) - return 0; - sp->ctx = (SSL_CTX *) ctx; - return 1; + return sp->ssl; +#else + return 0; +#endif } -void *cs_get_ssl(COMSTACK cs) +#if ENABLE_SSL +int cs_set_ssl_ctx(COMSTACK cs, void *ctx) { struct tcpip_state *sp; if (!cs || cs->type != ssl_type) return 0; sp = (struct tcpip_state *) cs->cprivate; - return sp->ssl; + if (sp->ctx_alloc) + return 0; + sp->ctx = (SSL_CTX *) ctx; + return 1; } int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname) @@ -1418,11 +1422,6 @@ int cs_set_ssl_ctx(COMSTACK cs, void *ctx) return 0; } -void *cs_get_ssl(COMSTACK cs) -{ - return 0; -} - int cs_get_peer_certificate_x509(COMSTACK cs, char **buf, int *len) { return 0; -- 1.7.10.4