From 074a765cb0ff07a0b89b9d3e75aa1572e88920a1 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 8 Apr 2011 14:34:17 +0200 Subject: fix Bug #857: Imprudence lluserauth reports different mac address than other 1.23/SG1.x viewers this just takes lluserauth from SG1.5 --- linden/indra/newview/lluserauth.cpp | 62 +++++++++---------------------------- linden/indra/newview/lluserauth.h | 7 ++++- 2 files changed, 21 insertions(+), 48 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/lluserauth.cpp b/linden/indra/newview/lluserauth.cpp index d76ed72..86d35e2 100644 --- a/linden/indra/newview/lluserauth.cpp +++ b/linden/indra/newview/lluserauth.cpp @@ -38,10 +38,12 @@ #include #include "lldir.h" +#include "llversionviewer.h" #include "llappviewer.h" +#include "llviewerbuild.h" #include "llviewercontrol.h" #include "llxmlrpctransaction.h" -#include "llmd5.h" +#include "llsdutil.h" // NOTE: MUST include these after otherincludes since queue gets redefined!?!! #include @@ -69,7 +71,8 @@ static const char* PLATFORM_STRING = "Sol"; LLUserAuth::LLUserAuth() : mTransaction(NULL), - mLastTransferRateBPS(0) + mLastTransferRateBPS(0), + mResult(LLSD()) { mAuthResponse = E_NO_RESPONSE_YET; } @@ -85,6 +88,7 @@ void LLUserAuth::reset() mTransaction = NULL; mResponses.clear(); mOptions.clear(); + mResult.clear(); } @@ -114,25 +118,8 @@ void LLUserAuth::authenticate( LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL; mAuthResponse = E_NO_RESPONSE_YET; - //mDownloadTimer.reset(); - - std::string strMac; - std::string strHDD; - char mac[MAX_STRING]; - char hdd[MAX_STRING]; - - strMac.assign(web_login_key.asString()); - strMac.append(hashed_mac.c_str()); - - strHDD.assign(web_login_key.asString()); - strHDD.append(hashed_volume_serial.c_str()); - - LLMD5 md5Mac((const unsigned char *)strMac.c_str()); - LLMD5 md5HDD((const unsigned char *)strHDD.c_str()); - - md5Mac.hex_digest(mac); - md5HDD.hex_digest(hdd); - + //mDownloadTimer.reset(); + // create the request XMLRPC_REQUEST request = XMLRPC_RequestNew(); XMLRPC_RequestSetMethodName(request, method.c_str()); @@ -147,9 +134,10 @@ void LLUserAuth::authenticate( XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); - XMLRPC_VectorAppendString(params, "mac", mac, 0); + XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); // A bit of security through obscurity: id0 is volume_serial - XMLRPC_VectorAppendString(params, "id0", hdd, 0); + XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); + if (skip_optional) { XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); @@ -218,28 +206,7 @@ void LLUserAuth::authenticate( mAuthResponse = E_NO_RESPONSE_YET; //mDownloadTimer.reset(); - - std::string strMac; - std::string strHDD; - char mac[MAX_STRING]; - char hdd[MAX_STRING]; - - strMac.assign(firstname); - strMac.append(lastname); - strMac.append(dpasswd.c_str()); - strMac.append(hashed_mac.c_str()); - - strHDD.assign(firstname); - strHDD.append(lastname); - strHDD.append(dpasswd.c_str()); - strHDD.append(hashed_volume_serial.c_str()); - - LLMD5 md5Mac((const unsigned char *)strMac.c_str()); - LLMD5 md5HDD((const unsigned char *)strHDD.c_str()); - - md5Mac.hex_digest(mac); - md5HDD.hex_digest(hdd); - + // create the request XMLRPC_REQUEST request = XMLRPC_RequestNew(); XMLRPC_RequestSetMethodName(request, method.c_str()); @@ -254,9 +221,10 @@ void LLUserAuth::authenticate( XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); - XMLRPC_VectorAppendString(params, "mac", mac, 0); + XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); // A bit of security through obscurity: id0 is volume_serial - XMLRPC_VectorAppendString(params, "id0", hdd, 0); + XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); + if (skip_optional) { XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); diff --git a/linden/indra/newview/lluserauth.h b/linden/indra/newview/lluserauth.h index 0af8718..85cc180 100644 --- a/linden/indra/newview/lluserauth.h +++ b/linden/indra/newview/lluserauth.h @@ -127,6 +127,11 @@ public: const std::string& hashed_volume_serial); UserAuthcode authResponse(); + // mResult contains the responses we get through the login process + // + LLSD mResult; // OGPX : *way* different access of auth result in OGP. + UserAuthcode mAuthResponse; // OGPX TODO: proper access functions + // clears out internal data cache. void reset(); @@ -143,7 +148,7 @@ public: private: LLXMLRPCTransaction* mTransaction; - UserAuthcode mAuthResponse; + std::string mErrorMessage; // dealing with the XML -- cgit v1.1