diff options
-rw-r--r-- | src/network/kernel/qauthenticator.cpp | 11 | ||||
-rw-r--r-- | tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index edbbbf5a75..f7b956651f 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -981,7 +981,7 @@ public: QNtlmPhase1Block() { qstrncpy(magic, "NTLMSSP", 8); type = 1; - flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET; + flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET | NTLMSSP_NEGOTIATE_ALWAYS_SIGN | NTLMSSP_NEGOTIATE_NTLM2; } // extracted @@ -1423,9 +1423,16 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas ds.setByteOrder(QDataStream::LittleEndian); QNtlmPhase3Block pb; + // set NTLMv2 + if (ch.flags & NTLMSSP_NEGOTIATE_NTLM2) + pb.flags |= NTLMSSP_NEGOTIATE_NTLM2; + + // set Always Sign + if (ch.flags & NTLMSSP_NEGOTIATE_ALWAYS_SIGN) + pb.flags |= NTLMSSP_NEGOTIATE_ALWAYS_SIGN; + bool unicode = ch.flags & NTLMSSP_NEGOTIATE_UNICODE; - pb.flags = NTLMSSP_NEGOTIATE_NTLM; if (unicode) pb.flags |= NTLMSSP_NEGOTIATE_UNICODE; else diff --git a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp index 6ba6781913..b61ec0883e 100644 --- a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp +++ b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp @@ -146,7 +146,7 @@ void tst_QAuthenticator::ntlmAuth() if (sso) QVERIFY(priv->calculateResponse("GET", "/").startsWith("NTLM ")); else - QCOMPARE(priv->calculateResponse("GET", "/").constData(), "NTLM TlRMTVNTUAABAAAABQIAAAAAAAAAAAAAAAAAAAAAAAA="); + QCOMPARE(priv->calculateResponse("GET", "/").constData(), "NTLM TlRMTVNTUAABAAAABYIIAAAAAAAAAAAAAAAAAAAAAAA="); // NTLM phase 2: challenge headers.clear(); |