aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lluserauth.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lluserauth.cpp')
-rw-r--r--linden/indra/newview/lluserauth.cpp53
1 files changed, 46 insertions, 7 deletions
diff --git a/linden/indra/newview/lluserauth.cpp b/linden/indra/newview/lluserauth.cpp
index 23965d1..b19692f 100644
--- a/linden/indra/newview/lluserauth.cpp
+++ b/linden/indra/newview/lluserauth.cpp
@@ -43,6 +43,7 @@
43#include "llviewerbuild.h" 43#include "llviewerbuild.h"
44#include "llviewercontrol.h" 44#include "llviewercontrol.h"
45#include "llxmlrpctransaction.h" 45#include "llxmlrpctransaction.h"
46#include "llmd5.h"
46 47
47// NOTE: MUST include these after otherincludes since queue gets redefined!?!! 48// NOTE: MUST include these after otherincludes since queue gets redefined!?!!
48#include <curl/curl.h> 49#include <curl/curl.h>
@@ -115,8 +116,25 @@ void LLUserAuth::authenticate(
115 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL; 116 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL;
116 117
117 mAuthResponse = E_NO_RESPONSE_YET; 118 mAuthResponse = E_NO_RESPONSE_YET;
118 //mDownloadTimer.reset(); 119 //mDownloadTimer.reset();
119 120
121 std::string strMac;
122 std::string strHDD;
123 char mac[MAX_STRING];
124 char hdd[MAX_STRING];
125
126 strMac.assign(web_login_key.asString());
127 strMac.append(hashed_mac.c_str());
128
129 strHDD.assign(web_login_key.asString());
130 strHDD.append(hashed_volume_serial.c_str());
131
132 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
133 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
134
135 md5Mac.hex_digest(mac);
136 md5HDD.hex_digest(hdd);
137
120 // create the request 138 // create the request
121 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 139 XMLRPC_REQUEST request = XMLRPC_RequestNew();
122 XMLRPC_RequestSetMethodName(request, method.c_str()); 140 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -131,9 +149,9 @@ void LLUserAuth::authenticate(
131 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 149 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
132 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 150 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
133 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 151 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
134 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); 152 XMLRPC_VectorAppendString(params, "mac", mac, 0);
135 // A bit of security through obscurity: id0 is volume_serial 153 // A bit of security through obscurity: id0 is volume_serial
136 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); 154 XMLRPC_VectorAppendString(params, "id0", hdd, 0);
137 if (skip_optional) 155 if (skip_optional)
138 { 156 {
139 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 157 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);
@@ -202,7 +220,28 @@ void LLUserAuth::authenticate(
202 220
203 mAuthResponse = E_NO_RESPONSE_YET; 221 mAuthResponse = E_NO_RESPONSE_YET;
204 //mDownloadTimer.reset(); 222 //mDownloadTimer.reset();
205 223
224 std::string strMac;
225 std::string strHDD;
226 char mac[MAX_STRING];
227 char hdd[MAX_STRING];
228
229 strMac.assign(firstname);
230 strMac.append(lastname);
231 strMac.append(dpasswd.c_str());
232 strMac.append(hashed_mac.c_str());
233
234 strHDD.assign(firstname);
235 strHDD.append(lastname);
236 strHDD.append(dpasswd.c_str());
237 strHDD.append(hashed_volume_serial.c_str());
238
239 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
240 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
241
242 md5Mac.hex_digest(mac);
243 md5HDD.hex_digest(hdd);
244
206 // create the request 245 // create the request
207 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 246 XMLRPC_REQUEST request = XMLRPC_RequestNew();
208 XMLRPC_RequestSetMethodName(request, method.c_str()); 247 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -217,9 +256,9 @@ void LLUserAuth::authenticate(
217 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 256 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
218 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 257 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
219 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 258 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
220 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); 259 XMLRPC_VectorAppendString(params, "mac", mac, 0);
221 // A bit of security through obscurity: id0 is volume_serial 260 // A bit of security through obscurity: id0 is volume_serial
222 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); 261 XMLRPC_VectorAppendString(params, "id0", hdd, 0);
223 if (skip_optional) 262 if (skip_optional)
224 { 263 {
225 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 264 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);