From: Pierre Habouzit Date: Sat, 12 May 2007 14:29:24 +0000 (+0200) Subject: there is no real need for a lib-hash anymore. fold it. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=fd97b7b962d97d99e98cd566a34fcdaaeb950bfd;p=apps%2Fmadmutt.git there is no real need for a lib-hash anymore. fold it. Signed-off-by: Pierre Habouzit --- diff --git a/Makefile.am b/Makefile.am index 6d514b8..afdbd40 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,7 @@ NNTP_SUBDIR = nntp endif SUBDIRS = tools intl m4 po \ - lib-lua lib-mime lib-lib lib-mx lib-hash lib-sys lib-ui \ + lib-lua lib-mime lib-lib lib-mx lib-sys lib-ui \ pop imap $(NNTP_SUBDIR) BUILT_SOURCES = keymap_defs.h charset.gperf @@ -22,14 +22,13 @@ madmutt_SOURCES = $(BUILT_SOURCES) \ handler.c headers.c help.c hook.c main.c muttlib.c mutt_idna.c \ pager.c pattern.c postpone.c recvattach.c recvcmd.c score.c send.c \ sendlib.c send_smtp.c sort.c state.c thread.c account.c remailer.c \ - mutt_sasl.c + mutt_sasl.c md5.c madmutt_LDADD = $(top_builddir)/lib-mime/libmime.a \ $(top_builddir)/lib-mx/libmx.a \ $(top_builddir)/imap/libimap.a \ $(top_builddir)/pop/libpop.a \ $(LIBNNTP) \ - $(top_builddir)/lib-hash/libhash.a \ $(top_builddir)/lib-sys/libsys.a \ $(top_builddir)/lib-ui/libui.a \ $(top_builddir)/lib-lua/liblua.a \ @@ -38,7 +37,6 @@ madmutt_LDADD = $(top_builddir)/lib-mime/libmime.a \ madmutt_DEPENDENCIES = $(top_builddir)/lib-lib/liblib.a \ $(top_builddir)/lib-mime/libmime.a \ - $(top_builddir)/lib-hash/libhash.a \ $(top_builddir)/lib-sys/libsys.a \ $(top_builddir)/lib-ui/libui.a \ $(top_builddir)/lib-lua/liblua.a \ diff --git a/configure.ac b/configure.ac index 1424eb2..7af4473 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,6 @@ PKG_PROG_PKG_CONFIG AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_RANLIB -AC_PROG_GPERF AC_PATH_PROG(GPERF, gperf, AC_MSG_ERROR([Could not find gperf])) AC_CHECK_TOOL(AR, ar, ar) @@ -610,7 +609,6 @@ AC_OUTPUT(Makefile lib-lib/Makefile lib-lua/Makefile lib-mime/Makefile - lib-hash/Makefile lib-mx/Makefile lib-sys/Makefile lib-ui/Makefile diff --git a/lib-hash/Makefile.am b/lib-hash/Makefile.am deleted file mode 100644 index 842d031..0000000 --- a/lib-hash/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -noinst_LIBRARIES = libhash.a - -libhash_a_SOURCES = md5.h md5.c -noinst_HEADERS = md5.h - --include $(top_buildir)/tools/cflags.mk diff --git a/lib-hash/hash.h b/lib-hash/hash.h deleted file mode 100644 index 831b081..0000000 --- a/lib-hash/hash.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright notice from original mutt: - * [none] - * - * This file is part of mutt-ng, see http://www.muttng.org/. - * It's licensed under the GNU General Public License, - * please see the file GPL in the top level source directory. - */ - -#ifndef _CRYPTHASH_H -# define _CRYPTHASH_H - - -# include -# if HAVE_INTTYPES_H -# include -# else -# if HAVE_STDINT_H -# include -# endif -# endif - -/* POINTER defines a generic pointer type */ -typedef unsigned char *POINTER; - -#include "md5.h" - -#endif diff --git a/lib-mx/hcache.c b/lib-mx/hcache.c index bdbeeb9..4f4504c 100644 --- a/lib-mx/hcache.c +++ b/lib-mx/hcache.c @@ -25,11 +25,9 @@ #include #endif -#include -#include - #include +#include "md5.h" #include "charset.h" #include "mutt.h" #include "hcache.h" diff --git a/lib-hash/md5.c b/md5.c similarity index 95% rename from lib-hash/md5.c rename to md5.c index 02f4661..aa36b26 100644 --- a/lib-hash/md5.c +++ b/md5.c @@ -52,8 +52,8 @@ documentation and/or software. static void MD5Transform (uint32_t[4], unsigned char[64]); static void Encode (unsigned char *, uint32_t *, unsigned int); static void Decode (uint32_t *, unsigned char *, unsigned int); -static void MD5_memcpy (POINTER, POINTER, unsigned int); -static void MD5_memset (POINTER, int, unsigned int); +static void MD5_memcpy (unsigned char *, unsigned char *, unsigned int); +static void MD5_memset (unsigned char *, int, unsigned int); static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -135,7 +135,7 @@ void MD5Update (context, input, inputLen) /* Transform as many times as possible. */ if (inputLen >= partLen) { - MD5_memcpy ((POINTER) & context->buffer[index], (POINTER) input, partLen); + MD5_memcpy ((unsigned char *) & context->buffer[index], (unsigned char *) input, partLen); MD5Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) @@ -148,7 +148,7 @@ void MD5Update (context, input, inputLen) /* Buffer remaining input */ MD5_memcpy - ((POINTER) & context->buffer[index], (POINTER) & input[i], inputLen - i); + ((unsigned char *) & context->buffer[index], (unsigned char *) & input[i], inputLen - i); } /* MD5 finalization. Ends an MD5 message-digest operation, writing the @@ -177,7 +177,7 @@ void MD5Final (digest, context) /* Zeroize sensitive information. */ - MD5_memset ((POINTER) context, 0, sizeof (*context)); + MD5_memset ((unsigned char *) context, 0, sizeof (*context)); } /* MD5 basic transformation. Transforms state based on block. @@ -268,7 +268,7 @@ static void MD5Transform (state, block) state[3] += d; /* Zeroize sensitive information. */ - MD5_memset ((POINTER) x, 0, sizeof (x)); + MD5_memset ((unsigned char *) x, 0, sizeof (x)); } /* Encodes input (uint32_t) into output (unsigned char). Assumes len is @@ -308,8 +308,8 @@ static void Decode (output, input, len) */ static void MD5_memcpy (output, input, len) - POINTER output; - POINTER input; + unsigned char * output; + unsigned char * input; unsigned int len; { unsigned int i; @@ -321,7 +321,7 @@ static void MD5_memcpy (output, input, len) /* Note: Replace "for loop" with standard memset if possible. */ static void MD5_memset (output, value, len) - POINTER output; + unsigned char * output; int value; unsigned int len; { diff --git a/lib-hash/md5.h b/md5.h similarity index 96% rename from lib-hash/md5.h rename to md5.h index 9bfe756..a803803 100644 --- a/lib-hash/md5.h +++ b/md5.h @@ -24,9 +24,9 @@ documentation and/or software. */ #ifndef MD5_H -#define MD5_H 1 +#define MD5_H -#include "hash.h" +#include /* MD5 context. */ typedef struct { diff --git a/pop/pop_auth.c b/pop/pop_auth.c index 171baa9..98dc1cc 100644 --- a/pop/pop_auth.c +++ b/pop/pop_auth.c @@ -12,9 +12,9 @@ #include #include -#include #include +#include "md5.h" #include "mutt.h" #include "pop.h" #include "mutt_sasl.h"