qsslcertificate.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/ssl/qsslcertificate.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13QSslCertificate::QSslCertificate(QIODevice *device, QSsl::EncodingFormat format)-
14 : d(new QSslCertificatePrivate)-
15{-
16 QSslSocketPrivate::ensureInitialized();-
17 if (device
deviceDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
)
0-4
18 d->init(device->readAll(), format);
executed 4 times by 1 test: d->init(device->readAll(), format);
Executed by:
  • tst_qsslcertificate - unknown status
4
19}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
4
20-
21-
22-
23-
24-
25-
26-
27QSslCertificate::QSslCertificate(const QByteArray &data, QSsl::EncodingFormat format)-
28 : d(new QSslCertificatePrivate)-
29{-
30 QSslSocketPrivate::ensureInitialized();-
31 d->init(data, format);-
32}
executed 30261 times by 16 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslellipticcurve - unknown status
  • tst_qsslerror - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
30261
33-
34-
35-
36-
37QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d)-
38{-
39}
executed 50550 times by 9 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslerror - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
50550
40-
41-
42-
43-
44QSslCertificate::~QSslCertificate()-
45{-
46}-
47-
48-
49-
50-
51-
52QSslCertificate &QSslCertificate::operator=(const QSslCertificate &other)-
53{-
54 d = other.d;-
55 return
executed 2084 times by 10 tests: return *this;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslerror - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
*this;
executed 2084 times by 10 tests: return *this;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslerror - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
2084
56}-
57bool QSslCertificate::isBlacklisted() const-
58{-
59 return
executed 55 times by 1 test: return QSslCertificatePrivate::isBlacklisted(*this);
Executed by:
  • tst_qsslcertificate - unknown status
QSslCertificatePrivate::isBlacklisted(*this);
executed 55 times by 1 test: return QSslCertificatePrivate::isBlacklisted(*this);
Executed by:
  • tst_qsslcertificate - unknown status
55
60}-
61void QSslCertificate::clear()-
62{-
63 if (isNull()
isNull()Description
TRUEevaluated 2074 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 59 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
)
59-2074
64 return;
executed 2074 times by 8 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
2074
65 d = new QSslCertificatePrivate;-
66}
executed 59 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
59
67QByteArray QSslCertificate::digest(QCryptographicHash::Algorithm algorithm) const-
68{-
69 return
executed 49 times by 1 test: return QCryptographicHash::hash(toDer(), algorithm);
Executed by:
  • tst_qsslcertificate - unknown status
QCryptographicHash::hash(toDer(), algorithm);
executed 49 times by 1 test: return QCryptographicHash::hash(toDer(), algorithm);
Executed by:
  • tst_qsslcertificate - unknown status
49
70}-
71QList<QSslCertificate> QSslCertificate::fromPath(const QString &path,-
72 QSsl::EncodingFormat format,-
73 QRegExp::PatternSyntax syntax)-
74{-
75-
76-
77-
78 QString sourcePath = QDir::fromNativeSeparators(path);-
79-
80-
81 QString pathPrefix = sourcePath.left(sourcePath.lastIndexOf(QLatin1Char('/')));-
82-
83-
84 int pos = -1;-
85 if (syntax == QRegExp::Wildcard
syntax == QRegExp::WildcardDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 9845 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
)
22-9845
86 pos = pathPrefix.indexOf(QRegExp(QLatin1String("[*?[]")));
executed 22 times by 1 test: pos = pathPrefix.indexOf(QRegExp(QLatin1String("[*?[]")));
Executed by:
  • tst_qsslcertificate - unknown status
22
87 else if (syntax != QRegExp::FixedString
syntax != QRegExp::FixedStringDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 9829 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
)
16-9829
88 pos = sourcePath.indexOf(QRegExp(QLatin1String("[\\$\\(\\)\\*\\+\\.\\?\\[\\]\\^\\{\\}\\|]")));
executed 16 times by 1 test: pos = sourcePath.indexOf(QRegExp(QLatin1String("[\\$\\(\\)\\*\\+\\.\\?\\[\\]\\^\\{\\}\\|]")));
Executed by:
  • tst_qsslcertificate - unknown status
16
89 if (pos != -1
pos != -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 9847 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
) {
20-9847
90-
91 pathPrefix = pathPrefix.left(pos);-
92 const int lastIndexOfSlash = pathPrefix.lastIndexOf(QLatin1Char('/'));-
93 if (lastIndexOfSlash != -1
lastIndexOfSlash != -1Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
0-20
94 pathPrefix = pathPrefix.left(lastIndexOfSlash);
never executed: pathPrefix = pathPrefix.left(lastIndexOfSlash);
0
95 else-
96 pathPrefix.clear();
executed 20 times by 1 test: pathPrefix.clear();
Executed by:
  • tst_qsslcertificate - unknown status
20
97 } else {-
98-
99 if (QFileInfo(sourcePath).isFile()
QFileInfo(sourcePath).isFile()Description
TRUEevaluated 9709 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 138 times by 3 tests
Evaluated by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
) {
138-9709
100 QFile file(sourcePath);-
101 QIODevice::OpenMode openMode = QIODevice::ReadOnly;-
102 if (format == QSsl::Pem
format == QSsl::PemDescription
TRUEevaluated 9707 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
2-9707
103 openMode |= QIODevice::Text;
executed 9707 times by 4 tests: openMode |= QIODevice::Text;
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
9707
104 if (file.open(openMode)
file.open(openMode)Description
TRUEevaluated 9709 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEnever evaluated
)
0-9709
105 return
executed 9709 times by 4 tests: return QSslCertificate::fromData(file.readAll(), format);
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
QSslCertificate::fromData(file.readAll(), format);
executed 9709 times by 4 tests: return QSslCertificate::fromData(file.readAll(), format);
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
9709
106 return
never executed: return QList<QSslCertificate>();
QList<QSslCertificate>();
never executed: return QList<QSslCertificate>();
0
107 }-
108 }
executed 138 times by 3 tests: end of block
Executed by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
138
109-
110-
111 int startIndex = 0;-
112 if (pathPrefix.isEmpty()
pathPrefix.isEmpty()Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 132 times by 3 tests
Evaluated by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
) {
26-132
113 pathPrefix = QLatin1String(".");-
114 startIndex = 2;-
115 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
26
116-
117-
118 QList<QSslCertificate> certs;-
119 QRegExp pattern(sourcePath, Qt::CaseSensitive, syntax);-
120 QDirIterator it(pathPrefix, QDir::Files, QDirIterator::FollowSymlinks | QDirIterator::Subdirectories);-
121 while (it.hasNext()
it.hasNext()Description
TRUEevaluated 2628 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 158 times by 3 tests
Evaluated by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
) {
158-2628
122 QString filePath = startIndex == 0
startIndex == 0Description
TRUEevaluated 496 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 2132 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
? it.next() : it.next().mid(startIndex);
496-2132
123 if (!pattern.exactMatch(filePath)
!pattern.exactMatch(filePath)Description
TRUEevaluated 2492 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 136 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
136-2492
124 continue;
executed 2492 times by 1 test: continue;
Executed by:
  • tst_qsslcertificate - unknown status
2492
125-
126 QFile file(filePath);-
127 QIODevice::OpenMode openMode = QIODevice::ReadOnly;-
128 if (format == QSsl::Pem
format == QSsl::PemDescription
TRUEevaluated 94 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
)
42-94
129 openMode |= QIODevice::Text;
executed 94 times by 1 test: openMode |= QIODevice::Text;
Executed by:
  • tst_qsslcertificate - unknown status
94
130 if (file.open(openMode)
file.open(openMode)Description
TRUEevaluated 136 times by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
)
0-136
131 certs += QSslCertificate::fromData(file.readAll(), format);
executed 136 times by 1 test: certs += QSslCertificate::fromData(file.readAll(), format);
Executed by:
  • tst_qsslcertificate - unknown status
136
132 }
executed 136 times by 1 test: end of block
Executed by:
  • tst_qsslcertificate - unknown status
136
133 return
executed 158 times by 3 tests: return certs;
Executed by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
certs;
executed 158 times by 3 tests: return certs;
Executed by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
158
134}-
135QList<QSslCertificate> QSslCertificate::fromDevice(QIODevice *device, QSsl::EncodingFormat format)-
136{-
137 if (!device
!deviceDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEnever evaluated
) {
0-1
138 for (bool qt_category_enabled = lcSsl().isWarningEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslcertificate - unknown status
; qt_category_enabled = false) QMessageLogger(__FILE__, 539, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslCertificate::fromDevice: cannot read from a null device");
executed 1 time by 1 test: QMessageLogger(__FILE__, 539, __PRETTY_FUNCTION__, lcSsl().categoryName()).warning("QSslCertificate::fromDevice: cannot read from a null device");
Executed by:
  • tst_qsslcertificate - unknown status
1
139 return
executed 1 time by 1 test: return QList<QSslCertificate>();
Executed by:
  • tst_qsslcertificate - unknown status
QList<QSslCertificate>();
executed 1 time by 1 test: return QList<QSslCertificate>();
Executed by:
  • tst_qsslcertificate - unknown status
1
140 }-
141 return
never executed: return fromData(device->readAll(), format);
fromData(device->readAll(), format);
never executed: return fromData(device->readAll(), format);
0
142}-
143QList<QSslCertificate> QSslCertificate::fromData(const QByteArray &data, QSsl::EncodingFormat format)-
144{-
145 return
executed 9845 times by 4 tests: return (format == QSsl::Pem) ? QSslCertificatePrivate::certificatesFromPem(data) : QSslCertificatePrivate::certificatesFromDer(data);
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
(format == QSsl::Pem)
executed 9845 times by 4 tests: return (format == QSsl::Pem) ? QSslCertificatePrivate::certificatesFromPem(data) : QSslCertificatePrivate::certificatesFromDer(data);
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
9845
146 ? QSslCertificatePrivate::certificatesFromPem(data)
executed 9845 times by 4 tests: return (format == QSsl::Pem) ? QSslCertificatePrivate::certificatesFromPem(data) : QSslCertificatePrivate::certificatesFromDer(data);
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
9845
147 : QSslCertificatePrivate::certificatesFromDer(data);
executed 9845 times by 4 tests: return (format == QSsl::Pem) ? QSslCertificatePrivate::certificatesFromPem(data) : QSslCertificatePrivate::certificatesFromDer(data);
Executed by:
  • tst_QNetworkReply
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
9845
148}-
149QList<QSslError> QSslCertificate::verify(QList<QSslCertificate> certificateChain, const QString &hostName)-
150-
151{-
152 return
executed 8 times by 1 test: return QSslSocketBackendPrivate::verify(certificateChain, hostName);
Executed by:
  • tst_qsslcertificate - unknown status
QSslSocketBackendPrivate::verify(certificateChain, hostName);
executed 8 times by 1 test: return QSslSocketBackendPrivate::verify(certificateChain, hostName);
Executed by:
  • tst_qsslcertificate - unknown status
8
153}-
154bool QSslCertificate::importPkcs12(QIODevice *device,-
155 QSslKey *key, QSslCertificate *certificate,-
156 QList<QSslCertificate> *caCertificates,-
157 const QByteArray &passPhrase)-
158{-
159 return
executed 1 time by 1 test: return QSslSocketBackendPrivate::importPkcs12(device, key, certificate, caCertificates, passPhrase);
Executed by:
  • tst_qsslcertificate - unknown status
QSslSocketBackendPrivate::importPkcs12(device, key, certificate, caCertificates, passPhrase);
executed 1 time by 1 test: return QSslSocketBackendPrivate::importPkcs12(device, key, certificate, caCertificates, passPhrase);
Executed by:
  • tst_qsslcertificate - unknown status
1
160}-
161-
162-
163-
164static const char *const certificate_blacklist[] = {-
165 "04:7e:cb:e9:fc:a5:5f:7b:d0:9e:ae:36:e1:0c:ae:1e", "mail.google.com",-
166 "f5:c8:6a:f3:61:62:f1:3a:64:f5:4f:6d:c9:58:7c:06", "www.google.com",-
167 "d7:55:8f:da:f5:f1:10:5b:b2:13:28:2b:70:77:29:a3", "login.yahoo.com",-
168 "39:2a:43:4f:0e:07:df:1f:8a:a3:05:de:34:e0:c2:29", "login.yahoo.com",-
169 "3e:75:ce:d4:6b:69:30:21:21:88:30:ae:86:a8:2a:71", "login.yahoo.com",-
170 "e9:02:8b:95:78:e4:15:dc:1a:71:0a:2b:88:15:44:47", "login.skype.com",-
171 "92:39:d5:34:8f:40:d1:69:5a:74:54:70:e1:f2:3f:43", "addons.mozilla.org",-
172 "b0:b7:13:3e:d0:96:f9:b5:6f:ae:91:c8:74:bd:3a:c0", "login.live.com",-
173 "d8:f3:5f:4e:b7:87:2b:2d:ab:06:92:e3:15:38:2f:b0", "global trustee",-
174-
175 "05:e2:e6:a4:cd:09:ea:54:d6:65:b0:75:fe:22:a2:56", "*.google.com",-
176 "0c:76:da:9c:91:0c:4e:2c:9e:fe:15:d0:58:93:3c:4c", "DigiNotar Root CA",-
177 "f1:4a:13:f4:87:2b:56:dc:39:df:84:ca:7a:a1:06:49", "DigiNotar Services CA",-
178 "36:16:71:55:43:42:1b:9d:e6:cb:a3:64:41:df:24:38", "DigiNotar Services 1024 CA",-
179 "0a:82:bd:1e:14:4e:88:14:d7:5b:1a:55:27:be:bf:3e", "DigiNotar Root CA G2",-
180 "a4:b6:ce:e3:2e:d3:35:46:26:3c:b3:55:3a:a8:92:21", "CertiID Enterprise Certificate Authority",-
181 "5b:d5:60:9c:64:17:68:cf:21:0e:35:fd:fb:05:ad:41", "DigiNotar Qualified CA",-
182-
183 "46:9c:2c:b0", "DigiNotar Services 1024 CA",-
184 "07:27:10:0d", "DigiNotar Cyber CA",-
185 "07:27:0f:f9", "DigiNotar Cyber CA",-
186 "07:27:10:03", "DigiNotar Cyber CA",-
187 "01:31:69:b0", "DigiNotar PKIoverheid CA Overheid en Bedrijven",-
188 "01:31:34:bf", "DigiNotar PKIoverheid CA Organisatie - G2",-
189 "d6:d0:29:77:f1:49:fd:1a:83:f2:b9:ea:94:8c:5c:b4", "DigiNotar Extended Validation CA",-
190 "1e:7d:7a:53:3d:45:30:41:96:40:0f:71:48:1f:45:04", "DigiNotar Public CA 2025",-
191-
192-
193-
194 "46:9c:2c:af", "DigiNotar Root CA",-
195 "46:9c:3c:c9", "DigiNotar Root CA",-
196-
197 "07:27:14:a9", "Digisign Server ID (Enrich)",-
198 "4c:0e:63:6a", "Digisign Server ID - (Enrich)",-
199 "72:03:21:05:c5:0c:08:57:3d:8e:a5:30:4e:fe:e8:b0", "UTN-USERFirst-Hardware",-
200 "41", "MD5 Collisions Inc. (http://www.phreedom.org/md5)",-
201-
202 "08:27", "*.EGO.GOV.TR",-
203 "08:64", "e-islem.kktcmerkezbankasi.org",-
204-
205 "03:1d:a7", "AC DG Tr\xC3\xA9sor SSL",-
206 "27:83", "NIC Certifying Authority",-
207 "27:92", "NIC CA 2011",-
208 "27:b1", "NIC CA 2014",-
209 0-
210};-
211-
212bool QSslCertificatePrivate::isBlacklisted(const QSslCertificate &certificate)-
213{-
214 for (int a = 0; certificate_blacklist[a] != 0
certificate_blacklist[a] != 0Description
TRUEevaluated 16975 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
FALSEevaluated 464 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
; a++) {
464-16975
215 QString blacklistedCommonName = QString::fromUtf8(certificate_blacklist[(a+1)]);-
216 if (certificate.serialNumber() == certificate_blacklist[a++]
certificate.se...blacklist[a++]Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 16957 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
&&
18-16957
217 (certificate.subjectInfo(QSslCertificate::CommonName).contains(blacklistedCommonName)
certificate.su...tedCommonName)Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
FALSEnever evaluated
||
0-18
218 certificate.issuerInfo(QSslCertificate::CommonName).contains(blacklistedCommonName)
certificate.is...tedCommonName)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
219 return
executed 18 times by 2 tests: return true;
Executed by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
true;
executed 18 times by 2 tests: return true;
Executed by:
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
18
220 }
executed 16957 times by 8 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
16957
221 return
executed 464 times by 8 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
false;
executed 464 times by 8 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
464
222}-
223-
224QByteArray QSslCertificatePrivate::subjectInfoToString(QSslCertificate::SubjectInfo info)-
225{-
226 QByteArray str;-
227 switch (info) {-
228 case
executed 76 times by 1 test: case QSslCertificate::Organization:
Executed by:
  • tst_qsslcertificate - unknown status
QSslCertificate::Organization:
executed 76 times by 1 test: case QSslCertificate::Organization:
Executed by:
  • tst_qsslcertificate - unknown status
str = QByteArray("O"); break;
executed 76 times by 1 test: break;
Executed by:
  • tst_qsslcertificate - unknown status
76
229 case
executed 484 times by 8 tests: case QSslCertificate::CommonName:
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
QSslCertificate::CommonName:
executed 484 times by 8 tests: case QSslCertificate::CommonName:
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
str = QByteArray("CN"); break;
executed 484 times by 8 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
484
230 case
executed 74 times by 1 test: case QSslCertificate::LocalityName:
Executed by:
  • tst_qsslcertificate - unknown status
QSslCertificate::LocalityName:
executed 74 times by 1 test: case QSslCertificate::LocalityName:
Executed by:
  • tst_qsslcertificate - unknown status
str = QByteArray("L"); break;
executed 74 times by 1 test: break;
Executed by:
  • tst_qsslcertificate - unknown status
74
231 case
executed 74 times by 1 test: case QSslCertificate::OrganizationalUnitName:
Executed by:
  • tst_qsslcertificate - unknown status
QSslCertificate::OrganizationalUnitName:
executed 74 times by 1 test: case QSslCertificate::OrganizationalUnitName:
Executed by:
  • tst_qsslcertificate - unknown status
str = QByteArray("OU"); break;
executed 74 times by 1 test: break;
Executed by:
  • tst_qsslcertificate - unknown status
74
232 case
executed 74 times by 1 test: case QSslCertificate::CountryName:
Executed by:
  • tst_qsslcertificate - unknown status
QSslCertificate::CountryName:
executed 74 times by 1 test: case QSslCertificate::CountryName:
Executed by:
  • tst_qsslcertificate - unknown status
str = QByteArray("C"); break;
executed 74 times by 1 test: break;
Executed by:
  • tst_qsslcertificate - unknown status
74
233 case
executed 74 times by 1 test: case QSslCertificate::StateOrProvinceName:
Executed by:
  • tst_qsslcertificate - unknown status
QSslCertificate::StateOrProvinceName:
executed 74 times by 1 test: case QSslCertificate::StateOrProvinceName:
Executed by:
  • tst_qsslcertificate - unknown status
str = QByteArray("ST"); break;
executed 74 times by 1 test: break;
Executed by:
  • tst_qsslcertificate - unknown status
74
234 case
never executed: case QSslCertificate::DistinguishedNameQualifier:
QSslCertificate::DistinguishedNameQualifier:
never executed: case QSslCertificate::DistinguishedNameQualifier:
str = QByteArray("dnQualifier"); break;
never executed: break;
0
235 case
never executed: case QSslCertificate::SerialNumber:
QSslCertificate::SerialNumber:
never executed: case QSslCertificate::SerialNumber:
str = QByteArray("serialNumber"); break;
never executed: break;
0
236 case
never executed: case QSslCertificate::EmailAddress:
QSslCertificate::EmailAddress:
never executed: case QSslCertificate::EmailAddress:
str = QByteArray("emailAddress"); break;
never executed: break;
0
237 }-
238 return
executed 856 times by 8 tests: return str;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
str;
executed 856 times by 8 tests: return str;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslcertificate - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
856
239}-
240QDebug operator<<(QDebug debug, const QSslCertificate &certificate)-
241{-
242 QDebugStateSaver saver(debug);-
243 debug.resetFormat().nospace();-
244 debug << "QSslCertificate("-
245 << certificate.version()-
246 << ", " << certificate.serialNumber()-
247 << ", " << certificate.digest().toBase64()-
248 << ", " << certificate.issuerInfo(QSslCertificate::Organization)-
249 << ", " << certificate.subjectInfo(QSslCertificate::Organization)-
250 << ", " << certificate.subjectAlternativeNames()-
251-
252 << ", " << certificate.effectiveDate()-
253 << ", " << certificate.expiryDate()-
254-
255 << ')';-
256 return
never executed: return debug;
debug;
never executed: return debug;
0
257}-
258QDebug operator<<(QDebug debug, QSslCertificate::SubjectInfo info)-
259{-
260 switch (info) {-
261 case
never executed: case QSslCertificate::Organization:
QSslCertificate::Organization:
never executed: case QSslCertificate::Organization:
debug << "Organization"; break;
never executed: break;
0
262 case
never executed: case QSslCertificate::CommonName:
QSslCertificate::CommonName:
never executed: case QSslCertificate::CommonName:
debug << "CommonName"; break;
never executed: break;
0
263 case
never executed: case QSslCertificate::CountryName:
QSslCertificate::CountryName:
never executed: case QSslCertificate::CountryName:
debug << "CountryName"; break;
never executed: break;
0
264 case
never executed: case QSslCertificate::LocalityName:
QSslCertificate::LocalityName:
never executed: case QSslCertificate::LocalityName:
debug << "LocalityName"; break;
never executed: break;
0
265 case
never executed: case QSslCertificate::OrganizationalUnitName:
QSslCertificate::OrganizationalUnitName:
never executed: case QSslCertificate::OrganizationalUnitName:
debug << "OrganizationalUnitName"; break;
never executed: break;
0
266 case
never executed: case QSslCertificate::StateOrProvinceName:
QSslCertificate::StateOrProvinceName:
never executed: case QSslCertificate::StateOrProvinceName:
debug << "StateOrProvinceName"; break;
never executed: break;
0
267 case
never executed: case QSslCertificate::DistinguishedNameQualifier:
QSslCertificate::DistinguishedNameQualifier:
never executed: case QSslCertificate::DistinguishedNameQualifier:
debug << "DistinguishedNameQualifier"; break;
never executed: break;
0
268 case
never executed: case QSslCertificate::SerialNumber:
QSslCertificate::SerialNumber:
never executed: case QSslCertificate::SerialNumber:
debug << "SerialNumber"; break;
never executed: break;
0
269 case
never executed: case QSslCertificate::EmailAddress:
QSslCertificate::EmailAddress:
never executed: case QSslCertificate::EmailAddress:
debug << "EmailAddress"; break;
never executed: break;
0
270 }-
271 return
never executed: return debug;
debug;
never executed: return debug;
0
272}-
273-
274-
275-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9