gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_3_0_7-66-gfe2212f


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_7-66-gfe2212f
Date: Thu, 10 Nov 2011 21:33:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=fe2212f20d438b0704c7b0c08c22f145727cd44a

The branch, master has been updated
       via  fe2212f20d438b0704c7b0c08c22f145727cd44a (commit)
       via  ba054cb89336cf4fd2b238860111f3d5104132a5 (commit)
       via  0144bc53e999d20bfe8eeb395c1377f1f4eb06b3 (commit)
       via  af1aa950a2ac21851eed9cbe4fe4da8d55407b17 (commit)
       via  20ae8dcfab88dcf5d82c5569541c5c407cfc4962 (commit)
       via  2b91222a89d0fca3e8e00c012c973055358a3a26 (commit)
      from  8b5b5f8c07a735e160efd2fa619f2d5b2ee7ea6b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fe2212f20d438b0704c7b0c08c22f145727cd44a
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Nov 10 22:32:44 2011 +0100

    added missing dir

commit ba054cb89336cf4fd2b238860111f3d5104132a5
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Nov 10 22:32:27 2011 +0100

    Revert "periodically print messages that might be used in timing attacks."
    
    This reverts commit a333d71762903ff5b716d1e3967017b1baf61bd2.

commit 0144bc53e999d20bfe8eeb395c1377f1f4eb06b3
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Nov 10 22:32:20 2011 +0100

    Revert "dropped packets are also reported on gnutls_deinit() to ensure that 
they are not lost."
    
    This reverts commit 41a73fb4a147dc4773d4b546d5d8b5cfdae255d9.

commit af1aa950a2ac21851eed9cbe4fe4da8d55407b17
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Nov 10 22:31:59 2011 +0100

    updated

commit 20ae8dcfab88dcf5d82c5569541c5c407cfc4962
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Nov 10 22:30:53 2011 +0100

    provide less timing information during packet MAC verification.

commit 2b91222a89d0fca3e8e00c012c973055358a3a26
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Nov 10 22:14:50 2011 +0100

    silence test

-----------------------------------------------------------------------

Summary of changes:
 NEWS                |    5 +++++
 configure.ac        |    1 +
 lib/gnutls_cipher.c |    8 +++-----
 lib/gnutls_int.h    |    4 ----
 lib/gnutls_record.c |   14 ++++----------
 lib/gnutls_state.c  |    4 ----
 tests/ecdsa/ecdsa   |    6 +++---
 7 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/NEWS b/NEWS
index 9f136bc..644e3e3 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,11 @@ See the end for copying conditions.
 
 * Version 3.0.8 (unreleased)
 
+** libgnutls: Corrected ECC key generation (introduced in 3.0.6)
+
+** libgnutls: Provide less timing information when decoding
+TLS/DTLS record packets.
+
 ** doc: man pages for API functions were removed.
 The reason was that the code that auto-generated the man pages missed
 many APIs and we couldn't fix it (volunteers welcome).  See the info
diff --git a/configure.ac b/configure.ac
index 8d47fbc..e79c704 100644
--- a/configure.ac
+++ b/configure.ac
@@ -474,6 +474,7 @@ AC_CONFIG_FILES([
   tests/pkcs8-decode/Makefile
   tests/rsa-md5-collision/Makefile
   tests/sha2/Makefile
+  tests/ecdsa/Makefile
   tests/userid/Makefile
   extra/Makefile
   extra/includes/Makefile
diff --git a/lib/gnutls_cipher.c b/lib/gnutls_cipher.c
index 716b7c9..d5279ef 100644
--- a/lib/gnutls_cipher.c
+++ b/lib/gnutls_cipher.c
@@ -544,13 +544,14 @@ ciphertext_to_compressed (gnutls_session_t session,
            * the pad_failed. If zero means success.
            */
           pad_failed = GNUTLS_E_DECRYPTION_FAILED;
+          pad = (int) ciphertext->size - tag_size;
         }
 
       length = ciphertext->size - tag_size - pad;
 
       /* Check the pading bytes (TLS 1.x)
        */
-      if (ver != GNUTLS_SSL3 && pad_failed == 0)
+      if (ver != GNUTLS_SSL3)
         for (i = 2; i < pad; i++)
           {
             if (ciphertext->data[ciphertext->size - i] !=
@@ -582,12 +583,9 @@ ciphertext_to_compressed (gnutls_session_t session,
   /* This one was introduced to avoid a timing attack against the TLS
    * 1.0 protocol.
    */
-  if (pad_failed != 0)
-    return gnutls_assert_val(pad_failed);
-
   /* HMAC was not the same. 
    */
-  if (memcmp (tag, &ciphertext->data[length], tag_size) != 0)
+  if (memcmp (tag, &ciphertext->data[length], tag_size) != 0 || pad_failed != 
0)
     return gnutls_assert_val(GNUTLS_E_DECRYPTION_FAILED);
 
   /* copy the decrypted stuff to compress_data.
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index 3c888fa..4818eeb 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -141,9 +141,6 @@ typedef struct
 /* expire time for resuming sessions */
 #define DEFAULT_EXPIRE_TIME 3600
 
-/* printing period of messages */
-#define PRINT_MESSAGE_PERIOD 30
-
 typedef enum transport_t
 {
   GNUTLS_STREAM,
@@ -628,7 +625,6 @@ typedef struct
   /* last retransmission triggered by record layer */
   time_t last_retransmit;
   unsigned int packets_dropped;
-  time_t last_print;
 } dtls_st;
 
 
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 3b89c35..4ff2951 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -1020,7 +1020,8 @@ begin:
       ret = _dtls_record_check(session, packet_sequence);
       if (ret < 0)
         {
-          gnutls_assert();
+          _gnutls_audit_log(session, "Discarded duplicate message[%u]\n",
+            (unsigned int) _gnutls_uint64touint32 (packet_sequence));
           goto sanity_check_error;
         }
     }
@@ -1087,15 +1088,8 @@ discard:
 sanity_check_error:
   if (IS_DTLS(session))
     {
-      time_t now = time(0);
-      session->internals.dtls.packets_dropped++;
-
-      if (now - session->internals.dtls.last_print < PRINT_MESSAGE_PERIOD)
-        {
-          session->internals.dtls.last_print = now;
-          _gnutls_audit_log(session, "Discarded %u messages (duplicates or 
invalid decryption)\n", 
-               (unsigned int)session->internals.dtls.packets_dropped);
-        }
+      _gnutls_audit_log(session, "Discarded message[%u] due to invalid 
decryption\n", 
+            (unsigned int)_gnutls_uint64touint32 (packet_sequence));
       ret = gnutls_assert_val(GNUTLS_E_AGAIN);
       goto cleanup;
     }
diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c
index 43602cc..3c12508 100644
--- a/lib/gnutls_state.c
+++ b/lib/gnutls_state.c
@@ -425,10 +425,6 @@ gnutls_deinit (gnutls_session_t session)
   if (session == NULL)
     return;
 
-  if (IS_DTLS(session) && session->internals.dtls.packets_dropped > 0)
-    _gnutls_audit_log(session, "Discarded %u messages (duplicates or invalid 
decryption)\n", 
-                      (unsigned int)session->internals.dtls.packets_dropped);
-
   /* remove auth info firstly */
   _gnutls_free_auth_info (session);
 
diff --git a/tests/ecdsa/ecdsa b/tests/ecdsa/ecdsa
index 20ea747..e1b7dc6 100755
--- a/tests/ecdsa/ecdsa
+++ b/tests/ecdsa/ecdsa
@@ -28,7 +28,7 @@ CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
 echo ca > template
 echo cn = "ECDSA SHA 256 CA" >> template
 
-$CERTTOOL --generate-privkey --ecc > key-ca-ecdsa.pem
+$CERTTOOL --generate-privkey --ecc > key-ca-ecdsa.pem 2>/dev/null 
 
 $CERTTOOL -d 2 --generate-self-signed --template template \
     --load-privkey key-ca-ecdsa.pem \
@@ -41,7 +41,7 @@ if [ $? != 0 ];then
 fi
 
 echo ca > template
-$CERTTOOL --generate-privkey --ecc > key-subca-ecdsa.pem
+$CERTTOOL --generate-privkey --ecc > key-subca-ecdsa.pem 2>/dev/null 
 echo cn = "ECDSA SHA 224 Mid CA" >> template
 
 $CERTTOOL -d 2 --generate-certificate --template template \
@@ -58,7 +58,7 @@ fi
 
 echo cn = "End-user" > template
 
-$CERTTOOL --generate-privkey --ecc > key-ecdsa.pem
+$CERTTOOL --generate-privkey --ecc > key-ecdsa.pem 2>/dev/null 
 
 $CERTTOOL -d 2 --generate-certificate --template template \
     --load-ca-privkey key-subca-ecdsa.pem \


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]