From: Paul Belanger Date: Thu, 18 Nov 2010 17:51:34 +0000 (+0000) Subject: Fix compiler warnings when using openssl-dev 1.0.0+ X-Git-Tag: 1.6.2.16-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=952edec236ed042e885cfa8987cb77dab1ea968e;p=thirdparty%2Fasterisk.git Fix compiler warnings when using openssl-dev 1.0.0+ Review: https://reviewboard.asterisk.org/r/1016/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@295440 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/jabber.h b/include/asterisk/jabber.h index b56900d145..84f42f7080 100644 --- a/include/asterisk/jabber.h +++ b/include/asterisk/jabber.h @@ -153,7 +153,7 @@ struct aji_client { #ifdef HAVE_OPENSSL SSL_CTX *ssl_context; SSL *ssl_session; - SSL_METHOD *ssl_method; + const SSL_METHOD *ssl_method; unsigned int stream_flags; #endif /* HAVE_OPENSSL */ enum aji_state state; diff --git a/res/res_jabber.c b/res/res_jabber.c index e4bdacc785..5031560896 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -618,40 +618,45 @@ static int aji_tls_handshake(struct aji_client *client) { int ret; int sock; - - ast_debug(1, "Starting TLS handshake\n"); + + ast_debug(1, "Starting TLS handshake\n"); /* Choose an SSL/TLS protocol version, create SSL_CTX */ client->ssl_method = SSLv3_method(); - client->ssl_context = SSL_CTX_new(client->ssl_method); - if (!client->ssl_context) + client->ssl_context = SSL_CTX_new((SSL_METHOD *) client->ssl_method); + if (!client->ssl_context) { return IKS_NET_TLSFAIL; + } /* Create new SSL session */ client->ssl_session = SSL_new(client->ssl_context); - if (!client->ssl_session) + if (!client->ssl_session) { return IKS_NET_TLSFAIL; + } /* Enforce TLS on our XMPP connection */ sock = iks_fd(client->p); ret = SSL_set_fd(client->ssl_session, sock); - if (!ret) + if (!ret) { return IKS_NET_TLSFAIL; + } /* Perform SSL handshake */ ret = SSL_connect(client->ssl_session); - if (!ret) + if (!ret) { return IKS_NET_TLSFAIL; + } client->stream_flags &= (~TRY_SECURE); client->stream_flags |= SECURE; /* Sent over the established TLS connection */ ret = aji_send_header(client, client->jid->server); - if (ret != IKS_OK) + if (ret != IKS_OK) { return IKS_NET_TLSFAIL; + } - ast_debug(1, "TLS started with server\n"); + ast_debug(1, "TLS started with server\n"); return IKS_OK; }