X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=rpa.c;h=3f236ce945c40f56154aa9e75fc033b62e2519ef;hb=adad2fc62f159c7e43c36af0ad4f9bf9f6b3efc7;hp=433c12e6d0f3474056c3ab22c51ba9723f9a6cdd;hpb=c3e52ea6ca3178b7ecab4b389a9ba9269662b48f;p=~andy%2Ffetchmail diff --git a/rpa.c b/rpa.c index 433c12e6..3f236ce9 100644 --- a/rpa.c +++ b/rpa.c @@ -21,11 +21,12 @@ #include #include #include +#include #include "socket.h" #include "fetchmail.h" -#include "md5.h" -#include "i18n.h" +#include "fm_md5.h" +#include "gettext.h" #ifdef TESTMODE extern unsigned char line1[]; @@ -35,23 +36,21 @@ extern unsigned char line3[]; extern int linecount; #endif -#ifndef NO_PROTO - /* prototypes for internal functions */ - static int POP3_rpa_resp(char* argbuf, int socket ); - static void LenAppend(char** pptr, int len); - static int LenSkip(char** pptr, int rxlen); - static int DecBase64(char* bufp); - static void EncBase64(char* bufp, int len); - static void ToUnicode(char** pptr, char delim, unsigned char* buf, int* plen, +/* prototypes for internal functions */ +static int POP3_rpa_resp(char* argbuf, int socket ); +static void LenAppend(char** pptr, int len); +static int LenSkip(char** pptr, int rxlen); +static int DecBase64(char* bufp); +static void EncBase64(char* bufp, int len); +static void ToUnicode(char** pptr, char delim, unsigned char* buf, int* plen, int conv); - static int SetRealmService(char* bufp); - static void GenChallenge(unsigned char* buf, int len); - static int DigestPassphrase(char* passphrase, +static int SetRealmService(char* bufp); +static void GenChallenge(unsigned char* buf, int len); +static int DigestPassphrase(char* passphrase, unsigned char* rbuf, int unicodeit); - static void CompUserResp(); - static int CheckUserAuth(); - static void md5(const void* in, int len, unsigned char* out); -#endif +static void CompUserResp(void); +static int CheckUserAuth(void); +static void md5(const void* in, int len, unsigned char* out); /* RPA protocol definitions */ @@ -114,7 +113,7 @@ int POP3_auth_rpa (char *userid, char *passphrase, int socket) char buf [POPBUFSIZE]; char *bufp; int status,aulin,kuslin; - char* stdec[4] = { N_("Success") , + const char* stdec[4] = { N_("Success") , N_("Restricted user (something wrong with account)") , N_("Invalid userid or passphrase") , N_("Deity error") }; @@ -527,7 +526,7 @@ static int DecBase64(char *bufp) else if ( ch=='+' ) newx = 62; else if ( ch=='/' ) newx = 63; else { - report(stderr, GT_("dec64 error at char %d: %x\n"), inp - bufp, ch); + report(stderr, GT_("dec64 error at char %d: %x\n"), (int)(inp - bufp), ch); return(0); } part=((part & 0x3F)*64) + newx; @@ -883,7 +882,7 @@ static void md5(const void *in_,int len,unsigned char *out) MD5Final( out, &md5context ); if (outlevel >= O_DEBUG) { - report(stdout, GT_("MD5 result is: \n")); + report(stdout, GT_("MD5 result is:\n")); for (i=0; i<16; i++) { report_build(stdout, "%02X ",out[i]);