aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-02-17 11:26:44 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2008-02-17 11:26:44 +0000
commit9186d15356a46576fb5b306f49a6acdb64fb7622 (patch)
treeba8040110d4bdfe3c38abc4005c24f25a8dbc90b
parente6648bf3b821ae40c0640857aae069bc0f5d90c4 (diff)
Automatically truncate MSN passports to 16 characters because that's the
maximum supported by MSN and giving a longer password will make the authentication fail.
-rw-r--r--protocols/msn/passport.c5
-rw-r--r--protocols/msn/passport.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/protocols/msn/passport.c b/protocols/msn/passport.c
index 7a15c3fe..565d15f3 100644
--- a/protocols/msn/passport.c
+++ b/protocols/msn/passport.c
@@ -52,6 +52,11 @@ int passport_get_token( gpointer func, gpointer data, char *username, char *pass
if( mad->cookie[i] == ',' )
mad->cookie[i] = '&';
+ /* Microsoft doesn't allow password longer than 16 chars and silently
+ fails authentication if you give the "full version" of your passwd. */
+ if( strlen( mad->password ) > MAX_PASSPORT_PWLEN )
+ mad->password[MAX_PASSPORT_PWLEN] = 0;
+
return passport_get_token_real( mad );
}
diff --git a/protocols/msn/passport.h b/protocols/msn/passport.h
index 1d0c6edc..517d2e91 100644
--- a/protocols/msn/passport.h
+++ b/protocols/msn/passport.h
@@ -35,6 +35,8 @@
#endif
#include "nogaim.h"
+#define MAX_PASSPORT_PWLEN 16
+
struct msn_auth_data
{
char *url;