[asterisk-scf-commits] asterisk-scf/integration/pjproject.git branch "fix-oneiric" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Oct 24 13:01:26 CDT 2011


branch "fix-oneiric" has been created
        at  4eb0721525b2a3a406950f8313162d2e679bd76b (commit)

- Log -----------------------------------------------------------------
commit 4eb0721525b2a3a406950f8313162d2e679bd76b
Author: David M. Lee <dlee at digium.com>
Date:   Mon Oct 24 12:59:00 2011 -0500

    Fixed for Ubuntu Oneiric.
    
    In Oneiric, OpenSSL has SSLv2 disabled, which results in link errors
    unless you #ifdef appropriately.

diff --git a/pjlib/src/pj/ssl_sock_ossl.c b/pjlib/src/pj/ssl_sock_ossl.c
index 516f161..eb7c2fe 100644
--- a/pjlib/src/pj/ssl_sock_ossl.c
+++ b/pjlib/src/pj/ssl_sock_ossl.c
@@ -305,13 +305,24 @@ static pj_status_t init_openssl(void)
 	STACK_OF(SSL_CIPHER) *sk_cipher;
 	unsigned i, n;
 
+#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
 	meth = (SSL_METHOD*)SSLv23_server_method();
+#endif
+
+#if !defined(OPENSSL_NO_TLS1)
 	if (!meth)
 	    meth = (SSL_METHOD*)TLSv1_server_method();
+#endif
+
+#if !defined(OPENSSL_NO_SSL3)
 	if (!meth)
 	    meth = (SSL_METHOD*)SSLv3_server_method();
+#endif
+
+#if !defined(OPENSSL_NO_SSL2)
 	if (!meth)
 	    meth = (SSL_METHOD*)SSLv2_server_method();
+#endif
 	pj_assert(meth);
 
 	ctx=SSL_CTX_new(meth);
@@ -485,18 +496,26 @@ static pj_status_t create_ssl(pj_ssl_sock_t *ssock)
     /* Determine SSL method to use */
     switch (ssock->param.proto) {
     case PJ_SSL_SOCK_PROTO_DEFAULT:
+#if !defined(OPENSSL_NO_TLS1)
     case PJ_SSL_SOCK_PROTO_TLS1:
 	ssl_method = (SSL_METHOD*)TLSv1_method();
 	break;
+#endif
+#if !defined(OPENSSL_NO_SSL2)
     case PJ_SSL_SOCK_PROTO_SSL2:
 	ssl_method = (SSL_METHOD*)SSLv2_method();
 	break;
+#endif
+#if !defined(OPENSSL_NO_SSL3)
     case PJ_SSL_SOCK_PROTO_SSL3:
 	ssl_method = (SSL_METHOD*)SSLv3_method();
 	break;
+#endif
+#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
     case PJ_SSL_SOCK_PROTO_SSL23:
 	ssl_method = (SSL_METHOD*)SSLv23_method();
 	break;
+#endif
     //case PJ_SSL_SOCK_PROTO_DTLS1:
 	//ssl_method = (SSL_METHOD*)DTLSv1_method();
 	//break;

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/pjproject.git



More information about the asterisk-scf-commits mailing list