From b328e36e41dc0c529c897fe845c53be1d39424be Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Tue, 3 Jan 2012 14:08:03 +0000 Subject: Add a new QT_NO_SSL feature macro. At the moment users of Qt must detect if it was compiled with SSL support by testing for QT_NO_OPENSSL. This means that any code that is conditionally compiled this way is tied to the presence of the openssl backend. This commit makes it possible to implement new SSL backends during the Qt5 lifetime without breaking this code. People can still test for QT_NO_OPENSSL if they really need openssl, but if they simply want to know if there's SSL support at all they should use this define instead. In addition, this commit changes the public API headers to use the new define. Change-Id: Ib57a71aa65836ac9351f120a487bfeb8009d9515 Reviewed-by: Peter Hartmann --- configure | 2 +- configure.exe | Bin 1150464 -> 1115648 bytes src/network/ssl/qsslcertificate.h | 4 ++-- src/network/ssl/qsslcertificateextension.h | 4 ++-- src/network/ssl/qsslcipher.h | 4 ++-- src/network/ssl/qsslconfiguration.h | 4 ++-- src/network/ssl/qsslerror.h | 4 ++-- src/network/ssl/qsslkey.h | 4 ++-- src/network/ssl/qsslsocket.h | 6 +++--- tools/configure/configureapp.cpp | 5 ++++- 10 files changed, 20 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 9288de5d93..ce8f99c056 100755 --- a/configure +++ b/configure @@ -7790,7 +7790,7 @@ QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_S60" [ "$CFG_INOTIFY" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY" [ "$CFG_NAS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NAS" [ "$CFG_NIS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS" -[ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL" +[ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL QT_NO_SSL" [ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL" [ "$CFG_SM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SESSIONMANAGER" diff --git a/configure.exe b/configure.exe index 6048dc5708..e27966e3cd 100644 Binary files a/configure.exe and b/configure.exe differ diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h index 22721ad6b9..3aa7075eb3 100644 --- a/src/network/ssl/qsslcertificate.h +++ b/src/network/ssl/qsslcertificate.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Network) -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL class QDateTime; class QIODevice; @@ -152,7 +152,7 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslCertificate &certific Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QSslCertificate::SubjectInfo info); #endif -#endif // QT_NO_OPENSSL +#endif // QT_NO_SSL QT_END_NAMESPACE diff --git a/src/network/ssl/qsslcertificateextension.h b/src/network/ssl/qsslcertificateextension.h index 200ae3e091..6c1d219a3b 100644 --- a/src/network/ssl/qsslcertificateextension.h +++ b/src/network/ssl/qsslcertificateextension.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Network) -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL class QSslCertificateExtensionPrivate; @@ -78,7 +78,7 @@ private: QSharedDataPointer d; }; -#endif // QT_NO_OPENSSL +#endif // QT_NO_SSL QT_END_NAMESPACE diff --git a/src/network/ssl/qsslcipher.h b/src/network/ssl/qsslcipher.h index 112b7753a7..8d58fa50ba 100644 --- a/src/network/ssl/qsslcipher.h +++ b/src/network/ssl/qsslcipher.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Network) -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL class QSslCipherPrivate; class Q_NETWORK_EXPORT QSslCipher @@ -88,7 +88,7 @@ class QDebug; Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslCipher &cipher); #endif -#endif // QT_NO_OPENSSL +#endif // QT_NO_SSL QT_END_NAMESPACE diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h index 961c821ffc..37df073ae9 100644 --- a/src/network/ssl/qsslconfiguration.h +++ b/src/network/ssl/qsslconfiguration.h @@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Network) -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL template class QList; class QSslCertificate; @@ -132,7 +132,7 @@ private: QSharedDataPointer d; }; -#endif // QT_NO_OPENSSL +#endif // QT_NO_SSL QT_END_NAMESPACE diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h index 552d91da48..0bdc230b2e 100644 --- a/src/network/ssl/qsslerror.h +++ b/src/network/ssl/qsslerror.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Network) -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL class QSslErrorPrivate; class Q_NETWORK_EXPORT QSslError @@ -115,7 +115,7 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslError &error); Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslError::SslError &error); #endif -#endif // QT_NO_OPENSSL +#endif // QT_NO_SSL QT_END_NAMESPACE diff --git a/src/network/ssl/qsslkey.h b/src/network/ssl/qsslkey.h index eadb79dabe..d7d52fa992 100644 --- a/src/network/ssl/qsslkey.h +++ b/src/network/ssl/qsslkey.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Network) -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL template struct QPair; @@ -103,7 +103,7 @@ class QDebug; Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslKey &key); #endif -#endif // QT_NO_OPENSSL +#endif // QT_NO_SSL QT_END_NAMESPACE diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index 9a0500cae4..7dc888b155 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -45,7 +45,7 @@ #include #include -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL # include # include #endif @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Network) -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL class QDir; class QSslCipher; @@ -217,7 +217,7 @@ private: friend class QSslSocketBackendPrivate; }; -#endif // QT_NO_OPENSSL +#endif // QT_NO_SSL QT_END_NAMESPACE diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index c3ea048a18..bcc86cb697 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2915,7 +2915,10 @@ void Configure::generateConfigfiles() if (dictionary["EXCEPTIONS"] == "no") qconfigList += "QT_NO_EXCEPTIONS"; if (dictionary["OPENGL"] == "no") qconfigList += "QT_NO_OPENGL"; if (dictionary["OPENVG"] == "no") qconfigList += "QT_NO_OPENVG"; - if (dictionary["OPENSSL"] == "no") qconfigList += "QT_NO_OPENSSL"; + if (dictionary["OPENSSL"] == "no") { + qconfigList += "QT_NO_OPENSSL"; + qconfigList += "QT_NO_SSL"; + } if (dictionary["OPENSSL"] == "linked") qconfigList += "QT_LINKED_OPENSSL"; if (dictionary["DBUS"] == "no") qconfigList += "QT_NO_DBUS"; if (dictionary["WEBKIT"] == "no") qconfigList += "QT_NO_WEBKIT"; -- cgit v1.2.3