[dovecot-cvs] dovecot/src/lib md5.c, 1.8.2.1, 1.8.2.2 md5.h, 1.4, 1.4.2.1

tss at dovecot.org tss at dovecot.org
Mon Oct 9 00:10:49 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv32585

Modified Files:
      Tag: branch_1_0
	md5.c md5.h 
Log Message:
Added MD5_RESULTLEN macro.



Index: md5.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/md5.c,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -d -r1.8.2.1 -r1.8.2.2
--- md5.c	16 Jun 2006 10:28:30 -0000	1.8.2.1
+++ md5.c	8 Oct 2006 23:10:17 -0000	1.8.2.2
@@ -219,7 +219,7 @@
 	memcpy(ctx->buffer, data, size);
 }
 
-void md5_final(struct md5_context *ctx, unsigned char result[16])
+void md5_final(struct md5_context *ctx, unsigned char result[MD5_RESULTLEN])
 {
 	/* @UNSAFE */
 	unsigned long used, free;
@@ -271,7 +271,8 @@
 	safe_memset(ctx, 0, sizeof(*ctx));
 }
 
-void md5_get_digest(const void *data, size_t size, unsigned char result[16])
+void md5_get_digest(const void *data, size_t size,
+		    unsigned char result[MD5_RESULTLEN])
 {
 	struct md5_context ctx;
 

Index: md5.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/md5.h,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -d -r1.4 -r1.4.2.1
--- md5.h	5 Jan 2003 13:09:51 -0000	1.4
+++ md5.h	8 Oct 2006 23:10:17 -0000	1.4.2.1
@@ -9,17 +9,20 @@
 #ifndef __MD5_H
 #define __MD5_H
 
+#define	MD5_RESULTLEN (128/8)
+
 struct md5_context {
 	uint_fast32_t lo, hi;
 	uint_fast32_t a, b, c, d;
 	unsigned char buffer[64];
-	uint_fast32_t block[16];
+	uint_fast32_t block[MD5_RESULTLEN];
 };
 
 void md5_init(struct md5_context *ctx);
 void md5_update(struct md5_context *ctx, const void *data, size_t size);
-void md5_final(struct md5_context *ctx, unsigned char result[16]);
+void md5_final(struct md5_context *ctx, unsigned char result[MD5_RESULTLEN]);
 
-void md5_get_digest(const void *data, size_t size, unsigned char result[16]);
+void md5_get_digest(const void *data, size_t size,
+		    unsigned char result[MD5_RESULTLEN]);
 
 #endif



More information about the dovecot-cvs mailing list