Ticket #51135: patch-src_network_ssl_qsslsocket_openssl.diff

File patch-src_network_ssl_qsslsocket_openssl.diff, 5.2 KB (added by kylesch@…, 8 years ago)

patch allowing qt4-mac to build against libressl by wrapping SSLv3_* function calls in macro checks using '#ifndef OPENSSL_NO_SSLV3'

  • src/network/ssl/qsslsocket_openssl.cpp

    old new  
    267267#endif
    268268        break;
    269269    case QSsl::SslV3:
     270#ifndef OPENSSL_NO_SSL3
    270271        ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method());
     272#else
     273        ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
     274//      SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1|SSL_OP_NO_SSLv2);
     275#endif
    271276        break;
    272277    case QSsl::SecureProtocols: // SslV2 will be disabled below
    273278    case QSsl::TlsV1SslV3: // SslV2 will be disabled below
    274 -- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig  2015-05-07 10:14:44.000000000 -0400
     279++ src/network/ssl/qsslsocket_openssl_symbols.cpp       2016-07-20 16:04:54.000000000 -0400
     
    225225DEFINEFUNC(void, SSL_set_connect_state, SSL *a, a, return, DUMMYARG)
    226226DEFINEFUNC(int, SSL_shutdown, SSL *a, a, return -1, return)
    227227#if OPENSSL_VERSION_NUMBER >= 0x10000000L
    228 #ifndef OPENSSL_NO_SSL2
     228# ifndef OPENSSL_NO_SSL2
    229229DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
    230 #endif
     230# endif
     231# ifndef OPENSSL_NO_SSL3
    231232DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
     233# else
    232234DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
     235# endif
    233236DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
    234 #ifndef OPENSSL_NO_SSL2
     237# ifndef OPENSSL_NO_SSL2
    235238DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
    236 #endif
     239# endif
     240# ifndef OPENSSL_NO_SSL3
    237241DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
     242# else
    238243DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
     244# endif
    239245DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
    240246#else
    241247DEFINEFUNC(SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
     248# ifndef OPENSSL_NO_SSL3
    242249DEFINEFUNC(SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
     250# else
    243251DEFINEFUNC(SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
     252# endif
    244253DEFINEFUNC(SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
    245254DEFINEFUNC(SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
     255# ifndef OPENSSL_NO_SSL3
    246256DEFINEFUNC(SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
     257# else
    247258DEFINEFUNC(SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
     259# endif
    248260DEFINEFUNC(SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
    249261#endif
    250262DEFINEFUNC3(int, SSL_write, SSL *a, a, const void *b, b, int c, c, return -1, return)
     
    687699    RESOLVEFUNC(SSL_shutdown, 173, libs.first )
    688700    RESOLVEFUNC(SSL_write, 188, libs.first )
    689701    RESOLVEFUNC(SSLv2_client_method, 192, libs.first )
     702#ifndef OPENSSL_NO_SSL3
    690703    RESOLVEFUNC(SSLv3_client_method, 195, libs.first )
     704#else
    691705    RESOLVEFUNC(SSLv23_client_method, 189, libs.first )
     706#endif
    692707    RESOLVEFUNC(TLSv1_client_method, 198, libs.first )
    693708    RESOLVEFUNC(SSLv2_server_method, 194, libs.first )
     709#ifndef OPENSSL_NO_SSL3
    694710    RESOLVEFUNC(SSLv3_server_method, 197, libs.first )
     711#else
    695712    RESOLVEFUNC(SSLv23_server_method, 191, libs.first )
     713#endif
    696714    RESOLVEFUNC(TLSv1_server_method, 200, libs.first )
    697715    RESOLVEFUNC(SSL_CTX_load_verify_locations, 34, libs.first )
    698716    RESOLVEFUNC(X509_NAME_entry_count, 1821, libs.second )
     
    822840#ifndef OPENSSL_NO_SSL2
    823841    RESOLVEFUNC(SSLv2_client_method)
    824842#endif
     843#ifndef OPENSSL_NO_SSL3
    825844    RESOLVEFUNC(SSLv3_client_method)
     845#else
    826846    RESOLVEFUNC(SSLv23_client_method)
     847#endif
    827848    RESOLVEFUNC(TLSv1_client_method)
    828849#ifndef OPENSSL_NO_SSL2
    829850    RESOLVEFUNC(SSLv2_server_method)
    830851#endif
     852#ifndef OPENSSL_NO_SSL3
    831853    RESOLVEFUNC(SSLv3_server_method)
     854#else
    832855    RESOLVEFUNC(SSLv23_server_method)
     856#endif
    833857    RESOLVEFUNC(TLSv1_server_method)
    834858    RESOLVEFUNC(X509_NAME_entry_count)
    835859    RESOLVEFUNC(X509_NAME_get_entry)
  • src/network/ssl/qsslsocket_openssl_symbols_p.h

    old new  
    327327int q_SSL_shutdown(SSL *a);
    328328#if OPENSSL_VERSION_NUMBER >= 0x10000000L
    329329const SSL_METHOD *q_SSLv2_client_method();
     330#ifndef OPENSSL_NO_SSL3
    330331const SSL_METHOD *q_SSLv3_client_method();
     332#else
    331333const SSL_METHOD *q_SSLv23_client_method();
     334#endif
    332335const SSL_METHOD *q_TLSv1_client_method();
    333336const SSL_METHOD *q_SSLv2_server_method();
     337#ifndef OPENSSL_NO_SSL3
    334338const SSL_METHOD *q_SSLv3_server_method();
     339#else
    335340const SSL_METHOD *q_SSLv23_server_method();
     341#endif
    336342const SSL_METHOD *q_TLSv1_server_method();
    337343#else
    338344SSL_METHOD *q_SSLv2_client_method();
     345#ifndef OPENSSL_NO_SSL3
    339346SSL_METHOD *q_SSLv3_client_method();
     347#else
    340348SSL_METHOD *q_SSLv23_client_method();
     349#endif
    341350SSL_METHOD *q_TLSv1_client_method();
    342351SSL_METHOD *q_SSLv2_server_method();
     352#ifndef OPENSSL_NO_SSL3
    343353SSL_METHOD *q_SSLv3_server_method();
     354#else
    344355SSL_METHOD *q_SSLv23_server_method();
     356#endif
    345357SSL_METHOD *q_TLSv1_server_method();
    346358#endif
    347359int q_SSL_write(SSL *a, const void *b, int c);