diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-09-10 00:12:31 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-09-10 00:12:31 -0500 |
commit | c6d4bab1608c330c0ef9b0d4b0aea886412c9738 (patch) | |
tree | c5c58623753117d9965861201b456e9652f02a39 /lib/libtdekrb/src/tdekrbclientsocket.cpp | |
parent | a1de7e6e37885e68623757abb7b49665499c77a4 (diff) | |
download | ulab-c6d4bab1608c330c0ef9b0d4b0aea886412c9738.tar.gz ulab-c6d4bab1608c330c0ef9b0d4b0aea886412c9738.zip |
Fix incorrect SASL property fetch calls
This resolves the long-standing incorrect buffer size issues
Diffstat (limited to 'lib/libtdekrb/src/tdekrbclientsocket.cpp')
-rw-r--r-- | lib/libtdekrb/src/tdekrbclientsocket.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/libtdekrb/src/tdekrbclientsocket.cpp b/lib/libtdekrb/src/tdekrbclientsocket.cpp index 15ca9ea..4bf840b 100644 --- a/lib/libtdekrb/src/tdekrbclientsocket.cpp +++ b/lib/libtdekrb/src/tdekrbclientsocket.cpp @@ -810,6 +810,7 @@ void TDEKerberosClientSocket::continueKerberosInitialization() { const char *data = 0; const char *chosenmech = 0; sasl_ssf_t *ssf = 0; + const void *sasl_prop_ptr; if (m_krbInitRunning) { switch (m_krbInitState) { @@ -957,7 +958,8 @@ void TDEKerberosClientSocket::continueKerberosInitialization() { break; case 2: if (state() == TQSocket::Connected) { - m_krbInitResult = sasl_getprop(saslData->m_krbConnection, SASL_USERNAME, (const void **)&data); + m_krbInitResult = sasl_getprop(saslData->m_krbConnection, SASL_USERNAME, &sasl_prop_ptr); + data = (const char *)sasl_prop_ptr; if (m_krbInitResult != SASL_OK) { printf("[WARNING] Unable to determine authenticated username!\n\r"); } @@ -966,7 +968,8 @@ void TDEKerberosClientSocket::continueKerberosInitialization() { } #if 0 - m_krbInitResult = sasl_getprop(saslData->m_krbConnection, SASL_DEFUSERREALM, (const void **)&data); + m_krbInitResult = sasl_getprop(saslData->m_krbConnection, SASL_DEFUSERREALM, &sasl_prop_ptr); + data = (const char *)sasl_prop_ptr; if (m_krbInitResult != SASL_OK) { printf("[WARNING] Unable to determine authenticated realm!\n\r"); } @@ -975,7 +978,8 @@ void TDEKerberosClientSocket::continueKerberosInitialization() { } #endif - m_krbInitResult = sasl_getprop(saslData->m_krbConnection, SASL_SSF, (const void **)&ssf); + m_krbInitResult = sasl_getprop(saslData->m_krbConnection, SASL_SSF, &sasl_prop_ptr); + ssf = (sasl_ssf_t *)sasl_prop_ptr; if (m_krbInitResult != SASL_OK) { printf("[WARNING] Unable to determine SSF!\n\r"); } @@ -983,7 +987,8 @@ void TDEKerberosClientSocket::continueKerberosInitialization() { printf("[DEBUG] Authenticated SSF: %d\n", *ssf); } - m_krbInitResult = sasl_getprop(saslData->m_krbConnection, SASL_MAXOUTBUF, (const void **)&m_negotiatedMaxBufferSize); + m_krbInitResult = sasl_getprop(saslData->m_krbConnection, SASL_MAXOUTBUF, &sasl_prop_ptr); + m_negotiatedMaxBufferSize = *((unsigned*)sasl_prop_ptr); if (m_krbInitResult != SASL_OK) { printf("[WARNING] Unable to determine maximum buffer size!\n\r"); m_negotiatedMaxBufferSize = NET_SEC_BUF_SIZE; |