summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-04-14 17:54:24 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2020-04-30 13:45:55 +0200
commit8e4c32857de277c36a4876d5d4e5df8e3b84f18c (patch)
treedd679fcaf2646fdf77aa6cee1426d0607fb3d133 /src/network
parentc78a960198d59fb9a9ddd83ad7098b1db396edfd (diff)
QAuthenticator: make sure we load the SSPI library
Change-Id: Iac371065dfc20ad5920889be66c8282a45c5805e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/kernel/qauthenticator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index c95b1280b0..3ac54605e4 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -71,6 +71,7 @@ QT_BEGIN_NAMESPACE
static QByteArray qNtlmPhase1();
static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phase2data);
#if QT_CONFIG(sspi) // SSPI
+static bool q_SSPI_library_load();
static QByteArray qSspiStartup(QAuthenticatorPrivate *ctx, QAuthenticatorPrivate::Method method,
const QString& host);
static QByteArray qSspiContinue(QAuthenticatorPrivate *ctx, QAuthenticatorPrivate::Method method,
@@ -503,8 +504,13 @@ QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMet
if (challenge.isEmpty()) {
#if QT_CONFIG(sspi) // SSPI
QByteArray phase1Token;
- if (user.isEmpty()) // Only pull from system if no user was specified in authenticator
+ if (user.isEmpty()) { // Only pull from system if no user was specified in authenticator
phase1Token = qSspiStartup(this, method, host);
+ } else if (!q_SSPI_library_load()) {
+ // Since we're not running qSspiStartup we have to make sure the library is loaded
+ qWarning("Failed to load the SSPI libraries");
+ return "";
+ }
if (!phase1Token.isEmpty()) {
response = phase1Token.toBase64();
phase = Phase2;