diff options
author | George Hazan <ghazan@miranda.im> | 2020-07-14 18:34:12 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-07-14 18:34:12 +0300 |
commit | 48d7b407e3c7b8bbd2758b90146dd08e06281745 (patch) | |
tree | 76d67f0253b48184a15cb60876d35ec96b945039 | |
parent | dd925ffda8f7c62cc18d2dcf852f8fccd4c04836 (diff) |
more logs for #2486
-rw-r--r-- | src/core/stdssl/src/netlibssl.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/stdssl/src/netlibssl.cpp b/src/core/stdssl/src/netlibssl.cpp index 8781e4ea20..0c16f9fdb5 100644 --- a/src/core/stdssl/src/netlibssl.cpp +++ b/src/core/stdssl/src/netlibssl.cpp @@ -754,13 +754,13 @@ int NetlibSslWrite(SslHandle *ssl, const char *buf, int num) static void* NetlibSslUnique(SslHandle *ssl, int *cbLen)
{
*cbLen = 0;
- if (!IsWinVer7Plus()) // XP doesn't support that functionality
- return nullptr;
SEC_CHANNEL_BINDINGS bindings;
SECURITY_STATUS scRet = g_pSSPI->QueryContextAttributesW(&ssl->hContext, SECPKG_ATTR_UNIQUE_BINDINGS, &bindings);
- if (scRet != SEC_E_OK)
+ if (scRet != SEC_E_OK) {
+ Netlib_Logf(nullptr, "NetlibSslUnique() failed with error %08x", scRet);
return nullptr;
+ }
LPBYTE pBuf = LPBYTE(bindings.dwInitiatorOffset);
if (bindings.dwInitiatorOffset == 0) {
@@ -772,8 +772,12 @@ static void* NetlibSslUnique(SslHandle *ssl, int *cbLen) bindings = *(SEC_CHANNEL_BINDINGS *)bindings.dwInitiatorOffset;
pBuf += bindings.dwApplicationDataOffset;
- if (memcmp(pBuf, "tls-unique:", 11))
+ if (memcmp(pBuf, "tls-unique:", 11)) {
+ CMStringA tmp(' ', bindings.cbApplicationDataLength * 2);
+ bin2hex(pBuf, bindings.cbApplicationDataLength, tmp.GetBuffer());
+ Netlib_Logf(nullptr, "NetlibSslUnique() failed: bad buffer: %s", tmp.c_str());
return nullptr;
+ }
pBuf += 11; bindings.cbApplicationDataLength -= 11;
*cbLen = bindings.cbApplicationDataLength;
|