#ifdef OPIE_ENABLE
if ((ctl->server.authenticate == A_ANY
|| ctl->server.authenticate == A_OTP)
- && strstr(capabilities, "AUTH=X-OTP"))
+ && strstr(capabilities, "AUTH=X-OTP")) {
if ((ok = do_otp(sock, "AUTHENTICATE", ctl)))
{
/* SASL cancellation of authentication */
gen_send(sock, "*");
if(ctl->server.authenticate != A_ANY)
return ok;
- }
- else
+ } else {
return ok;
+ }
+ }
#else
if (ctl->server.authenticate == A_OTP)
{
gen_send(sock, "%s X-OTP", command);
- if (rval = gen_recv(sock, buffer, sizeof(buffer)))
+ if ((rval = gen_recv(sock, buffer, sizeof(buffer))))
return rval;
if (strncmp(buffer, "+", 1)) {
gen_send(sock, buffer, sizeof(buffer));
suppress_tags = FALSE;
- if (rval = gen_recv(sock, buffer, sizeof(buffer)))
+ if ((rval = gen_recv(sock, buffer, sizeof(buffer))))
return rval;
memset(challenge, '\0', sizeof(challenge));
gen_send(sock, buffer, strlen(buffer));
suppress_tags = FALSE;
- if (rval = gen_recv(sock, buffer, sizeof(buffer)))
+ if ((rval = gen_recv(sock, buffer, sizeof(buffer))))
return rval;
if (result)
#if defined(STDC_HEADERS)
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
#include "fetchmail.h"
#include "socket.h"
"HELO %s %s",
ctl->remotename, ctl->password);
shroud[0] = '\0';
+ return status;
}
static int pop2_getrange(int sock, struct query *ctl, const char *folder,
return(gen_transact(sock, "QUIT"));
}
-const static struct method pop2 =
+static const struct method pop2 =
{
"POP2", /* Post Office Protocol v2 */
#if INET6_ENABLE
#if defined(POP3_ENABLE) && defined(RPA_ENABLE)
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
-#include <string.h>
+#include <string.h>
#include "socket.h"
#include "fetchmail.h"
}
if (status != 0)
{
- if (outlevel > O_SILENT)
- if (status < 4)
+ if (outlevel > O_SILENT) {
+ if (status < 4) {
report(stderr, GT_("RPA rejects you: %s\n"),GT_(stdec[status]));
- else
+ } else {
report(stderr, GT_("RPA rejects you, reason unknown\n"));
+ }
+ }
return(PS_AUTHFAIL);
}
if (Aul != aulin)
globals: reads outlevel;
*********************************************************************/
-static void ToUnicode(pptr,delim,buf,plen,conv)
-unsigned char **pptr; /* input string */
-unsigned char delim;
-unsigned char *buf; /* output buffer */
-int *plen;
-int conv;
+static void ToUnicode(unsigned char **pptr /* input string*/,
+ unsigned char delim, unsigned char *buf /* output buffer */,
+ int *plen, int conv)
{
unsigned char *p;
int i;
writes Ns Nsl Nr Nrl
*********************************************************************/
-static int SetRealmService(bufp)
-unsigned char* bufp;
+static int SetRealmService(unsigned char *bufp)
{
/* For the moment we pick the first available realm. It would */
/* make more sense to verify that the realm which the user */
reads /dev/random
*********************************************************************/
-static void GenChallenge(buf,len)
-unsigned char *buf;
-int len;
+static void GenChallenge(unsigned char *buf, int len)
{
int i;
FILE *devrandom;
writes Pu.
*********************************************************************/
-static int DigestPassphrase(passphrase,rbuf,unicodeit)
-unsigned char *passphrase;
-unsigned char *rbuf;
-int unicodeit;
+static int DigestPassphrase(unsigned char *passphrase,unsigned char *rbuf,
+ int unicodeit)
{
int len;
unsigned char workarea[STRMAX];
writes Ru.
*********************************************************************/
-static void CompUserResp()
+static void CompUserResp(void)
{
unsigned char workarea[Pul+48+STRMAX*5+Tsl+Pul];
unsigned char* p;
writes Ru.
*********************************************************************/
-static int CheckUserAuth()
+static int CheckUserAuth(void)
{
unsigned char workarea[Pul+48+STRMAX*7+Tsl+Pul];
unsigned char* p;
globals: reads outlevel
*********************************************************************/
-static void md5(in,len,out)
-unsigned char* in;
-int len;
-unsigned char* out;
+static void md5(unsigned char *in,int len,unsigned char *out)
{
int i;
MD5_CTX md5context;