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