From: Adam Dickmeiss Date: Thu, 5 Jun 2008 21:25:18 +0000 (+0200) Subject: Make cs_get_ssl return 0 if GNU TLS is enabled. X-Git-Tag: v3.0.30~6 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=966a14020bc5855bbc4f3aebaa157f5c6d4ae292;p=yaz-moved-to-github.git 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). --- 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;