]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
updated
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 2 Jun 2011 22:44:05 +0000 (00:44 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 2 Jun 2011 22:44:05 +0000 (00:44 +0200)
lib/ext/ecc.c

index f6d0218f68ce22f80be36ce221f1201f2b7246e9..358b3ea1f91ca9757332d4f2b24bb1c7d4711561 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2002, 2003, 2004, 2005, 2010 Free Software Foundation,
- * Inc.
+ * Copyright (C) 2011 Free Software Foundation, Inc.
  *
  * Author: Nikos Mavrogiannopoulos
  *
@@ -215,8 +214,8 @@ int data_size = _data_size;
       len = data[0];
       DECR_LEN (data_size, len+1);
 
-      for (i=0;i<len;i++)
-        if (data[1+i] == 0) /* uncompressed */
+      for (i=1;i<=len;i++)
+        if (data[i] == 0) /* uncompressed */
           uncompressed = 1;
       
       if (uncompressed == 0)
@@ -244,9 +243,12 @@ _gnutls_supported_ecc_pf_send_params (gnutls_session_t session, gnutls_buffer_st
   if (session->security_parameters.entity == GNUTLS_SERVER && !_gnutls_session_is_ecc(session))
     return 0;
   
-  /* this extension is only being sent on client and server side */
-  _gnutls_buffer_append_data(extdata, p, 2);
-  return 2;
+  if (session->internals.priorities.supported_ecc.algorithms > 0)
+    {
+      _gnutls_buffer_append_data(extdata, p, 2);
+      return 2;
+    }
+  return 0;
 }