| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/network/ssl/qsslsocket.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | class QSslSocketGlobalData | - | ||||||||||||||||||||||||
| 6 | { | - | ||||||||||||||||||||||||
| 7 | public: | - | ||||||||||||||||||||||||
| 8 | QSslSocketGlobalData() : config(new QSslConfigurationPrivate) {} executed 15 times by 15 tests: end of blockExecuted by:
| 15 | ||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||
| 10 | QMutex mutex; | - | ||||||||||||||||||||||||
| 11 | QList<QSslCipher> supportedCiphers; | - | ||||||||||||||||||||||||
| 12 | QVector<QSslEllipticCurve> supportedEllipticCurves; | - | ||||||||||||||||||||||||
| 13 | QExplicitlySharedDataPointer<QSslConfigurationPrivate> config; | - | ||||||||||||||||||||||||
| 14 | }; | - | ||||||||||||||||||||||||
| 15 | namespace { namespace Q_QGS_globalData { typedef QSslSocketGlobalData Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
executed 15 times by 15 tests: }guard.store(QtGlobalStatic::Destroyed);Executed by:
executed 15 times by 15 tests: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blockExecuted by:
executed 4220 times by 16 tests: &holder.value;return &holder.value;Executed by:
executed 4220 times by 16 tests: } } } static QGlobalStatic<QSslSocketGlobalData, Q_QGS_globalData::innerFunction, Q_QGS_globalData::guard> globalData;return &holder.value;Executed by:
| 0-4220 | ||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||
| 20 | - | |||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||
| 22 | QSslSocket::QSslSocket(QObject *parent) | - | ||||||||||||||||||||||||
| 23 | : QTcpSocket(*new QSslSocketBackendPrivate, parent) | - | ||||||||||||||||||||||||
| 24 | { | - | ||||||||||||||||||||||||
| 25 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||
| 29 | d->q_ptr = this; | - | ||||||||||||||||||||||||
| 30 | d->init(); | - | ||||||||||||||||||||||||
| 31 | } executed 720 times by 8 tests: end of blockExecuted by:
| 720 | ||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||
| 34 | - | |||||||||||||||||||||||||
| 35 | - | |||||||||||||||||||||||||
| 36 | QSslSocket::~QSslSocket() | - | ||||||||||||||||||||||||
| 37 | { | - | ||||||||||||||||||||||||
| 38 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 39 | - | |||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | delete d->plainSocket; | - | ||||||||||||||||||||||||
| 43 | d->plainSocket = 0; | - | ||||||||||||||||||||||||
| 44 | } executed 714 times by 9 tests: end of blockExecuted by:
| 714 | ||||||||||||||||||||||||
| 45 | void QSslSocket::resume() | - | ||||||||||||||||||||||||
| 46 | { | - | ||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||
| 48 | QMetaObject::invokeMethod(this, "_q_resumeImplementation", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 49 | } executed 20 times by 1 test: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||
| 50 | void QSslSocket::connectToHostEncrypted(const QString &hostName, quint16 port, OpenMode mode, NetworkLayerProtocol protocol) | - | ||||||||||||||||||||||||
| 51 | { | - | ||||||||||||||||||||||||
| 52 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 53 | if (d->state == ConnectedState
| 0-405 | ||||||||||||||||||||||||
| 54 | for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
never executed: QMessageLogger( __FILE__ , 440 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 55 | __FILE__ never executed: QMessageLogger( __FILE__ , 440 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 56 | , never executed: QMessageLogger( __FILE__ , 440 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 57 | 440 never executed: QMessageLogger( __FILE__ , 440 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 58 | , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") never executed: QMessageLogger( __FILE__ , 440 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 59 | ; never executed: QMessageLogger( __FILE__ , 440 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 60 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 61 | } | - | ||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||
| 63 | d->init(); | - | ||||||||||||||||||||||||
| 64 | d->autoStartHandshake = true; | - | ||||||||||||||||||||||||
| 65 | d->initialized = true; | - | ||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||
| 67 | - | |||||||||||||||||||||||||
| 68 | - | |||||||||||||||||||||||||
| 69 | connectToHost(hostName, port, mode, protocol); | - | ||||||||||||||||||||||||
| 70 | } executed 405 times by 6 tests: end of blockExecuted by:
| 405 | ||||||||||||||||||||||||
| 71 | void QSslSocket::connectToHostEncrypted(const QString &hostName, quint16 port, | - | ||||||||||||||||||||||||
| 72 | const QString &sslPeerName, OpenMode mode, | - | ||||||||||||||||||||||||
| 73 | NetworkLayerProtocol protocol) | - | ||||||||||||||||||||||||
| 74 | { | - | ||||||||||||||||||||||||
| 75 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 76 | if (d->state == ConnectedState
| 0-5 | ||||||||||||||||||||||||
| 77 | for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
never executed: QMessageLogger( __FILE__ , 471 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 78 | __FILE__ never executed: QMessageLogger( __FILE__ , 471 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 79 | , never executed: QMessageLogger( __FILE__ , 471 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 80 | 471 never executed: QMessageLogger( __FILE__ , 471 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 81 | , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") never executed: QMessageLogger( __FILE__ , 471 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 82 | ; never executed: QMessageLogger( __FILE__ , 471 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::connectToHostEncrypted() called when already connecting/connected") ; | 0 | ||||||||||||||||||||||||
| 83 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 84 | } | - | ||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||
| 86 | d->init(); | - | ||||||||||||||||||||||||
| 87 | d->autoStartHandshake = true; | - | ||||||||||||||||||||||||
| 88 | d->initialized = true; | - | ||||||||||||||||||||||||
| 89 | d->verificationPeerName = sslPeerName; | - | ||||||||||||||||||||||||
| 90 | - | |||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||
| 92 | - | |||||||||||||||||||||||||
| 93 | connectToHost(hostName, port, mode, protocol); | - | ||||||||||||||||||||||||
| 94 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||
| 95 | bool QSslSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState state, OpenMode openMode) | - | ||||||||||||||||||||||||
| 96 | { | - | ||||||||||||||||||||||||
| 97 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||
| 99 | - | |||||||||||||||||||||||||
| 100 | - | |||||||||||||||||||||||||
| 101 | - | |||||||||||||||||||||||||
| 102 | if (!d->plainSocket
| 0-69 | ||||||||||||||||||||||||
| 103 | d->createPlainSocket(openMode); executed 69 times by 3 tests: d->createPlainSocket(openMode);Executed by:
| 69 | ||||||||||||||||||||||||
| 104 | bool retVal = d->plainSocket->setSocketDescriptor(socketDescriptor, state, openMode); | - | ||||||||||||||||||||||||
| 105 | d->cachedSocketDescriptor = d->plainSocket->socketDescriptor(); | - | ||||||||||||||||||||||||
| 106 | d->setError(d->plainSocket->error(), d->plainSocket->errorString()); | - | ||||||||||||||||||||||||
| 107 | setSocketState(state); | - | ||||||||||||||||||||||||
| 108 | setOpenMode(openMode); | - | ||||||||||||||||||||||||
| 109 | setLocalPort(d->plainSocket->localPort()); | - | ||||||||||||||||||||||||
| 110 | setLocalAddress(d->plainSocket->localAddress()); | - | ||||||||||||||||||||||||
| 111 | setPeerPort(d->plainSocket->peerPort()); | - | ||||||||||||||||||||||||
| 112 | setPeerAddress(d->plainSocket->peerAddress()); | - | ||||||||||||||||||||||||
| 113 | setPeerName(d->plainSocket->peerName()); | - | ||||||||||||||||||||||||
| 114 | d->readChannelCount = d->plainSocket->readChannelCount(); | - | ||||||||||||||||||||||||
| 115 | d->writeChannelCount = d->plainSocket->writeChannelCount(); | - | ||||||||||||||||||||||||
| 116 | return executed 69 times by 3 tests: retVal;return retVal;Executed by:
executed 69 times by 3 tests: return retVal;Executed by:
| 69 | ||||||||||||||||||||||||
| 117 | } | - | ||||||||||||||||||||||||
| 118 | - | |||||||||||||||||||||||||
| 119 | - | |||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||
| 122 | - | |||||||||||||||||||||||||
| 123 | - | |||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||
| 125 | void QSslSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) | - | ||||||||||||||||||||||||
| 126 | { | - | ||||||||||||||||||||||||
| 127 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 128 | if (d->plainSocket
| 0-121 | ||||||||||||||||||||||||
| 129 | d->plainSocket->setSocketOption(option, value); executed 121 times by 3 tests: d->plainSocket->setSocketOption(option, value);Executed by:
| 121 | ||||||||||||||||||||||||
| 130 | } executed 121 times by 3 tests: end of blockExecuted by:
| 121 | ||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||
| 134 | - | |||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||
| 136 | - | |||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||
| 138 | QVariant QSslSocket::socketOption(QAbstractSocket::SocketOption option) | - | ||||||||||||||||||||||||
| 139 | { | - | ||||||||||||||||||||||||
| 140 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 141 | if (d->plainSocket
| 0 | ||||||||||||||||||||||||
| 142 | return never executed: d->plainSocket->socketOption(option);return d->plainSocket->socketOption(option);never executed: return d->plainSocket->socketOption(option); | 0 | ||||||||||||||||||||||||
| 143 | else | - | ||||||||||||||||||||||||
| 144 | return never executed: QVariant();return QVariant();never executed: return QVariant(); | 0 | ||||||||||||||||||||||||
| 145 | } | - | ||||||||||||||||||||||||
| 146 | QSslSocket::SslMode QSslSocket::mode() const | - | ||||||||||||||||||||||||
| 147 | { | - | ||||||||||||||||||||||||
| 148 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 149 | return executed 24 times by 1 test: d->mode;return d->mode;Executed by:
executed 24 times by 1 test: return d->mode;Executed by:
| 24 | ||||||||||||||||||||||||
| 150 | } | - | ||||||||||||||||||||||||
| 151 | bool QSslSocket::isEncrypted() const | - | ||||||||||||||||||||||||
| 152 | { | - | ||||||||||||||||||||||||
| 153 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 154 | return executed 122 times by 1 test: d->connectionEncrypted;return d->connectionEncrypted;Executed by:
executed 122 times by 1 test: return d->connectionEncrypted;Executed by:
| 122 | ||||||||||||||||||||||||
| 155 | } | - | ||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||
| 159 | - | |||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||
| 162 | QSsl::SslProtocol QSslSocket::protocol() const | - | ||||||||||||||||||||||||
| 163 | { | - | ||||||||||||||||||||||||
| 164 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 165 | return executed 130 times by 1 test: d->configuration.protocol;return d->configuration.protocol;Executed by:
executed 130 times by 1 test: return d->configuration.protocol;Executed by:
| 130 | ||||||||||||||||||||||||
| 166 | } | - | ||||||||||||||||||||||||
| 167 | - | |||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||
| 169 | - | |||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||
| 173 | void QSslSocket::setProtocol(QSsl::SslProtocol protocol) | - | ||||||||||||||||||||||||
| 174 | { | - | ||||||||||||||||||||||||
| 175 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 176 | d->configuration.protocol = protocol; | - | ||||||||||||||||||||||||
| 177 | } executed 117 times by 2 tests: end of blockExecuted by:
| 117 | ||||||||||||||||||||||||
| 178 | QSslSocket::PeerVerifyMode QSslSocket::peerVerifyMode() const | - | ||||||||||||||||||||||||
| 179 | { | - | ||||||||||||||||||||||||
| 180 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 181 | return executed 3 times by 1 test: d->configuration.peerVerifyMode;return d->configuration.peerVerifyMode;Executed by:
executed 3 times by 1 test: return d->configuration.peerVerifyMode;Executed by:
| 3 | ||||||||||||||||||||||||
| 182 | } | - | ||||||||||||||||||||||||
| 183 | void QSslSocket::setPeerVerifyMode(QSslSocket::PeerVerifyMode mode) | - | ||||||||||||||||||||||||
| 184 | { | - | ||||||||||||||||||||||||
| 185 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 186 | d->configuration.peerVerifyMode = mode; | - | ||||||||||||||||||||||||
| 187 | } executed 67 times by 1 test: end of blockExecuted by:
| 67 | ||||||||||||||||||||||||
| 188 | int QSslSocket::peerVerifyDepth() const | - | ||||||||||||||||||||||||
| 189 | { | - | ||||||||||||||||||||||||
| 190 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 191 | return executed 15 times by 1 test: d->configuration.peerVerifyDepth;return d->configuration.peerVerifyDepth;Executed by:
executed 15 times by 1 test: return d->configuration.peerVerifyDepth;Executed by:
| 15 | ||||||||||||||||||||||||
| 192 | } | - | ||||||||||||||||||||||||
| 193 | void QSslSocket::setPeerVerifyDepth(int depth) | - | ||||||||||||||||||||||||
| 194 | { | - | ||||||||||||||||||||||||
| 195 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 196 | if (depth < 0
| 5 | ||||||||||||||||||||||||
| 197 | for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
executed 5 times by 1 test: QMessageLogger(__FILE__, 687, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::setPeerVerifyDepth: cannot set negative depth of %d", depth);Executed by:
| 5 | ||||||||||||||||||||||||
| 198 | return; executed 5 times by 1 test: return;Executed by:
| 5 | ||||||||||||||||||||||||
| 199 | } | - | ||||||||||||||||||||||||
| 200 | d->configuration.peerVerifyDepth = depth; | - | ||||||||||||||||||||||||
| 201 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||
| 202 | QString QSslSocket::peerVerifyName() const | - | ||||||||||||||||||||||||
| 203 | { | - | ||||||||||||||||||||||||
| 204 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 205 | return never executed: d->verificationPeerName;return d->verificationPeerName;never executed: return d->verificationPeerName; | 0 | ||||||||||||||||||||||||
| 206 | } | - | ||||||||||||||||||||||||
| 207 | void QSslSocket::setPeerVerifyName(const QString &hostName) | - | ||||||||||||||||||||||||
| 208 | { | - | ||||||||||||||||||||||||
| 209 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 210 | d->verificationPeerName = hostName; | - | ||||||||||||||||||||||||
| 211 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 212 | - | |||||||||||||||||||||||||
| 213 | - | |||||||||||||||||||||||||
| 214 | - | |||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | - | |||||||||||||||||||||||||
| 218 | - | |||||||||||||||||||||||||
| 219 | qint64 QSslSocket::bytesAvailable() const | - | ||||||||||||||||||||||||
| 220 | { | - | ||||||||||||||||||||||||
| 221 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 222 | if (d->mode == UnencryptedMode
| 887-18874 | ||||||||||||||||||||||||
| 223 | return executed 887 times by 3 tests: QIODevice::bytesAvailable() + (d->plainSocket ? d->plainSocket->bytesAvailable() : 0);return QIODevice::bytesAvailable() + (d->plainSocket ? d->plainSocket->bytesAvailable() : 0);Executed by:
executed 887 times by 3 tests: return QIODevice::bytesAvailable() + (d->plainSocket ? d->plainSocket->bytesAvailable() : 0);Executed by:
| 887 | ||||||||||||||||||||||||
| 224 | return executed 18874 times by 5 tests: QIODevice::bytesAvailable();return QIODevice::bytesAvailable();Executed by:
executed 18874 times by 5 tests: return QIODevice::bytesAvailable();Executed by:
| 18874 | ||||||||||||||||||||||||
| 225 | } | - | ||||||||||||||||||||||||
| 226 | - | |||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||
| 228 | - | |||||||||||||||||||||||||
| 229 | - | |||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||
| 231 | - | |||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||
| 233 | qint64 QSslSocket::bytesToWrite() const | - | ||||||||||||||||||||||||
| 234 | { | - | ||||||||||||||||||||||||
| 235 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 236 | if (d->mode == UnencryptedMode
| 327-7609 | ||||||||||||||||||||||||
| 237 | return executed 327 times by 3 tests: d->plainSocket ? d->plainSocket->bytesToWrite() : 0;return d->plainSocket ? d->plainSocket->bytesToWrite() : 0;Executed by:
executed 327 times by 3 tests: return d->plainSocket ? d->plainSocket->bytesToWrite() : 0;Executed by:
| 327 | ||||||||||||||||||||||||
| 238 | return executed 7609 times by 3 tests: d->writeBuffer.size();return d->writeBuffer.size();Executed by:
executed 7609 times by 3 tests: return d->writeBuffer.size();Executed by:
| 7609 | ||||||||||||||||||||||||
| 239 | } | - | ||||||||||||||||||||||||
| 240 | qint64 QSslSocket::encryptedBytesAvailable() const | - | ||||||||||||||||||||||||
| 241 | { | - | ||||||||||||||||||||||||
| 242 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 243 | if (d->mode == UnencryptedMode
| 0 | ||||||||||||||||||||||||
| 244 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 245 | return never executed: d->plainSocket->bytesAvailable();return d->plainSocket->bytesAvailable();never executed: return d->plainSocket->bytesAvailable(); | 0 | ||||||||||||||||||||||||
| 246 | } | - | ||||||||||||||||||||||||
| 247 | - | |||||||||||||||||||||||||
| 248 | - | |||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||
| 250 | - | |||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||
| 253 | - | |||||||||||||||||||||||||
| 254 | qint64 QSslSocket::encryptedBytesToWrite() const | - | ||||||||||||||||||||||||
| 255 | { | - | ||||||||||||||||||||||||
| 256 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 257 | if (d->mode == UnencryptedMode
| 220-3051 | ||||||||||||||||||||||||
| 258 | return executed 220 times by 5 tests: 0;return 0;Executed by:
executed 220 times by 5 tests: return 0;Executed by:
| 220 | ||||||||||||||||||||||||
| 259 | return executed 3051 times by 6 tests: d->plainSocket->bytesToWrite();return d->plainSocket->bytesToWrite();Executed by:
executed 3051 times by 6 tests: return d->plainSocket->bytesToWrite();Executed by:
| 3051 | ||||||||||||||||||||||||
| 260 | } | - | ||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||
| 266 | - | |||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||
| 268 | bool QSslSocket::canReadLine() const | - | ||||||||||||||||||||||||
| 269 | { | - | ||||||||||||||||||||||||
| 270 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 271 | if (d->mode == UnencryptedMode
| 1-89 | ||||||||||||||||||||||||
| 272 | return executed 89 times by 2 tests: QIODevice::canReadLine() || (d->plainSocket && d->plainSocket->canReadLine());return QIODevice::canReadLine() || (d->plainSocket && d->plainSocket->canReadLine());Executed by:
executed 89 times by 2 tests: return QIODevice::canReadLine() || (d->plainSocket && d->plainSocket->canReadLine());Executed by:
| 89 | ||||||||||||||||||||||||
| 273 | return executed 1 time by 1 test: QIODevice::canReadLine();return QIODevice::canReadLine();Executed by:
executed 1 time by 1 test: return QIODevice::canReadLine();Executed by:
| 1 | ||||||||||||||||||||||||
| 274 | } | - | ||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||
| 279 | void QSslSocket::close() | - | ||||||||||||||||||||||||
| 280 | { | - | ||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||
| 284 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 285 | if (encryptedBytesToWrite()
| 0-261 | ||||||||||||||||||||||||
| 286 | flush(); executed 3 times by 1 test: flush();Executed by:
| 3 | ||||||||||||||||||||||||
| 287 | if (d->plainSocket
| 0-264 | ||||||||||||||||||||||||
| 288 | d->plainSocket->close(); executed 264 times by 6 tests: d->plainSocket->close();Executed by:
| 264 | ||||||||||||||||||||||||
| 289 | QTcpSocket::close(); | - | ||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||
| 292 | d->buffer.clear(); | - | ||||||||||||||||||||||||
| 293 | d->writeBuffer.clear(); | - | ||||||||||||||||||||||||
| 294 | } executed 264 times by 6 tests: end of blockExecuted by:
| 264 | ||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||
| 299 | bool QSslSocket::atEnd() const | - | ||||||||||||||||||||||||
| 300 | { | - | ||||||||||||||||||||||||
| 301 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 302 | if (d->mode == UnencryptedMode
| 0-12 | ||||||||||||||||||||||||
| 303 | return executed 12 times by 2 tests: QIODevice::atEnd() && (!d->plainSocket || d->plainSocket->atEnd());return QIODevice::atEnd() && (!d->plainSocket || d->plainSocket->atEnd());Executed by:
executed 12 times by 2 tests: return QIODevice::atEnd() && (!d->plainSocket || d->plainSocket->atEnd());Executed by:
| 12 | ||||||||||||||||||||||||
| 304 | return never executed: QIODevice::atEnd();return QIODevice::atEnd();never executed: return QIODevice::atEnd(); | 0 | ||||||||||||||||||||||||
| 305 | } | - | ||||||||||||||||||||||||
| 306 | bool QSslSocket::flush() | - | ||||||||||||||||||||||||
| 307 | { | - | ||||||||||||||||||||||||
| 308 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||
| 312 | if (d->mode != UnencryptedMode
| 16-1810 | ||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||
| 314 | d->transmit(); executed 1810 times by 3 tests: d->transmit();Executed by:
| 1810 | ||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||
| 316 | return executed 1826 times by 4 tests: d->plainSocket ? d->plainSocket->flush() : false;return d->plainSocket ? d->plainSocket->flush() : false;Executed by:
executed 1826 times by 4 tests: return d->plainSocket ? d->plainSocket->flush() : false;Executed by:
| 1826 | ||||||||||||||||||||||||
| 317 | } | - | ||||||||||||||||||||||||
| 318 | - | |||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | - | |||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||
| 324 | void QSslSocket::setReadBufferSize(qint64 size) | - | ||||||||||||||||||||||||
| 325 | { | - | ||||||||||||||||||||||||
| 326 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 327 | d->readBufferMaxSize = size; | - | ||||||||||||||||||||||||
| 328 | - | |||||||||||||||||||||||||
| 329 | if (d->plainSocket
| 1-816 | ||||||||||||||||||||||||
| 330 | d->plainSocket->setReadBufferSize(size); executed 816 times by 8 tests: d->plainSocket->setReadBufferSize(size);Executed by:
| 816 | ||||||||||||||||||||||||
| 331 | } executed 817 times by 8 tests: end of blockExecuted by:
| 817 | ||||||||||||||||||||||||
| 332 | void QSslSocket::abort() | - | ||||||||||||||||||||||||
| 333 | { | - | ||||||||||||||||||||||||
| 334 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 335 | - | |||||||||||||||||||||||||
| 336 | - | |||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||
| 338 | if (d->plainSocket
| 0-81 | ||||||||||||||||||||||||
| 339 | d->plainSocket->abort(); executed 81 times by 3 tests: d->plainSocket->abort();Executed by:
| 81 | ||||||||||||||||||||||||
| 340 | close(); | - | ||||||||||||||||||||||||
| 341 | } executed 81 times by 3 tests: end of blockExecuted by:
| 81 | ||||||||||||||||||||||||
| 342 | QSslConfiguration QSslSocket::sslConfiguration() const | - | ||||||||||||||||||||||||
| 343 | { | - | ||||||||||||||||||||||||
| 344 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||
| 346 | - | |||||||||||||||||||||||||
| 347 | QSslConfigurationPrivate *copy = new QSslConfigurationPrivate(d->configuration); | - | ||||||||||||||||||||||||
| 348 | copy->ref.store(0); | - | ||||||||||||||||||||||||
| 349 | copy->sessionCipher = d->sessionCipher(); | - | ||||||||||||||||||||||||
| 350 | copy->sessionProtocol = d->sessionProtocol(); | - | ||||||||||||||||||||||||
| 351 | - | |||||||||||||||||||||||||
| 352 | return executed 633 times by 4 tests: QSslConfiguration(copy);return QSslConfiguration(copy);Executed by:
executed 633 times by 4 tests: return QSslConfiguration(copy);Executed by:
| 633 | ||||||||||||||||||||||||
| 353 | } | - | ||||||||||||||||||||||||
| 354 | void QSslSocket::setSslConfiguration(const QSslConfiguration &configuration) | - | ||||||||||||||||||||||||
| 355 | { | - | ||||||||||||||||||||||||
| 356 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 357 | d->configuration.localCertificateChain = configuration.localCertificateChain(); | - | ||||||||||||||||||||||||
| 358 | d->configuration.privateKey = configuration.privateKey(); | - | ||||||||||||||||||||||||
| 359 | d->configuration.ciphers = configuration.ciphers(); | - | ||||||||||||||||||||||||
| 360 | d->configuration.ellipticCurves = configuration.ellipticCurves(); | - | ||||||||||||||||||||||||
| 361 | d->configuration.caCertificates = configuration.caCertificates(); | - | ||||||||||||||||||||||||
| 362 | d->configuration.peerVerifyDepth = configuration.peerVerifyDepth(); | - | ||||||||||||||||||||||||
| 363 | d->configuration.peerVerifyMode = configuration.peerVerifyMode(); | - | ||||||||||||||||||||||||
| 364 | d->configuration.protocol = configuration.protocol(); | - | ||||||||||||||||||||||||
| 365 | d->configuration.sslOptions = configuration.d->sslOptions; | - | ||||||||||||||||||||||||
| 366 | d->configuration.sslSession = configuration.sessionTicket(); | - | ||||||||||||||||||||||||
| 367 | d->configuration.sslSessionTicketLifeTimeHint = configuration.sessionTicketLifeTimeHint(); | - | ||||||||||||||||||||||||
| 368 | d->configuration.nextAllowedProtocols = configuration.allowedNextProtocols(); | - | ||||||||||||||||||||||||
| 369 | d->configuration.nextNegotiatedProtocol = configuration.nextNegotiatedProtocol(); | - | ||||||||||||||||||||||||
| 370 | d->configuration.nextProtocolNegotiationStatus = configuration.nextProtocolNegotiationStatus(); | - | ||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||
| 372 | - | |||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||
| 375 | if (!configuration.d->allowRootCertOnDemandLoading
| 52-87 | ||||||||||||||||||||||||
| 376 | d->allowRootCertOnDemandLoading = false; executed 52 times by 2 tests: d->allowRootCertOnDemandLoading = false;Executed by:
| 52 | ||||||||||||||||||||||||
| 377 | } executed 139 times by 4 tests: end of blockExecuted by:
| 139 | ||||||||||||||||||||||||
| 378 | void QSslSocket::setLocalCertificateChain(const QList<QSslCertificate> &localChain) | - | ||||||||||||||||||||||||
| 379 | { | - | ||||||||||||||||||||||||
| 380 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 381 | d->configuration.localCertificateChain = localChain; | - | ||||||||||||||||||||||||
| 382 | } executed 21 times by 1 test: end of blockExecuted by:
| 21 | ||||||||||||||||||||||||
| 383 | QList<QSslCertificate> QSslSocket::localCertificateChain() const | - | ||||||||||||||||||||||||
| 384 | { | - | ||||||||||||||||||||||||
| 385 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 386 | return never executed: d->configuration.localCertificateChain;return d->configuration.localCertificateChain;never executed: return d->configuration.localCertificateChain; | 0 | ||||||||||||||||||||||||
| 387 | } | - | ||||||||||||||||||||||||
| 388 | void QSslSocket::setLocalCertificate(const QSslCertificate &certificate) | - | ||||||||||||||||||||||||
| 389 | { | - | ||||||||||||||||||||||||
| 390 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 391 | d->configuration.localCertificateChain = QList<QSslCertificate>(); | - | ||||||||||||||||||||||||
| 392 | d->configuration.localCertificateChain += certificate; | - | ||||||||||||||||||||||||
| 393 | } executed 79 times by 2 tests: end of blockExecuted by:
| 79 | ||||||||||||||||||||||||
| 394 | void QSslSocket::setLocalCertificate(const QString &path, | - | ||||||||||||||||||||||||
| 395 | QSsl::EncodingFormat format) | - | ||||||||||||||||||||||||
| 396 | { | - | ||||||||||||||||||||||||
| 397 | QFile file(path); | - | ||||||||||||||||||||||||
| 398 | if (file.open(QIODevice::ReadOnly | QIODevice::Text)
| 0-19 | ||||||||||||||||||||||||
| 399 | setLocalCertificate(QSslCertificate(file.readAll(), format)); executed 19 times by 2 tests: setLocalCertificate(QSslCertificate(file.readAll(), format));Executed by:
| 19 | ||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||
| 401 | } executed 19 times by 2 tests: end of blockExecuted by:
| 19 | ||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||
| 403 | - | |||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||
| 405 | - | |||||||||||||||||||||||||
| 406 | - | |||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||
| 408 | - | |||||||||||||||||||||||||
| 409 | QSslCertificate QSslSocket::localCertificate() const | - | ||||||||||||||||||||||||
| 410 | { | - | ||||||||||||||||||||||||
| 411 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 412 | if (d->configuration.localCertificateChain.isEmpty()
| 5 | ||||||||||||||||||||||||
| 413 | return executed 5 times by 1 test: QSslCertificate();return QSslCertificate();Executed by:
executed 5 times by 1 test: return QSslCertificate();Executed by:
| 5 | ||||||||||||||||||||||||
| 414 | return executed 5 times by 1 test: d->configuration.localCertificateChain[0];return d->configuration.localCertificateChain[0];Executed by:
executed 5 times by 1 test: return d->configuration.localCertificateChain[0];Executed by:
| 5 | ||||||||||||||||||||||||
| 415 | } | - | ||||||||||||||||||||||||
| 416 | QSslCertificate QSslSocket::peerCertificate() const | - | ||||||||||||||||||||||||
| 417 | { | - | ||||||||||||||||||||||||
| 418 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 419 | return executed 26 times by 1 test: d->configuration.peerCertificate;return d->configuration.peerCertificate;Executed by:
executed 26 times by 1 test: return d->configuration.peerCertificate;Executed by:
| 26 | ||||||||||||||||||||||||
| 420 | } | - | ||||||||||||||||||||||||
| 421 | QList<QSslCertificate> QSslSocket::peerCertificateChain() const | - | ||||||||||||||||||||||||
| 422 | { | - | ||||||||||||||||||||||||
| 423 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 424 | return executed 26 times by 1 test: d->configuration.peerCertificateChain;return d->configuration.peerCertificateChain;Executed by:
executed 26 times by 1 test: return d->configuration.peerCertificateChain;Executed by:
| 26 | ||||||||||||||||||||||||
| 425 | } | - | ||||||||||||||||||||||||
| 426 | QSslCipher QSslSocket::sessionCipher() const | - | ||||||||||||||||||||||||
| 427 | { | - | ||||||||||||||||||||||||
| 428 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 429 | return executed 27 times by 1 test: d->sessionCipher();return d->sessionCipher();Executed by:
executed 27 times by 1 test: return d->sessionCipher();Executed by:
| 27 | ||||||||||||||||||||||||
| 430 | } | - | ||||||||||||||||||||||||
| 431 | QSsl::SslProtocol QSslSocket::sessionProtocol() const | - | ||||||||||||||||||||||||
| 432 | { | - | ||||||||||||||||||||||||
| 433 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 434 | return never executed: d->sessionProtocol();return d->sessionProtocol();never executed: return d->sessionProtocol(); | 0 | ||||||||||||||||||||||||
| 435 | } | - | ||||||||||||||||||||||||
| 436 | void QSslSocket::setPrivateKey(const QSslKey &key) | - | ||||||||||||||||||||||||
| 437 | { | - | ||||||||||||||||||||||||
| 438 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 439 | d->configuration.privateKey = key; | - | ||||||||||||||||||||||||
| 440 | } executed 85 times by 1 test: end of blockExecuted by:
| 85 | ||||||||||||||||||||||||
| 441 | void QSslSocket::setPrivateKey(const QString &fileName, QSsl::KeyAlgorithm algorithm, | - | ||||||||||||||||||||||||
| 442 | QSsl::EncodingFormat format, const QByteArray &passPhrase) | - | ||||||||||||||||||||||||
| 443 | { | - | ||||||||||||||||||||||||
| 444 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 445 | QFile file(fileName); | - | ||||||||||||||||||||||||
| 446 | if (file.open(QIODevice::ReadOnly)
| 0-9 | ||||||||||||||||||||||||
| 447 | d->configuration.privateKey = QSslKey(file.readAll(), algorithm, | - | ||||||||||||||||||||||||
| 448 | format, QSsl::PrivateKey, passPhrase); | - | ||||||||||||||||||||||||
| 449 | } executed 9 times by 2 tests: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||
| 450 | } executed 9 times by 2 tests: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||
| 451 | - | |||||||||||||||||||||||||
| 452 | - | |||||||||||||||||||||||||
| 453 | - | |||||||||||||||||||||||||
| 454 | - | |||||||||||||||||||||||||
| 455 | - | |||||||||||||||||||||||||
| 456 | - | |||||||||||||||||||||||||
| 457 | QSslKey QSslSocket::privateKey() const | - | ||||||||||||||||||||||||
| 458 | { | - | ||||||||||||||||||||||||
| 459 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 460 | return never executed: d->configuration.privateKey;return d->configuration.privateKey;never executed: return d->configuration.privateKey; | 0 | ||||||||||||||||||||||||
| 461 | } | - | ||||||||||||||||||||||||
| 462 | QList<QSslCipher> QSslSocket::ciphers() const | - | ||||||||||||||||||||||||
| 463 | { | - | ||||||||||||||||||||||||
| 464 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 465 | return executed 30 times by 1 test: d->configuration.ciphers;return d->configuration.ciphers;Executed by:
executed 30 times by 1 test: return d->configuration.ciphers;Executed by:
| 30 | ||||||||||||||||||||||||
| 466 | } | - | ||||||||||||||||||||||||
| 467 | void QSslSocket::setCiphers(const QList<QSslCipher> &ciphers) | - | ||||||||||||||||||||||||
| 468 | { | - | ||||||||||||||||||||||||
| 469 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 470 | d->configuration.ciphers = ciphers; | - | ||||||||||||||||||||||||
| 471 | } executed 15 times by 1 test: end of blockExecuted by:
| 15 | ||||||||||||||||||||||||
| 472 | void QSslSocket::setCiphers(const QString &ciphers) | - | ||||||||||||||||||||||||
| 473 | { | - | ||||||||||||||||||||||||
| 474 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 475 | d->configuration.ciphers.clear(); | - | ||||||||||||||||||||||||
| 476 | const auto cipherNames = ciphers.split(QLatin1Char(':'), QString::SkipEmptyParts); | - | ||||||||||||||||||||||||
| 477 | for (const QString &cipherName : cipherNames) { | - | ||||||||||||||||||||||||
| 478 | QSslCipher cipher(cipherName); | - | ||||||||||||||||||||||||
| 479 | if (!cipher.isNull()
| 11-30 | ||||||||||||||||||||||||
| 480 | d->configuration.ciphers << cipher; executed 11 times by 1 test: d->configuration.ciphers << cipher;Executed by:
| 11 | ||||||||||||||||||||||||
| 481 | } executed 41 times by 1 test: end of blockExecuted by:
| 41 | ||||||||||||||||||||||||
| 482 | } executed 11 times by 1 test: end of blockExecuted by:
| 11 | ||||||||||||||||||||||||
| 483 | void QSslSocket::setDefaultCiphers(const QList<QSslCipher> &ciphers) | - | ||||||||||||||||||||||||
| 484 | { | - | ||||||||||||||||||||||||
| 485 | QSslSocketPrivate::setDefaultCiphers(ciphers); | - | ||||||||||||||||||||||||
| 486 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||
| 487 | QList<QSslCipher> QSslSocket::defaultCiphers() | - | ||||||||||||||||||||||||
| 488 | { | - | ||||||||||||||||||||||||
| 489 | return executed 40 times by 1 test: QSslSocketPrivate::defaultCiphers();return QSslSocketPrivate::defaultCiphers();Executed by:
executed 40 times by 1 test: return QSslSocketPrivate::defaultCiphers();Executed by:
| 40 | ||||||||||||||||||||||||
| 490 | } | - | ||||||||||||||||||||||||
| 491 | QList<QSslCipher> QSslSocket::supportedCiphers() | - | ||||||||||||||||||||||||
| 492 | { | - | ||||||||||||||||||||||||
| 493 | return executed 20 times by 1 test: QSslSocketPrivate::supportedCiphers();return QSslSocketPrivate::supportedCiphers();Executed by:
executed 20 times by 1 test: return QSslSocketPrivate::supportedCiphers();Executed by:
| 20 | ||||||||||||||||||||||||
| 494 | } | - | ||||||||||||||||||||||||
| 495 | bool QSslSocket::addCaCertificates(const QString &path, QSsl::EncodingFormat format, | - | ||||||||||||||||||||||||
| 496 | QRegExp::PatternSyntax syntax) | - | ||||||||||||||||||||||||
| 497 | { | - | ||||||||||||||||||||||||
| 498 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 499 | QList<QSslCertificate> certs = QSslCertificate::fromPath(path, format, syntax); | - | ||||||||||||||||||||||||
| 500 | if (certs.isEmpty()
| 0-12 | ||||||||||||||||||||||||
| 501 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 502 | - | |||||||||||||||||||||||||
| 503 | d->configuration.caCertificates += certs; | - | ||||||||||||||||||||||||
| 504 | return executed 12 times by 1 test: true;return true;Executed by:
executed 12 times by 1 test: return true;Executed by:
| 12 | ||||||||||||||||||||||||
| 505 | } | - | ||||||||||||||||||||||||
| 506 | void QSslSocket::addCaCertificate(const QSslCertificate &certificate) | - | ||||||||||||||||||||||||
| 507 | { | - | ||||||||||||||||||||||||
| 508 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 509 | d->configuration.caCertificates += certificate; | - | ||||||||||||||||||||||||
| 510 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 511 | void QSslSocket::addCaCertificates(const QList<QSslCertificate> &certificates) | - | ||||||||||||||||||||||||
| 512 | { | - | ||||||||||||||||||||||||
| 513 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 514 | d->configuration.caCertificates += certificates; | - | ||||||||||||||||||||||||
| 515 | } executed 20 times by 1 test: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||
| 516 | void QSslSocket::setCaCertificates(const QList<QSslCertificate> &certificates) | - | ||||||||||||||||||||||||
| 517 | { | - | ||||||||||||||||||||||||
| 518 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 519 | d->configuration.caCertificates = certificates; | - | ||||||||||||||||||||||||
| 520 | d->allowRootCertOnDemandLoading = false; | - | ||||||||||||||||||||||||
| 521 | } executed 38 times by 2 tests: end of blockExecuted by:
| 38 | ||||||||||||||||||||||||
| 522 | QList<QSslCertificate> QSslSocket::caCertificates() const | - | ||||||||||||||||||||||||
| 523 | { | - | ||||||||||||||||||||||||
| 524 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 525 | return executed 20 times by 1 test: d->configuration.caCertificates;return d->configuration.caCertificates;Executed by:
executed 20 times by 1 test: return d->configuration.caCertificates;Executed by:
| 20 | ||||||||||||||||||||||||
| 526 | } | - | ||||||||||||||||||||||||
| 527 | bool QSslSocket::addDefaultCaCertificates(const QString &path, QSsl::EncodingFormat encoding, | - | ||||||||||||||||||||||||
| 528 | QRegExp::PatternSyntax syntax) | - | ||||||||||||||||||||||||
| 529 | { | - | ||||||||||||||||||||||||
| 530 | return never executed: QSslSocketPrivate::addDefaultCaCertificates(path, encoding, syntax);return QSslSocketPrivate::addDefaultCaCertificates(path, encoding, syntax);never executed: return QSslSocketPrivate::addDefaultCaCertificates(path, encoding, syntax); | 0 | ||||||||||||||||||||||||
| 531 | } | - | ||||||||||||||||||||||||
| 532 | void QSslSocket::addDefaultCaCertificate(const QSslCertificate &certificate) | - | ||||||||||||||||||||||||
| 533 | { | - | ||||||||||||||||||||||||
| 534 | QSslSocketPrivate::addDefaultCaCertificate(certificate); | - | ||||||||||||||||||||||||
| 535 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 536 | void QSslSocket::addDefaultCaCertificates(const QList<QSslCertificate> &certificates) | - | ||||||||||||||||||||||||
| 537 | { | - | ||||||||||||||||||||||||
| 538 | QSslSocketPrivate::addDefaultCaCertificates(certificates); | - | ||||||||||||||||||||||||
| 539 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 540 | void QSslSocket::setDefaultCaCertificates(const QList<QSslCertificate> &certificates) | - | ||||||||||||||||||||||||
| 541 | { | - | ||||||||||||||||||||||||
| 542 | QSslSocketPrivate::setDefaultCaCertificates(certificates); | - | ||||||||||||||||||||||||
| 543 | } executed 51 times by 2 tests: end of blockExecuted by:
| 51 | ||||||||||||||||||||||||
| 544 | QList<QSslCertificate> QSslSocket::defaultCaCertificates() | - | ||||||||||||||||||||||||
| 545 | { | - | ||||||||||||||||||||||||
| 546 | return executed 41 times by 2 tests: QSslSocketPrivate::defaultCaCertificates();return QSslSocketPrivate::defaultCaCertificates();Executed by:
executed 41 times by 2 tests: return QSslSocketPrivate::defaultCaCertificates();Executed by:
| 41 | ||||||||||||||||||||||||
| 547 | } | - | ||||||||||||||||||||||||
| 548 | QList<QSslCertificate> QSslSocket::systemCaCertificates() | - | ||||||||||||||||||||||||
| 549 | { | - | ||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||
| 551 | return executed 53 times by 2 tests: QSslSocketPrivate::systemCaCertificates();return QSslSocketPrivate::systemCaCertificates();Executed by:
executed 53 times by 2 tests: return QSslSocketPrivate::systemCaCertificates();Executed by:
| 53 | ||||||||||||||||||||||||
| 552 | } | - | ||||||||||||||||||||||||
| 553 | bool QSslSocket::waitForConnected(int msecs) | - | ||||||||||||||||||||||||
| 554 | { | - | ||||||||||||||||||||||||
| 555 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 556 | if (!d->plainSocket
| 5-198 | ||||||||||||||||||||||||
| 557 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 558 | bool retVal = d->plainSocket->waitForConnected(msecs); | - | ||||||||||||||||||||||||
| 559 | if (!retVal
| 25-173 | ||||||||||||||||||||||||
| 560 | setSocketState(d->plainSocket->state()); | - | ||||||||||||||||||||||||
| 561 | d->setError(d->plainSocket->error(), d->plainSocket->errorString()); | - | ||||||||||||||||||||||||
| 562 | } executed 25 times by 2 tests: end of blockExecuted by:
| 25 | ||||||||||||||||||||||||
| 563 | return executed 198 times by 3 tests: retVal;return retVal;Executed by:
executed 198 times by 3 tests: return retVal;Executed by:
| 198 | ||||||||||||||||||||||||
| 564 | } | - | ||||||||||||||||||||||||
| 565 | bool QSslSocket::waitForEncrypted(int msecs) | - | ||||||||||||||||||||||||
| 566 | { | - | ||||||||||||||||||||||||
| 567 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 568 | if (!d->plainSocket
| 0-210 | ||||||||||||||||||||||||
| 569 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 570 | if (d->mode == UnencryptedMode
| 0-156 | ||||||||||||||||||||||||
| 571 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 572 | - | |||||||||||||||||||||||||
| 573 | QElapsedTimer stopWatch; | - | ||||||||||||||||||||||||
| 574 | stopWatch.start(); | - | ||||||||||||||||||||||||
| 575 | - | |||||||||||||||||||||||||
| 576 | if (d->plainSocket->state() != QAbstractSocket::ConnectedState
| 54-156 | ||||||||||||||||||||||||
| 577 | - | |||||||||||||||||||||||||
| 578 | if (!d->plainSocket->waitForConnected(msecs)
| 8-148 | ||||||||||||||||||||||||
| 579 | return executed 8 times by 2 tests: false;return false;Executed by:
executed 8 times by 2 tests: return false;Executed by:
| 8 | ||||||||||||||||||||||||
| 580 | } executed 148 times by 3 tests: end of blockExecuted by:
| 148 | ||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||
| 582 | while (!d->connectionEncrypted
| 137-470 | ||||||||||||||||||||||||
| 583 | - | |||||||||||||||||||||||||
| 584 | if (d->mode == UnencryptedMode
| 0-470 | ||||||||||||||||||||||||
| 585 | startClientEncryption(); never executed: startClientEncryption(); | 0 | ||||||||||||||||||||||||
| 586 | - | |||||||||||||||||||||||||
| 587 | - | |||||||||||||||||||||||||
| 588 | if (!d->plainSocket->waitForReadyRead(qt_subtract_from_timeout(msecs, stopWatch.elapsed()))
| 65-405 | ||||||||||||||||||||||||
| 589 | return executed 65 times by 3 tests: false;return false;Executed by:
executed 65 times by 3 tests: return false;Executed by:
| 65 | ||||||||||||||||||||||||
| 590 | } executed 405 times by 5 tests: end of blockExecuted by:
| 405 | ||||||||||||||||||||||||
| 591 | return executed 137 times by 5 tests: d->connectionEncrypted;return d->connectionEncrypted;Executed by:
executed 137 times by 5 tests: return d->connectionEncrypted;Executed by:
| 137 | ||||||||||||||||||||||||
| 592 | } | - | ||||||||||||||||||||||||
| 593 | - | |||||||||||||||||||||||||
| 594 | - | |||||||||||||||||||||||||
| 595 | - | |||||||||||||||||||||||||
| 596 | - | |||||||||||||||||||||||||
| 597 | bool QSslSocket::waitForReadyRead(int msecs) | - | ||||||||||||||||||||||||
| 598 | { | - | ||||||||||||||||||||||||
| 599 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 600 | if (!d->plainSocket
| 5-287 | ||||||||||||||||||||||||
| 601 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 602 | if (d->mode == UnencryptedMode
| 0-233 | ||||||||||||||||||||||||
| 603 | return executed 233 times by 2 tests: d->plainSocket->waitForReadyRead(msecs);return d->plainSocket->waitForReadyRead(msecs);Executed by:
executed 233 times by 2 tests: return d->plainSocket->waitForReadyRead(msecs);Executed by:
| 233 | ||||||||||||||||||||||||
| 604 | - | |||||||||||||||||||||||||
| 605 | - | |||||||||||||||||||||||||
| 606 | - | |||||||||||||||||||||||||
| 607 | - | |||||||||||||||||||||||||
| 608 | - | |||||||||||||||||||||||||
| 609 | bool readyReadEmitted = false; | - | ||||||||||||||||||||||||
| 610 | bool *previousReadyReadEmittedPointer = d->readyReadEmittedPointer; | - | ||||||||||||||||||||||||
| 611 | d->readyReadEmittedPointer = &readyReadEmitted; | - | ||||||||||||||||||||||||
| 612 | - | |||||||||||||||||||||||||
| 613 | QElapsedTimer stopWatch; | - | ||||||||||||||||||||||||
| 614 | stopWatch.start(); | - | ||||||||||||||||||||||||
| 615 | - | |||||||||||||||||||||||||
| 616 | if (!d->connectionEncrypted
| 3-51 | ||||||||||||||||||||||||
| 617 | - | |||||||||||||||||||||||||
| 618 | if (!waitForEncrypted(msecs)
| 0-3 | ||||||||||||||||||||||||
| 619 | d->readyReadEmittedPointer = previousReadyReadEmittedPointer; | - | ||||||||||||||||||||||||
| 620 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 621 | } | - | ||||||||||||||||||||||||
| 622 | } executed 3 times by 2 tests: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 623 | - | |||||||||||||||||||||||||
| 624 | if (!d->writeBuffer.isEmpty()
| 1-53 | ||||||||||||||||||||||||
| 625 | - | |||||||||||||||||||||||||
| 626 | d->transmit(); | - | ||||||||||||||||||||||||
| 627 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 628 | - | |||||||||||||||||||||||||
| 629 | - | |||||||||||||||||||||||||
| 630 | - | |||||||||||||||||||||||||
| 631 | while (!readyReadEmitted
| 34-54 | ||||||||||||||||||||||||
| 632 | d->plainSocket->waitForReadyRead(qt_subtract_from_timeout(msecs, stopWatch.elapsed()))
| 20-34 | ||||||||||||||||||||||||
| 633 | } executed 34 times by 3 tests: end of blockExecuted by:
| 34 | ||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||
| 635 | d->readyReadEmittedPointer = previousReadyReadEmittedPointer; | - | ||||||||||||||||||||||||
| 636 | return executed 54 times by 3 tests: readyReadEmitted;return readyReadEmitted;Executed by:
executed 54 times by 3 tests: return readyReadEmitted;Executed by:
| 54 | ||||||||||||||||||||||||
| 637 | } | - | ||||||||||||||||||||||||
| 638 | - | |||||||||||||||||||||||||
| 639 | - | |||||||||||||||||||||||||
| 640 | - | |||||||||||||||||||||||||
| 641 | - | |||||||||||||||||||||||||
| 642 | bool QSslSocket::waitForBytesWritten(int msecs) | - | ||||||||||||||||||||||||
| 643 | { | - | ||||||||||||||||||||||||
| 644 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 645 | if (!d->plainSocket
| 5-2544 | ||||||||||||||||||||||||
| 646 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 647 | if (d->mode == UnencryptedMode
| 170-2374 | ||||||||||||||||||||||||
| 648 | return executed 170 times by 2 tests: d->plainSocket->waitForBytesWritten(msecs);return d->plainSocket->waitForBytesWritten(msecs);Executed by:
executed 170 times by 2 tests: return d->plainSocket->waitForBytesWritten(msecs);Executed by:
| 170 | ||||||||||||||||||||||||
| 649 | - | |||||||||||||||||||||||||
| 650 | QElapsedTimer stopWatch; | - | ||||||||||||||||||||||||
| 651 | stopWatch.start(); | - | ||||||||||||||||||||||||
| 652 | - | |||||||||||||||||||||||||
| 653 | if (!d->connectionEncrypted
| 0-2374 | ||||||||||||||||||||||||
| 654 | - | |||||||||||||||||||||||||
| 655 | if (!waitForEncrypted(msecs)
| 0 | ||||||||||||||||||||||||
| 656 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 657 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 658 | if (!d->writeBuffer.isEmpty()
| 1-2373 | ||||||||||||||||||||||||
| 659 | - | |||||||||||||||||||||||||
| 660 | d->transmit(); | - | ||||||||||||||||||||||||
| 661 | } executed 2373 times by 3 tests: end of blockExecuted by:
| 2373 | ||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||
| 663 | return executed 2374 times by 3 tests: d->plainSocket->waitForBytesWritten(qt_subtract_from_timeout(msecs, stopWatch.elapsed()));return d->plainSocket->waitForBytesWritten(qt_subtract_from_timeout(msecs, stopWatch.elapsed()));Executed by:
executed 2374 times by 3 tests: return d->plainSocket->waitForBytesWritten(qt_subtract_from_timeout(msecs, stopWatch.elapsed()));Executed by:
| 2374 | ||||||||||||||||||||||||
| 664 | } | - | ||||||||||||||||||||||||
| 665 | bool QSslSocket::waitForDisconnected(int msecs) | - | ||||||||||||||||||||||||
| 666 | { | - | ||||||||||||||||||||||||
| 667 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 668 | - | |||||||||||||||||||||||||
| 669 | - | |||||||||||||||||||||||||
| 670 | if (state() == UnconnectedState
| 5-120 | ||||||||||||||||||||||||
| 671 | for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
executed 5 times by 1 test: QMessageLogger(__FILE__, 1682, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::waitForDisconnected() is not allowed in UnconnectedState");Executed by:
| 5 | ||||||||||||||||||||||||
| 672 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 673 | } | - | ||||||||||||||||||||||||
| 674 | - | |||||||||||||||||||||||||
| 675 | if (!d->plainSocket
| 0-120 | ||||||||||||||||||||||||
| 676 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 677 | if (d->mode == UnencryptedMode
| 40-80 | ||||||||||||||||||||||||
| 678 | return executed 80 times by 3 tests: d->plainSocket->waitForDisconnected(msecs);return d->plainSocket->waitForDisconnected(msecs);Executed by:
executed 80 times by 3 tests: return d->plainSocket->waitForDisconnected(msecs);Executed by:
| 80 | ||||||||||||||||||||||||
| 679 | - | |||||||||||||||||||||||||
| 680 | QElapsedTimer stopWatch; | - | ||||||||||||||||||||||||
| 681 | stopWatch.start(); | - | ||||||||||||||||||||||||
| 682 | - | |||||||||||||||||||||||||
| 683 | if (!d->connectionEncrypted
| 0-40 | ||||||||||||||||||||||||
| 684 | - | |||||||||||||||||||||||||
| 685 | if (!waitForEncrypted(msecs)
| 0 | ||||||||||||||||||||||||
| 686 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 687 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 688 | bool retVal = d->plainSocket->waitForDisconnected(qt_subtract_from_timeout(msecs, stopWatch.elapsed())); | - | ||||||||||||||||||||||||
| 689 | if (!retVal
| 0-40 | ||||||||||||||||||||||||
| 690 | setSocketState(d->plainSocket->state()); | - | ||||||||||||||||||||||||
| 691 | d->setError(d->plainSocket->error(), d->plainSocket->errorString()); | - | ||||||||||||||||||||||||
| 692 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 693 | return executed 40 times by 2 tests: retVal;return retVal;Executed by:
executed 40 times by 2 tests: return retVal;Executed by:
| 40 | ||||||||||||||||||||||||
| 694 | } | - | ||||||||||||||||||||||||
| 695 | QList<QSslError> QSslSocket::sslErrors() const | - | ||||||||||||||||||||||||
| 696 | { | - | ||||||||||||||||||||||||
| 697 | const QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 698 | return executed 13 times by 1 test: d->sslErrors;return d->sslErrors;Executed by:
executed 13 times by 1 test: return d->sslErrors;Executed by:
| 13 | ||||||||||||||||||||||||
| 699 | } | - | ||||||||||||||||||||||||
| 700 | - | |||||||||||||||||||||||||
| 701 | - | |||||||||||||||||||||||||
| 702 | - | |||||||||||||||||||||||||
| 703 | - | |||||||||||||||||||||||||
| 704 | - | |||||||||||||||||||||||||
| 705 | - | |||||||||||||||||||||||||
| 706 | bool QSslSocket::supportsSsl() | - | ||||||||||||||||||||||||
| 707 | { | - | ||||||||||||||||||||||||
| 708 | return executed 52090 times by 25 tests: QSslSocketPrivate::supportsSsl();return QSslSocketPrivate::supportsSsl();Executed by:
executed 52090 times by 25 tests: return QSslSocketPrivate::supportsSsl();Executed by:
| 52090 | ||||||||||||||||||||||||
| 709 | } | - | ||||||||||||||||||||||||
| 710 | long QSslSocket::sslLibraryVersionNumber() | - | ||||||||||||||||||||||||
| 711 | { | - | ||||||||||||||||||||||||
| 712 | return executed 7 times by 1 test: QSslSocketPrivate::sslLibraryVersionNumber();return QSslSocketPrivate::sslLibraryVersionNumber();Executed by:
executed 7 times by 1 test: return QSslSocketPrivate::sslLibraryVersionNumber();Executed by:
| 7 | ||||||||||||||||||||||||
| 713 | } | - | ||||||||||||||||||||||||
| 714 | - | |||||||||||||||||||||||||
| 715 | - | |||||||||||||||||||||||||
| 716 | - | |||||||||||||||||||||||||
| 717 | - | |||||||||||||||||||||||||
| 718 | - | |||||||||||||||||||||||||
| 719 | - | |||||||||||||||||||||||||
| 720 | - | |||||||||||||||||||||||||
| 721 | QString QSslSocket::sslLibraryVersionString() | - | ||||||||||||||||||||||||
| 722 | { | - | ||||||||||||||||||||||||
| 723 | return executed 6 times by 1 test: QSslSocketPrivate::sslLibraryVersionString();return QSslSocketPrivate::sslLibraryVersionString();Executed by:
executed 6 times by 1 test: return QSslSocketPrivate::sslLibraryVersionString();Executed by:
| 6 | ||||||||||||||||||||||||
| 724 | } | - | ||||||||||||||||||||||||
| 725 | long QSslSocket::sslLibraryBuildVersionNumber() | - | ||||||||||||||||||||||||
| 726 | { | - | ||||||||||||||||||||||||
| 727 | return never executed: QSslSocketPrivate::sslLibraryBuildVersionNumber();return QSslSocketPrivate::sslLibraryBuildVersionNumber();never executed: return QSslSocketPrivate::sslLibraryBuildVersionNumber(); | 0 | ||||||||||||||||||||||||
| 728 | } | - | ||||||||||||||||||||||||
| 729 | QString QSslSocket::sslLibraryBuildVersionString() | - | ||||||||||||||||||||||||
| 730 | { | - | ||||||||||||||||||||||||
| 731 | return never executed: QSslSocketPrivate::sslLibraryBuildVersionString();return QSslSocketPrivate::sslLibraryBuildVersionString();never executed: return QSslSocketPrivate::sslLibraryBuildVersionString(); | 0 | ||||||||||||||||||||||||
| 732 | } | - | ||||||||||||||||||||||||
| 733 | void QSslSocket::startClientEncryption() | - | ||||||||||||||||||||||||
| 734 | { | - | ||||||||||||||||||||||||
| 735 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 736 | if (d->mode != UnencryptedMode
| 0-425 | ||||||||||||||||||||||||
| 737 | for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
never executed: QMessageLogger( __FILE__ , 1798 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection") ; | 0 | ||||||||||||||||||||||||
| 738 | __FILE__ never executed: QMessageLogger( __FILE__ , 1798 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection") ; | 0 | ||||||||||||||||||||||||
| 739 | , never executed: QMessageLogger( __FILE__ , 1798 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection") ; | 0 | ||||||||||||||||||||||||
| 740 | 1798 never executed: QMessageLogger( __FILE__ , 1798 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection") ; | 0 | ||||||||||||||||||||||||
| 741 | , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection") never executed: QMessageLogger( __FILE__ , 1798 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection") ; | 0 | ||||||||||||||||||||||||
| 742 | ; never executed: QMessageLogger( __FILE__ , 1798 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection") ; | 0 | ||||||||||||||||||||||||
| 743 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 744 | } | - | ||||||||||||||||||||||||
| 745 | if (state() != ConnectedState
| 6-419 | ||||||||||||||||||||||||
| 746 | for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
executed 6 times by 1 test: QMessageLogger( __FILE__ , 1803 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake when not connected") ;Executed by:
| 6 | ||||||||||||||||||||||||
| 747 | __FILE__ executed 6 times by 1 test: QMessageLogger( __FILE__ , 1803 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake when not connected") ;Executed by:
| 6 | ||||||||||||||||||||||||
| 748 | , executed 6 times by 1 test: QMessageLogger( __FILE__ , 1803 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake when not connected") ;Executed by:
| 6 | ||||||||||||||||||||||||
| 749 | 1803 executed 6 times by 1 test: QMessageLogger( __FILE__ , 1803 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake when not connected") ;Executed by:
| 6 | ||||||||||||||||||||||||
| 750 | , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake when not connected") executed 6 times by 1 test: QMessageLogger( __FILE__ , 1803 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake when not connected") ;Executed by:
| 6 | ||||||||||||||||||||||||
| 751 | ; executed 6 times by 1 test: QMessageLogger( __FILE__ , 1803 , __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startClientEncryption: cannot start handshake when not connected") ;Executed by:
| 6 | ||||||||||||||||||||||||
| 752 | return; executed 6 times by 1 test: return;Executed by:
| 6 | ||||||||||||||||||||||||
| 753 | } | - | ||||||||||||||||||||||||
| 754 | - | |||||||||||||||||||||||||
| 755 | - | |||||||||||||||||||||||||
| 756 | - | |||||||||||||||||||||||||
| 757 | d->mode = SslClientMode; | - | ||||||||||||||||||||||||
| 758 | modeChanged(d->mode); | - | ||||||||||||||||||||||||
| 759 | d->startClientEncryption(); | - | ||||||||||||||||||||||||
| 760 | } executed 419 times by 7 tests: end of blockExecuted by:
| 419 | ||||||||||||||||||||||||
| 761 | void QSslSocket::startServerEncryption() | - | ||||||||||||||||||||||||
| 762 | { | - | ||||||||||||||||||||||||
| 763 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 764 | if (d->mode != UnencryptedMode
| 0-65 | ||||||||||||||||||||||||
| 765 | for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
never executed: QMessageLogger(__FILE__, 1838, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslSocket::startServerEncryption: cannot start handshake on non-plain connection"); | 0 | ||||||||||||||||||||||||
| 766 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 767 | } | - | ||||||||||||||||||||||||
| 768 | - | |||||||||||||||||||||||||
| 769 | - | |||||||||||||||||||||||||
| 770 | - | |||||||||||||||||||||||||
| 771 | d->mode = SslServerMode; | - | ||||||||||||||||||||||||
| 772 | modeChanged(d->mode); | - | ||||||||||||||||||||||||
| 773 | d->startServerEncryption(); | - | ||||||||||||||||||||||||
| 774 | } executed 65 times by 2 tests: end of blockExecuted by:
| 65 | ||||||||||||||||||||||||
| 775 | void QSslSocket::ignoreSslErrors() | - | ||||||||||||||||||||||||
| 776 | { | - | ||||||||||||||||||||||||
| 777 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 778 | d->ignoreAllSslErrors = true; | - | ||||||||||||||||||||||||
| 779 | } executed 168 times by 5 tests: end of blockExecuted by:
| 168 | ||||||||||||||||||||||||
| 780 | void QSslSocket::ignoreSslErrors(const QList<QSslError> &errors) | - | ||||||||||||||||||||||||
| 781 | { | - | ||||||||||||||||||||||||
| 782 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 783 | d->ignoreErrorsList = errors; | - | ||||||||||||||||||||||||
| 784 | } executed 188 times by 4 tests: end of blockExecuted by:
| 188 | ||||||||||||||||||||||||
| 785 | - | |||||||||||||||||||||||||
| 786 | - | |||||||||||||||||||||||||
| 787 | - | |||||||||||||||||||||||||
| 788 | - | |||||||||||||||||||||||||
| 789 | void QSslSocket::connectToHost(const QString &hostName, quint16 port, OpenMode openMode, NetworkLayerProtocol protocol) | - | ||||||||||||||||||||||||
| 790 | { | - | ||||||||||||||||||||||||
| 791 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 792 | d->preferredNetworkLayerProtocol = protocol; | - | ||||||||||||||||||||||||
| 793 | if (!d->initialized
| 311-410 | ||||||||||||||||||||||||
| 794 | d->init(); executed 311 times by 3 tests: d->init();Executed by:
| 311 | ||||||||||||||||||||||||
| 795 | d->initialized = false; | - | ||||||||||||||||||||||||
| 796 | - | |||||||||||||||||||||||||
| 797 | - | |||||||||||||||||||||||||
| 798 | - | |||||||||||||||||||||||||
| 799 | - | |||||||||||||||||||||||||
| 800 | - | |||||||||||||||||||||||||
| 801 | if (!d->plainSocket
| 128-593 | ||||||||||||||||||||||||
| 802 | - | |||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||
| 804 | - | |||||||||||||||||||||||||
| 805 | d->createPlainSocket(openMode); | - | ||||||||||||||||||||||||
| 806 | } executed 593 times by 8 tests: end of blockExecuted by:
| 593 | ||||||||||||||||||||||||
| 807 | - | |||||||||||||||||||||||||
| 808 | d->plainSocket->setProxy(proxy()); | - | ||||||||||||||||||||||||
| 809 | - | |||||||||||||||||||||||||
| 810 | QIODevice::open(openMode); | - | ||||||||||||||||||||||||
| 811 | d->readChannelCount = d->writeChannelCount = 0; | - | ||||||||||||||||||||||||
| 812 | d->plainSocket->connectToHost(hostName, port, openMode, d->preferredNetworkLayerProtocol); | - | ||||||||||||||||||||||||
| 813 | d->cachedSocketDescriptor = d->plainSocket->socketDescriptor(); | - | ||||||||||||||||||||||||
| 814 | } executed 721 times by 8 tests: end of blockExecuted by:
| 721 | ||||||||||||||||||||||||
| 815 | - | |||||||||||||||||||||||||
| 816 | - | |||||||||||||||||||||||||
| 817 | - | |||||||||||||||||||||||||
| 818 | - | |||||||||||||||||||||||||
| 819 | void QSslSocket::disconnectFromHost() | - | ||||||||||||||||||||||||
| 820 | { | - | ||||||||||||||||||||||||
| 821 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 822 | - | |||||||||||||||||||||||||
| 823 | - | |||||||||||||||||||||||||
| 824 | - | |||||||||||||||||||||||||
| 825 | if (!d->plainSocket
| 0-164 | ||||||||||||||||||||||||
| 826 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 827 | if (d->state == UnconnectedState
| 0-164 | ||||||||||||||||||||||||
| 828 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 829 | if (d->mode == UnencryptedMode
| 9-110 | ||||||||||||||||||||||||
| 830 | d->plainSocket->disconnectFromHost(); | - | ||||||||||||||||||||||||
| 831 | return; executed 45 times by 1 test: return;Executed by:
| 45 | ||||||||||||||||||||||||
| 832 | } | - | ||||||||||||||||||||||||
| 833 | if (d->state <= ConnectingState
| 9-110 | ||||||||||||||||||||||||
| 834 | d->pendingClose = true; | - | ||||||||||||||||||||||||
| 835 | return; executed 9 times by 1 test: return;Executed by:
| 9 | ||||||||||||||||||||||||
| 836 | } | - | ||||||||||||||||||||||||
| 837 | - | |||||||||||||||||||||||||
| 838 | - | |||||||||||||||||||||||||
| 839 | if (d->state != ClosingState
| 48-62 | ||||||||||||||||||||||||
| 840 | d->state = ClosingState; | - | ||||||||||||||||||||||||
| 841 | stateChanged(d->state); | - | ||||||||||||||||||||||||
| 842 | } executed 48 times by 1 test: end of blockExecuted by:
| 48 | ||||||||||||||||||||||||
| 843 | - | |||||||||||||||||||||||||
| 844 | if (!d->writeBuffer.isEmpty()
| 10-100 | ||||||||||||||||||||||||
| 845 | d->pendingClose = true; | - | ||||||||||||||||||||||||
| 846 | return; executed 10 times by 1 test: return;Executed by:
| 10 | ||||||||||||||||||||||||
| 847 | } | - | ||||||||||||||||||||||||
| 848 | - | |||||||||||||||||||||||||
| 849 | if (d->mode == UnencryptedMode
| 0-100 | ||||||||||||||||||||||||
| 850 | d->plainSocket->disconnectFromHost(); | - | ||||||||||||||||||||||||
| 851 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 852 | d->disconnectFromHost(); | - | ||||||||||||||||||||||||
| 853 | } executed 100 times by 1 test: end of blockExecuted by:
| 100 | ||||||||||||||||||||||||
| 854 | } | - | ||||||||||||||||||||||||
| 855 | - | |||||||||||||||||||||||||
| 856 | - | |||||||||||||||||||||||||
| 857 | - | |||||||||||||||||||||||||
| 858 | - | |||||||||||||||||||||||||
| 859 | qint64 QSslSocket::readData(char *data, qint64 maxlen) | - | ||||||||||||||||||||||||
| 860 | { | - | ||||||||||||||||||||||||
| 861 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 862 | qint64 readBytes = 0; | - | ||||||||||||||||||||||||
| 863 | - | |||||||||||||||||||||||||
| 864 | if (d->mode == UnencryptedMode
| 0-5635 | ||||||||||||||||||||||||
| 865 | readBytes = d->plainSocket->read(data, maxlen); | - | ||||||||||||||||||||||||
| 866 | - | |||||||||||||||||||||||||
| 867 | - | |||||||||||||||||||||||||
| 868 | - | |||||||||||||||||||||||||
| 869 | - | |||||||||||||||||||||||||
| 870 | } executed 5394 times by 3 tests: else {end of blockExecuted by:
| 5394 | ||||||||||||||||||||||||
| 871 | - | |||||||||||||||||||||||||
| 872 | if (d->plainSocket->bytesAvailable()
| 1-5634 | ||||||||||||||||||||||||
| 873 | QMetaObject::invokeMethod(this, "_q_flushReadBuffer", Qt::QueuedConnection); executed 1 time by 1 test: QMetaObject::invokeMethod(this, "_q_flushReadBuffer", Qt::QueuedConnection);Executed by:
| 1 | ||||||||||||||||||||||||
| 874 | } executed 5635 times by 5 tests: end of blockExecuted by:
| 5635 | ||||||||||||||||||||||||
| 875 | - | |||||||||||||||||||||||||
| 876 | return executed 11029 times by 6 tests: readBytes;return readBytes;Executed by:
executed 11029 times by 6 tests: return readBytes;Executed by:
| 11029 | ||||||||||||||||||||||||
| 877 | } | - | ||||||||||||||||||||||||
| 878 | - | |||||||||||||||||||||||||
| 879 | - | |||||||||||||||||||||||||
| 880 | - | |||||||||||||||||||||||||
| 881 | - | |||||||||||||||||||||||||
| 882 | qint64 QSslSocket::writeData(const char *data, qint64 len) | - | ||||||||||||||||||||||||
| 883 | { | - | ||||||||||||||||||||||||
| 884 | QSslSocketPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 885 | - | |||||||||||||||||||||||||
| 886 | - | |||||||||||||||||||||||||
| 887 | - | |||||||||||||||||||||||||
| 888 | if (d->mode == UnencryptedMode
| 7-5396 | ||||||||||||||||||||||||
| 889 | return executed 295 times by 3 tests: d->plainSocket->write(data, len);return d->plainSocket->write(data, len);Executed by:
executed 295 times by 3 tests: return d->plainSocket->write(data, len);Executed by:
| 295 | ||||||||||||||||||||||||
| 890 | - | |||||||||||||||||||||||||
| 891 | d->writeBuffer.append(data, len); | - | ||||||||||||||||||||||||
| 892 | - | |||||||||||||||||||||||||
| 893 | - | |||||||||||||||||||||||||
| 894 | QMetaObject::invokeMethod(this, "_q_flushWriteBuffer", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 895 | - | |||||||||||||||||||||||||
| 896 | return executed 5403 times by 5 tests: len;return len;Executed by:
executed 5403 times by 5 tests: return len;Executed by:
| 5403 | ||||||||||||||||||||||||
| 897 | } | - | ||||||||||||||||||||||||
| 898 | - | |||||||||||||||||||||||||
| 899 | - | |||||||||||||||||||||||||
| 900 | - | |||||||||||||||||||||||||
| 901 | - | |||||||||||||||||||||||||
| 902 | QSslSocketPrivate::QSslSocketPrivate() | - | ||||||||||||||||||||||||
| 903 | : initialized(false) | - | ||||||||||||||||||||||||
| 904 | , mode(QSslSocket::UnencryptedMode) | - | ||||||||||||||||||||||||
| 905 | , autoStartHandshake(false) | - | ||||||||||||||||||||||||
| 906 | , connectionEncrypted(false) | - | ||||||||||||||||||||||||
| 907 | , shutdown(false) | - | ||||||||||||||||||||||||
| 908 | , ignoreAllSslErrors(false) | - | ||||||||||||||||||||||||
| 909 | , readyReadEmittedPointer(0) | - | ||||||||||||||||||||||||
| 910 | , allowRootCertOnDemandLoading(true) | - | ||||||||||||||||||||||||
| 911 | , plainSocket(0) | - | ||||||||||||||||||||||||
| 912 | , paused(false) | - | ||||||||||||||||||||||||
| 913 | { | - | ||||||||||||||||||||||||
| 914 | QSslConfigurationPrivate::deepCopyDefaultConfiguration(&configuration); | - | ||||||||||||||||||||||||
| 915 | } executed 720 times by 8 tests: end of blockExecuted by:
| 720 | ||||||||||||||||||||||||
| 916 | - | |||||||||||||||||||||||||
| 917 | - | |||||||||||||||||||||||||
| 918 | - | |||||||||||||||||||||||||
| 919 | - | |||||||||||||||||||||||||
| 920 | QSslSocketPrivate::~QSslSocketPrivate() | - | ||||||||||||||||||||||||
| 921 | { | - | ||||||||||||||||||||||||
| 922 | } | - | ||||||||||||||||||||||||
| 923 | - | |||||||||||||||||||||||||
| 924 | - | |||||||||||||||||||||||||
| 925 | - | |||||||||||||||||||||||||
| 926 | - | |||||||||||||||||||||||||
| 927 | void QSslSocketPrivate::init() | - | ||||||||||||||||||||||||
| 928 | { | - | ||||||||||||||||||||||||
| 929 | mode = QSslSocket::UnencryptedMode; | - | ||||||||||||||||||||||||
| 930 | autoStartHandshake = false; | - | ||||||||||||||||||||||||
| 931 | connectionEncrypted = false; | - | ||||||||||||||||||||||||
| 932 | ignoreAllSslErrors = false; | - | ||||||||||||||||||||||||
| 933 | shutdown = false; | - | ||||||||||||||||||||||||
| 934 | pendingClose = false; | - | ||||||||||||||||||||||||
| 935 | - | |||||||||||||||||||||||||
| 936 | - | |||||||||||||||||||||||||
| 937 | - | |||||||||||||||||||||||||
| 938 | - | |||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||
| 940 | buffer.clear(); | - | ||||||||||||||||||||||||
| 941 | writeBuffer.clear(); | - | ||||||||||||||||||||||||
| 942 | configuration.peerCertificate.clear(); | - | ||||||||||||||||||||||||
| 943 | configuration.peerCertificateChain.clear(); | - | ||||||||||||||||||||||||
| 944 | } executed 1456 times by 8 tests: end of blockExecuted by:
| 1456 | ||||||||||||||||||||||||
| 945 | - | |||||||||||||||||||||||||
| 946 | - | |||||||||||||||||||||||||
| 947 | - | |||||||||||||||||||||||||
| 948 | - | |||||||||||||||||||||||||
| 949 | QList<QSslCipher> QSslSocketPrivate::defaultCiphers() | - | ||||||||||||||||||||||||
| 950 | { | - | ||||||||||||||||||||||||
| 951 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 952 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 953 | return executed 94 times by 4 tests: globalData()->config->ciphers;return globalData()->config->ciphers;Executed by:
executed 94 times by 4 tests: return globalData()->config->ciphers;Executed by:
| 94 | ||||||||||||||||||||||||
| 954 | } | - | ||||||||||||||||||||||||
| 955 | - | |||||||||||||||||||||||||
| 956 | - | |||||||||||||||||||||||||
| 957 | - | |||||||||||||||||||||||||
| 958 | - | |||||||||||||||||||||||||
| 959 | QList<QSslCipher> QSslSocketPrivate::supportedCiphers() | - | ||||||||||||||||||||||||
| 960 | { | - | ||||||||||||||||||||||||
| 961 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 962 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 963 | return executed 63 times by 1 test: globalData()->supportedCiphers;return globalData()->supportedCiphers;Executed by:
executed 63 times by 1 test: return globalData()->supportedCiphers;Executed by:
| 63 | ||||||||||||||||||||||||
| 964 | } | - | ||||||||||||||||||||||||
| 965 | - | |||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||
| 967 | - | |||||||||||||||||||||||||
| 968 | - | |||||||||||||||||||||||||
| 969 | void QSslSocketPrivate::setDefaultCiphers(const QList<QSslCipher> &ciphers) | - | ||||||||||||||||||||||||
| 970 | { | - | ||||||||||||||||||||||||
| 971 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 972 | globalData()->config.detach(); | - | ||||||||||||||||||||||||
| 973 | globalData()->config->ciphers = ciphers; | - | ||||||||||||||||||||||||
| 974 | } executed 20 times by 15 tests: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||
| 975 | - | |||||||||||||||||||||||||
| 976 | - | |||||||||||||||||||||||||
| 977 | - | |||||||||||||||||||||||||
| 978 | - | |||||||||||||||||||||||||
| 979 | void QSslSocketPrivate::setDefaultSupportedCiphers(const QList<QSslCipher> &ciphers) | - | ||||||||||||||||||||||||
| 980 | { | - | ||||||||||||||||||||||||
| 981 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 982 | globalData()->config.detach(); | - | ||||||||||||||||||||||||
| 983 | globalData()->supportedCiphers = ciphers; | - | ||||||||||||||||||||||||
| 984 | } executed 15 times by 15 tests: end of blockExecuted by:
| 15 | ||||||||||||||||||||||||
| 985 | - | |||||||||||||||||||||||||
| 986 | - | |||||||||||||||||||||||||
| 987 | - | |||||||||||||||||||||||||
| 988 | - | |||||||||||||||||||||||||
| 989 | QVector<QSslEllipticCurve> QSslSocketPrivate::supportedEllipticCurves() | - | ||||||||||||||||||||||||
| 990 | { | - | ||||||||||||||||||||||||
| 991 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 992 | const QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 993 | return executed 2 times by 1 test: globalData()->supportedEllipticCurves;return globalData()->supportedEllipticCurves;Executed by:
executed 2 times by 1 test: return globalData()->supportedEllipticCurves;Executed by:
| 2 | ||||||||||||||||||||||||
| 994 | } | - | ||||||||||||||||||||||||
| 995 | - | |||||||||||||||||||||||||
| 996 | - | |||||||||||||||||||||||||
| 997 | - | |||||||||||||||||||||||||
| 998 | - | |||||||||||||||||||||||||
| 999 | void QSslSocketPrivate::setDefaultSupportedEllipticCurves(const QVector<QSslEllipticCurve> &curves) | - | ||||||||||||||||||||||||
| 1000 | { | - | ||||||||||||||||||||||||
| 1001 | const QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 1002 | globalData()->config.detach(); | - | ||||||||||||||||||||||||
| 1003 | globalData()->supportedEllipticCurves = curves; | - | ||||||||||||||||||||||||
| 1004 | } executed 15 times by 15 tests: end of blockExecuted by:
| 15 | ||||||||||||||||||||||||
| 1005 | - | |||||||||||||||||||||||||
| 1006 | - | |||||||||||||||||||||||||
| 1007 | - | |||||||||||||||||||||||||
| 1008 | - | |||||||||||||||||||||||||
| 1009 | QList<QSslCertificate> QSslSocketPrivate::defaultCaCertificates() | - | ||||||||||||||||||||||||
| 1010 | { | - | ||||||||||||||||||||||||
| 1011 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 1012 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 1013 | return executed 42 times by 3 tests: globalData()->config->caCertificates;return globalData()->config->caCertificates;Executed by:
executed 42 times by 3 tests: return globalData()->config->caCertificates;Executed by:
| 42 | ||||||||||||||||||||||||
| 1014 | } | - | ||||||||||||||||||||||||
| 1015 | - | |||||||||||||||||||||||||
| 1016 | - | |||||||||||||||||||||||||
| 1017 | - | |||||||||||||||||||||||||
| 1018 | - | |||||||||||||||||||||||||
| 1019 | void QSslSocketPrivate::setDefaultCaCertificates(const QList<QSslCertificate> &certs) | - | ||||||||||||||||||||||||
| 1020 | { | - | ||||||||||||||||||||||||
| 1021 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 1022 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 1023 | globalData()->config.detach(); | - | ||||||||||||||||||||||||
| 1024 | globalData()->config->caCertificates = certs; | - | ||||||||||||||||||||||||
| 1025 | - | |||||||||||||||||||||||||
| 1026 | - | |||||||||||||||||||||||||
| 1027 | s_loadRootCertsOnDemand = false; | - | ||||||||||||||||||||||||
| 1028 | } executed 52 times by 3 tests: end of blockExecuted by:
| 52 | ||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||
| 1030 | - | |||||||||||||||||||||||||
| 1031 | - | |||||||||||||||||||||||||
| 1032 | - | |||||||||||||||||||||||||
| 1033 | bool QSslSocketPrivate::addDefaultCaCertificates(const QString &path, QSsl::EncodingFormat format, | - | ||||||||||||||||||||||||
| 1034 | QRegExp::PatternSyntax syntax) | - | ||||||||||||||||||||||||
| 1035 | { | - | ||||||||||||||||||||||||
| 1036 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 1037 | QList<QSslCertificate> certs = QSslCertificate::fromPath(path, format, syntax); | - | ||||||||||||||||||||||||
| 1038 | if (certs.isEmpty()
| 0 | ||||||||||||||||||||||||
| 1039 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1040 | - | |||||||||||||||||||||||||
| 1041 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 1042 | globalData()->config.detach(); | - | ||||||||||||||||||||||||
| 1043 | globalData()->config->caCertificates += certs; | - | ||||||||||||||||||||||||
| 1044 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1045 | } | - | ||||||||||||||||||||||||
| 1046 | - | |||||||||||||||||||||||||
| 1047 | - | |||||||||||||||||||||||||
| 1048 | - | |||||||||||||||||||||||||
| 1049 | - | |||||||||||||||||||||||||
| 1050 | void QSslSocketPrivate::addDefaultCaCertificate(const QSslCertificate &cert) | - | ||||||||||||||||||||||||
| 1051 | { | - | ||||||||||||||||||||||||
| 1052 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 1053 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 1054 | globalData()->config.detach(); | - | ||||||||||||||||||||||||
| 1055 | globalData()->config->caCertificates += cert; | - | ||||||||||||||||||||||||
| 1056 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 1057 | - | |||||||||||||||||||||||||
| 1058 | - | |||||||||||||||||||||||||
| 1059 | - | |||||||||||||||||||||||||
| 1060 | - | |||||||||||||||||||||||||
| 1061 | void QSslSocketPrivate::addDefaultCaCertificates(const QList<QSslCertificate> &certs) | - | ||||||||||||||||||||||||
| 1062 | { | - | ||||||||||||||||||||||||
| 1063 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 1064 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 1065 | globalData()->config.detach(); | - | ||||||||||||||||||||||||
| 1066 | globalData()->config->caCertificates += certs; | - | ||||||||||||||||||||||||
| 1067 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1068 | - | |||||||||||||||||||||||||
| 1069 | - | |||||||||||||||||||||||||
| 1070 | - | |||||||||||||||||||||||||
| 1071 | - | |||||||||||||||||||||||||
| 1072 | QSslConfiguration QSslConfigurationPrivate::defaultConfiguration() | - | ||||||||||||||||||||||||
| 1073 | { | - | ||||||||||||||||||||||||
| 1074 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 1075 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 1076 | return executed 1003 times by 11 tests: QSslConfiguration(globalData()->config.data());return QSslConfiguration(globalData()->config.data());Executed by:
executed 1003 times by 11 tests: return QSslConfiguration(globalData()->config.data());Executed by:
| 1003 | ||||||||||||||||||||||||
| 1077 | } | - | ||||||||||||||||||||||||
| 1078 | - | |||||||||||||||||||||||||
| 1079 | - | |||||||||||||||||||||||||
| 1080 | - | |||||||||||||||||||||||||
| 1081 | - | |||||||||||||||||||||||||
| 1082 | void QSslConfigurationPrivate::setDefaultConfiguration(const QSslConfiguration &configuration) | - | ||||||||||||||||||||||||
| 1083 | { | - | ||||||||||||||||||||||||
| 1084 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 1085 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 1086 | if (globalData()->config == configuration.d
| 0-16 | ||||||||||||||||||||||||
| 1087 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||
| 1089 | globalData()->config = const_cast<QSslConfigurationPrivate*>(configuration.d.constData()); | - | ||||||||||||||||||||||||
| 1090 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||
| 1091 | - | |||||||||||||||||||||||||
| 1092 | - | |||||||||||||||||||||||||
| 1093 | - | |||||||||||||||||||||||||
| 1094 | - | |||||||||||||||||||||||||
| 1095 | void QSslConfigurationPrivate::deepCopyDefaultConfiguration(QSslConfigurationPrivate *ptr) | - | ||||||||||||||||||||||||
| 1096 | { | - | ||||||||||||||||||||||||
| 1097 | QSslSocketPrivate::ensureInitialized(); | - | ||||||||||||||||||||||||
| 1098 | QMutexLocker locker(&globalData()->mutex); | - | ||||||||||||||||||||||||
| 1099 | const QSslConfigurationPrivate *global = globalData()->config.constData(); | - | ||||||||||||||||||||||||
| 1100 | - | |||||||||||||||||||||||||
| 1101 | if (!global
| 0-720 | ||||||||||||||||||||||||
| 1102 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1103 | - | |||||||||||||||||||||||||
| 1104 | ptr->ref.store(1); | - | ||||||||||||||||||||||||
| 1105 | ptr->peerCertificate = global->peerCertificate; | - | ||||||||||||||||||||||||
| 1106 | ptr->peerCertificateChain = global->peerCertificateChain; | - | ||||||||||||||||||||||||
| 1107 | ptr->localCertificateChain = global->localCertificateChain; | - | ||||||||||||||||||||||||
| 1108 | ptr->privateKey = global->privateKey; | - | ||||||||||||||||||||||||
| 1109 | ptr->sessionCipher = global->sessionCipher; | - | ||||||||||||||||||||||||
| 1110 | ptr->sessionProtocol = global->sessionProtocol; | - | ||||||||||||||||||||||||
| 1111 | ptr->ciphers = global->ciphers; | - | ||||||||||||||||||||||||
| 1112 | ptr->caCertificates = global->caCertificates; | - | ||||||||||||||||||||||||
| 1113 | ptr->protocol = global->protocol; | - | ||||||||||||||||||||||||
| 1114 | ptr->peerVerifyMode = global->peerVerifyMode; | - | ||||||||||||||||||||||||
| 1115 | ptr->peerVerifyDepth = global->peerVerifyDepth; | - | ||||||||||||||||||||||||
| 1116 | ptr->sslOptions = global->sslOptions; | - | ||||||||||||||||||||||||
| 1117 | ptr->ellipticCurves = global->ellipticCurves; | - | ||||||||||||||||||||||||
| 1118 | } executed 720 times by 8 tests: end of blockExecuted by:
| 720 | ||||||||||||||||||||||||
| 1119 | - | |||||||||||||||||||||||||
| 1120 | - | |||||||||||||||||||||||||
| 1121 | - | |||||||||||||||||||||||||
| 1122 | - | |||||||||||||||||||||||||
| 1123 | void QSslSocketPrivate::createPlainSocket(QIODevice::OpenMode openMode) | - | ||||||||||||||||||||||||
| 1124 | { | - | ||||||||||||||||||||||||
| 1125 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1126 | q->setOpenMode(openMode); | - | ||||||||||||||||||||||||
| 1127 | q->setSocketState(QAbstractSocket::UnconnectedState); | - | ||||||||||||||||||||||||
| 1128 | q->setSocketError(QAbstractSocket::UnknownSocketError); | - | ||||||||||||||||||||||||
| 1129 | q->setLocalPort(0); | - | ||||||||||||||||||||||||
| 1130 | q->setLocalAddress(QHostAddress()); | - | ||||||||||||||||||||||||
| 1131 | q->setPeerPort(0); | - | ||||||||||||||||||||||||
| 1132 | q->setPeerAddress(QHostAddress()); | - | ||||||||||||||||||||||||
| 1133 | q->setPeerName(QString()); | - | ||||||||||||||||||||||||
| 1134 | - | |||||||||||||||||||||||||
| 1135 | plainSocket = new QTcpSocket(q); | - | ||||||||||||||||||||||||
| 1136 | - | |||||||||||||||||||||||||
| 1137 | - | |||||||||||||||||||||||||
| 1138 | plainSocket->setProperty("_q_networksession", q->property("_q_networksession")); | - | ||||||||||||||||||||||||
| 1139 | - | |||||||||||||||||||||||||
| 1140 | q->connect(plainSocket, qFlagLocation("2""connected()" "\0" __FILE__ ":" "2261"), | - | ||||||||||||||||||||||||
| 1141 | q, qFlagLocation("1""_q_connectedSlot()" "\0" __FILE__ ":" "2262"), | - | ||||||||||||||||||||||||
| 1142 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 1143 | q->connect(plainSocket, qFlagLocation("2""hostFound()" "\0" __FILE__ ":" "2264"), | - | ||||||||||||||||||||||||
| 1144 | q, qFlagLocation("1""_q_hostFoundSlot()" "\0" __FILE__ ":" "2265"), | - | ||||||||||||||||||||||||
| 1145 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 1146 | q->connect(plainSocket, qFlagLocation("2""disconnected()" "\0" __FILE__ ":" "2267"), | - | ||||||||||||||||||||||||
| 1147 | q, qFlagLocation("1""_q_disconnectedSlot()" "\0" __FILE__ ":" "2268"), | - | ||||||||||||||||||||||||
| 1148 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 1149 | q->connect(plainSocket, qFlagLocation("2""stateChanged(QAbstractSocket::SocketState)" "\0" __FILE__ ":" "2270"), | - | ||||||||||||||||||||||||
| 1150 | q, qFlagLocation("1""_q_stateChangedSlot(QAbstractSocket::SocketState)" "\0" __FILE__ ":" "2271"), | - | ||||||||||||||||||||||||
| 1151 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 1152 | q->connect(plainSocket, qFlagLocation("2""error(QAbstractSocket::SocketError)" "\0" __FILE__ ":" "2273"), | - | ||||||||||||||||||||||||
| 1153 | q, qFlagLocation("1""_q_errorSlot(QAbstractSocket::SocketError)" "\0" __FILE__ ":" "2274"), | - | ||||||||||||||||||||||||
| 1154 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 1155 | q->connect(plainSocket, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "2276"), | - | ||||||||||||||||||||||||
| 1156 | q, qFlagLocation("1""_q_readyReadSlot()" "\0" __FILE__ ":" "2277"), | - | ||||||||||||||||||||||||
| 1157 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 1158 | q->connect(plainSocket, qFlagLocation("2""channelReadyRead(int)" "\0" __FILE__ ":" "2279"), | - | ||||||||||||||||||||||||
| 1159 | q, qFlagLocation("1""_q_channelReadyReadSlot(int)" "\0" __FILE__ ":" "2280"), | - | ||||||||||||||||||||||||
| 1160 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 1161 | q->connect(plainSocket, qFlagLocation("2""bytesWritten(qint64)" "\0" __FILE__ ":" "2282"), | - | ||||||||||||||||||||||||
| 1162 | q, qFlagLocation("1""_q_bytesWrittenSlot(qint64)" "\0" __FILE__ ":" "2283"), | - | ||||||||||||||||||||||||
| 1163 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 1164 | q->connect(plainSocket, qFlagLocation("2""channelBytesWritten(int, qint64)" "\0" __FILE__ ":" "2285"), | - | ||||||||||||||||||||||||
| 1165 | q, qFlagLocation("1""_q_channelBytesWrittenSlot(int, qint64)" "\0" __FILE__ ":" "2286"), | - | ||||||||||||||||||||||||
| 1166 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 1167 | - | |||||||||||||||||||||||||
| 1168 | q->connect(plainSocket, qFlagLocation("2""proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "2289"), | - | ||||||||||||||||||||||||
| 1169 | q, qFlagLocation("2""proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "2290")); | - | ||||||||||||||||||||||||
| 1170 | - | |||||||||||||||||||||||||
| 1171 | - | |||||||||||||||||||||||||
| 1172 | buffer.clear(); | - | ||||||||||||||||||||||||
| 1173 | writeBuffer.clear(); | - | ||||||||||||||||||||||||
| 1174 | connectionEncrypted = false; | - | ||||||||||||||||||||||||
| 1175 | configuration.peerCertificate.clear(); | - | ||||||||||||||||||||||||
| 1176 | configuration.peerCertificateChain.clear(); | - | ||||||||||||||||||||||||
| 1177 | mode = QSslSocket::UnencryptedMode; | - | ||||||||||||||||||||||||
| 1178 | q->setReadBufferSize(readBufferMaxSize); | - | ||||||||||||||||||||||||
| 1179 | } executed 677 times by 8 tests: end of blockExecuted by:
| 677 | ||||||||||||||||||||||||
| 1180 | - | |||||||||||||||||||||||||
| 1181 | void QSslSocketPrivate::pauseSocketNotifiers(QSslSocket *socket) | - | ||||||||||||||||||||||||
| 1182 | { | - | ||||||||||||||||||||||||
| 1183 | if (!socket->d_func()->plainSocket
| 0-148 | ||||||||||||||||||||||||
| 1184 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1185 | QAbstractSocketPrivate::pauseSocketNotifiers(socket->d_func()->plainSocket); | - | ||||||||||||||||||||||||
| 1186 | } executed 148 times by 4 tests: end of blockExecuted by:
| 148 | ||||||||||||||||||||||||
| 1187 | - | |||||||||||||||||||||||||
| 1188 | void QSslSocketPrivate::resumeSocketNotifiers(QSslSocket *socket) | - | ||||||||||||||||||||||||
| 1189 | { | - | ||||||||||||||||||||||||
| 1190 | if (!socket->d_func()->plainSocket
| 0-128 | ||||||||||||||||||||||||
| 1191 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1192 | QAbstractSocketPrivate::resumeSocketNotifiers(socket->d_func()->plainSocket); | - | ||||||||||||||||||||||||
| 1193 | } executed 128 times by 3 tests: end of blockExecuted by:
| 128 | ||||||||||||||||||||||||
| 1194 | - | |||||||||||||||||||||||||
| 1195 | bool QSslSocketPrivate::isPaused() const | - | ||||||||||||||||||||||||
| 1196 | { | - | ||||||||||||||||||||||||
| 1197 | return never executed: paused;return paused;never executed: return paused; | 0 | ||||||||||||||||||||||||
| 1198 | } | - | ||||||||||||||||||||||||
| 1199 | - | |||||||||||||||||||||||||
| 1200 | bool QSslSocketPrivate::bind(const QHostAddress &address, quint16 port, QAbstractSocket::BindMode mode) | - | ||||||||||||||||||||||||
| 1201 | { | - | ||||||||||||||||||||||||
| 1202 | - | |||||||||||||||||||||||||
| 1203 | if (!initialized
| 0-15 | ||||||||||||||||||||||||
| 1204 | init(); executed 15 times by 1 test: init();Executed by:
| 15 | ||||||||||||||||||||||||
| 1205 | initialized = false; | - | ||||||||||||||||||||||||
| 1206 | - | |||||||||||||||||||||||||
| 1207 | - | |||||||||||||||||||||||||
| 1208 | - | |||||||||||||||||||||||||
| 1209 | - | |||||||||||||||||||||||||
| 1210 | if (!plainSocket
| 0-15 | ||||||||||||||||||||||||
| 1211 | - | |||||||||||||||||||||||||
| 1212 | - | |||||||||||||||||||||||||
| 1213 | - | |||||||||||||||||||||||||
| 1214 | createPlainSocket(QIODevice::ReadWrite); | - | ||||||||||||||||||||||||
| 1215 | } executed 15 times by 1 test: end of blockExecuted by:
| 15 | ||||||||||||||||||||||||
| 1216 | bool ret = plainSocket->bind(address, port, mode); | - | ||||||||||||||||||||||||
| 1217 | localPort = plainSocket->localPort(); | - | ||||||||||||||||||||||||
| 1218 | localAddress = plainSocket->localAddress(); | - | ||||||||||||||||||||||||
| 1219 | cachedSocketDescriptor = plainSocket->socketDescriptor(); | - | ||||||||||||||||||||||||
| 1220 | readChannelCount = writeChannelCount = 0; | - | ||||||||||||||||||||||||
| 1221 | return executed 15 times by 1 test: ret;return ret;Executed by:
executed 15 times by 1 test: return ret;Executed by:
| 15 | ||||||||||||||||||||||||
| 1222 | } | - | ||||||||||||||||||||||||
| 1223 | - | |||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||
| 1225 | - | |||||||||||||||||||||||||
| 1226 | - | |||||||||||||||||||||||||
| 1227 | void QSslSocketPrivate::_q_connectedSlot() | - | ||||||||||||||||||||||||
| 1228 | { | - | ||||||||||||||||||||||||
| 1229 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1230 | q->setLocalPort(plainSocket->localPort()); | - | ||||||||||||||||||||||||
| 1231 | q->setLocalAddress(plainSocket->localAddress()); | - | ||||||||||||||||||||||||
| 1232 | q->setPeerPort(plainSocket->peerPort()); | - | ||||||||||||||||||||||||
| 1233 | q->setPeerAddress(plainSocket->peerAddress()); | - | ||||||||||||||||||||||||
| 1234 | q->setPeerName(plainSocket->peerName()); | - | ||||||||||||||||||||||||
| 1235 | cachedSocketDescriptor = plainSocket->socketDescriptor(); | - | ||||||||||||||||||||||||
| 1236 | readChannelCount = plainSocket->readChannelCount(); | - | ||||||||||||||||||||||||
| 1237 | writeChannelCount = plainSocket->writeChannelCount(); | - | ||||||||||||||||||||||||
| 1238 | if (autoStartHandshake
| 267-376 | ||||||||||||||||||||||||
| 1239 | q->startClientEncryption(); executed 376 times by 6 tests: q->startClientEncryption();Executed by:
| 376 | ||||||||||||||||||||||||
| 1240 | - | |||||||||||||||||||||||||
| 1241 | q->connected(); | - | ||||||||||||||||||||||||
| 1242 | - | |||||||||||||||||||||||||
| 1243 | if (pendingClose
| 0-634 | ||||||||||||||||||||||||
| 1244 | pendingClose = false; | - | ||||||||||||||||||||||||
| 1245 | q->disconnectFromHost(); | - | ||||||||||||||||||||||||
| 1246 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1247 | } executed 643 times by 8 tests: end of blockExecuted by:
| 643 | ||||||||||||||||||||||||
| 1248 | - | |||||||||||||||||||||||||
| 1249 | - | |||||||||||||||||||||||||
| 1250 | - | |||||||||||||||||||||||||
| 1251 | - | |||||||||||||||||||||||||
| 1252 | void QSslSocketPrivate::_q_hostFoundSlot() | - | ||||||||||||||||||||||||
| 1253 | { | - | ||||||||||||||||||||||||
| 1254 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1255 | - | |||||||||||||||||||||||||
| 1256 | - | |||||||||||||||||||||||||
| 1257 | - | |||||||||||||||||||||||||
| 1258 | - | |||||||||||||||||||||||||
| 1259 | q->hostFound(); | - | ||||||||||||||||||||||||
| 1260 | } executed 365 times by 8 tests: end of blockExecuted by:
| 365 | ||||||||||||||||||||||||
| 1261 | - | |||||||||||||||||||||||||
| 1262 | - | |||||||||||||||||||||||||
| 1263 | - | |||||||||||||||||||||||||
| 1264 | - | |||||||||||||||||||||||||
| 1265 | void QSslSocketPrivate::_q_disconnectedSlot() | - | ||||||||||||||||||||||||
| 1266 | { | - | ||||||||||||||||||||||||
| 1267 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1268 | - | |||||||||||||||||||||||||
| 1269 | - | |||||||||||||||||||||||||
| 1270 | - | |||||||||||||||||||||||||
| 1271 | - | |||||||||||||||||||||||||
| 1272 | disconnected(); | - | ||||||||||||||||||||||||
| 1273 | q->disconnected(); | - | ||||||||||||||||||||||||
| 1274 | - | |||||||||||||||||||||||||
| 1275 | q->setLocalPort(0); | - | ||||||||||||||||||||||||
| 1276 | q->setLocalAddress(QHostAddress()); | - | ||||||||||||||||||||||||
| 1277 | q->setPeerPort(0); | - | ||||||||||||||||||||||||
| 1278 | q->setPeerAddress(QHostAddress()); | - | ||||||||||||||||||||||||
| 1279 | q->setPeerName(QString()); | - | ||||||||||||||||||||||||
| 1280 | cachedSocketDescriptor = -1; | - | ||||||||||||||||||||||||
| 1281 | } executed 707 times by 9 tests: end of blockExecuted by:
| 707 | ||||||||||||||||||||||||
| 1282 | - | |||||||||||||||||||||||||
| 1283 | - | |||||||||||||||||||||||||
| 1284 | - | |||||||||||||||||||||||||
| 1285 | - | |||||||||||||||||||||||||
| 1286 | void QSslSocketPrivate::_q_stateChangedSlot(QAbstractSocket::SocketState state) | - | ||||||||||||||||||||||||
| 1287 | { | - | ||||||||||||||||||||||||
| 1288 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1289 | - | |||||||||||||||||||||||||
| 1290 | - | |||||||||||||||||||||||||
| 1291 | - | |||||||||||||||||||||||||
| 1292 | q->setSocketState(state); | - | ||||||||||||||||||||||||
| 1293 | q->stateChanged(state); | - | ||||||||||||||||||||||||
| 1294 | } executed 3332 times by 9 tests: end of blockExecuted by:
| 3332 | ||||||||||||||||||||||||
| 1295 | - | |||||||||||||||||||||||||
| 1296 | - | |||||||||||||||||||||||||
| 1297 | - | |||||||||||||||||||||||||
| 1298 | - | |||||||||||||||||||||||||
| 1299 | void QSslSocketPrivate::_q_errorSlot(QAbstractSocket::SocketError error) | - | ||||||||||||||||||||||||
| 1300 | { | - | ||||||||||||||||||||||||
| 1301 | (void)error; | - | ||||||||||||||||||||||||
| 1302 | - | |||||||||||||||||||||||||
| 1303 | - | |||||||||||||||||||||||||
| 1304 | - | |||||||||||||||||||||||||
| 1305 | - | |||||||||||||||||||||||||
| 1306 | - | |||||||||||||||||||||||||
| 1307 | - | |||||||||||||||||||||||||
| 1308 | - | |||||||||||||||||||||||||
| 1309 | if (plainSocket->bytesAvailable()
| 22-200 | ||||||||||||||||||||||||
| 1310 | qint64 tmpReadBufferMaxSize = readBufferMaxSize; | - | ||||||||||||||||||||||||
| 1311 | readBufferMaxSize = 0; | - | ||||||||||||||||||||||||
| 1312 | transmit(); | - | ||||||||||||||||||||||||
| 1313 | readBufferMaxSize = tmpReadBufferMaxSize; | - | ||||||||||||||||||||||||
| 1314 | } executed 22 times by 3 tests: end of blockExecuted by:
| 22 | ||||||||||||||||||||||||
| 1315 | - | |||||||||||||||||||||||||
| 1316 | setErrorAndEmit(plainSocket->error(), plainSocket->errorString()); | - | ||||||||||||||||||||||||
| 1317 | } executed 222 times by 7 tests: end of blockExecuted by:
| 222 | ||||||||||||||||||||||||
| 1318 | - | |||||||||||||||||||||||||
| 1319 | - | |||||||||||||||||||||||||
| 1320 | - | |||||||||||||||||||||||||
| 1321 | - | |||||||||||||||||||||||||
| 1322 | void QSslSocketPrivate::_q_readyReadSlot() | - | ||||||||||||||||||||||||
| 1323 | { | - | ||||||||||||||||||||||||
| 1324 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1325 | - | |||||||||||||||||||||||||
| 1326 | - | |||||||||||||||||||||||||
| 1327 | - | |||||||||||||||||||||||||
| 1328 | if (mode == QSslSocket::UnencryptedMode
| 2341-2685 | ||||||||||||||||||||||||
| 1329 | if (readyReadEmittedPointer
| 0-2341 | ||||||||||||||||||||||||
| 1330 | * never executed: readyReadEmittedPointer = true;*readyReadEmittedPointer = true;never executed: *readyReadEmittedPointer = true; | 0 | ||||||||||||||||||||||||
| 1331 | q->readyRead(); | - | ||||||||||||||||||||||||
| 1332 | return; executed 2341 times by 3 tests: return;Executed by:
| 2341 | ||||||||||||||||||||||||
| 1333 | } | - | ||||||||||||||||||||||||
| 1334 | - | |||||||||||||||||||||||||
| 1335 | transmit(); | - | ||||||||||||||||||||||||
| 1336 | } executed 2685 times by 7 tests: end of blockExecuted by:
| 2685 | ||||||||||||||||||||||||
| 1337 | - | |||||||||||||||||||||||||
| 1338 | - | |||||||||||||||||||||||||
| 1339 | - | |||||||||||||||||||||||||
| 1340 | - | |||||||||||||||||||||||||
| 1341 | void QSslSocketPrivate::_q_channelReadyReadSlot(int channel) | - | ||||||||||||||||||||||||
| 1342 | { | - | ||||||||||||||||||||||||
| 1343 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1344 | if (mode == QSslSocket::UnencryptedMode
| 2340-2686 | ||||||||||||||||||||||||
| 1345 | q->channelReadyRead(channel); executed 2340 times by 3 tests: q->channelReadyRead(channel);Executed by:
| 2340 | ||||||||||||||||||||||||
| 1346 | } executed 5026 times by 8 tests: end of blockExecuted by:
| 5026 | ||||||||||||||||||||||||
| 1347 | - | |||||||||||||||||||||||||
| 1348 | - | |||||||||||||||||||||||||
| 1349 | - | |||||||||||||||||||||||||
| 1350 | - | |||||||||||||||||||||||||
| 1351 | void QSslSocketPrivate::_q_bytesWrittenSlot(qint64 written) | - | ||||||||||||||||||||||||
| 1352 | { | - | ||||||||||||||||||||||||
| 1353 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1354 | - | |||||||||||||||||||||||||
| 1355 | - | |||||||||||||||||||||||||
| 1356 | - | |||||||||||||||||||||||||
| 1357 | - | |||||||||||||||||||||||||
| 1358 | if (mode == QSslSocket::UnencryptedMode
| 267-5194 | ||||||||||||||||||||||||
| 1359 | q->bytesWritten(written); executed 267 times by 3 tests: q->bytesWritten(written);Executed by:
| 267 | ||||||||||||||||||||||||
| 1360 | else | - | ||||||||||||||||||||||||
| 1361 | q->encryptedBytesWritten(written); executed 5194 times by 7 tests: q->encryptedBytesWritten(written);Executed by:
| 5194 | ||||||||||||||||||||||||
| 1362 | if (state == QAbstractSocket::ClosingState
| 0-5391 | ||||||||||||||||||||||||
| 1363 | q->disconnectFromHost(); executed 70 times by 2 tests: q->disconnectFromHost();Executed by:
| 70 | ||||||||||||||||||||||||
| 1364 | } executed 5461 times by 8 tests: end of blockExecuted by:
| 5461 | ||||||||||||||||||||||||
| 1365 | - | |||||||||||||||||||||||||
| 1366 | - | |||||||||||||||||||||||||
| 1367 | - | |||||||||||||||||||||||||
| 1368 | - | |||||||||||||||||||||||||
| 1369 | void QSslSocketPrivate::_q_channelBytesWrittenSlot(int channel, qint64 written) | - | ||||||||||||||||||||||||
| 1370 | { | - | ||||||||||||||||||||||||
| 1371 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1372 | if (mode == QSslSocket::UnencryptedMode
| 267-5194 | ||||||||||||||||||||||||
| 1373 | q->channelBytesWritten(channel, written); executed 267 times by 3 tests: q->channelBytesWritten(channel, written);Executed by:
| 267 | ||||||||||||||||||||||||
| 1374 | } executed 5461 times by 8 tests: end of blockExecuted by:
| 5461 | ||||||||||||||||||||||||
| 1375 | - | |||||||||||||||||||||||||
| 1376 | - | |||||||||||||||||||||||||
| 1377 | - | |||||||||||||||||||||||||
| 1378 | - | |||||||||||||||||||||||||
| 1379 | void QSslSocketPrivate::_q_flushWriteBuffer() | - | ||||||||||||||||||||||||
| 1380 | { | - | ||||||||||||||||||||||||
| 1381 | QSslSocket * const q = q_func(); | - | ||||||||||||||||||||||||
| 1382 | if (!writeBuffer.isEmpty()
| 1205-1809 | ||||||||||||||||||||||||
| 1383 | q->flush(); executed 1809 times by 3 tests: q->flush();Executed by:
| 1809 | ||||||||||||||||||||||||
| 1384 | } executed 3014 times by 4 tests: end of blockExecuted by:
| 3014 | ||||||||||||||||||||||||
| 1385 | - | |||||||||||||||||||||||||
| 1386 | - | |||||||||||||||||||||||||
| 1387 | - | |||||||||||||||||||||||||
| 1388 | - | |||||||||||||||||||||||||
| 1389 | void QSslSocketPrivate::_q_flushReadBuffer() | - | ||||||||||||||||||||||||
| 1390 | { | - | ||||||||||||||||||||||||
| 1391 | - | |||||||||||||||||||||||||
| 1392 | if (mode != QSslSocket::UnencryptedMode
| 0-1 | ||||||||||||||||||||||||
| 1393 | transmit(); executed 1 time by 1 test: transmit();Executed by:
| 1 | ||||||||||||||||||||||||
| 1394 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 1395 | - | |||||||||||||||||||||||||
| 1396 | - | |||||||||||||||||||||||||
| 1397 | - | |||||||||||||||||||||||||
| 1398 | - | |||||||||||||||||||||||||
| 1399 | void QSslSocketPrivate::_q_resumeImplementation() | - | ||||||||||||||||||||||||
| 1400 | { | - | ||||||||||||||||||||||||
| 1401 | if (plainSocket
| 0-20 | ||||||||||||||||||||||||
| 1402 | plainSocket->resume(); executed 20 times by 1 test: plainSocket->resume();Executed by:
| 20 | ||||||||||||||||||||||||
| 1403 | paused = false; | - | ||||||||||||||||||||||||
| 1404 | if (!connectionEncrypted
| 0-20 | ||||||||||||||||||||||||
| 1405 | if (verifyErrorsHaveBeenIgnored()
| 10 | ||||||||||||||||||||||||
| 1406 | continueHandshake(); | - | ||||||||||||||||||||||||
| 1407 | } executed 10 times by 1 test: else {end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 1408 | setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError, sslErrors.constFirst().errorString()); | - | ||||||||||||||||||||||||
| 1409 | plainSocket->disconnectFromHost(); | - | ||||||||||||||||||||||||
| 1410 | return; executed 10 times by 1 test: return;Executed by:
| 10 | ||||||||||||||||||||||||
| 1411 | } | - | ||||||||||||||||||||||||
| 1412 | } | - | ||||||||||||||||||||||||
| 1413 | transmit(); | - | ||||||||||||||||||||||||
| 1414 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 1415 | - | |||||||||||||||||||||||||
| 1416 | - | |||||||||||||||||||||||||
| 1417 | - | |||||||||||||||||||||||||
| 1418 | - | |||||||||||||||||||||||||
| 1419 | bool QSslSocketPrivate::verifyErrorsHaveBeenIgnored() | - | ||||||||||||||||||||||||
| 1420 | { | - | ||||||||||||||||||||||||
| 1421 | bool doEmitSslError; | - | ||||||||||||||||||||||||
| 1422 | if (!ignoreErrorsList.empty()
| 43-225 | ||||||||||||||||||||||||
| 1423 | - | |||||||||||||||||||||||||
| 1424 | - | |||||||||||||||||||||||||
| 1425 | - | |||||||||||||||||||||||||
| 1426 | doEmitSslError = false; | - | ||||||||||||||||||||||||
| 1427 | for (int a = 0; a < sslErrors.count()
| 27-43 | ||||||||||||||||||||||||
| 1428 | if (!ignoreErrorsList.contains(sslErrors.at(a))
| 16-27 | ||||||||||||||||||||||||
| 1429 | doEmitSslError = true; | - | ||||||||||||||||||||||||
| 1430 | break; executed 16 times by 2 tests: break;Executed by:
| 16 | ||||||||||||||||||||||||
| 1431 | } | - | ||||||||||||||||||||||||
| 1432 | } executed 27 times by 2 tests: end of blockExecuted by:
| 27 | ||||||||||||||||||||||||
| 1433 | } executed 43 times by 2 tests: else {end of blockExecuted by:
| 43 | ||||||||||||||||||||||||
| 1434 | - | |||||||||||||||||||||||||
| 1435 | - | |||||||||||||||||||||||||
| 1436 | - | |||||||||||||||||||||||||
| 1437 | doEmitSslError = !ignoreAllSslErrors; | - | ||||||||||||||||||||||||
| 1438 | } executed 225 times by 7 tests: end of blockExecuted by:
| 225 | ||||||||||||||||||||||||
| 1439 | return executed 268 times by 7 tests: !doEmitSslError;return !doEmitSslError;Executed by:
executed 268 times by 7 tests: return !doEmitSslError;Executed by:
| 268 | ||||||||||||||||||||||||
| 1440 | } | - | ||||||||||||||||||||||||
| 1441 | - | |||||||||||||||||||||||||
| 1442 | - | |||||||||||||||||||||||||
| 1443 | - | |||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||
| 1445 | qint64 QSslSocketPrivate::peek(char *data, qint64 maxSize) | - | ||||||||||||||||||||||||
| 1446 | { | - | ||||||||||||||||||||||||
| 1447 | if (mode == QSslSocket::UnencryptedMode
| 0-112 | ||||||||||||||||||||||||
| 1448 | - | |||||||||||||||||||||||||
| 1449 | - | |||||||||||||||||||||||||
| 1450 | qint64 r = buffer.peek(data, maxSize, transactionPos); | - | ||||||||||||||||||||||||
| 1451 | if (r == maxSize
| 5-107 | ||||||||||||||||||||||||
| 1452 | return executed 107 times by 2 tests: r;return r;Executed by:
executed 107 times by 2 tests: return r;Executed by:
| 107 | ||||||||||||||||||||||||
| 1453 | data += r; | - | ||||||||||||||||||||||||
| 1454 | - | |||||||||||||||||||||||||
| 1455 | if (plainSocket
| 0-5 | ||||||||||||||||||||||||
| 1456 | qint64 r2 = plainSocket->peek(data, maxSize - r); | - | ||||||||||||||||||||||||
| 1457 | if (r2 < 0
| 0-5 | ||||||||||||||||||||||||
| 1458 | return never executed: (r > 0 ? r : r2);return (r > 0 ? r : r2);never executed: return (r > 0 ? r : r2); | 0 | ||||||||||||||||||||||||
| 1459 | return executed 5 times by 2 tests: r + r2;return r + r2;Executed by:
executed 5 times by 2 tests: return r + r2;Executed by:
| 5 | ||||||||||||||||||||||||
| 1460 | } else { | - | ||||||||||||||||||||||||
| 1461 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 1462 | } | - | ||||||||||||||||||||||||
| 1463 | } else { | - | ||||||||||||||||||||||||
| 1464 | - | |||||||||||||||||||||||||
| 1465 | return executed 95 times by 4 tests: QTcpSocketPrivate::peek(data, maxSize);return QTcpSocketPrivate::peek(data, maxSize);Executed by:
executed 95 times by 4 tests: return QTcpSocketPrivate::peek(data, maxSize);Executed by:
| 95 | ||||||||||||||||||||||||
| 1466 | } | - | ||||||||||||||||||||||||
| 1467 | } | - | ||||||||||||||||||||||||
| 1468 | - | |||||||||||||||||||||||||
| 1469 | - | |||||||||||||||||||||||||
| 1470 | - | |||||||||||||||||||||||||
| 1471 | - | |||||||||||||||||||||||||
| 1472 | QByteArray QSslSocketPrivate::peek(qint64 maxSize) | - | ||||||||||||||||||||||||
| 1473 | { | - | ||||||||||||||||||||||||
| 1474 | if (mode == QSslSocket::UnencryptedMode
| 0-10 | ||||||||||||||||||||||||
| 1475 | - | |||||||||||||||||||||||||
| 1476 | - | |||||||||||||||||||||||||
| 1477 | QByteArray ret; | - | ||||||||||||||||||||||||
| 1478 | ret.reserve(maxSize); | - | ||||||||||||||||||||||||
| 1479 | ret.resize(buffer.peek(ret.data(), maxSize, transactionPos)); | - | ||||||||||||||||||||||||
| 1480 | if (ret.length() == maxSize
| 1-9 | ||||||||||||||||||||||||
| 1481 | return executed 1 time by 1 test: ret;return ret;Executed by:
executed 1 time by 1 test: return ret;Executed by:
| 1 | ||||||||||||||||||||||||
| 1482 | - | |||||||||||||||||||||||||
| 1483 | if (plainSocket
| 4-5 | ||||||||||||||||||||||||
| 1484 | return executed 4 times by 1 test: ret + plainSocket->peek(maxSize - ret.length());return ret + plainSocket->peek(maxSize - ret.length());Executed by:
executed 4 times by 1 test: return ret + plainSocket->peek(maxSize - ret.length());Executed by:
| 4 | ||||||||||||||||||||||||
| 1485 | else | - | ||||||||||||||||||||||||
| 1486 | return executed 5 times by 1 test: QByteArray();return QByteArray();Executed by:
executed 5 times by 1 test: return QByteArray();Executed by:
| 5 | ||||||||||||||||||||||||
| 1487 | } else { | - | ||||||||||||||||||||||||
| 1488 | - | |||||||||||||||||||||||||
| 1489 | return executed 2 times by 1 test: QTcpSocketPrivate::peek(maxSize);return QTcpSocketPrivate::peek(maxSize);Executed by:
executed 2 times by 1 test: return QTcpSocketPrivate::peek(maxSize);Executed by:
| 2 | ||||||||||||||||||||||||
| 1490 | } | - | ||||||||||||||||||||||||
| 1491 | } | - | ||||||||||||||||||||||||
| 1492 | - | |||||||||||||||||||||||||
| 1493 | - | |||||||||||||||||||||||||
| 1494 | - | |||||||||||||||||||||||||
| 1495 | - | |||||||||||||||||||||||||
| 1496 | bool QSslSocketPrivate::rootCertOnDemandLoadingSupported() | - | ||||||||||||||||||||||||
| 1497 | { | - | ||||||||||||||||||||||||
| 1498 | return executed 3 times by 1 test: s_loadRootCertsOnDemand;return s_loadRootCertsOnDemand;Executed by:
executed 3 times by 1 test: return s_loadRootCertsOnDemand;Executed by:
| 3 | ||||||||||||||||||||||||
| 1499 | } | - | ||||||||||||||||||||||||
| 1500 | - | |||||||||||||||||||||||||
| 1501 | - | |||||||||||||||||||||||||
| 1502 | - | |||||||||||||||||||||||||
| 1503 | - | |||||||||||||||||||||||||
| 1504 | QList<QByteArray> QSslSocketPrivate::unixRootCertDirectories() | - | ||||||||||||||||||||||||
| 1505 | { | - | ||||||||||||||||||||||||
| 1506 | return executed 132 times by 16 tests: QList<QByteArray>() << "/etc/ssl/certs/"return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
executed 132 times by 16 tests: return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
| 132 | ||||||||||||||||||||||||
| 1507 | << "/usr/lib/ssl/certs/" executed 132 times by 16 tests: return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
| 132 | ||||||||||||||||||||||||
| 1508 | << "/usr/share/ssl/" executed 132 times by 16 tests: return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
| 132 | ||||||||||||||||||||||||
| 1509 | << "/usr/local/ssl/" executed 132 times by 16 tests: return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
| 132 | ||||||||||||||||||||||||
| 1510 | << "/var/ssl/certs/" executed 132 times by 16 tests: return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
| 132 | ||||||||||||||||||||||||
| 1511 | << "/usr/local/ssl/certs/" executed 132 times by 16 tests: return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
| 132 | ||||||||||||||||||||||||
| 1512 | << "/etc/openssl/certs/" executed 132 times by 16 tests: return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
| 132 | ||||||||||||||||||||||||
| 1513 | << "/opt/openssl/certs/" executed 132 times by 16 tests: return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
| 132 | ||||||||||||||||||||||||
| 1514 | << "/etc/ssl/"; executed 132 times by 16 tests: return QList<QByteArray>() << "/etc/ssl/certs/" << "/usr/lib/ssl/certs/" << "/usr/share/ssl/" << "/usr/local/ssl/" << "/var/ssl/certs/" << "/usr/local/ssl/certs/" << "/etc/openssl/certs/" << "/opt/openssl/certs/" << "/etc/ssl/";Executed by:
| 132 | ||||||||||||||||||||||||
| 1515 | } | - | ||||||||||||||||||||||||
| 1516 | - | |||||||||||||||||||||||||
| 1517 | - | |||||||||||||||||||||||||
| 1518 | - | |||||||||||||||||||||||||
| 1519 | - | |||||||||||||||||||||||||
| 1520 | void QSslSocketPrivate::checkSettingSslContext(QSslSocket* socket, QSharedPointer<QSslContext> sslContext) | - | ||||||||||||||||||||||||
| 1521 | { | - | ||||||||||||||||||||||||
| 1522 | if (socket->d_func()->sslContextPointer.isNull()
| 0-26 | ||||||||||||||||||||||||
| 1523 | socket->d_func()->sslContextPointer = sslContext; executed 26 times by 1 test: socket->d_func()->sslContextPointer = sslContext;Executed by:
| 26 | ||||||||||||||||||||||||
| 1524 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||||||||||||||||||||
| 1525 | - | |||||||||||||||||||||||||
| 1526 | - | |||||||||||||||||||||||||
| 1527 | - | |||||||||||||||||||||||||
| 1528 | - | |||||||||||||||||||||||||
| 1529 | QSharedPointer<QSslContext> QSslSocketPrivate::sslContext(QSslSocket *socket) | - | ||||||||||||||||||||||||
| 1530 | { | - | ||||||||||||||||||||||||
| 1531 | return executed 95 times by 3 tests: (socket) ? socket->d_func()->sslContextPointer : QSharedPointer<QSslContext>();return (socket) ? socket->d_func()->sslContextPointer : QSharedPointer<QSslContext>();Executed by:
executed 95 times by 3 tests: return (socket) ? socket->d_func()->sslContextPointer : QSharedPointer<QSslContext>();Executed by:
| 95 | ||||||||||||||||||||||||
| 1532 | } | - | ||||||||||||||||||||||||
| 1533 | - | |||||||||||||||||||||||||
| 1534 | bool QSslSocketPrivate::isMatchingHostname(const QSslCertificate &cert, const QString &peerName) | - | ||||||||||||||||||||||||
| 1535 | { | - | ||||||||||||||||||||||||
| 1536 | const QString lowerPeerName = peerName.toLower(); | - | ||||||||||||||||||||||||
| 1537 | const QStringList commonNames = cert.subjectInfo(QSslCertificate::CommonName); | - | ||||||||||||||||||||||||
| 1538 | - | |||||||||||||||||||||||||
| 1539 | for (const QString &commonName : commonNames) { | - | ||||||||||||||||||||||||
| 1540 | if (isMatchingHostname(commonName.toLower(), lowerPeerName)
| 63-323 | ||||||||||||||||||||||||
| 1541 | return executed 323 times by 8 tests: true;return true;Executed by:
executed 323 times by 8 tests: return true;Executed by:
| 323 | ||||||||||||||||||||||||
| 1542 | } executed 63 times by 3 tests: end of blockExecuted by:
| 63 | ||||||||||||||||||||||||
| 1543 | - | |||||||||||||||||||||||||
| 1544 | const auto subjectAlternativeNames = cert.subjectAlternativeNames(); | - | ||||||||||||||||||||||||
| 1545 | const auto altNames = subjectAlternativeNames.equal_range(QSsl::DnsEntry); | - | ||||||||||||||||||||||||
| 1546 | for (auto it = altNames.first; it != altNames.second
| 0-63 | ||||||||||||||||||||||||
| 1547 | if (isMatchingHostname(it->toLower(), lowerPeerName)
| 0 | ||||||||||||||||||||||||
| 1548 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1549 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1550 | - | |||||||||||||||||||||||||
| 1551 | return executed 63 times by 3 tests: false;return false;Executed by:
executed 63 times by 3 tests: return false;Executed by:
| 63 | ||||||||||||||||||||||||
| 1552 | } | - | ||||||||||||||||||||||||
| 1553 | - | |||||||||||||||||||||||||
| 1554 | bool QSslSocketPrivate::isMatchingHostname(const QString &cn, const QString &hostname) | - | ||||||||||||||||||||||||
| 1555 | { | - | ||||||||||||||||||||||||
| 1556 | int wildcard = cn.indexOf(QLatin1Char('*')); | - | ||||||||||||||||||||||||
| 1557 | - | |||||||||||||||||||||||||
| 1558 | - | |||||||||||||||||||||||||
| 1559 | if (wildcard < 0
| 65-406 | ||||||||||||||||||||||||
| 1560 | return executed 406 times by 8 tests: cn == hostname;return cn == hostname;Executed by:
executed 406 times by 8 tests: return cn == hostname;Executed by:
| 406 | ||||||||||||||||||||||||
| 1561 | - | |||||||||||||||||||||||||
| 1562 | int firstCnDot = cn.indexOf(QLatin1Char('.')); | - | ||||||||||||||||||||||||
| 1563 | int secondCnDot = cn.indexOf(QLatin1Char('.'), firstCnDot+1); | - | ||||||||||||||||||||||||
| 1564 | - | |||||||||||||||||||||||||
| 1565 | - | |||||||||||||||||||||||||
| 1566 | if ((-
| 10-45 | ||||||||||||||||||||||||
| 1567 | return executed 30 times by 1 test: false;return false;Executed by:
executed 30 times by 1 test: return false;Executed by:
| 30 | ||||||||||||||||||||||||
| 1568 | - | |||||||||||||||||||||||||
| 1569 | - | |||||||||||||||||||||||||
| 1570 | if (wildcard+1 != firstCnDot
| 0-35 | ||||||||||||||||||||||||
| 1571 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1572 | - | |||||||||||||||||||||||||
| 1573 | - | |||||||||||||||||||||||||
| 1574 | if (cn.lastIndexOf(QLatin1Char('*')) != wildcard
| 5-30 | ||||||||||||||||||||||||
| 1575 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 1576 | - | |||||||||||||||||||||||||
| 1577 | - | |||||||||||||||||||||||||
| 1578 | if (wildcard
| 5-15 | ||||||||||||||||||||||||
| 1579 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 1580 | - | |||||||||||||||||||||||||
| 1581 | - | |||||||||||||||||||||||||
| 1582 | if (hostname.midRef(hostname.indexOf(QLatin1Char('.'))) != cn.midRef(firstCnDot)
| 5-20 | ||||||||||||||||||||||||
| 1583 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 1584 | - | |||||||||||||||||||||||||
| 1585 | - | |||||||||||||||||||||||||
| 1586 | QHostAddress addr(hostname); | - | ||||||||||||||||||||||||
| 1587 | if (!addr.isNull()
| 5-15 | ||||||||||||||||||||||||
| 1588 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 1589 | - | |||||||||||||||||||||||||
| 1590 | - | |||||||||||||||||||||||||
| 1591 | return executed 15 times by 1 test: true;return true;Executed by:
executed 15 times by 1 test: return true;Executed by:
| 15 | ||||||||||||||||||||||||
| 1592 | } | - | ||||||||||||||||||||||||
| 1593 | - | |||||||||||||||||||||||||
| 1594 | - | |||||||||||||||||||||||||
| 1595 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |