Trying to use gsasl utf-8 support with libidn.
This commit is contained in:
@@ -322,6 +322,7 @@ win32 {
|
||||
-lgcrypt \
|
||||
-ltasn1 \
|
||||
-lgpg-error \
|
||||
-lidn \
|
||||
-lgsasl
|
||||
LIBS += -lcurl
|
||||
LIBS += -lz
|
||||
|
||||
+1
-1
@@ -134,7 +134,7 @@ win32 {
|
||||
}
|
||||
|
||||
win32-g++ {
|
||||
LIBS += -lgnutls-openssl -lgnutls -lgcrypt -ltasn1 -lgpg-error -lgsasl
|
||||
LIBS += -lgnutls-openssl -lgnutls -lgcrypt -ltasn1 -lgpg-error -lidn -lgsasl
|
||||
LIBS += -lcurl
|
||||
LIBS += -lz
|
||||
LIBS += -llibboost_thread-mgw44-mt
|
||||
|
||||
@@ -96,10 +96,10 @@ SessionData::CreateClientAuthSession(Gsasl *context, const string &userName, con
|
||||
errorCode = gsasl_client_start(context, "SCRAM-SHA-1", &m_authSession);
|
||||
if (errorCode == GSASL_OK)
|
||||
{
|
||||
char *base64User = NULL;
|
||||
gsasl_base64_to(userName.c_str(), userName.length(), &base64User, NULL);
|
||||
gsasl_property_set(m_authSession, GSASL_AUTHID, base64User);
|
||||
gsasl_free(base64User);
|
||||
//char *base64User = NULL;
|
||||
//gsasl_base64_to(userName.c_str(), userName.length(), &base64User, NULL);
|
||||
gsasl_property_set(m_authSession, GSASL_AUTHID, userName.c_str());
|
||||
//gsasl_free(base64User);
|
||||
|
||||
gsasl_property_set(m_authSession, GSASL_PASSWORD, password.c_str());
|
||||
|
||||
@@ -141,14 +141,15 @@ SessionData::AuthGetUser() const
|
||||
string retStr;
|
||||
if (m_authSession)
|
||||
{
|
||||
char *base64User = NULL;
|
||||
size_t lenBase64User = 0;
|
||||
//char *base64User = NULL;
|
||||
//size_t lenBase64User = 0;
|
||||
const char *tmpUser = gsasl_property_fast(m_authSession, GSASL_AUTHID);
|
||||
gsasl_base64_from(tmpUser, strlen(tmpUser), &base64User, &lenBase64User);
|
||||
if (base64User)
|
||||
//gsasl_base64_from(tmpUser, strlen(tmpUser), &base64User, &lenBase64User);
|
||||
if (tmpUser)
|
||||
{
|
||||
retStr = string(base64User, lenBase64User);
|
||||
gsasl_free(base64User);
|
||||
//retStr = string(base64User, lenBase64User);
|
||||
retStr = tmpUser;
|
||||
//gsasl_free(base64User);
|
||||
}
|
||||
}
|
||||
return retStr;
|
||||
|
||||
Reference in New Issue
Block a user