diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-26 17:57:01 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-26 17:57:01 +0300 |
commit | 7a135968ad505c9ac82d56e27773a33ea77ccfdc (patch) | |
tree | c9f150590d322dd4753747a179a6e49abac16a1b /protocols/JabberG | |
parent | a35c9ea8f4020e08d04f5366d433734fef41edbd (diff) |
Jabber: fix for SCRAM-xxx-PLUS login
Diffstat (limited to 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber_secur.cpp | 25 |
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);
|