summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp17
-rw-r--r--protocols/JabberG/src/jabber_secur.h1
2 files changed, 10 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index c92cc4dc64..a4f21a7d77 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -51,6 +51,14 @@ TNtlmAuth::TNtlmAuth(ThreadData *info, const char *mechanism) :
if ((hProvider = Netlib_InitSecurityProvider(szProvider, szSpn)) == nullptr)
return;
+ // This generates login method advertisement packet
+ if (info->conn.password[0] != 0)
+ szInitRequest = Netlib_NtlmCreateResponse(hProvider, "", Utf2T(info->conn.username), Utf2T(info->conn.password), complete);
+ else
+ szInitRequest = Netlib_NtlmCreateResponse(hProvider, "", nullptr, nullptr, complete);
+ if (szInitRequest == nullptr)
+ return;
+
bIsValid = true;
}
@@ -98,14 +106,7 @@ bool TNtlmAuth::getSpn(wchar_t* szSpn, size_t dwSpnLen)
char* TNtlmAuth::getInitialRequest()
{
- if (!hProvider)
- return nullptr;
-
- // This generates login method advertisement packet
- if (info->conn.password[0] != 0)
- return Netlib_NtlmCreateResponse(hProvider, "", Utf2T(info->conn.username), Utf2T(info->conn.password), complete);
-
- return Netlib_NtlmCreateResponse(hProvider, "", nullptr, nullptr, complete);
+ return szInitRequest.detach();
}
char* TNtlmAuth::getChallenge(const char *challenge)
diff --git a/protocols/JabberG/src/jabber_secur.h b/protocols/JabberG/src/jabber_secur.h
index 14ad699b70..26286b491b 100644
--- a/protocols/JabberG/src/jabber_secur.h
+++ b/protocols/JabberG/src/jabber_secur.h
@@ -110,6 +110,7 @@ class TNtlmAuth : public TJabberAuth
typedef TJabberAuth CSuper;
HANDLE hProvider;
+ ptrA szInitRequest;
public:
TNtlmAuth(ThreadData*, const char* mechanism);