aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lluserauth.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/lluserauth.cpp62
1 files changed, 15 insertions, 47 deletions
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 @@
38#include <iterator> 38#include <iterator>
39 39
40#include "lldir.h" 40#include "lldir.h"
41#include "llversionviewer.h"
41#include "llappviewer.h" 42#include "llappviewer.h"
43#include "llviewerbuild.h"
42#include "llviewercontrol.h" 44#include "llviewercontrol.h"
43#include "llxmlrpctransaction.h" 45#include "llxmlrpctransaction.h"
44#include "llmd5.h" 46#include "llsdutil.h"
45 47
46// NOTE: MUST include these after otherincludes since queue gets redefined!?!! 48// NOTE: MUST include these after otherincludes since queue gets redefined!?!!
47#include <curl/curl.h> 49#include <curl/curl.h>
@@ -69,7 +71,8 @@ static const char* PLATFORM_STRING = "Sol";
69 71
70LLUserAuth::LLUserAuth() : 72LLUserAuth::LLUserAuth() :
71 mTransaction(NULL), 73 mTransaction(NULL),
72 mLastTransferRateBPS(0) 74 mLastTransferRateBPS(0),
75 mResult(LLSD())
73{ 76{
74 mAuthResponse = E_NO_RESPONSE_YET; 77 mAuthResponse = E_NO_RESPONSE_YET;
75} 78}
@@ -85,6 +88,7 @@ void LLUserAuth::reset()
85 mTransaction = NULL; 88 mTransaction = NULL;
86 mResponses.clear(); 89 mResponses.clear();
87 mOptions.clear(); 90 mOptions.clear();
91 mResult.clear();
88} 92}
89 93
90 94
@@ -114,25 +118,8 @@ void LLUserAuth::authenticate(
114 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL; 118 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL;
115 119
116 mAuthResponse = E_NO_RESPONSE_YET; 120 mAuthResponse = E_NO_RESPONSE_YET;
117 //mDownloadTimer.reset(); 121 //mDownloadTimer.reset();
118 122
119 std::string strMac;
120 std::string strHDD;
121 char mac[MAX_STRING];
122 char hdd[MAX_STRING];
123
124 strMac.assign(web_login_key.asString());
125 strMac.append(hashed_mac.c_str());
126
127 strHDD.assign(web_login_key.asString());
128 strHDD.append(hashed_volume_serial.c_str());
129
130 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
131 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
132
133 md5Mac.hex_digest(mac);
134 md5HDD.hex_digest(hdd);
135
136 // create the request 123 // create the request
137 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 124 XMLRPC_REQUEST request = XMLRPC_RequestNew();
138 XMLRPC_RequestSetMethodName(request, method.c_str()); 125 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -147,9 +134,10 @@ void LLUserAuth::authenticate(
147 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 134 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
148 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 135 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
149 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 136 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
150 XMLRPC_VectorAppendString(params, "mac", mac, 0); 137 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0);
151 // A bit of security through obscurity: id0 is volume_serial 138 // A bit of security through obscurity: id0 is volume_serial
152 XMLRPC_VectorAppendString(params, "id0", hdd, 0); 139 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0);
140
153 if (skip_optional) 141 if (skip_optional)
154 { 142 {
155 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 143 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);
@@ -218,28 +206,7 @@ void LLUserAuth::authenticate(
218 206
219 mAuthResponse = E_NO_RESPONSE_YET; 207 mAuthResponse = E_NO_RESPONSE_YET;
220 //mDownloadTimer.reset(); 208 //mDownloadTimer.reset();
221 209
222 std::string strMac;
223 std::string strHDD;
224 char mac[MAX_STRING];
225 char hdd[MAX_STRING];
226
227 strMac.assign(firstname);
228 strMac.append(lastname);
229 strMac.append(dpasswd.c_str());
230 strMac.append(hashed_mac.c_str());
231
232 strHDD.assign(firstname);
233 strHDD.append(lastname);
234 strHDD.append(dpasswd.c_str());
235 strHDD.append(hashed_volume_serial.c_str());
236
237 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
238 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
239
240 md5Mac.hex_digest(mac);
241 md5HDD.hex_digest(hdd);
242
243 // create the request 210 // create the request
244 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 211 XMLRPC_REQUEST request = XMLRPC_RequestNew();
245 XMLRPC_RequestSetMethodName(request, method.c_str()); 212 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -254,9 +221,10 @@ void LLUserAuth::authenticate(
254 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 221 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
255 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 222 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
256 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 223 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
257 XMLRPC_VectorAppendString(params, "mac", mac, 0); 224 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0);
258 // A bit of security through obscurity: id0 is volume_serial 225 // A bit of security through obscurity: id0 is volume_serial
259 XMLRPC_VectorAppendString(params, "id0", hdd, 0); 226 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0);
227
260 if (skip_optional) 228 if (skip_optional)
261 { 229 {
262 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 230 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);