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