[xmlsec] removed support for old gnutls and bumped min version to 2.8.0



commit c12e2128dedd2089ac0d0873b3278328ac749a87
Author: Aleksey Sanin <aleksey aleksey com>
Date:   Tue Apr 27 22:19:47 2010 -0700

    removed support for old gnutls and bumped min version to 2.8.0

 ChangeLog            |    1 +
 configure.in         |   30 +++++++-----------------------
 src/gnutls/ciphers.c |    9 +--------
 src/gnutls/digests.c |    9 +--------
 src/gnutls/hmac.c    |    9 +--------
 5 files changed, 11 insertions(+), 47 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4292f8f..e2435fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-04-26  Aleksey Sanin  <aleksey aleksey com>
 	* Converted xmlsec-mscrypto to unicode and provided a compile time 
 	option to switch between unicode/non-unicode builds
+	* Deleted support for old gnutls, new required version 2.8.0
 
 2010-04-26  Aleksey Sanin  <aleksey aleksey com>
 	* Added support for HMAC with MD5, SHA1, SHA256/384/512 in xmlsec-mscrypto
diff --git a/configure.in b/configure.in
index 83bdd3c..fd8f073 100644
--- a/configure.in
+++ b/configure.in
@@ -791,8 +791,7 @@ dnl See if we can find GnuTLS
 dnl ==========================================================================
 GNUTLS_CONFIG="libgnutls-config"
 XMLSEC_NO_GNUTLS="1"
-GNUTLS_MIN_VERSION="0.8.1"
-GNUTLS_NEW_MIN_VERSION="1.0.0"
+GNUTLS_MIN_VERSION="2.8.0"
 GNUTLS_VERSION=""
 GNUTLS_CFLAGS=""
 GNUTLS_LIBS=""
@@ -804,26 +803,17 @@ if test "z$with_gnutls" = "zno" ; then
     AC_MSG_RESULT(no)
     GNUTLS_FOUND="without"
 elif test "z$with_gnutls" = "z" -a "z$PKGCONFIG_FOUND" = "zyes" ; then
-    PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_NEW_MIN_VERSION,
+    PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_MIN_VERSION,
 	[GNUTLS_FOUND=yes],
 	[GNUTLS_FOUND=no])
     if test "z$GNUTLS_FOUND" = "zno" ; then 
-        PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_NEW_MIN_VERSION,
+        PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_MIN_VERSION,
 	    [GNUTLS_FOUND=yes],
 	    [GNUTLS_FOUND=no])
     fi
-
-    if test "z$GNUTLS_FOUND" = "zno" ; then 
-	PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_MIN_VERSION,
-	    [GNUTLS_FOUND=yes],
-	    [GNUTLS_FOUND=no])
-	if test "z$GNUTLS_FOUND" = "zyes" ; then 
-	    GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DXMLSEC_GNUTLS_OLD=1"
-	fi
-    fi
 fi
 
-if test "z$GNUTLS_FOUND" = "zno" ; then 
+if test "z$GNUTLS_FOUND" = "zno" ; then
     AC_MSG_CHECKING(for gnutls libraries >= $GNUTLS_MIN_VERSION) 
     if test "z$with_gnutls" != "z" ; then
 	GNUTLS_CONFIG=$with_gnutls/bin/$GNUTLS_CONFIG
@@ -831,7 +821,7 @@ if test "z$GNUTLS_FOUND" = "zno" ; then
     if ! $GNUTLS_CONFIG --version > /dev/null 2>&1 ; then
 	if test "z$with_gnutls" != "z" ; then
 	    AC_MSG_ERROR(Unable to find gnutls at '$with_gnutls')
-	else 
+	else
 	    AC_MSG_RESULT(no)
 	fi
     else
@@ -839,16 +829,10 @@ if test "z$GNUTLS_FOUND" = "zno" ; then
 	minvers=`echo $GNUTLS_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
 	if test "$vers" -ge "$minvers" ; then
 	    GNUTLS_CFLAGS="$GNUTLS_CFLAGS `$GNUTLS_CONFIG --cflags`"
-    	    GNUTLS_LIBS="$GNUTLS_LIBS `$GNUTLS_CONFIG --libs`"
+	    GNUTLS_LIBS="$GNUTLS_LIBS `$GNUTLS_CONFIG --libs`"
 	    GNUTLS_FOUND=yes
-	
-	    new_minvers=`echo $GNUTLS_NEW_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-	    if test "$vers" -lt "$new_minvers" ; then
-		GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DXMLSEC_GNUTLS_OLD=1"
-	    fi    
-	    AC_MSG_RESULT(yes)
 	else
-    	    AC_MSG_ERROR(You need at least gnutls $GNUTLS_MIN_VERSION for this version of $XMLSEC_PACKAGE)
+	    AC_MSG_ERROR(You need at least gnutls $GNUTLS_MIN_VERSION for this version of $XMLSEC_PACKAGE)
 	fi	
     fi
 fi
diff --git a/src/gnutls/ciphers.c b/src/gnutls/ciphers.c
index b594a1f..a137ac8 100644
--- a/src/gnutls/ciphers.c
+++ b/src/gnutls/ciphers.c
@@ -30,7 +30,7 @@ typedef struct _xmlSecGnuTLSBlockCipherCtx              xmlSecGnuTLSBlockCipherC
 struct _xmlSecGnuTLSBlockCipherCtx {
     int                 cipher;
     int                 mode;
-    GcryCipherHd        cipherCtx;
+    gcry_cipher_hd_t    cipherCtx;
     xmlSecKeyDataId     keyId;
     int                 keyInitialized;
     int                 ctxInitialized;
@@ -446,9 +446,7 @@ xmlSecGnuTLSBlockCipherCheckId(xmlSecTransformPtr transform) {
 static int
 xmlSecGnuTLSBlockCipherInitialize(xmlSecTransformPtr transform) {
     xmlSecGnuTLSBlockCipherCtxPtr ctx;
-#ifndef XMLSEC_GNUTLS_OLD
     gpg_err_code_t ret;
-#endif /* XMLSEC_GNUTLS_OLD */
 
     xmlSecAssert2(xmlSecGnuTLSBlockCipherCheckId(transform), -1);
     xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecGnuTLSBlockCipherSize), -1);
@@ -491,13 +489,8 @@ xmlSecGnuTLSBlockCipherInitialize(xmlSecTransformPtr transform) {
         return(-1);
     }
 
-#ifndef XMLSEC_GNUTLS_OLD
     ret = gcry_cipher_open(&ctx->cipherCtx, ctx->cipher, ctx->mode, GCRY_CIPHER_SECURE); /* we are paranoid */
     if(ret != GPG_ERR_NO_ERROR) {
-#else /* XMLSEC_GNUTLS_OLD */
-    ctx->cipherCtx = gcry_cipher_open(ctx->cipher, ctx->mode, GCRY_CIPHER_SECURE); /* we are paranoid */
-    if(ctx->cipherCtx == NULL) {
-#endif /* XMLSEC_GNUTLS_OLD */
         xmlSecError(XMLSEC_ERRORS_HERE,
                     xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
                     "gcry_cipher_open",
diff --git a/src/gnutls/digests.c b/src/gnutls/digests.c
index 1a2dd89..31a281e 100644
--- a/src/gnutls/digests.c
+++ b/src/gnutls/digests.c
@@ -31,7 +31,7 @@
 typedef struct _xmlSecGnuTLSDigestCtx           xmlSecGnuTLSDigestCtx, *xmlSecGnuTLSDigestCtxPtr;
 struct _xmlSecGnuTLSDigestCtx {
     int                 digest;
-    GcryMDHd            digestCtx;
+    gcry_md_hd_t        digestCtx;
     xmlSecByte          dgst[XMLSEC_GNUTLS_MAX_DIGEST_SIZE];
     xmlSecSize          dgstSize;       /* dgst size in bytes */
 };
@@ -74,9 +74,7 @@ xmlSecGnuTLSDigestCheckId(xmlSecTransformPtr transform) {
 static int
 xmlSecGnuTLSDigestInitialize(xmlSecTransformPtr transform) {
     xmlSecGnuTLSDigestCtxPtr ctx;
-#ifndef XMLSEC_GNUTLS_OLD
     gpg_err_code_t ret;
-#endif /* XMLSEC_GNUTLS_OLD */
 
     xmlSecAssert2(xmlSecGnuTLSDigestCheckId(transform), -1);
     xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecGnuTLSDigestSize), -1);
@@ -102,13 +100,8 @@ xmlSecGnuTLSDigestInitialize(xmlSecTransformPtr transform) {
         return(-1);
     }
 
-#ifndef XMLSEC_GNUTLS_OLD
     ret = gcry_md_open(&ctx->digestCtx, ctx->digest, GCRY_MD_FLAG_SECURE); /* we are paranoid */
     if(ret != GPG_ERR_NO_ERROR) {
-#else /* XMLSEC_GNUTLS_OLD */
-    ctx->digestCtx = gcry_md_open(ctx->digest, GCRY_MD_FLAG_SECURE); /* we are paranoid */
-    if(ctx->digestCtx == NULL) {
-#endif /* XMLSEC_GNUTLS_OLD */
         xmlSecError(XMLSEC_ERRORS_HERE,
                     xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
                     "gcry_md_open",
diff --git a/src/gnutls/hmac.c b/src/gnutls/hmac.c
index 4df4342..a16a64e 100644
--- a/src/gnutls/hmac.c
+++ b/src/gnutls/hmac.c
@@ -65,7 +65,7 @@ void xmlSecGnuTLSHmacSetMinOutputLength(int min_length)
 typedef struct _xmlSecGnuTLSHmacCtx             xmlSecGnuTLSHmacCtx, *xmlSecGnuTLSHmacCtxPtr;
 struct _xmlSecGnuTLSHmacCtx {
     int                 digest;
-    GcryMDHd            digestCtx;
+    gcry_md_hd_t        digestCtx;
     xmlSecByte          dgst[XMLSEC_GNUTLS_MAX_HMAC_SIZE / 8];
     xmlSecSize          dgstSize;       /* dgst size in bits */
 };
@@ -106,9 +106,7 @@ static int      xmlSecGnuTLSHmacExecute                 (xmlSecTransformPtr tran
 static int
 xmlSecGnuTLSHmacInitialize(xmlSecTransformPtr transform) {
     xmlSecGnuTLSHmacCtxPtr ctx;
-#ifndef XMLSEC_GNUTLS_OLD
     gpg_err_code_t ret;
-#endif /* XMLSEC_GNUTLS_OLD */
 
     xmlSecAssert2(xmlSecGnuTLSHmacCheckId(transform), -1);
     xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecGnuTLSHmacSize), -1);
@@ -132,13 +130,8 @@ xmlSecGnuTLSHmacInitialize(xmlSecTransformPtr transform) {
         return(-1);
     }
 
-#ifndef XMLSEC_GNUTLS_OLD
     ret = gcry_md_open(&ctx->digestCtx, ctx->digest, GCRY_MD_FLAG_HMAC | GCRY_MD_FLAG_SECURE); /* we are paranoid */
     if(ret != GPG_ERR_NO_ERROR) {
-#else /* XMLSEC_GNUTLS_OLD */
-    ctx->digestCtx = gcry_md_open(ctx->digest, GCRY_MD_FLAG_HMAC | GCRY_MD_FLAG_SECURE); /* we are paranoid */
-    if(ctx->digestCtx == NULL) {
-#endif /* XMLSEC_GNUTLS_OLD */
         xmlSecError(XMLSEC_ERRORS_HERE,
                     xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
                     "gcry_md_open",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]