summaryrefslogtreecommitdiff
path: root/MySpace/server_con.cpp
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-03 01:03:35 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-03 01:03:35 +0000
commitf44474ebf5d3a34f47a75ccd2a2924f1d6fbb804 (patch)
tree55797322eb6719aeb14e80f7f6cd3b44ca7c99f2 /MySpace/server_con.cpp
parent59e7fddf68763f1206e9cd9a104edf7569ed8a9c (diff)
only use first 10 chars of password
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@246 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'MySpace/server_con.cpp')
-rw-r--r--MySpace/server_con.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/MySpace/server_con.cpp b/MySpace/server_con.cpp
index 94c0cc5..baf506f 100644
--- a/MySpace/server_con.cpp
+++ b/MySpace/server_con.cpp
@@ -183,16 +183,19 @@ void try_login(NetMessage &msg, HANDLE connection) {
char *ch_resp;
mir_sha1_byte_t pw_hash[20];
int ch_resp_size;
- wchar_t wpw[256];
mir_sha1_byte_t key[20];
char email[256];
+ // only use first 10 chars of pw
+ wchar_t wpw[11];
+ wpw[10] = 0;
+
#ifdef _UNICODE
- _tcscpy(wpw, options.pw);
+ _tcsncpy(wpw, options.pw, 10);
WideCharToMultiByte(CP_UTF8, 0, options.email, -1, email, 256, 0, 0);
#else
strcpy(email, options.email);
- MultiByteToWideChar(code_page, 0, options.pw, -1, wpw, 256);
+ MultiByteToWideChar(code_page, 0, options.pw, -1, wpw, 10);
#endif
sha1.sha1_hash((mir_sha1_byte_t*)wpw, wcslen(wpw) * sizeof(wchar_t), pw_hash);