From 9186d15356a46576fb5b306f49a6acdb64fb7622 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 17 Feb 2008 11:26:44 +0000 Subject: 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. --- protocols/msn/passport.c | 5 +++++ protocols/msn/passport.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'protocols') 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; -- cgit v1.2.3