aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac6
-rw-r--r--cram.c8
-rw-r--r--fetchmail.h8
-rw-r--r--fm_md5.h (renamed from md5.h)13
-rw-r--r--gssapi.c2
-rw-r--r--md5c.c2
-rw-r--r--md5ify.c2
-rw-r--r--opie.c2
-rw-r--r--pop3.c2
-rw-r--r--rpa.c5
-rw-r--r--smbutil.c10
-rw-r--r--smtp.c2
-rw-r--r--transact.c2
14 files changed, 37 insertions, 29 deletions
diff --git a/Makefile.am b/Makefile.am
index 488346d3..900ea59e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,7 +61,7 @@ TESTS+= t.regression
endif
fetchmail_SOURCES= fetchmail.h getopt.h \
- i18n.h kerberos.h md5.h mx.h netrc.h smtp.h \
+ i18n.h kerberos.h fm_md5.h mx.h netrc.h smtp.h \
socket.h tunable.h \
socket.c getpass.c \
fetchmail.c env.c idle.c options.c daemon.c \
diff --git a/configure.ac b/configure.ac
index 69e38390..6f47a32c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,7 @@ AC_TYPE_SIGNAL
AC_CHECK_HEADERS([unistd.h termios.h termio.h sgtty.h stdarg.h \
sys/itimer.h fcntl.h sys/fcntl.h memory.h sys/wait.h \
arpa/inet.h arpa/nameser.h netinet/in.h net/socket.h netdb.h \
- sys/select.h sys/socket.h sys/time.h langinfo.h])
+ sys/select.h sys/socket.h sys/time.h langinfo.h md5.h])
if test _$ac_cv_header_stdarg_h != _yes ; then
AC_MSG_WARN([stdarg.h is not defined. Unsupported configuration, proceed at your own risk.])
fi
@@ -502,7 +502,7 @@ AC_CACHE_CHECK([for getnameinfo],[fm_cv_getnameinfo],[
#include <netdb.h>
#endif
#ifndef NULL
-#define NULL ((void *)0)
+#define NULL 0
#endif
], [getnameinfo(NULL,0, NULL,0, NULL, 0, 0);],
[ fm_cv_getnameinfo=yes],
@@ -791,7 +791,7 @@ then
save_LIBS="$LIBS"
for i in "" "-ldl" ; do
LIBS="$LDFLAGS $save_LIBS $i"
- AC_LINK_IFELSE([AC_LANG_PROGRAM(,[SSL_library_init()])],[found=1; break])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <openssl/ssl.h>],[SSL_library_init()])],[found=1; break])
done
if test $found = 0 ; then
AC_MSG_RESULT([error])
diff --git a/cram.c b/cram.c
index 16591b8d..e71f0ecd 100644
--- a/cram.c
+++ b/cram.c
@@ -15,16 +15,16 @@
#include "socket.h"
#include "i18n.h"
-#include "md5.h"
+#include "fm_md5.h"
-void hmac_md5 (const char *password, size_t pass_len,
+void hmac_md5 (const unsigned char *password, size_t pass_len,
const char *challenge, size_t chal_len,
unsigned char *response, size_t resp_len)
{
int i;
unsigned char ipad[64];
unsigned char opad[64];
- char hash_passwd[16];
+ unsigned char hash_passwd[16];
MD5_CTX ctx;
@@ -110,7 +110,7 @@ int do_cram_md5 (int sock, const char *command, struct query *ctl, const char *s
* (including angle-brackets).
*/
- hmac_md5(ctl->password, strlen(ctl->password),
+ hmac_md5((unsigned char *)ctl->password, strlen(ctl->password),
msg_id, strlen (msg_id),
response, sizeof (response));
diff --git a/fetchmail.h b/fetchmail.h
index 51562933..a786caf2 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -324,7 +324,7 @@ struct query
char *smtpaddress; /* address to force in RCPT TO */
char *smtpname; /* full RCPT TO name, including domain */
struct idlist *antispam; /* list of listener's antispam response */
- char *mda; /* local MDA to pass mail to */
+ const char *mda; /* local MDA to pass mail to */
char *bsmtp; /* BSMTP output file */
char listener; /* what's the listener's wire protocol? */
#define SMTP_MODE 'S'
@@ -384,7 +384,7 @@ struct query
/* internal use -- per-message state */
int mimemsg; /* bitmask indicating MIME body-type */
- char digest[DIGESTLEN]; /* md5 digest buffer */
+ unsigned char digest[DIGESTLEN]; /* md5 digest buffer */
/* internal use -- housekeeping */
struct query *next; /* next query control block in chain */
@@ -651,8 +651,8 @@ extern char currentwd[1024], rcfiledir[1024];
struct query *hostalloc(struct query *);
int parsecmdline (int, char **, struct runctl *, struct query *);
char *prependdir (const char *, const char *);
-char *MD5Digest (unsigned const char *);
-void hmac_md5 (const char *, size_t, const char *, size_t, unsigned char *, size_t);
+unsigned char *MD5Digest (unsigned const char *);
+void hmac_md5 (const unsigned char *, size_t, const char *, size_t, unsigned char *, size_t);
int POP3_auth_rpa(char *, char *, int socket);
typedef RETSIGTYPE (*SIGHANDLERTYPE) (int);
void deal_with_sigchld(void);
diff --git a/md5.h b/fm_md5.h
index 83b748c4..6fccc526 100644
--- a/md5.h
+++ b/fm_md5.h
@@ -1,11 +1,19 @@
#ifndef MD5_H
#define MD5_H
+
+#include "config.h"
+
+#include <sys/types.h>
+
+#ifdef HAVE_MD5_H
+#include <md5.h>
+#else
+
#ifndef HEADER_MD5_H
/* Try to avoid clashes with OpenSSL */
#define HEADER_MD5_H
#endif
-#include "config.h"
#if SIZEOF_INT == 4
typedef unsigned int uint32;
@@ -24,11 +32,10 @@ void MD5Update(struct MD5Context *context, const void *buf, unsigned len);
void MD5Final(void *digest, struct MD5Context *context);
void MD5Transform(uint32 buf[], uint32 const in[]);
-char *MD5Digest (unsigned const char *s);
-
/*
* This is needed to make RSAREF happy on some MS-DOS compilers.
*/
typedef struct MD5Context MD5_CTX;
+#endif
#endif /* !MD5_H */
diff --git a/gssapi.c b/gssapi.c
index 4f8e766c..37c5a6af 100644
--- a/gssapi.c
+++ b/gssapi.c
@@ -15,7 +15,7 @@
#include "socket.h"
#include "i18n.h"
-#include "md5.h"
+#include "fm_md5.h"
#include <sys/types.h>
#include <netinet/in.h> /* for htonl/ntohl */
diff --git a/md5c.c b/md5c.c
index 61fd2fe7..545b088b 100644
--- a/md5c.c
+++ b/md5c.c
@@ -16,7 +16,7 @@
*/
#include "config.h"
-#include "md5.h"
+#include "fm_md5.h"
#ifdef HAVE_STRING_H
#include <string.h> /* memmove */
#endif
diff --git a/md5ify.c b/md5ify.c
index 8d5c8807..5affe316 100644
--- a/md5ify.c
+++ b/md5ify.c
@@ -17,7 +17,7 @@
#include <string.h>
#endif
-#include "md5.h"
+#include "fm_md5.h"
char *
MD5Digest (unsigned const char *s)
diff --git a/opie.c b/opie.c
index 94fd59b4..06756121 100644
--- a/opie.c
+++ b/opie.c
@@ -15,7 +15,7 @@
#include "socket.h"
#include "i18n.h"
-#include "md5.h"
+#include "fm_md5.h"
#ifdef OPIE_ENABLE
#ifdef __cplusplus
diff --git a/pop3.c b/pop3.c
index 70a91dd5..d9bc0000 100644
--- a/pop3.c
+++ b/pop3.c
@@ -690,7 +690,7 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting)
msg = (char *)xmalloc((end-start+1) + strlen(ctl->password) + 1);
strcpy(msg,start);
strcat(msg,ctl->password);
- strcpy(ctl->digest, MD5Digest((unsigned char *)msg));
+ strcpy((char *)ctl->digest, (char *)MD5Digest((unsigned char *)msg));
free(msg);
ok = gen_transact(sock, "APOP %s %s", ctl->remotename, ctl->digest);
diff --git a/rpa.c b/rpa.c
index a8091897..925718a7 100644
--- a/rpa.c
+++ b/rpa.c
@@ -21,10 +21,11 @@
#include <unistd.h>
#include <ctype.h>
#include <string.h>
+#include <sys/types.h>
#include "socket.h"
#include "fetchmail.h"
-#include "md5.h"
+#include "fm_md5.h"
#include "i18n.h"
#ifdef TESTMODE
@@ -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") };
diff --git a/smbutil.c b/smbutil.c
index fd239d9c..a26b3496 100644
--- a/smbutil.c
+++ b/smbutil.c
@@ -84,12 +84,12 @@ static void dumpRaw(FILE *fp, unsigned char *buf, size_t len)
/* helper macro to destructively resize buffers; assumes that bufsiz
* is initialized to 0 if buf is unallocated! */
-#define allocbuf(buf, bufsiz, need) do { \
+#define allocbuf(buf, bufsiz, need, type) do { \
if (!buf || (need) > (bufsiz)) \
{ \
(bufsiz) = ((need) < 1024) ? 1024 : (need); \
xfree(buf); \
- (buf) = xmalloc(bufsiz); \
+ (buf) = (type)xmalloc(bufsiz); \
} \
} while (0);
@@ -101,7 +101,7 @@ static char *unicodeToString(char *p, size_t len)
static char *buf;
static size_t bufsiz;
- allocbuf(buf, bufsiz, len + 1);
+ allocbuf(buf, bufsiz, len + 1, char *);
for (i=0; i<len; ++i)
{
@@ -121,7 +121,7 @@ static unsigned char *strToUnicode(char *p)
size_t l = strlen(p);
int i = 0;
- allocbuf(buf, bufsiz, l * 2);
+ allocbuf(buf, bufsiz, l * 2, unsigned char *);
while (l--)
{
@@ -137,7 +137,7 @@ static unsigned char *toString(char *p, size_t len)
static unsigned char *buf;
static size_t bufsiz;
- allocbuf(buf, bufsiz, len + 1);
+ allocbuf(buf, bufsiz, len + 1, unsigned char *);
memcpy(buf,p,len);
buf[len] = 0;
diff --git a/smtp.c b/smtp.c
index ef6cdb2d..584f9ece 100644
--- a/smtp.c
+++ b/smtp.c
@@ -97,7 +97,7 @@ static void SMTP_auth(int sock, char smtp_mode, char *username, char *password,
}
if (outlevel >= O_DEBUG)
report(stdout, GT_("Challenge decoded: %s\n"), b64buf);
- hmac_md5(password, strlen(password),
+ hmac_md5((unsigned char *)password, strlen(password),
b64buf, strlen(b64buf), digest, sizeof(digest));
snprintf(tmp, sizeof(tmp),
"%s %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
diff --git a/transact.c b/transact.c
index 5201ceef..5e93c6ca 100644
--- a/transact.c
+++ b/transact.c
@@ -29,7 +29,7 @@
#endif
#include <sys/socket.h>
#include <netdb.h>
-#include "md5.h"
+#include "fm_md5.h"
#include "i18n.h"
#include "socket.h"