[dovecot-cvs] dovecot/src/lib hmac-md5.c, 1.2, 1.3 hmac-md5.h, 1.1, 1.2

tss at dovecot.org tss at dovecot.org
Sun May 13 13:18:53 EEST 2007


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

Modified Files:
	hmac-md5.c hmac-md5.h 
Log Message:
hmac-md5 API cleanups. Use arrays with MD5_RESULTLEN and CRAM_MD5_CONTEXTLEN
sizes instead of pointers. hmac_md5_set_cram_context() takes a const array
now.



Index: hmac-md5.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/hmac-md5.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hmac-md5.c	16 Jun 2006 10:38:57 -0000	1.2
+++ hmac-md5.c	13 May 2007 10:18:50 -0000	1.3
@@ -54,7 +54,7 @@
 }
 
 void hmac_md5_get_cram_context(struct hmac_md5_context *ctx,
-			       unsigned char *context_digest)
+			unsigned char context_digest[CRAM_MD5_CONTEXTLEN])
 {
 	unsigned char *cdp;
 
@@ -76,9 +76,9 @@
 }
 
 void hmac_md5_set_cram_context(struct hmac_md5_context *ctx,
-			       unsigned char *context_digest)
+			const unsigned char context_digest[CRAM_MD5_CONTEXTLEN])
 {
-	unsigned char *cdp;
+	const unsigned char *cdp;
 
 #define CDGET(p, c) STMT_START { \
 	(c)  = (*p++);           \

Index: hmac-md5.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/hmac-md5.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hmac-md5.h	30 Jul 2004 01:57:04 -0000	1.1
+++ hmac-md5.h	13 May 2007 10:18:51 -0000	1.2
@@ -3,18 +3,21 @@
 
 #include "md5.h"
 
+#define CRAM_MD5_CONTEXTLEN 32
+
 struct hmac_md5_context {
 	struct md5_context ctx, ctxo;
 };
 
 void hmac_md5_init(struct hmac_md5_context *ctx,
 		   const unsigned char *key, size_t key_len);
-void hmac_md5_final(struct hmac_md5_context *ctx, unsigned char *digest);
+void hmac_md5_final(struct hmac_md5_context *ctx,
+		    unsigned char digest[MD5_RESULTLEN]);
 
 void hmac_md5_get_cram_context(struct hmac_md5_context *ctx,
-			       unsigned char *context_digest);
+		unsigned char context_digest[CRAM_MD5_CONTEXTLEN]);
 void hmac_md5_set_cram_context(struct hmac_md5_context *ctx,
-			       unsigned char *context_digest);
+		const unsigned char context_digest[CRAM_MD5_CONTEXTLEN]);
 
 
 static inline void



More information about the dovecot-cvs mailing list