rpms/iksemel/F-12 0001-Fix-issues-compiling-with-newer-gnutls.patch, NONE, 1.1 0002-Strip-out-internal-SHA-code-and-use-functions-from-g.patch, NONE, 1.1 iksemel.spec, 1.15, 1.16 sources, 1.3, 1.4 iksemel-64bit.patch, 1.2, NONE iksemel-gcrypt-sha.patch, 1.2, NONE

Jeffrey C. Ollie jcollie at fedoraproject.org
Fri Oct 23 05:02:02 UTC 2009


Author: jcollie

Update of /cvs/pkgs/rpms/iksemel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26902

Modified Files:
	iksemel.spec sources 
Added Files:
	0001-Fix-issues-compiling-with-newer-gnutls.patch 
	0002-Strip-out-internal-SHA-code-and-use-functions-from-g.patch 
Removed Files:
	iksemel-64bit.patch iksemel-gcrypt-sha.patch 
Log Message:
* Thu Oct 22 2009 Jeffrey C. Ollie <jeff at ocjtech.us> - 1.4-1
- Update to 1.4
- Apply patch from upstream so that gnutls autoconf works.
- Update gcrypt-sha patch so that it applies.


0001-Fix-issues-compiling-with-newer-gnutls.patch:
 configure.ac |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--- NEW FILE 0001-Fix-issues-compiling-with-newer-gnutls.patch ---
>From a5f5d88a10e90c0dac44c8e845d8ce295a233bbd Mon Sep 17 00:00:00 2001
From: Jeffrey C. Ollie <jeff at ocjtech.us>
Date: Thu, 22 Oct 2009 23:46:22 -0500
Subject: [PATCH 1/2] Fix issues compiling with newer gnutls

---
 configure.ac |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 91e69e3..952bbe6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,7 +45,15 @@ AC_SEARCH_LIBS(recv,socket)
 AC_CHECK_FUNCS(getopt_long)
 AC_CHECK_FUNCS(getaddrinfo)
 
-AM_PATH_LIBGNUTLS(,AC_DEFINE(HAVE_GNUTLS,,"Use libgnutls"))
+dnl Check GNU TLS
+PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.0.0, have_gnutls=yes, have_gnutls=no)
+if test "x$have_gnutls" = "xyes"; then
+  LIBGNUTLS_CFLAGS="$GNUTLS_CFLAGS"
+  LIBGNUTLS_LIBS="$GNUTLS_LIBS"
+  AC_SUBST(LIBGNUTLS_CFLAGS)
+  AC_SUBST(LIBGNUTLS_LIBS)
+  AC_DEFINE(HAVE_GNUTLS, 1, [whether to use GnuTSL support.])
+fi
 
 dnl Check -Wall flag of GCC
 if test "x$GCC" = "xyes"; then
-- 
1.6.5.rc2


0002-Strip-out-internal-SHA-code-and-use-functions-from-g.patch:
 configure.ac    |    1 
 src/Makefile.am |    4 +-
 src/sha.c       |  109 +++++++-------------------------------------------------
 3 files changed, 18 insertions(+), 96 deletions(-)

--- NEW FILE 0002-Strip-out-internal-SHA-code-and-use-functions-from-g.patch ---
>From e909440a2abcdf1ed58810a20a7fd6a8f187816f Mon Sep 17 00:00:00 2001
From: Jeffrey C. Ollie <jeff at ocjtech.us>
Date: Sat, 25 Aug 2007 22:31:07 -0500
Subject: [PATCH 2/2] Strip out internal SHA code and use functions from gcrypt.

---
 configure.ac    |    1 +
 src/Makefile.am |    4 +-
 src/sha.c       |  108 ++++++++-----------------------------------------------
 3 files changed, 18 insertions(+), 95 deletions(-)

diff --git a/configure.ac b/configure.ac
index 952bbe6..b215f1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,7 @@ if test "x$have_gnutls" = "xyes"; then
   AC_SUBST(LIBGNUTLS_LIBS)
   AC_DEFINE(HAVE_GNUTLS, 1, [whether to use GnuTSL support.])
 fi
+AM_PATH_LIBGCRYPT(,AC_DEFINE(HAVE_LIBGCRYPT,,"Use libgcrypt"))
 
 dnl Check -Wall flag of GCC
 if test "x$GCC" = "xyes"; then
diff --git a/src/Makefile.am b/src/Makefile.am
index 303671c..f13f482 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,5 +25,5 @@ libiksemel_la_SOURCES = \
 	base64.c
 
 libiksemel_la_LDFLAGS = -version-info 4:1:1 -no-undefined
-libiksemel_la_CFLAGS = $(CFLAGS) $(LIBGNUTLS_CFLAGS)
-libiksemel_la_LIBADD = $(LIBGNUTLS_LIBS)
+libiksemel_la_CFLAGS = $(CFLAGS) $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS)
+libiksemel_la_LIBADD = $(LIBGNUTLS_LIBS) $(LIBGCRYPT_LIBS)
diff --git a/src/sha.c b/src/sha.c
index 04d566e..7b2126b 100644
--- a/src/sha.c
+++ b/src/sha.c
@@ -4,17 +4,13 @@
 ** modify it under the terms of GNU Lesser General Public License.
 */
 
+#include <gcrypt.h>
+
 #include "common.h"
 #include "iksemel.h"
 
-static void sha_buffer (iksha *sha, const unsigned char *data, int len);
-static void sha_calculate (iksha *sha);
-
 struct iksha_struct {
-	unsigned int hash[5];
-	unsigned int buf[80];
-	int blen;
-	unsigned int lenhi, lenlo;
+	gcry_md_hd_t c;
 };
 
 iksha *
@@ -32,56 +28,37 @@ void
 iks_sha_reset (iksha *sha)
 {
 	memset (sha, 0, sizeof (iksha));
-	sha->hash[0] = 0x67452301;
-	sha->hash[1] = 0xefcdab89;
-	sha->hash[2] = 0x98badcfe;
-	sha->hash[3] = 0x10325476;
-	sha->hash[4] = 0xc3d2e1f0;
+	gcry_md_open(&sha->c, GCRY_MD_SHA1, 0);
 }
 
 void
 iks_sha_hash (iksha *sha, const unsigned char *data, size_t len, int finish)
 {
-	unsigned char pad[8];
-	unsigned char padc;
-
-	if (data && len != 0) sha_buffer (sha, data, len);
-	if (!finish) return;
-
-	pad[0] = (unsigned char)((sha->lenhi >> 24) & 0xff);
-	pad[1] = (unsigned char)((sha->lenhi >> 16) & 0xff);
-	pad[2] = (unsigned char)((sha->lenhi >> 8) & 0xff);
-	pad[3] = (unsigned char)(sha->lenhi & 0xff);
-	pad[4] = (unsigned char)((sha->lenlo >> 24) & 0xff);
-	pad[5] = (unsigned char)((sha->lenlo >> 16) & 0xff);
-	pad[6] = (unsigned char)((sha->lenlo >> 8) & 0xff);
-	pad[7] = (unsigned char)(sha->lenlo & 255);
-
-	padc = 0x80;
-	sha_buffer (sha, &padc, 1);
-
-	padc = 0x00;
-	while (sha->blen != 56)
-		sha_buffer (sha, &padc, 1);
-
-	sha_buffer (sha, pad, 8);
+	if (data && len != 0)
+		gcry_md_write(sha->c, data, len);
+	if (finish)
+		gcry_md_final(sha->c);
 }
 
 void
 iks_sha_print (iksha *sha, char *hash)
 {
+	unsigned char bin[20];
 	int i;
 
-	for (i=0; i<5; i++)
+	memcpy(bin, gcry_md_read(sha->c, 0), 20);
+
+	for (i=0; i<20; i++)
 	{
-		sprintf (hash, "%08x", sha->hash[i]);
-		hash += 8;
+		sprintf (hash, "%02x", bin[i]);
+		hash += 2;
 	}
 }
 
 void
 iks_sha_delete (iksha *sha)
 {
+	gcry_md_close(sha->c);
 	iks_free (sha);
 }
 
@@ -95,58 +72,3 @@ iks_sha (const char *data, char *hash)
 	iks_sha_print (sha, hash);
 	iks_free (sha);
 }
-
-static void
-sha_buffer (iksha *sha, const unsigned char *data, int len)
-{
-	int i;
-
-	for (i=0; i<len; i++) {
-		sha->buf[sha->blen / 4] <<= 8;
-		sha->buf[sha->blen / 4] |= (unsigned int)data[i];
-		if ((++sha->blen) % 64 == 0) {
-			sha_calculate (sha);
-			sha->blen = 0;
-		}
-		sha->lenlo += 8;
-		sha->lenhi += (sha->lenlo < 8);
-	}
-}
-
-#define SRL(x,y) (((x) << (y)) | ((x) >> (32-(y))))
-#define SHA(a,b,f,c) \
-	for (i= (a) ; i<= (b) ; i++) { \
-		TMP = SRL(A,5) + ( (f) ) + E + sha->buf[i] + (c) ; \
-		E = D; \
-		D = C; \
-		C = SRL(B,30); \
-		B = A; \
-		A = TMP; \
-	}
-
-static void
-sha_calculate (iksha *sha)
-{
-	int i;
-	unsigned int A, B, C, D, E, TMP;
-
-	for (i=16; i<80; i++)
-		sha->buf[i] = SRL (sha->buf[i-3] ^ sha->buf[i-8] ^ sha->buf[i-14] ^ sha->buf[i-16], 1);
-
-	A = sha->hash[0];
-	B = sha->hash[1];
-	C = sha->hash[2];
-	D = sha->hash[3];
-	E = sha->hash[4];
-
-	SHA (0,  19, ((C^D)&B)^D,     0x5a827999);
-	SHA (20, 39, B^C^D,           0x6ed9eba1);
-	SHA (40, 59, (B&C)|(D&(B|C)), 0x8f1bbcdc);
-	SHA (60, 79, B^C^D,           0xca62c1d6);
-
-	sha->hash[0] += A;
-	sha->hash[1] += B;
-	sha->hash[2] += C;
-	sha->hash[3] += D;
-	sha->hash[4] += E;
-}
-- 
1.6.5.rc2



Index: iksemel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/iksemel/F-12/iksemel.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- iksemel.spec	25 Jul 2009 03:16:26 -0000	1.15
+++ iksemel.spec	23 Oct 2009 05:02:02 -0000	1.16
@@ -1,14 +1,14 @@
 Name:           iksemel
-Version:        1.3
-Release:        8%{?dist}
+Version:        1.4
+Release:        1%{?dist}
 Summary:        An XML parser library designed for Jabber applications
 
 Group:          System Environment/Libraries
 License:        LGPLv2+
 URL:            http://code.google.com/p/iksemel/
 Source0:        http://iksemel.googlecode.com/files/iksemel-%{version}.tar.gz
-Patch0:         iksemel-gcrypt-sha.patch
-Patch1:         iksemel-64bit.patch
+Patch0:         0001-Fix-issues-compiling-with-newer-gnutls.patch
+Patch1:         0002-Strip-out-internal-SHA-code-and-use-functions-from-g.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  gnutls-devel
@@ -117,6 +117,11 @@ fi
 %{_bindir}/iksroster
 
 %changelog
+* Thu Oct 22 2009 Jeffrey C. Ollie <jeff at ocjtech.us> - 1.4-1
+- Update to 1.4
+- Apply patch from upstream so that gnutls autoconf works.
+- Update gcrypt-sha patch so that it applies.
+
 * Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.3-8
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/iksemel/F-12/sources,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- sources	26 Aug 2007 04:19:07 -0000	1.3
+++ sources	23 Oct 2009 05:02:02 -0000	1.4
@@ -1 +1 @@
-36ab2d9f11980a19217b6f79a19ef8e7  iksemel-1.3.tar.gz
+532e77181694f87ad5eb59435d11c1ca  iksemel-1.4.tar.gz


--- iksemel-64bit.patch DELETED ---


--- iksemel-gcrypt-sha.patch DELETED ---




More information about the scm-commits mailing list