Line | Source | Count |
1 | | - |
2 | | - |
3 | static QByteArray qNtlmPhase1(); | - |
4 | static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phase2data); | - |
5 | QAuthenticator::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 | | - |
13 | QAuthenticator::~QAuthenticator() | - |
14 | { | - |
15 | if (dTRUE | evaluated 2549 times by 16 testsEvaluated 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
| FALSE | evaluated 4790 times by 13 testsEvaluated 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 | | - |
22 | QAuthenticator::QAuthenticator(const QAuthenticator &other) | - |
23 | : d(0) | - |
24 | { | - |
25 | if (other.dTRUE | never evaluated | FALSE | never 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 | | - |
32 | QAuthenticator &QAuthenticator::operator=(const QAuthenticator &other) | - |
33 | { | - |
34 | if (d == other.dTRUE | never evaluated | FALSE | evaluated 43 times by 3 testsEvaluated 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.dTRUE | never evaluated | FALSE | evaluated 43 times by 3 testsEvaluated 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::StartTRUE | evaluated 43 times by 3 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
- tst_qhttpsocketengine - unknown status
| FALSE | never 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 | returnexecuted 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 | | - |
61 | bool QAuthenticator::operator==(const QAuthenticator &other) const | - |
62 | { | - |
63 | if (d == other.dTRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
|
) | 4 |
64 | returnexecuted 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 (!dTRUE | evaluated 2 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 2 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
|
|| !other.dTRUE | evaluated 2 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never evaluated |
) | 0-2 |
66 | returnexecuted 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->usernever 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 | } | - |
73 | QString QAuthenticator::user() const | - |
74 | { | - |
75 | returnexecuted 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 | | - |
83 | void 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 | | - |
93 | QString QAuthenticator::password() const | - |
94 | { | - |
95 | returnexecuted 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 | | - |
103 | void 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 | | - |
112 | void QAuthenticator::detach() | - |
113 | { | - |
114 | if (!dTRUE | evaluated 2596 times by 15 testsEvaluated 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
| FALSE | evaluated 2156 times by 10 testsEvaluated 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::DoneTRUE | evaluated 578 times by 9 testsEvaluated 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
| FALSE | evaluated 1578 times by 10 testsEvaluated 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 | | - |
126 | QString QAuthenticator::realm() const | - |
127 | { | - |
128 | returnexecuted 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 | | - |
134 | void QAuthenticator::setRealm(const QString &realm) | - |
135 | { | - |
136 | detach(); | - |
137 | d->realm = realm; | - |
138 | } never executed: end of block | 0 |
139 | QVariant QAuthenticator::option(const QString &opt) const | - |
140 | { | - |
141 | returnexecuted 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 | } | - |
143 | QVariantHash 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 | } | - |
147 | void QAuthenticator::setOption(const QString &opt, const QVariant &value) | - |
148 | { | - |
149 | detach(); | - |
150 | d->options.insert(opt, value); | - |
151 | } never executed: end of block | 0 |
152 | bool QAuthenticator::isNull() const | - |
153 | { | - |
154 | returnexecuted 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 | } | - |
156 | QAuthenticatorPrivate::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 | | - |
170 | QAuthenticatorPrivate::~QAuthenticatorPrivate() | - |
171 | { | - |
172 | | - |
173 | | - |
174 | | - |
175 | | - |
176 | } | - |
177 | | - |
178 | void QAuthenticatorPrivate::updateCredentials() | - |
179 | { | - |
180 | int separatorPosn = 0; | - |
181 | | - |
182 | switch (method) { | - |
183 | caseexecuted 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 ((TRUE | never evaluated | FALSE | evaluated 8 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
|
separatorPosn = user.indexOf(QLatin1String("\\"))) != -1TRUE | never evaluated | FALSE | evaluated 8 times by 1 testEvaluated 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 | defaultexecuted 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 | | - |
201 | void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByteArray> > &values, bool isProxy) | - |
202 | { | - |
203 | const char *search = isProxyTRUE | evaluated 229 times by 7 testsEvaluated 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
| FALSE | evaluated 311 times by 3 testsEvaluated 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()TRUE | evaluated 4613 times by 9 testsEvaluated 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
| FALSE | evaluated 540 times by 9 testsEvaluated 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> ¤t = values.at(i); | - |
209 | if (current.first.toLower() != searchTRUE | evaluated 4074 times by 8 testsEvaluated 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
| FALSE | evaluated 539 times by 9 testsEvaluated 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 < BasicTRUE | evaluated 539 times by 9 testsEvaluated 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
| FALSE | never evaluated |
&& str.startsWith("basic")TRUE | evaluated 463 times by 9 testsEvaluated 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
| FALSE | evaluated 76 times by 4 testsEvaluated 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 < NtlmTRUE | evaluated 76 times by 4 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
- tst_qauthenticator - unknown status
- tst_qhttpsocketengine - unknown status
| FALSE | never evaluated |
&& str.startsWith("ntlm")TRUE | evaluated 8 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 68 times by 3 testsEvaluated 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 < DigestMd5TRUE | evaluated 68 times by 3 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
- tst_qhttpsocketengine - unknown status
| FALSE | never evaluated |
&& str.startsWith("digest")TRUE | evaluated 67 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | evaluated 1 time by 1 testEvaluated 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 | caseexecuted 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()TRUE | evaluated 291 times by 9 testsEvaluated 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
| FALSE | evaluated 172 times by 3 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
- tst_qhttpsocketengine - unknown status
|
&& password.isEmpty()TRUE | evaluated 291 times by 9 testsEvaluated 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
| FALSE | never 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 | caseexecuted 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 | caseexecuted 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"TRUE | never evaluated | FALSE | evaluated 67 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
|
) | 0-67 |
241 | phase = Start; never executed: phase = Start; | 0 |
242 | if (user.isEmpty()TRUE | evaluated 8 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | evaluated 59 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
|
&& password.isEmpty()TRUE | evaluated 8 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | never 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 | defaultexecuted 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 | | - |
253 | QByteArray 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 | caseexecuted 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==")TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
274 | response = user.toUtf8().toBase64(); | - |
275 | phase = Phase2; | - |
276 | } never executed: end of block else if (challenge.contains("UGFzc3dvcmQA")TRUE | never evaluated | FALSE | never 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 | caseexecuted 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 | caseexecuted 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()TRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
|
) { | 4 |
291 | { | - |
292 | response = qNtlmPhase1().toBase64(); | - |
293 | if (user.isEmpty()TRUE | evaluated 2 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 2 times by 1 testEvaluated 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 | returnexecuted 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 | | - |
313 | QHash<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 < endTRUE | evaluated 871 times by 9 testsEvaluated 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
| FALSE | evaluated 573 times by 9 testsEvaluated 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 < endTRUE | evaluated 1177 times by 9 testsEvaluated 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
| FALSE | never evaluated |
&& (*TRUE | evaluated 306 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | evaluated 871 times by 9 testsEvaluated 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 == ' 'TRUE | evaluated 306 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | evaluated 871 times by 9 testsEvaluated 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
|
|| *TRUE | never evaluated | FALSE | evaluated 871 times by 9 testsEvaluated 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'TRUE | never evaluated | FALSE | evaluated 871 times by 9 testsEvaluated 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
|
|| *TRUE | never evaluated | FALSE | evaluated 871 times by 9 testsEvaluated 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'TRUE | never evaluated | FALSE | evaluated 871 times by 9 testsEvaluated 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 < endTRUE | evaluated 6700 times by 9 testsEvaluated 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
| FALSE | evaluated 2 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
|
&& *TRUE | evaluated 5831 times by 9 testsEvaluated 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
| FALSE | evaluated 869 times by 9 testsEvaluated 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 != '='TRUE | evaluated 5831 times by 9 testsEvaluated 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
| FALSE | evaluated 869 times by 9 testsEvaluated 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 >= endTRUE | evaluated 2 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 869 times by 9 testsEvaluated 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 (quoteTRUE | evaluated 761 times by 8 testsEvaluated 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
| FALSE | evaluated 108 times by 4 testsEvaluated 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 >= endTRUE | never evaluated | FALSE | evaluated 869 times by 9 testsEvaluated 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 < endTRUE | evaluated 19276 times by 9 testsEvaluated 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
| FALSE | evaluated 6 times by 2 testsEvaluated by:- tst_qauthenticator - unknown status
- tst_qhttpsocketengine - unknown status
|
) { | 6-19276 |
337 | bool backslash = false; | - |
338 | if (*TRUE | never evaluated | FALSE | evaluated 19276 times by 9 testsEvaluated 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 == '\\'TRUE | never evaluated | FALSE | evaluated 19276 times by 9 testsEvaluated 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 - 1TRUE | never evaluated | FALSE | never evaluated |
) { | 0-19276 |
339 | ++d; | - |
340 | backslash = true; | - |
341 | } never executed: end of block | 0 |
342 | if (!backslashTRUE | evaluated 19276 times by 9 testsEvaluated 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
| FALSE | never evaluated |
) { | 0-19276 |
343 | if (quoteTRUE | evaluated 18826 times by 8 testsEvaluated 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
| FALSE | evaluated 450 times by 4 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
- tst_qauthenticator - unknown status
- tst_qhttpsocketengine - unknown status
|
) { | 450-18826 |
344 | if (*TRUE | evaluated 761 times by 8 testsEvaluated 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
| FALSE | evaluated 18065 times by 8 testsEvaluated 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 == '"'TRUE | evaluated 761 times by 8 testsEvaluated 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
| FALSE | evaluated 18065 times by 8 testsEvaluated 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 (*TRUE | evaluated 102 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | evaluated 348 times by 4 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
- tst_qauthenticator - unknown status
- tst_qhttpsocketengine - unknown status
|
d == ','TRUE | evaluated 102 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | evaluated 348 times by 4 testsEvaluated 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 < endTRUE | evaluated 1067 times by 8 testsEvaluated 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
| FALSE | evaluated 563 times by 9 testsEvaluated 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
|
&& *TRUE | evaluated 761 times by 8 testsEvaluated 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
| FALSE | evaluated 306 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
|
d != ','TRUE | evaluated 761 times by 8 testsEvaluated 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
| FALSE | evaluated 306 times by 2 testsEvaluated 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()TRUE | evaluated 102 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | evaluated 473 times by 9 testsEvaluated 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")TRUE | never evaluated | FALSE | evaluated 102 times by 2 testsEvaluated 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 | returnexecuted 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 | } | - |
377 | static 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"TRUE | never evaluated | FALSE | evaluated 35 times by 2 testsEvaluated 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"TRUE | never evaluated | FALSE | evaluated 35 times by 2 testsEvaluated 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()TRUE | evaluated 35 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | never 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 | returnexecuted 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 | | - |
442 | QByteArray 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() < 8TRUE | evaluated 245 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | evaluated 35 times by 2 testsEvaluated 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()TRUE | never evaluated | FALSE | evaluated 35 times by 2 testsEvaluated 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()TRUE | evaluated 35 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | never 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()TRUE | evaluated 35 times by 2 testsEvaluated by:- tst_QHttpNetworkConnection
- tst_QNetworkReply
| FALSE | never 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 | returnexecuted 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 | } | - |
481 | const int blockSize = 64; | - |
482 | const quint8 respversion = 1; | - |
483 | const quint8 hirespversion = 1; | - |
484 | class QNtlmBuffer { | - |
485 | public: | - |
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 | | - |
493 | class QNtlmPhase1BlockBase | - |
494 | { | - |
495 | public: | - |
496 | char magic[8]; | - |
497 | quint32 type; | - |
498 | quint32 flags; | - |
499 | QNtlmBuffer domain; | - |
500 | QNtlmBuffer workstation; | - |
501 | enum { Size = 32 }; | - |
502 | }; | - |
503 | | - |
504 | | - |
505 | class QNtlmPhase2BlockBase | - |
506 | { | - |
507 | public: | - |
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 | | - |
518 | class QNtlmPhase3BlockBase { | - |
519 | public: | - |
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 | | - |
532 | static 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 | | - |
538 | static void qStreamNtlmString(QDataStream& ds, const QString& s, bool unicode) | - |
539 | { | - |
540 | if (!unicodeTRUE | never evaluated | FALSE | evaluated 8 times by 1 testEvaluated 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()TRUE | evaluated 62 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 8 times by 1 testEvaluated 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 | | - |
551 | static 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 | returnexecuted 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 | | - |
560 | static int qEncodeNtlmString(QNtlmBuffer& buf, int offset, const QString& s, bool unicode) | - |
561 | { | - |
562 | if (!unicodeTRUE | never evaluated | FALSE | evaluated 12 times by 1 testEvaluated 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 | returnexecuted 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 | | - |
571 | static QDataStream& operator<<(QDataStream& s, const QNtlmBuffer& b) | - |
572 | { | - |
573 | s << b.len << b.maxLen << b.offset; | - |
574 | returnexecuted 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 | | - |
577 | static QDataStream& operator>>(QDataStream& s, QNtlmBuffer& b) | - |
578 | { | - |
579 | s >> b.len >> b.maxLen >> b.offset; | - |
580 | returnexecuted 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 | | - |
584 | class QNtlmPhase1Block : public QNtlmPhase1BlockBase | - |
585 | { | - |
586 | public: | - |
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 | | - |
598 | class QNtlmPhase2Block : public QNtlmPhase2BlockBase | - |
599 | { | - |
600 | public: | - |
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 | | - |
613 | class QNtlmPhase3Block : public QNtlmPhase3BlockBase { | - |
614 | public: | - |
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 | | - |
628 | static 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()TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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()TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
|
) | 0-4 |
639 | qStreamNtlmString(s, b.workstationStr, unicode); never executed: qStreamNtlmString(s, b.workstationStr, unicode); | 0 |
640 | returnexecuted 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 | | - |
644 | static 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()TRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never 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()TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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 | returnexecuted 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 | | - |
673 | static QByteArray qNtlmPhase1() | - |
674 | { | - |
675 | QByteArray rc; | - |
676 | QDataStream ds(&rc, QIODevice::WriteOnly); | - |
677 | ds.setByteOrder(QDataStream::LittleEndian); | - |
678 | QNtlmPhase1Block pb; | - |
679 | ds << pb; | - |
680 | returnexecuted 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 | | - |
684 | static 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()TRUE | evaluated 84 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 12 times by 1 testEvaluated 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 | returnexecuted 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 | | - |
696 | static 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() / 2TRUE | evaluated 40 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 4 times by 1 testEvaluated 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 | returnexecuted 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 | } | - |
705 | QByteArray 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()TRUE | never evaluated | FALSE | evaluated 8 times by 1 testEvaluated 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()TRUE | evaluated 512 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 8 times by 1 testEvaluated 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()TRUE | evaluated 512 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 8 times by 1 testEvaluated 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 | returnexecuted 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 | | - |
755 | static 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() == 0TRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never 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 | returnexecuted 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 | | - |
778 | static 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 | returnexecuted 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 | | - |
786 | static 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 != 0TRUE | evaluated 18 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
|
) { | 4-18 |
798 | if(avId == 7TRUE | never evaluated | FALSE | evaluated 18 times by 1 testEvaluated 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 | returnexecuted 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 | | - |
811 | static 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.lenTRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never 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()TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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 > 0TRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never 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 | returnexecuted 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 | | - |
882 | static 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 | | - |
901 | static 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::SizeTRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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) < 8TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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) != 0TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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 != 2TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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) < 8TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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 > 0TRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never evaluated |
) { | 0-4 |
927 | if (ch.targetName.len + ch.targetName.offset > (unsigned)data.size()TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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 > 0TRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never evaluated |
) { | 0-4 |
934 | if (ch.targetInfo.len + ch.targetInfo.offset > (unsigned)data.size()TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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 | returnexecuted 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 | | - |
944 | static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phase2data) | - |
945 | { | - |
946 | QNtlmPhase2Block ch; | - |
947 | if (!qNtlmDecodePhase2(phase2data, ch)TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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 & 0x00080000TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
|
) | 0-4 |
957 | pb.flags |= 0x00080000; never executed: pb.flags |= 0x00080000; | 0 |
958 | | - |
959 | | - |
960 | if (ch.flags & 0x00008000TRUE | never evaluated | FALSE | evaluated 4 times by 1 testEvaluated 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 (unicodeTRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never 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()TRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never evaluated |
&& !ctx->extractedUser.contains(QLatin1Char('@'))TRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never 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 > 0TRUE | evaluated 4 times by 1 testEvaluated by:- tst_qauthenticator - unknown status
| FALSE | never 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 | returnexecuted 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 | | - |
| | |