qauthenticator.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/kernel/qauthenticator.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3static QByteArray qNtlmPhase1();-
4static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phase2data);-
5QAuthenticator::QAuthenticator()-
6 : d(0)-
7{-
8}
executed 7351 times by 15 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
7351
9-
10-
11-
12-
13QAuthenticator::~QAuthenticator()-
14{-
15 if (d
dDescription
TRUEevaluated 2549 times by 16 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
FALSEevaluated 4790 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
)
2549-4790
16 delete d;
executed 2549 times by 16 tests: delete d;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
2549
17}
executed 7339 times by 16 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
7339
18-
19-
20-
21-
22QAuthenticator::QAuthenticator(const QAuthenticator &other)-
23 : d(0)-
24{-
25 if (other.d
other.dDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
26 *
never executed: *this = other;
this = other;
never executed: *this = other;
0
27}
never executed: end of block
0
28-
29-
30-
31-
32QAuthenticator &QAuthenticator::operator=(const QAuthenticator &other)-
33{-
34 if (d == other.d
d == other.dDescription
TRUEnever evaluated
FALSEevaluated 43 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
)
0-43
35 return
never executed: return *this;
*this;
never executed: return *this;
0
36-
37-
38-
39-
40 detach();-
41 if (other.d
other.dDescription
TRUEnever evaluated
FALSEevaluated 43 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
) {
0-43
42 d->user = other.d->user;-
43 d->userDomain = other.d->userDomain;-
44 d->workstation = other.d->workstation;-
45 d->extractedUser = other.d->extractedUser;-
46 d->password = other.d->password;-
47 d->realm = other.d->realm;-
48 d->method = other.d->method;-
49 d->options = other.d->options;-
50 }
never executed: end of block
else if (d->phase == QAuthenticatorPrivate::Start
d->phase == QA...Private::StartDescription
TRUEevaluated 43 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
FALSEnever evaluated
) {
0-43
51 delete d;-
52 d = 0;-
53 }
executed 43 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
43
54 return
executed 43 times by 3 tests: return *this;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
*this;
executed 43 times by 3 tests: return *this;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
43
55}-
56-
57-
58-
59-
60-
61bool QAuthenticator::operator==(const QAuthenticator &other) const-
62{-
63 if (d == other.d
d == other.dDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
4
64 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qauthenticator - unknown status
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qauthenticator - unknown status
4
65 if (!d
!dDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
|| !other.d
!other.dDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
)
0-2
66 return
executed 4 times by 1 test: return false;
Executed by:
  • tst_qauthenticator - unknown status
false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qauthenticator - unknown status
4
67 return
never executed: return d->user == other.d->user && d->password == other.d->password && d->realm == other.d->realm && d->method == other.d->method && d->options == other.d->options;
d->user == other.d->user
never executed: return d->user == other.d->user && d->password == other.d->password && d->realm == other.d->realm && d->method == other.d->method && d->options == other.d->options;
0
68 && d->password == other.d->password
never executed: return d->user == other.d->user && d->password == other.d->password && d->realm == other.d->realm && d->method == other.d->method && d->options == other.d->options;
0
69 && d->realm == other.d->realm
never executed: return d->user == other.d->user && d->password == other.d->password && d->realm == other.d->realm && d->method == other.d->method && d->options == other.d->options;
0
70 && d->method == other.d->method
never executed: return d->user == other.d->user && d->password == other.d->password && d->realm == other.d->realm && d->method == other.d->method && d->options == other.d->options;
0
71 && d->options == other.d->options;
never executed: return d->user == other.d->user && d->password == other.d->password && d->realm == other.d->realm && d->method == other.d->method && d->options == other.d->options;
0
72}-
73QString QAuthenticator::user() const-
74{-
75 return
executed 4333 times by 8 tests: return d ? d->user : QString();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d ? d->user : QString();
executed 4333 times by 8 tests: return d ? d->user : QString();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
4333
76}-
77-
78-
79-
80-
81-
82-
83void QAuthenticator::setUser(const QString &user)-
84{-
85 detach();-
86 d->user = user;-
87 d->updateCredentials();-
88}
executed 1156 times by 10 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1156
89-
90-
91-
92-
93QString QAuthenticator::password() const-
94{-
95 return
executed 3969 times by 8 tests: return d ? d->password : QString();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d ? d->password : QString();
executed 3969 times by 8 tests: return d ? d->password : QString();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
3969
96}-
97-
98-
99-
100-
101-
102-
103void QAuthenticator::setPassword(const QString &password)-
104{-
105 detach();-
106 d->password = password;-
107}
executed 1165 times by 10 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1165
108-
109-
110-
111-
112void QAuthenticator::detach()-
113{-
114 if (!d
!dDescription
TRUEevaluated 2596 times by 15 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 2156 times by 10 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
) {
2156-2596
115 d = new QAuthenticatorPrivate;-
116 return;
executed 2596 times by 15 tests: return;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
2596
117 }-
118-
119 if (d->phase == QAuthenticatorPrivate::Done
d->phase == QA...rPrivate::DoneDescription
TRUEevaluated 578 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1578 times by 10 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
)
578-1578
120 d->phase = QAuthenticatorPrivate::Start;
executed 578 times by 9 tests: d->phase = QAuthenticatorPrivate::Start;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
578
121}
executed 2156 times by 10 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
2156
122-
123-
124-
125-
126QString QAuthenticator::realm() const-
127{-
128 return
executed 430 times by 3 tests: return d ? d->realm : QString();
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
d ? d->realm : QString();
executed 430 times by 3 tests: return d ? d->realm : QString();
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
430
129}-
130-
131-
132-
133-
134void QAuthenticator::setRealm(const QString &realm)-
135{-
136 detach();-
137 d->realm = realm;-
138}
never executed: end of block
0
139QVariant QAuthenticator::option(const QString &opt) const-
140{-
141 return
executed 3 times by 1 test: return d ? d->options.value(opt) : QVariant();
Executed by:
  • tst_qauthenticator - unknown status
d ? d->options.value(opt) : QVariant();
executed 3 times by 1 test: return d ? d->options.value(opt) : QVariant();
Executed by:
  • tst_qauthenticator - unknown status
3
142}-
143QVariantHash QAuthenticator::options() const-
144{-
145 return
never executed: return d ? d->options : QVariantHash();
d ? d->options : QVariantHash();
never executed: return d ? d->options : QVariantHash();
0
146}-
147void QAuthenticator::setOption(const QString &opt, const QVariant &value)-
148{-
149 detach();-
150 d->options.insert(opt, value);-
151}
never executed: end of block
0
152bool QAuthenticator::isNull() const-
153{-
154 return
executed 1220 times by 8 tests: return !d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
!d;
executed 1220 times by 8 tests: return !d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1220
155}-
156QAuthenticatorPrivate::QAuthenticatorPrivate()-
157 : method(None)-
158-
159-
160-
161 , hasFailed(false)-
162 , phase(Start)-
163 , nonceCount(0)-
164{-
165 cnonce = QCryptographicHash::hash(QByteArray::number(qrand(), 16) + QByteArray::number(qrand(), 16),-
166 QCryptographicHash::Md5).toHex();-
167 nonceCount = 0;-
168}
executed 2596 times by 15 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
2596
169-
170QAuthenticatorPrivate::~QAuthenticatorPrivate()-
171{-
172-
173-
174-
175-
176}-
177-
178void QAuthenticatorPrivate::updateCredentials()-
179{-
180 int separatorPosn = 0;-
181-
182 switch (method) {-
183 case
executed 8 times by 1 test: case QAuthenticatorPrivate::Ntlm:
Executed by:
  • tst_qauthenticator - unknown status
QAuthenticatorPrivate::Ntlm:
executed 8 times by 1 test: case QAuthenticatorPrivate::Ntlm:
Executed by:
  • tst_qauthenticator - unknown status
8
184 if ((
(separatorPosn...("\\"))) != -1Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
separatorPosn = user.indexOf(QLatin1String("\\"))) != -1
(separatorPosn...("\\"))) != -1Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
) {
0-8
185-
186 realm.clear();-
187 userDomain = user.left(separatorPosn);-
188 extractedUser = user.mid(separatorPosn + 1);-
189 }
never executed: end of block
else {
0
190 extractedUser = user;-
191 realm.clear();-
192 userDomain.clear();-
193 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
8
194 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qauthenticator - unknown status
8
195 default
executed 1688 times by 10 tests: default:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
:
executed 1688 times by 10 tests: default:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1688
196 userDomain.clear();-
197 break;
executed 1688 times by 10 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1688
198 }-
199}-
200-
201void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByteArray> > &values, bool isProxy)-
202{-
203 const char *search = isProxy
isProxyDescription
TRUEevaluated 229 times by 7 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 311 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qauthenticator - unknown status
? "proxy-authenticate" : "www-authenticate";
229-311
204-
205 method = None;-
206 QByteArray headerVal;-
207 for (int i = 0; i < values.size()
i < values.size()Description
TRUEevaluated 4613 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 540 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
; ++i) {
540-4613
208 const QPair<QByteArray, QByteArray> &current = values.at(i);-
209 if (current.first.toLower() != search
current.first....er() != searchDescription
TRUEevaluated 4074 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 539 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
)
539-4074
210 continue;
executed 4074 times by 8 tests: continue;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
4074
211 QByteArray str = current.second.toLower();-
212 if (method < Basic
method < BasicDescription
TRUEevaluated 539 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
&& str.startsWith("basic")
str.startsWith("basic")Description
TRUEevaluated 463 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 76 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
) {
0-539
213 method = Basic;-
214 headerVal = current.second.mid(6);-
215 }
executed 463 times by 9 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
else if (method < Ntlm
method < NtlmDescription
TRUEevaluated 76 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
FALSEnever evaluated
&& str.startsWith("ntlm")
str.startsWith("ntlm")Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 68 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
) {
0-463
216 method = Ntlm;-
217 headerVal = current.second.mid(5);-
218 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
else if (method < DigestMd5
method < DigestMd5Description
TRUEevaluated 68 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
FALSEnever evaluated
&& str.startsWith("digest")
str.startsWith("digest")Description
TRUEevaluated 67 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhttpsocketengine - unknown status
) {
0-68
219 method = DigestMd5;-
220 headerVal = current.second.mid(7);-
221 }
executed 67 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
67
222 }
executed 539 times by 9 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
539
223-
224-
225 updateCredentials();-
226 challenge = headerVal.trimmed();-
227 QHash<QByteArray, QByteArray> options = parseDigestAuthenticationChallenge(challenge);-
228-
229 switch(method) {-
230 case
executed 463 times by 9 tests: case Basic:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
Basic:
executed 463 times by 9 tests: case Basic:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
463
231 this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));-
232 if (user.isEmpty()
user.isEmpty()Description
TRUEevaluated 291 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 172 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
&& password.isEmpty()
password.isEmpty()Description
TRUEevaluated 291 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
)
0-291
233 phase = Done;
executed 291 times by 9 tests: phase = Done;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
291
234 break;
executed 463 times by 9 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
463
235 case
executed 8 times by 1 test: case Ntlm:
Executed by:
  • tst_qauthenticator - unknown status
Ntlm:
executed 8 times by 1 test: case Ntlm:
Executed by:
  • tst_qauthenticator - unknown status
8
236-
237 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qauthenticator - unknown status
8
238 case
executed 67 times by 2 tests: case DigestMd5:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
DigestMd5:
executed 67 times by 2 tests: case DigestMd5:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
{
67
239 this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));-
240 if (options.value("stale").toLower() == "true"
options.value(...er() == "true"Description
TRUEnever evaluated
FALSEevaluated 67 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-67
241 phase = Start;
never executed: phase = Start;
0
242 if (user.isEmpty()
user.isEmpty()Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 59 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& password.isEmpty()
password.isEmpty()Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
)
0-59
243 phase = Done;
executed 8 times by 2 tests: phase = Done;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
8
244 break;
executed 67 times by 2 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
67
245 }-
246 default
executed 2 times by 1 test: default:
Executed by:
  • tst_qhttpsocketengine - unknown status
:
executed 2 times by 1 test: default:
Executed by:
  • tst_qhttpsocketengine - unknown status
2
247 realm.clear();-
248 challenge = QByteArray();-
249 phase = Invalid;-
250 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qhttpsocketengine - unknown status
2
251}-
252-
253QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMethod, const QByteArray &path)-
254{-
255 QByteArray response;-
256 const char *methodString = 0;-
257 switch(method) {-
258 case
never executed: case QAuthenticatorPrivate::None:
QAuthenticatorPrivate::None:
never executed: case QAuthenticatorPrivate::None:
0
259 methodString = "";-
260 phase = Done;-
261 break;
never executed: break;
0
262 case
never executed: case QAuthenticatorPrivate::Plain:
QAuthenticatorPrivate::Plain:
never executed: case QAuthenticatorPrivate::Plain:
0
263 response = '\0' + user.toUtf8() + '\0' + password.toUtf8();-
264 phase = Done;-
265 break;
never executed: break;
0
266 case
executed 326 times by 9 tests: case QAuthenticatorPrivate::Basic:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
QAuthenticatorPrivate::Basic:
executed 326 times by 9 tests: case QAuthenticatorPrivate::Basic:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
326
267 methodString = "Basic ";-
268 response = user.toLatin1() + ':' + password.toLatin1();-
269 response = response.toBase64();-
270 phase = Done;-
271 break;
executed 326 times by 9 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
326
272 case
never executed: case QAuthenticatorPrivate::Login:
QAuthenticatorPrivate::Login:
never executed: case QAuthenticatorPrivate::Login:
0
273 if (challenge.contains("VXNlciBOYW1lAA==")
challenge.cont...ciBOYW1lAA==")Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
274 response = user.toUtf8().toBase64();-
275 phase = Phase2;-
276 }
never executed: end of block
else if (challenge.contains("UGFzc3dvcmQA")
challenge.cont...UGFzc3dvcmQA")Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
277 response = password.toUtf8().toBase64();-
278 phase = Done;-
279 }
never executed: end of block
0
280 break;
never executed: break;
0
281 case
never executed: case QAuthenticatorPrivate::CramMd5:
QAuthenticatorPrivate::CramMd5:
never executed: case QAuthenticatorPrivate::CramMd5:
0
282 break;
never executed: break;
0
283 case
executed 35 times by 2 tests: case QAuthenticatorPrivate::DigestMd5:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
QAuthenticatorPrivate::DigestMd5:
executed 35 times by 2 tests: case QAuthenticatorPrivate::DigestMd5:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
35
284 methodString = "Digest ";-
285 response = digestMd5Response(challenge, requestMethod, path);-
286 phase = Done;-
287 break;
executed 35 times by 2 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
35
288 case
executed 8 times by 1 test: case QAuthenticatorPrivate::Ntlm:
Executed by:
  • tst_qauthenticator - unknown status
QAuthenticatorPrivate::Ntlm:
executed 8 times by 1 test: case QAuthenticatorPrivate::Ntlm:
Executed by:
  • tst_qauthenticator - unknown status
8
289 methodString = "NTLM ";-
290 if (challenge.isEmpty()
challenge.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
) {
4
291 {-
292 response = qNtlmPhase1().toBase64();-
293 if (user.isEmpty()
user.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
2
294 phase = Done;
executed 2 times by 1 test: phase = Done;
Executed by:
  • tst_qauthenticator - unknown status
2
295 else-
296 phase = Phase2;
executed 2 times by 1 test: phase = Phase2;
Executed by:
  • tst_qauthenticator - unknown status
2
297 }-
298 } else {-
299 {-
300 response = qNtlmPhase3(this, QByteArray::fromBase64(challenge)).toBase64();-
301 phase = Done;-
302 }-
303 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
304-
305 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qauthenticator - unknown status
8
306 }-
307 return
executed 369 times by 9 tests: return QByteArray(methodString) + response;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
QByteArray(methodString) + response;
executed 369 times by 9 tests: return QByteArray(methodString) + response;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
369
308}-
309-
310-
311-
312-
313QHash<QByteArray, QByteArray> QAuthenticatorPrivate::parseDigestAuthenticationChallenge(const QByteArray &challenge)-
314{-
315 QHash<QByteArray, QByteArray> options;-
316-
317 const char *d = challenge.constData();-
318 const char *end = d + challenge.length();-
319 while (d < end
d < endDescription
TRUEevaluated 871 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 573 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
) {
573-871
320 while (d < end
d < endDescription
TRUEevaluated 1177 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
&& (*
*d == ' 'Description
TRUEevaluated 306 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 871 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d == ' '
*d == ' 'Description
TRUEevaluated 306 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 871 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
|| *
*d == '\n'Description
TRUEnever evaluated
FALSEevaluated 871 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d == '\n'
*d == '\n'Description
TRUEnever evaluated
FALSEevaluated 871 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
|| *
*d == '\r'Description
TRUEnever evaluated
FALSEevaluated 871 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d == '\r'
*d == '\r'Description
TRUEnever evaluated
FALSEevaluated 871 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
))
0-1177
321 ++
executed 306 times by 2 tests: ++d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
d;
executed 306 times by 2 tests: ++d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
306
322 const char *start = d;-
323 while (d < end
d < endDescription
TRUEevaluated 6700 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
&& *
*d != '='Description
TRUEevaluated 5831 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 869 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d != '='
*d != '='Description
TRUEevaluated 5831 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 869 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
)
2-6700
324 ++
executed 5831 times by 9 tests: ++d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d;
executed 5831 times by 9 tests: ++d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
5831
325 QByteArray key = QByteArray(start, d - start);-
326 ++d;-
327 if (d >= end
d >= endDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 869 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
)
2-869
328 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qauthenticator - unknown status
2
329 bool quote = (*d == '"');-
330 if (quote
quoteDescription
TRUEevaluated 761 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 108 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
)
108-761
331 ++
executed 761 times by 8 tests: ++d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d;
executed 761 times by 8 tests: ++d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
761
332 if (d >= end
d >= endDescription
TRUEnever evaluated
FALSEevaluated 869 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
)
0-869
333 break;
never executed: break;
0
334 start = d;-
335 QByteArray value;-
336 while (d < end
d < endDescription
TRUEevaluated 19276 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
) {
6-19276
337 bool backslash = false;-
338 if (*
*d == '\\'Description
TRUEnever evaluated
FALSEevaluated 19276 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d == '\\'
*d == '\\'Description
TRUEnever evaluated
FALSEevaluated 19276 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
&& d < end - 1
d < end - 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-19276
339 ++d;-
340 backslash = true;-
341 }
never executed: end of block
0
342 if (!backslash
!backslashDescription
TRUEevaluated 19276 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
) {
0-19276
343 if (quote
quoteDescription
TRUEevaluated 18826 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 450 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
) {
450-18826
344 if (*
*d == '"'Description
TRUEevaluated 761 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 18065 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d == '"'
*d == '"'Description
TRUEevaluated 761 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 18065 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
)
761-18065
345 break;
executed 761 times by 8 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
761
346 }
executed 18065 times by 8 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
else {
18065
347 if (*
*d == ','Description
TRUEevaluated 102 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 348 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
d == ','
*d == ','Description
TRUEevaluated 102 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 348 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
)
102-348
348 break;
executed 102 times by 2 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
102
349 }
executed 348 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
348
350 }-
351 value += *d;-
352 ++d;-
353 }
executed 18413 times by 9 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
18413
354 while (d < end
d < endDescription
TRUEevaluated 1067 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 563 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
&& *
*d != ','Description
TRUEevaluated 761 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 306 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
d != ','
*d != ','Description
TRUEevaluated 761 times by 8 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 306 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
306-1067
355 ++
executed 761 times by 8 tests: ++d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
d;
executed 761 times by 8 tests: ++d;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
761
356 ++d;-
357 options[key] = value;-
358 }
executed 869 times by 9 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
869
359-
360 QByteArray qop = options.value("qop");-
361 if (!qop.isEmpty()
!qop.isEmpty()Description
TRUEevaluated 102 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 473 times by 9 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
) {
102-473
362 QList<QByteArray> qopoptions = qop.split(',');-
363 if (!qopoptions.contains("auth")
!qopoptions.contains("auth")Description
TRUEnever evaluated
FALSEevaluated 102 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-102
364 return
never executed: return QHash<QByteArray, QByteArray>();
QHash<QByteArray, QByteArray>();
never executed: return QHash<QByteArray, QByteArray>();
0
365-
366-
367-
368-
369-
370-
371-
372 options["qop"] = "auth";-
373 }
executed 102 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
102
374-
375 return
executed 575 times by 9 tests: return options;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
options;
executed 575 times by 9 tests: return options;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qauthenticator - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
575
376}-
377static QByteArray digestMd5ResponseHelper(-
378 const QByteArray &alg,-
379 const QByteArray &userName,-
380 const QByteArray &realm,-
381 const QByteArray &password,-
382 const QByteArray &nonce,-
383 const QByteArray &nonceCount,-
384 const QByteArray &cNonce,-
385 const QByteArray &qop,-
386 const QByteArray &method,-
387 const QByteArray &digestUri,-
388 const QByteArray &hEntity-
389 )-
390{-
391 QCryptographicHash hash(QCryptographicHash::Md5);-
392 hash.addData(userName);-
393 hash.addData(":", 1);-
394 hash.addData(realm);-
395 hash.addData(":", 1);-
396 hash.addData(password);-
397 QByteArray ha1 = hash.result();-
398 if (alg.toLower() == "md5-sess"
alg.toLower() == "md5-sess"Description
TRUEnever evaluated
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
0-35
399 hash.reset();-
400-
401-
402-
403-
404 hash.addData(ha1.toHex());-
405 hash.addData(":", 1);-
406 hash.addData(nonce);-
407 hash.addData(":", 1);-
408 hash.addData(cNonce);-
409 ha1 = hash.result();-
410 }
never executed: end of block
;
0
411 ha1 = ha1.toHex();-
412-
413-
414 hash.reset();-
415 hash.addData(method);-
416 hash.addData(":", 1);-
417 hash.addData(digestUri);-
418 if (qop.toLower() == "auth-int"
qop.toLower() == "auth-int"Description
TRUEnever evaluated
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
0-35
419 hash.addData(":", 1);-
420 hash.addData(hEntity);-
421 }
never executed: end of block
0
422 QByteArray ha2hex = hash.result().toHex();-
423-
424-
425 hash.reset();-
426 hash.addData(ha1);-
427 hash.addData(":", 1);-
428 hash.addData(nonce);-
429 hash.addData(":", 1);-
430 if (!qop.isNull()
!qop.isNull()Description
TRUEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-35
431 hash.addData(nonceCount);-
432 hash.addData(":", 1);-
433 hash.addData(cNonce);-
434 hash.addData(":", 1);-
435 hash.addData(qop);-
436 hash.addData(":", 1);-
437 }
executed 35 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
35
438 hash.addData(ha2hex);-
439 return
executed 35 times by 2 tests: return hash.result().toHex();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
hash.result().toHex();
executed 35 times by 2 tests: return hash.result().toHex();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
35
440}-
441-
442QByteArray QAuthenticatorPrivate::digestMd5Response(const QByteArray &challenge, const QByteArray &method, const QByteArray &path)-
443{-
444 QHash<QByteArray,QByteArray> options = parseDigestAuthenticationChallenge(challenge);-
445-
446 ++nonceCount;-
447 QByteArray nonceCountString = QByteArray::number(nonceCount, 16);-
448 while (nonceCountString.length() < 8
nonceCountString.length() < 8Description
TRUEevaluated 245 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
35-245
449 nonceCountString.prepend('0');
executed 245 times by 2 tests: nonceCountString.prepend('0');
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
245
450-
451 QByteArray nonce = options.value("nonce");-
452 QByteArray opaque = options.value("opaque");-
453 QByteArray qop = options.value("qop");-
454-
455-
456 QByteArray response = digestMd5ResponseHelper(options.value("algorithm"), user.toLatin1(),-
457 realm.toLatin1(), password.toLatin1(),-
458 nonce, nonceCountString,-
459 cnonce, qop, method,-
460 path, QByteArray());-
461-
462-
463 QByteArray credentials;-
464 credentials += "username=\"" + user.toLatin1() + "\", ";-
465 credentials += "realm=\"" + realm.toLatin1() + "\", ";-
466 credentials += "nonce=\"" + nonce + "\", ";-
467 credentials += "uri=\"" + path + "\", ";-
468 if (!opaque.isEmpty()
!opaque.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-35
469 credentials += "opaque=\"" + opaque + "\", ";
never executed: credentials += "opaque=\"" + opaque + "\", ";
0
470 credentials += "response=\"" + response + '"';-
471 if (!options.value("algorithm").isEmpty()
!options.value...hm").isEmpty()Description
TRUEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
)
0-35
472 credentials += ", algorithm=" + options.value("algorithm");
executed 35 times by 2 tests: credentials += ", algorithm=" + options.value("algorithm");
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
35
473 if (!options.value("qop").isEmpty()
!options.value...op").isEmpty()Description
TRUEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-35
474 credentials += ", qop=" + qop + ", ";-
475 credentials += "nc=" + nonceCountString + ", ";-
476 credentials += "cnonce=\"" + cnonce + '"';-
477 }
executed 35 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
35
478-
479 return
executed 35 times by 2 tests: return credentials;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
credentials;
executed 35 times by 2 tests: return credentials;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
35
480}-
481const int blockSize = 64;-
482const quint8 respversion = 1;-
483const quint8 hirespversion = 1;-
484class QNtlmBuffer {-
485public:-
486 QNtlmBuffer() : len(0), maxLen(0), offset(0) {}
executed 40 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
40
487 quint16 len;-
488 quint16 maxLen;-
489 quint32 offset;-
490 enum { Size = 8 };-
491};-
492-
493class QNtlmPhase1BlockBase-
494{-
495public:-
496 char magic[8];-
497 quint32 type;-
498 quint32 flags;-
499 QNtlmBuffer domain;-
500 QNtlmBuffer workstation;-
501 enum { Size = 32 };-
502};-
503-
504-
505class QNtlmPhase2BlockBase-
506{-
507public:-
508 char magic[8];-
509 quint32 type;-
510 QNtlmBuffer targetName;-
511 quint32 flags;-
512 unsigned char challenge[8];-
513 quint32 context[2];-
514 QNtlmBuffer targetInfo;-
515 enum { Size = 48 };-
516};-
517-
518class QNtlmPhase3BlockBase {-
519public:-
520 char magic[8];-
521 quint32 type;-
522 QNtlmBuffer lmResponse;-
523 QNtlmBuffer ntlmResponse;-
524 QNtlmBuffer domain;-
525 QNtlmBuffer user;-
526 QNtlmBuffer workstation;-
527 QNtlmBuffer sessionKey;-
528 quint32 flags;-
529 enum { Size = 64 };-
530};-
531-
532static void qStreamNtlmBuffer(QDataStream& ds, const QByteArray& s)-
533{-
534 ds.writeRawData(s.constData(), s.size());-
535}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
8
536-
537-
538static void qStreamNtlmString(QDataStream& ds, const QString& s, bool unicode)-
539{-
540 if (!unicode
!unicodeDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
) {
0-8
541 qStreamNtlmBuffer(ds, s.toLatin1());-
542 return;
never executed: return;
0
543 }-
544 const ushort *d = s.utf16();-
545 for (int i = 0; i < s.length()
i < s.length()Description
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
; ++i)
8-62
546 ds << d[i];
executed 62 times by 1 test: ds << d[i];
Executed by:
  • tst_qauthenticator - unknown status
62
547}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
8
548-
549-
550-
551static int qEncodeNtlmBuffer(QNtlmBuffer& buf, int offset, const QByteArray& s)-
552{-
553 buf.len = s.size();-
554 buf.maxLen = buf.len;-
555 buf.offset = (offset + 1) & ~1;-
556 return
executed 8 times by 1 test: return buf.offset + buf.len;
Executed by:
  • tst_qauthenticator - unknown status
buf.offset + buf.len;
executed 8 times by 1 test: return buf.offset + buf.len;
Executed by:
  • tst_qauthenticator - unknown status
8
557}-
558-
559-
560static int qEncodeNtlmString(QNtlmBuffer& buf, int offset, const QString& s, bool unicode)-
561{-
562 if (!unicode
!unicodeDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-12
563 return
never executed: return qEncodeNtlmBuffer(buf, offset, s.toLatin1());
qEncodeNtlmBuffer(buf, offset, s.toLatin1());
never executed: return qEncodeNtlmBuffer(buf, offset, s.toLatin1());
0
564 buf.len = 2 * s.length();-
565 buf.maxLen = buf.len;-
566 buf.offset = (offset + 1) & ~1;-
567 return
executed 12 times by 1 test: return buf.offset + buf.len;
Executed by:
  • tst_qauthenticator - unknown status
buf.offset + buf.len;
executed 12 times by 1 test: return buf.offset + buf.len;
Executed by:
  • tst_qauthenticator - unknown status
12
568}-
569-
570-
571static QDataStream& operator<<(QDataStream& s, const QNtlmBuffer& b)-
572{-
573 s << b.len << b.maxLen << b.offset;-
574 return
executed 32 times by 1 test: return s;
Executed by:
  • tst_qauthenticator - unknown status
s;
executed 32 times by 1 test: return s;
Executed by:
  • tst_qauthenticator - unknown status
32
575}-
576-
577static QDataStream& operator>>(QDataStream& s, QNtlmBuffer& b)-
578{-
579 s >> b.len >> b.maxLen >> b.offset;-
580 return
executed 8 times by 1 test: return s;
Executed by:
  • tst_qauthenticator - unknown status
s;
executed 8 times by 1 test: return s;
Executed by:
  • tst_qauthenticator - unknown status
8
581}-
582-
583-
584class QNtlmPhase1Block : public QNtlmPhase1BlockBase-
585{-
586public:-
587 QNtlmPhase1Block() {-
588 qstrncpy(magic, "NTLMSSP", 8);-
589 type = 1;-
590 flags = 0x00000001 | 0x00000200 | 0x00000004 | 0x00008000 | 0x00080000;-
591 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
592-
593-
594 QString domainStr, workstationStr;-
595};-
596-
597-
598class QNtlmPhase2Block : public QNtlmPhase2BlockBase-
599{-
600public:-
601 QNtlmPhase2Block() {-
602 magic[0] = 0;-
603 type = 0xffffffff;-
604 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
605-
606-
607 QString targetNameStr, targetInfoStr;-
608 QByteArray targetInfoBuff;-
609};-
610-
611-
612-
613class QNtlmPhase3Block : public QNtlmPhase3BlockBase {-
614public:-
615 QNtlmPhase3Block() {-
616 qstrncpy(magic, "NTLMSSP", 8);-
617 type = 3;-
618 flags = 0x00000001 | 0x00000200 | 0x00800000;-
619 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
620-
621-
622 QByteArray lmResponseBuf, ntlmResponseBuf;-
623 QString domainStr, userStr, workstationStr, sessionKeyStr;-
624 QByteArray v2Hash;-
625};-
626-
627-
628static QDataStream& operator<<(QDataStream& s, const QNtlmPhase1Block& b) {-
629 bool unicode = (b.flags & 0x00000001);-
630-
631 s.writeRawData(b.magic, sizeof(b.magic));-
632 s << b.type;-
633 s << b.flags;-
634 s << b.domain;-
635 s << b.workstation;-
636 if (!b.domainStr.isEmpty()
!b.domainStr.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
637 qStreamNtlmString(s, b.domainStr, unicode);
never executed: qStreamNtlmString(s, b.domainStr, unicode);
0
638 if (!b.workstationStr.isEmpty()
!b.workstationStr.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
639 qStreamNtlmString(s, b.workstationStr, unicode);
never executed: qStreamNtlmString(s, b.workstationStr, unicode);
0
640 return
executed 4 times by 1 test: return s;
Executed by:
  • tst_qauthenticator - unknown status
s;
executed 4 times by 1 test: return s;
Executed by:
  • tst_qauthenticator - unknown status
4
641}-
642-
643-
644static QDataStream& operator<<(QDataStream& s, const QNtlmPhase3Block& b) {-
645 bool unicode = (b.flags & 0x00000001);-
646 s.writeRawData(b.magic, sizeof(b.magic));-
647 s << b.type;-
648 s << b.lmResponse;-
649 s << b.ntlmResponse;-
650 s << b.domain;-
651 s << b.user;-
652 s << b.workstation;-
653 s << b.sessionKey;-
654 s << b.flags;-
655-
656 if (!b.domainStr.isEmpty()
!b.domainStr.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
)
0-4
657 qStreamNtlmString(s, b.domainStr, unicode);
executed 4 times by 1 test: qStreamNtlmString(s, b.domainStr, unicode);
Executed by:
  • tst_qauthenticator - unknown status
4
658-
659 qStreamNtlmString(s, b.userStr, unicode);-
660-
661 if (!b.workstationStr.isEmpty()
!b.workstationStr.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
662 qStreamNtlmString(s, b.workstationStr, unicode);
never executed: qStreamNtlmString(s, b.workstationStr, unicode);
0
663-
664-
665 qStreamNtlmBuffer(s, b.lmResponseBuf);-
666 qStreamNtlmBuffer(s, b.ntlmResponseBuf);-
667-
668-
669 return
executed 4 times by 1 test: return s;
Executed by:
  • tst_qauthenticator - unknown status
s;
executed 4 times by 1 test: return s;
Executed by:
  • tst_qauthenticator - unknown status
4
670}-
671-
672-
673static QByteArray qNtlmPhase1()-
674{-
675 QByteArray rc;-
676 QDataStream ds(&rc, QIODevice::WriteOnly);-
677 ds.setByteOrder(QDataStream::LittleEndian);-
678 QNtlmPhase1Block pb;-
679 ds << pb;-
680 return
executed 4 times by 1 test: return rc;
Executed by:
  • tst_qauthenticator - unknown status
rc;
executed 4 times by 1 test: return rc;
Executed by:
  • tst_qauthenticator - unknown status
4
681}-
682-
683-
684static QByteArray qStringAsUcs2Le(const QString& src)-
685{-
686 QByteArray rc(2*src.length(), 0);-
687 const unsigned short *s = src.utf16();-
688 unsigned short *d = (unsigned short*)rc.data();-
689 for (int i = 0; i < src.length()
i < src.length()Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
; ++i) {
12-84
690 d[i] = qToLittleEndian(s[i]);-
691 }
executed 84 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
84
692 return
executed 12 times by 1 test: return rc;
Executed by:
  • tst_qauthenticator - unknown status
rc;
executed 12 times by 1 test: return rc;
Executed by:
  • tst_qauthenticator - unknown status
12
693}-
694-
695-
696static QString qStringFromUcs2Le(QByteArray src)-
697{-
698 ((!(src.size() % 2 == 0)) ? qt_assert("src.size() % 2 == 0",__FILE__,1096) : qt_noop());-
699 unsigned short *d = (unsigned short*)src.data();-
700 for (int i = 0; i < src.length() / 2
i < src.length() / 2Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
; ++i) {
4-40
701 d[i] = qFromLittleEndian(d[i]);-
702 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
40
703 return
executed 4 times by 1 test: return QString((const QChar *)src.data(), src.size()/2);
Executed by:
  • tst_qauthenticator - unknown status
QString((const QChar *)src.data(), src.size()/2);
executed 4 times by 1 test: return QString((const QChar *)src.data(), src.size()/2);
Executed by:
  • tst_qauthenticator - unknown status
4
704}-
705QByteArray qEncodeHmacMd5(QByteArray &key, const QByteArray &message)-
706{-
707 ((!(!(message.isEmpty()))) ? qt_assert_x("qEncodeHmacMd5", "Empty message check",__FILE__,1129) : qt_noop());-
708 ((!(!(key.isEmpty()))) ? qt_assert_x("qEncodeHmacMd5", "Empty key check",__FILE__,1130) : qt_noop());-
709-
710 QCryptographicHash hash(QCryptographicHash::Md5);-
711 QByteArray hMsg;-
712-
713 QByteArray iKeyPad(blockSize, 0x36);-
714 QByteArray oKeyPad(blockSize, 0x5c);-
715-
716 hash.reset();-
717-
718-
719 if(blockSize < key.length()
blockSize < key.length()Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
) {
0-8
720 hash.addData(key);-
721 key = hash.result();-
722 }
never executed: end of block
0
723-
724-
725-
726 key = key.leftJustified(blockSize,0,true);-
727-
728-
729-
730-
731 for(int i = 0; i<key.size()
i<key.size()Description
TRUEevaluated 512 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
;i++) {
8-512
732 iKeyPad[i] = key[i]^iKeyPad[i];-
733 }
executed 512 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
512
734-
735-
736 for(int i = 0; i<key.size()
i<key.size()Description
TRUEevaluated 512 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
;i++) {
8-512
737 oKeyPad[i] = key[i]^oKeyPad[i];-
738 }
executed 512 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
512
739-
740 iKeyPad.append(message);-
741-
742 hash.reset();-
743 hash.addData(iKeyPad);-
744 hMsg = hash.result();-
745-
746-
747 QByteArray hmacDigest;-
748 oKeyPad.append(hMsg);-
749 hash.reset();-
750 hash.addData(oKeyPad);-
751 hmacDigest = hash.result();-
752 return
executed 8 times by 1 test: return hmacDigest;
Executed by:
  • tst_qauthenticator - unknown status
hmacDigest;
executed 8 times by 1 test: return hmacDigest;
Executed by:
  • tst_qauthenticator - unknown status
8
753}-
754-
755static QByteArray qCreatev2Hash(const QAuthenticatorPrivate *ctx,-
756 QNtlmPhase3Block *phase3)-
757{-
758 ((!(phase3 != 0)) ? qt_assert("phase3 != 0",__FILE__,1190) : qt_noop());-
759-
760-
761 if(phase3->v2Hash.size() == 0
phase3->v2Hash.size() == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
) {
0-4
762 QCryptographicHash md4(QCryptographicHash::Md4);-
763 QByteArray passUnicode = qStringAsUcs2Le(ctx->password);-
764 md4.addData(passUnicode.data(), passUnicode.size());-
765-
766 QByteArray hashKey = md4.result();-
767 ((!(hashKey.size() == 16)) ? qt_assert("hashKey.size() == 16",__FILE__,1199) : qt_noop());-
768-
769 QByteArray message =-
770 qStringAsUcs2Le(ctx->extractedUser.toUpper()) +-
771 qStringAsUcs2Le(phase3->domainStr);-
772-
773 phase3->v2Hash = qEncodeHmacMd5(hashKey, message);-
774 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
775 return
executed 4 times by 1 test: return phase3->v2Hash;
Executed by:
  • tst_qauthenticator - unknown status
phase3->v2Hash;
executed 4 times by 1 test: return phase3->v2Hash;
Executed by:
  • tst_qauthenticator - unknown status
4
776}-
777-
778static QByteArray clientChallenge(const QAuthenticatorPrivate *ctx)-
779{-
780 ((!(ctx->cnonce.size() >= 8)) ? qt_assert("ctx->cnonce.size() >= 8",__FILE__,1212) : qt_noop());-
781 QByteArray clientCh = ctx->cnonce.right(8);-
782 return
executed 4 times by 1 test: return clientCh;
Executed by:
  • tst_qauthenticator - unknown status
clientCh;
executed 4 times by 1 test: return clientCh;
Executed by:
  • tst_qauthenticator - unknown status
4
783}-
784-
785-
786static QByteArray qExtractServerTime(const QByteArray& targetInfoBuff)-
787{-
788 QByteArray timeArray;-
789 QDataStream ds(targetInfoBuff);-
790 ds.setByteOrder(QDataStream::LittleEndian);-
791-
792 quint16 avId;-
793 quint16 avLen;-
794-
795 ds >> avId;-
796 ds >> avLen;-
797 while(avId != 0
avId != 0Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
) {
4-18
798 if(avId == 7
avId == 7Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
) {
0-18
799 timeArray.resize(avLen);-
800-
801 ds.readRawData(timeArray.data(), avLen);-
802 break;
never executed: break;
0
803 }-
804 ds.skipRawData(avLen);-
805 ds >> avId;-
806 ds >> avLen;-
807 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
18
808 return
executed 4 times by 1 test: return timeArray;
Executed by:
  • tst_qauthenticator - unknown status
timeArray;
executed 4 times by 1 test: return timeArray;
Executed by:
  • tst_qauthenticator - unknown status
4
809}-
810-
811static QByteArray qEncodeNtlmv2Response(const QAuthenticatorPrivate *ctx,-
812 const QNtlmPhase2Block& ch,-
813 QNtlmPhase3Block *phase3)-
814{-
815 ((!(phase3 != 0)) ? qt_assert("phase3 != 0",__FILE__,1247) : qt_noop());-
816-
817 qCreatev2Hash(ctx, phase3);-
818-
819 QByteArray temp;-
820 QDataStream ds(&temp, QIODevice::WriteOnly);-
821 ds.setByteOrder(QDataStream::LittleEndian);-
822-
823 ds << respversion;-
824 ds << hirespversion;-
825-
826-
827 QByteArray reserved1(6, 0);-
828 ds.writeRawData(reserved1.constData(), reserved1.size());-
829-
830 quint64 time = 0;-
831 QByteArray timeArray;-
832-
833 if(ch.targetInfo.len
ch.targetInfo.lenDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
)
0-4
834 {-
835 timeArray = qExtractServerTime(ch.targetInfoBuff);-
836 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
837-
838-
839 if(timeArray.size()
timeArray.size()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
) {
0-4
840 ds.writeRawData(timeArray.constData(), timeArray.size());-
841 }
never executed: end of block
else {
0
842 QDateTime currentTime(QDate::currentDate(),-
843 QTime::currentTime(), Qt::UTC);-
844-
845-
846-
847-
848-
849 time = currentTime.toTime_t() + static_cast<unsigned long long>(11644473600ULL);-
850-
851-
852 time = time * static_cast<unsigned long long>(10000000ULL);-
853 ds << time;-
854 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
855-
856-
857 QByteArray clientCh = clientChallenge(ctx);-
858 ds.writeRawData(clientCh.constData(), clientCh.size());-
859-
860-
861 QByteArray reserved2(4, 0);-
862 ds.writeRawData(reserved2.constData(), reserved2.size());-
863-
864 if (ch.targetInfo.len > 0
ch.targetInfo.len > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
) {
0-4
865 ds.writeRawData(ch.targetInfoBuff.constData(),-
866 ch.targetInfoBuff.size());-
867 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
868-
869-
870 QByteArray reserved3(4, 0);-
871 ds.writeRawData(reserved3.constData(), reserved3.size());-
872-
873 QByteArray message((const char*)ch.challenge, sizeof(ch.challenge));-
874 message.append(temp);-
875-
876 QByteArray ntChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message);-
877 ntChallengeResp.append(temp);-
878-
879 return
executed 4 times by 1 test: return ntChallengeResp;
Executed by:
  • tst_qauthenticator - unknown status
ntChallengeResp;
executed 4 times by 1 test: return ntChallengeResp;
Executed by:
  • tst_qauthenticator - unknown status
4
880}-
881-
882static QByteArray qEncodeLmv2Response(const QAuthenticatorPrivate *ctx,-
883 const QNtlmPhase2Block& ch,-
884 QNtlmPhase3Block *phase3)-
885{-
886 ((!(phase3 != 0)) ? qt_assert("phase3 != 0",__FILE__,1318) : qt_noop());-
887-
888 qCreatev2Hash(ctx, phase3);-
889-
890 QByteArray message((const char*)ch.challenge, sizeof(ch.challenge));-
891 QByteArray clientCh = clientChallenge(ctx);-
892-
893 message.append(clientCh);-
894-
895 QByteArray lmChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message);-
896 lmChallengeResp.append(clientCh);-
897-
898 return
never executed: return lmChallengeResp;
lmChallengeResp;
never executed: return lmChallengeResp;
0
899}-
900-
901static bool qNtlmDecodePhase2(const QByteArray& data, QNtlmPhase2Block& ch)-
902{-
903 ((!(QNtlmPhase2BlockBase::Size == sizeof(QNtlmPhase2BlockBase))) ? qt_assert("QNtlmPhase2BlockBase::Size == sizeof(QNtlmPhase2BlockBase)",__FILE__,1335) : qt_noop());-
904 if (data.size() < QNtlmPhase2BlockBase::Size
data.size() < ...lockBase::SizeDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
905 return
never executed: return false;
false;
never executed: return false;
0
906-
907-
908 QDataStream ds(data);-
909 ds.setByteOrder(QDataStream::LittleEndian);-
910 if (ds.readRawData(ch.magic, 8) < 8
ds.readRawData....magic, 8) < 8Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
911 return
never executed: return false;
false;
never executed: return false;
0
912 if (strncmp(ch.magic, "NTLMSSP", 8) != 0
strncmp(ch.mag...MSSP", 8) != 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
913 return
never executed: return false;
false;
never executed: return false;
0
914-
915 ds >> ch.type;-
916 if (ch.type != 2
ch.type != 2Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
917 return
never executed: return false;
false;
never executed: return false;
0
918-
919 ds >> ch.targetName;-
920 ds >> ch.flags;-
921 if (ds.readRawData((char *)ch.challenge, 8) < 8
ds.readRawData...llenge, 8) < 8Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
922 return
never executed: return false;
false;
never executed: return false;
0
923 ds >> ch.context[0] >> ch.context[1];-
924 ds >> ch.targetInfo;-
925-
926 if (ch.targetName.len > 0
ch.targetName.len > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
) {
0-4
927 if (ch.targetName.len + ch.targetName.offset > (unsigned)data.size()
ch.targetName....ed)data.size()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
928 return
never executed: return false;
false;
never executed: return false;
0
929-
930 ch.targetNameStr = qStringFromUcs2Le(data.mid(ch.targetName.offset, ch.targetName.len));-
931 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
932-
933 if (ch.targetInfo.len > 0
ch.targetInfo.len > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
) {
0-4
934 if (ch.targetInfo.len + ch.targetInfo.offset > (unsigned)data.size()
ch.targetInfo....ed)data.size()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
935 return
never executed: return false;
false;
never executed: return false;
0
936-
937 ch.targetInfoBuff = data.mid(ch.targetInfo.offset, ch.targetInfo.len);-
938 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
4
939-
940 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qauthenticator - unknown status
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qauthenticator - unknown status
4
941}-
942-
943-
944static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phase2data)-
945{-
946 QNtlmPhase2Block ch;-
947 if (!qNtlmDecodePhase2(phase2data, ch)
!qNtlmDecodePh...hase2data, ch)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
948 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
949-
950 QByteArray rc;-
951 QDataStream ds(&rc, QIODevice::WriteOnly);-
952 ds.setByteOrder(QDataStream::LittleEndian);-
953 QNtlmPhase3Block pb;-
954-
955-
956 if (ch.flags & 0x00080000
ch.flags & 0x00080000Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
957 pb.flags |= 0x00080000;
never executed: pb.flags |= 0x00080000;
0
958-
959-
960 if (ch.flags & 0x00008000
ch.flags & 0x00008000Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
)
0-4
961 pb.flags |= 0x00008000;
never executed: pb.flags |= 0x00008000;
0
962-
963 bool unicode = ch.flags & 0x00000001;-
964-
965 if (unicode
unicodeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
)
0-4
966 pb.flags |= 0x00000001;
executed 4 times by 1 test: pb.flags |= 0x00000001;
Executed by:
  • tst_qauthenticator - unknown status
4
967 else-
968 pb.flags |= 0x00000002;
never executed: pb.flags |= 0x00000002;
0
969-
970-
971 int offset = QNtlmPhase3BlockBase::Size;-
972 ((!(QNtlmPhase3BlockBase::Size == sizeof(QNtlmPhase3BlockBase))) ? qt_assert("QNtlmPhase3BlockBase::Size == sizeof(QNtlmPhase3BlockBase)",__FILE__,1404) : qt_noop());-
973-
974-
975 if (ctx->userDomain.isEmpty()
ctx->userDomain.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
&& !ctx->extractedUser.contains(QLatin1Char('@'))
!ctx->extracte...tin1Char('@'))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
) {
0-4
976 offset = qEncodeNtlmString(pb.domain, offset, ch.targetNameStr, unicode);-
977 pb.domainStr = ch.targetNameStr;-
978 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
else {
4
979 offset = qEncodeNtlmString(pb.domain, offset, ctx->userDomain, unicode);-
980 pb.domainStr = ctx->userDomain;-
981 }
never executed: end of block
0
982-
983 offset = qEncodeNtlmString(pb.user, offset, ctx->extractedUser, unicode);-
984 pb.userStr = ctx->extractedUser;-
985-
986 offset = qEncodeNtlmString(pb.workstation, offset, ctx->workstation, unicode);-
987 pb.workstationStr = ctx->workstation;-
988-
989-
990 if (ch.targetInfo.len > 0
ch.targetInfo.len > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qauthenticator - unknown status
FALSEnever evaluated
) {
0-4
991 pb.lmResponseBuf = QByteArray();-
992 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qauthenticator - unknown status
else {
4
993 pb.lmResponseBuf = qEncodeLmv2Response(ctx, ch, &pb);-
994 }
never executed: end of block
0
995 offset = qEncodeNtlmBuffer(pb.lmResponse, offset, pb.lmResponseBuf);-
996-
997-
998 pb.ntlmResponseBuf = qEncodeNtlmv2Response(ctx, ch, &pb);-
999 offset = qEncodeNtlmBuffer(pb.ntlmResponse, offset, pb.ntlmResponseBuf);-
1000-
1001-
1002-
1003 ds << pb;-
1004-
1005 return
executed 4 times by 1 test: return rc;
Executed by:
  • tst_qauthenticator - unknown status
rc;
executed 4 times by 1 test: return rc;
Executed by:
  • tst_qauthenticator - unknown status
4
1006}-
1007-
Switch to Source codePreprocessed file

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