From 9063f2c9e15a5552f5e2bdbb4f4bd13aadbb080e Mon Sep 17 00:00:00 2001 From: lotodore Date: Wed, 24 Mar 2010 12:23:20 +0000 Subject: [PATCH] Trying to use gsasl utf-8 support with libidn. --- pokerth_game.pro | 1 + pokerth_server.pro | 2 +- src/net/common/sessiondata.cpp | 21 +++++++++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pokerth_game.pro b/pokerth_game.pro index e8a5628b..13e0b90a 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -322,6 +322,7 @@ win32 { -lgcrypt \ -ltasn1 \ -lgpg-error \ + -lidn \ -lgsasl LIBS += -lcurl LIBS += -lz diff --git a/pokerth_server.pro b/pokerth_server.pro index 85ca17d5..3e8c0218 100644 --- a/pokerth_server.pro +++ b/pokerth_server.pro @@ -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 diff --git a/src/net/common/sessiondata.cpp b/src/net/common/sessiondata.cpp index 934695a5..409698f9 100644 --- a/src/net/common/sessiondata.cpp +++ b/src/net/common/sessiondata.cpp @@ -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;