[Pkg-gnutls-commits] r1640 - in /packages/gnutls26/branches/branch2.12.20-1+wheezy/debian: changelog patches/31_allow_key_usage_violation.diff patches/32_record-padding-parsing.patch patches/33_stricter_rsa_pkcs_1.5.diff patches/series

ametzler at users.alioth.debian.org ametzler at users.alioth.debian.org
Sun Jan 6 10:04:11 UTC 2013


Author: ametzler
Date: Sun Jan  6 10:04:09 2013
New Revision: 1640

URL: http://svn.debian.org/wsvn/pkg-gnutls/?sc=1&rev=1640
Log:
Pull fixes from 2.12.22:

+31_allow_key_usage_violation.diff: Always tolerate key usage violation
 errors from the side of the peer, but also notify via an audit message.
+32_record-padding-parsing.patch: Fix record padding parsing issue.
+33_stricter_rsa_pkcs_1.5.diff: Fixes random handshake failures with
 non-GnuTLS implementations.

This brings us up to GnuTLS 2.12.22, except for these differences:
- The equivalent change of 33_stricter_rsa_pkcs_1.5.diff for the nettle
  code is not included as it is not relevant for Debian's binary packages.
- 0b9d8d6f21dad85038c6de36d8fbd56271263f64 Corrected bug in PGP subpacket
  encoding.
- Compability with libtasn1 3.x, which would require libtasn1 >=2.14.
- Updated gnulib.

Added:
    packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/31_allow_key_usage_violation.diff
    packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/32_record-padding-parsing.patch
    packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/33_stricter_rsa_pkcs_1.5.diff
Modified:
    packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/changelog
    packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/series

Modified: packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnutls/packages/gnutls26/branches/branch2.12.20-1%2Bwheezy/debian/changelog?rev=1640&op=diff
==============================================================================
--- packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/changelog (original)
+++ packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/changelog Sun Jan  6 10:04:09 2013
@@ -1,8 +1,20 @@
-gnutls26 (2.12.20-3) UNRELEASED; urgency=low
-
-  * NOT RELEASED YET
-
- -- Andreas Metzler <ametzler at debian.org>  Tue, 13 Nov 2012 19:32:03 +0100
+gnutls26 (2.12.20-3) unstable; urgency=low
+
+  * Pull fixes from 2.12.22:
+    +31_allow_key_usage_violation.diff: Always tolerate key usage violation
+     errors from the side of the peer, but also notify via an audit message.
+    +32_record-padding-parsing.patch: Fix record padding parsing issue.
+    +33_stricter_rsa_pkcs_1.5.diff: Fixes random handshake failures with
+     non-GnuTLS implementations.
+    This brings us up to GnuTLS 2.12.22, except for these differences:
+    - The equivalent change of 33_stricter_rsa_pkcs_1.5.diff for the nettle
+      code is not included as it is not relevant for Debian's binary packages.
+    - 0b9d8d6f21dad85038c6de36d8fbd56271263f64 Corrected bug in PGP subpacket
+      encoding.
+    - Compability with libtasn1 3.x, which would require libtasn1 >=2.14.
+    - Updated gnulib.
+
+ -- Andreas Metzler <ametzler at debian.org>  Sun, 06 Jan 2013 10:56:57 +0100
 
 gnutls26 (2.12.20-2) unstable; urgency=low
 

Added: packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/31_allow_key_usage_violation.diff
URL: http://svn.debian.org/wsvn/pkg-gnutls/packages/gnutls26/branches/branch2.12.20-1%2Bwheezy/debian/patches/31_allow_key_usage_violation.diff?rev=1640&op=file
==============================================================================
--- packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/31_allow_key_usage_violation.diff (added)
+++ packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/31_allow_key_usage_violation.diff Sun Jan  6 10:04:09 2013
@@ -1,0 +1,66 @@
+From: Nikos Mavrogiannopoulos <nmav at gnutls.org>
+Description:  
+ ** libgnutls: Always tolerate key usage violation errors from the side
+ of the peer, but also notify via an audit message.
+. 
+ Pulled from uptream GIT, combining
+ http://gitorious.org/gnutls/gnutls/commit/afd6b636d1d9b079699afb0c3b20692edcf5b262
+ and
+ http://gitorious.org/gnutls/gnutls/commit/dbc72ae47b16c6718cb5e53d4a31205bc45d3742
+
+--- gnutls26-2.12.20.orig/lib/gnutls_sig.c
++++ gnutls26-2.12.20/lib/gnutls_sig.c
+@@ -222,7 +222,7 @@ sign_tls_hash (gnutls_session_t session,
+         if (!(cert->key_usage & GNUTLS_KEY_DIGITAL_SIGNATURE))
+           {
+             gnutls_assert ();
+-            return GNUTLS_E_KEY_USAGE_VIOLATION;
++            _gnutls_debug_log("Key usage violation was detected (ignored).\n");
+           }
+ 
+       /* External signing. */
+@@ -270,7 +270,7 @@ es_cleanup:
+ }
+ 
+ static int
+-verify_tls_hash (gnutls_protocol_t ver, gnutls_cert * cert,
++verify_tls_hash (gnutls_session_t session, gnutls_protocol_t ver, gnutls_cert * cert,
+                     const gnutls_datum_t * hash_concat,
+                     gnutls_datum_t * signature, size_t sha1pos,
+                     gnutls_pk_algorithm_t pk_algo)
+@@ -292,7 +292,7 @@ verify_tls_hash (gnutls_protocol_t ver,
+     if (!(cert->key_usage & GNUTLS_KEY_DIGITAL_SIGNATURE))
+       {
+         gnutls_assert ();
+-        return GNUTLS_E_KEY_USAGE_VIOLATION;
++        _gnutls_debug_log("Key usage violation was detected (ignored).\n");
+       }
+ 
+   if (pk_algo == GNUTLS_PK_UNKNOWN)
+@@ -425,7 +425,7 @@ _gnutls_handshake_verify_data (gnutls_se
+       dconcat.size = _gnutls_hash_get_algo_len (hash_algo);
+     }
+ 
+-  ret = verify_tls_hash (ver, cert, &dconcat, signature,
++  ret = verify_tls_hash (session, ver, cert, &dconcat, signature,
+                             dconcat.size -
+                             _gnutls_hash_get_algo_len (hash_algo),
+                             _gnutls_sign_get_pk_algorithm (algo));
+@@ -490,7 +490,7 @@ _gnutls_handshake_verify_cert_vrfy12 (gn
+   dconcat.size = _gnutls_hash_get_algo_len (hash_algo);
+ 
+   ret =
+-    verify_tls_hash (ver, cert, &dconcat, signature, 0,
++    verify_tls_hash (session, ver, cert, &dconcat, signature, 0,
+                         cert->subject_pk_algorithm);
+   if (ret < 0)
+     {
+@@ -581,7 +581,7 @@ _gnutls_handshake_verify_cert_vrfy (gnut
+   dconcat.size = 20 + 16;       /* md5+ sha */
+ 
+   ret =
+-    verify_tls_hash (ver, cert, &dconcat, signature, 16,
++    verify_tls_hash (session, ver, cert, &dconcat, signature, 16,
+                         cert->subject_pk_algorithm);
+   if (ret < 0)
+     {

Added: packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/32_record-padding-parsing.patch
URL: http://svn.debian.org/wsvn/pkg-gnutls/packages/gnutls26/branches/branch2.12.20-1%2Bwheezy/debian/patches/32_record-padding-parsing.patch?rev=1640&op=file
==============================================================================
--- packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/32_record-padding-parsing.patch (added)
+++ packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/32_record-padding-parsing.patch Sun Jan  6 10:04:09 2013
@@ -1,0 +1,35 @@
+From 7b65049a81ea02a92fef934318a680afd55e98d2 Mon Sep 17 00:00:00 2001
+From: Nikos Mavrogiannopoulos <nmav at gnutls.org>
+Date: Thu, 3 Jan 2013 23:48:38 +0100
+Subject: [PATCH 07/11] Corrected bugs in record padding parsing.
+
+libgnutls: Fixed record padding parsing issue. Reported by Kenny
+Patterson and Nadhem Alfardan.
+http://gitorious.org/gnutls/gnutls/commit/7b65049a81ea02a92fef934318a680afd55e98d2
+
+ 
+diff --git a/lib/gnutls_cipher.c b/lib/gnutls_cipher.c
+index 6b83208..9a5d128 100644
+--- a/lib/gnutls_cipher.c
++++ b/lib/gnutls_cipher.c
+@@ -461,7 +461,7 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
+ {
+   uint8_t MAC[MAX_HASH_SIZE];
+   uint16_t c_length;
+-  uint8_t pad;
++  unsigned int pad;
+   int length;
+   uint16_t blocksize;
+   int ret, i, pad_failed = 0;
+@@ -537,7 +537,7 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
+       /* Check the pading bytes (TLS 1.x)
+        */
+       if (_gnutls_version_has_variable_padding (ver) && pad_failed == 0)
+-        for (i = 2; i < pad; i++)
++        for (i = 2; i <= pad; i++)
+           {
+             if (ciphertext.data[ciphertext.size - i] !=
+                 ciphertext.data[ciphertext.size - 1])
+-- 
+1.7.10.4
+

Added: packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/33_stricter_rsa_pkcs_1.5.diff
URL: http://svn.debian.org/wsvn/pkg-gnutls/packages/gnutls26/branches/branch2.12.20-1%2Bwheezy/debian/patches/33_stricter_rsa_pkcs_1.5.diff?rev=1640&op=file
==============================================================================
--- packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/33_stricter_rsa_pkcs_1.5.diff (added)
+++ packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/33_stricter_rsa_pkcs_1.5.diff Sun Jan  6 10:04:09 2013
@@ -1,0 +1,67 @@
+From 24c6ce144a1e071210dc33cc794690429d74456c Mon Sep 17 00:00:00 2001
+From: Nikos Mavrogiannopoulos <nmav at gnutls.org>
+Date: Sun, 6 Jan 2013 00:11:01 +0100
+Subject: [PATCH 11/11] libgcrypt code updated with similar checks to nettle
+ code
+
+This is the gcrypt counterpart to
+http://gitorious.org/gnutls/gnutls/commit/9709393ac263d7fbd9f790c884b7b8141c6f4b13
+Stricter RSA PKCS #1 1.5 encoding and decoding. Reported
+by Kikuchi Masashi.
+http://lists.gnutls.org/pipermail/gnutls-devel/2012-December/006016.html
+
+---
+ lib/gcrypt/pk.c |   16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/lib/gcrypt/pk.c b/lib/gcrypt/pk.c
+index e3bedaf..b1ce8f9 100644
+--- a/lib/gcrypt/pk.c
++++ b/lib/gcrypt/pk.c
+@@ -121,7 +121,7 @@ _wrap_gcry_pk_encrypt (gnutls_pk_algorithm_t algo,
+       goto cleanup;
+     }
+ 
+-  ret = _gnutls_mpi_dprint_size (res, ciphertext, plaintext->size);
++  ret = _gnutls_mpi_dprint_size (res, ciphertext, (_gnutls_mpi_get_nbits(pk_params->params[0])+7)/8);
+   _gnutls_mpi_release (&res);
+   if (ret < 0)
+     {
+@@ -164,6 +164,12 @@ _wrap_gcry_pk_decrypt (gnutls_pk_algorithm_t algo,
+   switch (algo)
+     {
+     case GNUTLS_PK_RSA:
++        if (ciphertext->size != (_gnutls_mpi_get_nbits(pk_params->params[0])+7)/8)
++          {
++            gnutls_assert ();
++            return GNUTLS_E_DECRYPTION_FAILED;
++          }
++
+       if (pk_params->params_nr >= 6)
+         rc = gcry_sexp_build (&s_pkey, NULL,
+                               "(private-key(rsa((n%m)(e%m)(d%m)(p%m)(q%m)(u%m))))",
+@@ -363,7 +369,7 @@ _wrap_gcry_pk_sign (gnutls_pk_algorithm_t algo, gnutls_datum_t * signature,
+         res[0] = gcry_sexp_nth_mpi (list, 1, GCRYMPI_FMT_USG);
+         gcry_sexp_release (list);
+ 
+-        ret = _gnutls_mpi_dprint (res[0], signature);
++        ret = _gnutls_mpi_dprint_size (res[0], signature, (_gnutls_mpi_get_nbits(pk_params->params[0])+7)/8);
+         if (ret < 0)
+           {
+             gnutls_assert ();
+@@ -424,6 +430,12 @@ _wrap_gcry_pk_verify (gnutls_pk_algorithm_t algo,
+                               pk_params->params[2], pk_params->params[3]);
+       break;
+     case GNUTLS_PK_RSA:
++      if (signature->size != (_gnutls_mpi_get_nbits(pk_params->params[0])+7)/8)
++        {
++          gnutls_assert ();
++          return GNUTLS_E_PK_SIG_VERIFY_FAILED;
++        }
++
+       if (pk_params->params_nr >= 2)
+         rc = gcry_sexp_build (&s_pkey, NULL,
+                               "(public-key(rsa(n%m)(e%m)))",
+-- 
+1.7.10.4
+

Modified: packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnutls/packages/gnutls26/branches/branch2.12.20-1%2Bwheezy/debian/patches/series?rev=1640&op=diff
==============================================================================
--- packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/series (original)
+++ packages/gnutls26/branches/branch2.12.20-1+wheezy/debian/patches/series Sun Jan  6 10:04:09 2013
@@ -4,3 +4,6 @@
 18_gpgerrorinpkgconfig.diff
 20_tests-select.diff
 30_strlen_on_null.diff
+31_allow_key_usage_violation.diff
+32_record-padding-parsing.patch
+33_stricter_rsa_pkcs_1.5.diff




More information about the Pkg-gnutls-commits mailing list