X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=rpa.c;h=c365f0ded8b2338ed9a1b2792557c4d0da07b209;hb=5b0e1fdef9c55b9c8a54f5c146fc84dab3b82e63;hp=79e4d8ab5c378c7b492a30521e9fbb8aef71651c;hpb=d57b00768a8fa44d1e1c5f758440edabfa488baf;p=~andy%2Ffetchmail diff --git a/rpa.c b/rpa.c index 79e4d8ab..c365f0de 100644 --- a/rpa.c +++ b/rpa.c @@ -21,10 +21,11 @@ #include #include #include +#include #include "socket.h" #include "fetchmail.h" -#include "md5.h" +#include "fm_md5.h" #include "i18n.h" #ifdef TESTMODE @@ -48,9 +49,9 @@ extern int linecount; 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(void* in, int len, unsigned char* out); + static void CompUserResp(void); + static int CheckUserAuth(void); + static void md5(const void* in, int len, unsigned char* out); #endif /* RPA protocol definitions */ @@ -114,7 +115,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") }; @@ -360,9 +361,7 @@ int POP3_auth_rpa (char *userid, char *passphrase, int socket) globals: reads outlevel. *********************************************************************/ -static int POP3_rpa_resp (argbuf,socket) -char *argbuf; -int socket; +static int POP3_rpa_resp (char *argbuf, int socket) { int ok; char buf [POPBUFSIZE]; @@ -419,9 +418,7 @@ int socket; globals: none *********************************************************************/ -static void LenAppend(pptr_,len) -char **pptr_; -int len; +static void LenAppend(char **pptr_, int len) { unsigned char **pptr = (unsigned char **)pptr_; @@ -455,9 +452,7 @@ int len; globals: reads outlevel. *********************************************************************/ -int LenSkip(pptr,rxlen) -char **pptr; -int rxlen; +int LenSkip(char **pptr, int rxlen) { int len; char *save; @@ -517,8 +512,7 @@ int rxlen; globals: reads outlevel. *********************************************************************/ -static int DecBase64(bufp) -char *bufp; +static int DecBase64(char *bufp) { unsigned int newx, bits=0, cnt=0, i, part=0; unsigned char ch; @@ -534,7 +528,7 @@ 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; @@ -576,9 +570,7 @@ char *bufp; globals: reads outlevel; *********************************************************************/ -static void EncBase64(bufp,len) -char *bufp; -int len; +static void EncBase64(char *bufp, int len) { char* outp; unsigned char c1,c2,c3; @@ -871,11 +863,11 @@ static int CheckUserAuth(void) globals: reads outlevel *********************************************************************/ -static void md5(void *in_,int len,unsigned char *out) +static void md5(const void *in_,int len,unsigned char *out) { int i; MD5_CTX md5context; - unsigned char *in = in_; + const unsigned char *in = (const unsigned char *)in_; if (outlevel >= O_DEBUG) { @@ -892,7 +884,7 @@ static void md5(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]);