ports/90094: Update port: security/mhash to 0.9.3

Vasil Dimov vd at datamax.bg
Thu Dec 8 07:10:26 UTC 2005


>Number:         90094
>Category:       ports
>Synopsis:       Update port: security/mhash to 0.9.3
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 08 07:10:06 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Vasil Dimov
>Release:        FreeBSD 6.0-STABLE amd64
>Organization:
DataMax
>Environment:

>Description:

Update security/mhash from 0.9.2 to 0.9.3

* add message to inform users that the new version brings API changes
* add `check' target to ease testing
* introduce patch-lib-stdfns.c to fix compile error about undefined MAXINT
* introduce patch-src-hmac_test.c and patch-src-keygen_test.c to force
  tests to pass. These both fix some stupid errors like using
  unappropriate printf(3) format strings and free(3)ing a buffer before
  printing it. Both patches are not really necessary because they fix
  the test programs, but I added them to help us test 0.9.4 when it
  comes out.

>How-To-Repeat:

>Fix:

--- mhash_0.9.2-0.9.3.diff begins here ---
diff -urN --exclude=CVS --exclude=README.html mhash.orig/Makefile mhash/Makefile
--- mhash.orig/Makefile	Tue Nov 15 08:51:00 2005
+++ mhash/Makefile	Thu Dec  8 08:48:10 2005
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	mhash
-PORTVERSION=	0.9.2
+PORTVERSION=	0.9.3
 CATEGORIES=	security
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -24,6 +24,16 @@
 MAN3=		mhash.3
 
 DOCFILES=	example.c md5-rfc1321.txt skid2-authentication
+
+pre-everything::
+	@${ECHO_MSG} ""
+	@${ECHO_MSG} "NOTE: Version 0.9.3 of mhash introduces API changes, see:"
+	@${ECHO_MSG} "http://sourceforge.net/project/shownotes.php?release_id=376618&group_id=4286"
+	@${ECHO_MSG} "for details"
+	@${ECHO_MSG} ""
+
+check: build
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} check
 
 .if !defined(NOPORTDOCS)
 post-install:
diff -urN --exclude=CVS --exclude=README.html mhash.orig/distinfo mhash/distinfo
--- mhash.orig/distinfo	Mon Jul 18 11:14:57 2005
+++ mhash/distinfo	Wed Dec  7 19:44:50 2005
@@ -1,2 +1,3 @@
-MD5 (mhash-0.9.2.tar.gz) = bf31627548376891e4f42ace54db4c2d
-SIZE (mhash-0.9.2.tar.gz) = 853662
+MD5 (mhash-0.9.3.tar.gz) = 8c2dc7b2bfe84bccf8d25d338bf75760
+SHA256 (mhash-0.9.3.tar.gz) = 1e10d5a8136fec1859175c001e9c9355cf5507d9c0cd2bfe5e615311908a64b2
+SIZE (mhash-0.9.3.tar.gz) = 1021016
diff -urN --exclude=CVS --exclude=README.html mhash.orig/files/patch-lib-stdfns.c mhash/files/patch-lib-stdfns.c
--- mhash.orig/files/patch-lib-stdfns.c	Thu Jan  1 02:00:00 1970
+++ mhash/files/patch-lib-stdfns.c	Thu Dec  8 08:01:46 2005
@@ -0,0 +1,17 @@
+--- lib/stdfns.c.orig	Thu Dec  8 07:51:20 2005
++++ lib/stdfns.c	Thu Dec  8 08:01:00 2005
+@@ -32,6 +32,14 @@
+  * to validate inputs.
+  */
+ 
++#ifndef MAXINT
++#ifdef INT_MAX
++#define MAXINT	INT_MAX
++#else
++#define MAXINT	0x7fffffff
++#endif
++#endif
++
+ WIN32DLL_DEFINE
+ void *
+ mutils_malloc(const mutils_word32 n)
diff -urN --exclude=CVS --exclude=README.html mhash.orig/files/patch-src-hmac_test.c mhash/files/patch-src-hmac_test.c
--- mhash.orig/files/patch-src-hmac_test.c	Thu Jan  1 02:00:00 1970
+++ mhash/files/patch-src-hmac_test.c	Thu Dec  8 08:40:04 2005
@@ -0,0 +1,20 @@
+--- src/hmac_test.c.orig	Thu Dec  8 08:38:26 2005
++++ src/hmac_test.c	Thu Dec  8 08:37:53 2005
+@@ -63,7 +63,7 @@
+ 	
+ 	for (j = 0; j < mhash_get_block_size(MHASH_MD5); j++)
+ 	{
+-		sprintf((char *) tmp2, "%2x", (char) mac[j]);
++		sprintf((char *) tmp2, "%02hhx", mac[j]);
+ 		mutils_strcat(tmp, tmp2);
+ 	}
+ 
+@@ -100,7 +100,7 @@
+ 	
+ 	for (j = 0; j < mhash_get_block_size(MHASH_MD5); j++)
+ 	{
+-		sprintf((char *) tmp2, "%.2x", (char) mac[j]);
++		sprintf((char *) tmp2, "%02hhx", mac[j]);
+ 		mutils_strcat(tmp, tmp2);
+ 	}
+ 
diff -urN --exclude=CVS --exclude=README.html mhash.orig/files/patch-src-keygen_test.c mhash/files/patch-src-keygen_test.c
--- mhash.orig/files/patch-src-keygen_test.c	Thu Jan  1 02:00:00 1970
+++ mhash/files/patch-src-keygen_test.c	Thu Dec  8 08:39:32 2005
@@ -0,0 +1,46 @@
+--- src/keygen_test.c.orig	Sun Oct 30 07:13:22 2005
++++ src/keygen_test.c	Thu Dec  8 08:38:01 2005
+@@ -77,7 +77,7 @@
+ 	mhash_keygen_ext(KEYGEN_MCRYPT, data, key, keysize, password, passlen);
+ 
+ 	for (j = 0; j < keysize; j++) {
+-		sprintf((char *) tmp2, "%.2x", key[j]);
++		sprintf((char *) tmp2, "%02hhx", key[j]);
+ 		mutils_strcat(tmp, tmp2);
+ 	}
+ 
+@@ -85,11 +85,11 @@
+ 
+ 	mutils_free(password);
+ 	mutils_free(key);
+-	mutils_free(tmp);
+ 
+ 	if (result != 0) {
+ 		fprintf(stderr, "KEYGEN-Test (KEYGEN_MCRYPT): Failed\n");
+ 		fprintf(stderr, "Expecting: 0x%s\nGot: 0x%s\n", KEY1, tmp);
++		mutils_free(tmp);
+ 		return(MUTILS_INVALID_RESULT);
+ 	}
+ 
+@@ -122,7 +122,7 @@
+ 	mutils_memset(tmp, 0, keysize * 2);
+ 
+ 	for (j = 0; j < keysize; j++) {
+-		sprintf((char *) tmp2, "%.2x", key[j]);
++		sprintf((char *) tmp2, "%02hhx", key[j]);
+ 		mutils_strcat(tmp, tmp2);
+ 	}
+ 
+@@ -130,11 +130,11 @@
+ 
+ 	mutils_free(password);
+ 	mutils_free(key);
+-	mutils_free(tmp);
+ 
+ 	if (mutils_strcmp((mutils_word8 *) KEY2, tmp) != 0) {
+ 		fprintf(stderr, "KEYGEN-Test (KEYGEN_S2K_SALTED): Failed\n");
+ 		fprintf(stderr, "Expecting: 0x%s\nGot: 0x%s\n", KEY2, tmp);
++		mutils_free(tmp);
+ 		return(MUTILS_INVALID_RESULT);
+ 	}
+ 
diff -urN --exclude=CVS --exclude=README.html mhash.orig/pkg-plist mhash/pkg-plist
--- mhash.orig/pkg-plist	Thu Dec 30 14:48:29 2004
+++ mhash/pkg-plist	Thu Dec  8 08:43:17 2005
@@ -1,4 +1,7 @@
+include/mglobal.h
 include/mhash.h
+include/mtypes.h
+include/mutils.h
 lib/libmhash.a
 lib/libmhash.so
 lib/libmhash.so.2
--- mhash_0.9.2-0.9.3.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list