Trying to use gsasl utf-8 support with libidn.

This commit is contained in:
lotodore
2010-03-24 12:23:20 +00:00
parent 7949b2e91c
commit 9063f2c9e1
3 changed files with 13 additions and 11 deletions
+1
View File
@@ -322,6 +322,7 @@ win32 {
-lgcrypt \ -lgcrypt \
-ltasn1 \ -ltasn1 \
-lgpg-error \ -lgpg-error \
-lidn \
-lgsasl -lgsasl
LIBS += -lcurl LIBS += -lcurl
LIBS += -lz LIBS += -lz
+1 -1
View File
@@ -134,7 +134,7 @@ win32 {
} }
win32-g++ { win32-g++ {
LIBS += -lgnutls-openssl -lgnutls -lgcrypt -ltasn1 -lgpg-error -lgsasl LIBS += -lgnutls-openssl -lgnutls -lgcrypt -ltasn1 -lgpg-error -lidn -lgsasl
LIBS += -lcurl LIBS += -lcurl
LIBS += -lz LIBS += -lz
LIBS += -llibboost_thread-mgw44-mt LIBS += -llibboost_thread-mgw44-mt
+11 -10
View File
@@ -96,10 +96,10 @@ SessionData::CreateClientAuthSession(Gsasl *context, const string &userName, con
errorCode = gsasl_client_start(context, "SCRAM-SHA-1", &m_authSession); errorCode = gsasl_client_start(context, "SCRAM-SHA-1", &m_authSession);
if (errorCode == GSASL_OK) if (errorCode == GSASL_OK)
{ {
char *base64User = NULL; //char *base64User = NULL;
gsasl_base64_to(userName.c_str(), userName.length(), &base64User, NULL); //gsasl_base64_to(userName.c_str(), userName.length(), &base64User, NULL);
gsasl_property_set(m_authSession, GSASL_AUTHID, base64User); gsasl_property_set(m_authSession, GSASL_AUTHID, userName.c_str());
gsasl_free(base64User); //gsasl_free(base64User);
gsasl_property_set(m_authSession, GSASL_PASSWORD, password.c_str()); gsasl_property_set(m_authSession, GSASL_PASSWORD, password.c_str());
@@ -141,14 +141,15 @@ SessionData::AuthGetUser() const
string retStr; string retStr;
if (m_authSession) if (m_authSession)
{ {
char *base64User = NULL; //char *base64User = NULL;
size_t lenBase64User = 0; //size_t lenBase64User = 0;
const char *tmpUser = gsasl_property_fast(m_authSession, GSASL_AUTHID); const char *tmpUser = gsasl_property_fast(m_authSession, GSASL_AUTHID);
gsasl_base64_from(tmpUser, strlen(tmpUser), &base64User, &lenBase64User); //gsasl_base64_from(tmpUser, strlen(tmpUser), &base64User, &lenBase64User);
if (base64User) if (tmpUser)
{ {
retStr = string(base64User, lenBase64User); //retStr = string(base64User, lenBase64User);
gsasl_free(base64User); retStr = tmpUser;
//gsasl_free(base64User);
} }
} }
return retStr; return retStr;