summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-26 17:57:01 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-26 17:57:01 +0300
commit7a135968ad505c9ac82d56e27773a33ea77ccfdc (patch)
treec9f150590d322dd4753747a179a6e49abac16a1b /protocols/JabberG
parenta35c9ea8f4020e08d04f5366d433734fef41edbd (diff)
Jabber: fix for SCRAM-xxx-PLUS login
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index 263574c448..9fe33337a6 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -209,18 +209,6 @@ TScramAuth::TScramAuth(ThreadData *info, const char *pszMech, const EVP_MD *pMet
hashMethod(pMethod)
{
priority = iPriority;
-
- if ((iPriority % 10) == 1) {
- int cbLen, tlsVer = info->proto->m_bTlsExporter;
- void *pData = Netlib_GetTlsUnique(info->s, cbLen, tlsVer);
- if (pData == nullptr)
- bIsValid = false;
- else {
- bindFlag = (tlsVer == 13) ? "p=tls-exporter,," : "p=tls-unique,,";
- bindData.append(pData, cbLen);
- }
- }
- else bindFlag = "n,,";
}
TScramAuth::~TScramAuth()
@@ -254,6 +242,19 @@ char* TScramAuth::getInitialRequest()
Utils_GetRandom(nonce, sizeof(nonce));
cnonce = mir_base64_encode(nonce, sizeof(nonce));
+ if ((priority % 10) == 1) {
+ if (info->proto->m_bTlsExporter) {
+ int cbLen, tlsVer = true;
+ void *pData = Netlib_GetTlsUnique(info->s, cbLen, tlsVer);
+ if (pData == nullptr)
+ return nullptr;
+
+ bindFlag = (tlsVer == 13) ? "p=tls-exporter,," : "p=tls-unique,,";
+ bindData.append(pData, cbLen);
+ }
+ }
+ else bindFlag = "n,,";
+
CMStringA buf(FORMAT, "n=%s,r=%s", info->conn.username, cnonce);
msg1 = mir_strdup(buf);