summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-29 16:06:48 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-29 16:06:48 (GMT)
commit7db218d6860a04df238735ff692010f0910d0c92 (patch)
treead8033623855b3afb17752552ca56b096c1b9159 /src/network/kernel
parent8943b44c38ee6244c4a5b190c2b35879b1921843 (diff)
parentc02ef9eb331f03dbd59d2fd938c53b54f5c65cea (diff)
downloadQt-7db218d6860a04df238735ff692010f0910d0c92.zip
Qt-7db218d6860a04df238735ff692010f0910d0c92.tar.gz
Qt-7db218d6860a04df238735ff692010f0910d0c92.tar.bz2
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/qauthenticator.cpp14
-rw-r--r--src/network/kernel/qauthenticator_p.h1
2 files changed, 9 insertions, 6 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index f97d833..220f7da 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -232,19 +232,21 @@ void QAuthenticator::setUser(const QString &user)
//domain name is present
d->realm.clear();
d->userDomain = user.left(separatorPosn);
- d->user = user.mid(separatorPosn + 1);
+ d->extractedUser = user.mid(separatorPosn + 1);
+ d->user = user;
} else if((separatorPosn = user.indexOf(QLatin1String("@"))) != -1) {
//domain name is present
d->realm.clear();
d->userDomain = user.left(separatorPosn);
- d->user = user.left(separatorPosn);
+ d->extractedUser = user.left(separatorPosn);
+ d->user = user;
} else {
+ d->extractedUser = user;
d->user = user;
d->realm.clear();
d->userDomain.clear();
}
break;
- // For other auth mechanisms, domain name will be part of username
default:
d->user = user;
break;
@@ -1196,7 +1198,7 @@ static QByteArray qCreatev2Hash(const QAuthenticatorPrivate *ctx,
Q_ASSERT(hashKey.size() == 16);
// Assuming the user and domain is always unicode in challenge
QByteArray message =
- qStringAsUcs2Le(ctx->user.toUpper()) +
+ qStringAsUcs2Le(ctx->extractedUser.toUpper()) +
qStringAsUcs2Le(phase3->domainStr);
phase3->v2Hash = qEncodeHmacMd5(hashKey, message);
@@ -1401,8 +1403,8 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
pb.domainStr = ctx->userDomain;
}
- offset = qEncodeNtlmString(pb.user, offset, ctx->user, unicode);
- pb.userStr = ctx->user;
+ offset = qEncodeNtlmString(pb.user, offset, ctx->extractedUser, unicode);
+ pb.userStr = ctx->extractedUser;
offset = qEncodeNtlmString(pb.workstation, offset, ctx->workstation, unicode);
pb.workstationStr = ctx->workstation;
diff --git a/src/network/kernel/qauthenticator_p.h b/src/network/kernel/qauthenticator_p.h
index 4e09360..9f2e607 100644
--- a/src/network/kernel/qauthenticator_p.h
+++ b/src/network/kernel/qauthenticator_p.h
@@ -71,6 +71,7 @@ public:
QAtomicInt ref;
QString user;
+ QString extractedUser;
QString password;
QVariantHash options;
Method method;