gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, gnutls_2_10_x, updated. gnutls_2_9_10-71-g62e03


From: Simon Josefsson
Subject: [SCM] GNU gnutls branch, gnutls_2_10_x, updated. gnutls_2_9_10-71-g62e03fb
Date: Mon, 07 Jun 2010 13:21:01 +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=62e03fb4b0f30790bfb17fe428c306ac910a61bf

The branch, gnutls_2_10_x has been updated
       via  62e03fb4b0f30790bfb17fe428c306ac910a61bf (commit)
      from  cf0152fe0c3970ea2fa0b27fec202e605b05ecab (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 62e03fb4b0f30790bfb17fe428c306ac910a61bf
Author: Simon Josefsson <address@hidden>
Date:   Mon Jun 7 15:20:58 2010 +0200

    Indent code.

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

Summary of changes:
 lib/gnutls_handshake.c          |   36 ++++++++++++++++++------------------
 lib/gnutls_int.h                |    3 ++-
 lib/gnutls_priority.c           |   12 ++++++------
 lib/x509/common.h               |    2 +-
 lib/x509/sign.c                 |    4 ++--
 lib/x509/verify.c               |   35 ++++++++++++++++++++---------------
 tests/mini-x509-rehandshake.c   |    8 ++++----
 tests/safe-renegotiation/srn0.c |   11 ++++++-----
 tests/safe-renegotiation/srn1.c |   11 ++++++-----
 tests/safe-renegotiation/srn2.c |   11 ++++++-----
 tests/safe-renegotiation/srn3.c |    3 +--
 tests/safe-renegotiation/srn5.c |    8 ++++----
 tests/safe-renegotiation/srn6.c |    8 ++++----
 tests/safe-renegotiation/srn7.c |   11 ++++++-----
 14 files changed, 86 insertions(+), 77 deletions(-)

diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index a597254..9c25772 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -866,22 +866,22 @@ _gnutls_server_select_suite (gnutls_session_t session, 
opaque * data,
    */
   if (session->internals.priorities.sr != SR_DISABLED)
     {
-    int offset;
+      int offset;
 
-    for (offset = 0; offset < datalen; offset += 2)
-      {
-       /* TLS_RENEGO_PROTECTION_REQUEST = { 0x00, 0xff } */
-       if (data[offset] == GNUTLS_RENEGO_PROTECTION_REQUEST_MAJOR &&
-           data[offset + 1] == GNUTLS_RENEGO_PROTECTION_REQUEST_MINOR)
-         {
-           _gnutls_handshake_log
-             ("HSK[%p]: Received safe renegotiation CS\n", session);
-           session->internals.safe_renegotiation_received = 1;
-           session->internals.connection_using_safe_renegotiation = 1;
-           break;
-         }
-      }
-  }
+      for (offset = 0; offset < datalen; offset += 2)
+       {
+         /* TLS_RENEGO_PROTECTION_REQUEST = { 0x00, 0xff } */
+         if (data[offset] == GNUTLS_RENEGO_PROTECTION_REQUEST_MAJOR &&
+             data[offset + 1] == GNUTLS_RENEGO_PROTECTION_REQUEST_MINOR)
+           {
+             _gnutls_handshake_log
+               ("HSK[%p]: Received safe renegotiation CS\n", session);
+             session->internals.safe_renegotiation_received = 1;
+             session->internals.connection_using_safe_renegotiation = 1;
+             break;
+           }
+       }
+    }
 
   pk_algo = _gnutls_server_find_pk_algos_in_ciphersuites (data, datalen);
 
@@ -2386,7 +2386,7 @@ _gnutls_recv_hello (gnutls_session_t session, opaque * 
data, int datalen)
       _gnutls_handshake_log ("HSK[%p]: Safe renegotiation succeeded\n",
                             session);
     }
-  else /* safe renegotiation not received... */
+  else                         /* safe renegotiation not received... */
     {
       if (session->internals.connection_using_safe_renegotiation)
        {
@@ -2401,7 +2401,7 @@ _gnutls_recv_hello (gnutls_session_t session, opaque * 
data, int datalen)
       if (session->internals.initial_negotiation_completed)
        {
 
-          if (session->internals.priorities.sr < SR_PARTIAL)
+         if (session->internals.priorities.sr < SR_PARTIAL)
            {
              _gnutls_handshake_log
                ("HSK[%p]: Allowing unsafe (re)negotiation\n", session);
@@ -2411,7 +2411,7 @@ _gnutls_recv_hello (gnutls_session_t session, opaque * 
data, int datalen)
              gnutls_assert ();
              _gnutls_handshake_log
                ("HSK[%p]: Denying unsafe (re)negotiation\n", session);
-              return GNUTLS_E_UNSAFE_RENEGOTIATION_DENIED;
+             return GNUTLS_E_UNSAFE_RENEGOTIATION_DENIED;
            }
        }
       else
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index 3d23f94..1740e51 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -451,7 +451,8 @@ typedef struct
   unsigned int algorithms;
 } priority_st;
 
-typedef enum {
+typedef enum
+{
   SR_DISABLED,
   SR_UNSAFE,
   SR_PARTIAL,
diff --git a/lib/gnutls_priority.c b/lib/gnutls_priority.c
index 319f097..3d721db 100644
--- a/lib/gnutls_priority.c
+++ b/lib/gnutls_priority.c
@@ -578,7 +578,7 @@ gnutls_priority_init (gnutls_priority_t * priority_cache,
       gnutls_assert ();
       return GNUTLS_E_MEMORY_ERROR;
     }
-  
+
   /* for now unsafe renegotiation is default on everyone. To be removed
    * when we make it the default.
    */
@@ -733,13 +733,13 @@ gnutls_priority_init (gnutls_priority_t * priority_cache,
              GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT;
          else if (strcasecmp (&broken_list[i][1],
                               "UNSAFE_RENEGOTIATION") == 0)
-            {
+           {
              (*priority_cache)->sr = SR_UNSAFE;
-            }
+           }
          else if (strcasecmp (&broken_list[i][1], "SAFE_RENEGOTIATION") == 0)
            {
              (*priority_cache)->sr = SR_SAFE;
-            }
+           }
          else if (strcasecmp (&broken_list[i][1],
                               "PARTIAL_RENEGOTIATION") == 0)
            {
@@ -747,9 +747,9 @@ gnutls_priority_init (gnutls_priority_t * priority_cache,
            }
          else if (strcasecmp (&broken_list[i][1],
                               "DISABLE_SAFE_RENEGOTIATION") == 0)
-            {
+           {
              (*priority_cache)->sr = SR_DISABLED;
-            }
+           }
          else
            goto error;
        }
diff --git a/lib/x509/common.h b/lib/x509/common.h
index a2a94fe..0853a11 100644
--- a/lib/x509/common.h
+++ b/lib/x509/common.h
@@ -128,6 +128,6 @@ int _gnutls_x509_get_signed_data (ASN1_TYPE src, const char 
*src_name,
 int _gnutls_x509_get_signature (ASN1_TYPE src, const char *src_name,
                                gnutls_datum_t * signature);
 
-gnutls_digest_algorithm_t _gnutls_dsa_q_to_hash(bigint_t q);
+gnutls_digest_algorithm_t _gnutls_dsa_q_to_hash (bigint_t q);
 
 #endif
diff --git a/lib/x509/sign.c b/lib/x509/sign.c
index e74c48f..b2fd7c2 100644
--- a/lib/x509/sign.c
+++ b/lib/x509/sign.c
@@ -180,7 +180,7 @@ dsa_sign (const gnutls_datum_t * text,
   opaque _digest[MAX_HASH_SIZE];
   digest_hd_st hd;
   gnutls_datum_t digest;
-  gnutls_digest_algorithm_t hash = _gnutls_dsa_q_to_hash(params[1]);
+  gnutls_digest_algorithm_t hash = _gnutls_dsa_q_to_hash (params[1]);
 
   ret = _gnutls_hash_init (&hd, hash);
   if (ret < 0)
@@ -193,7 +193,7 @@ dsa_sign (const gnutls_datum_t * text,
   _gnutls_hash_deinit (&hd, _digest);
 
   digest.data = _digest;
-  digest.size = _gnutls_hash_get_algo_len(hash);
+  digest.size = _gnutls_hash_get_algo_len (hash);
 
   if ((ret =
        _gnutls_sign (GNUTLS_PK_DSA, params, params_len, &digest,
diff --git a/lib/x509/verify.c b/lib/x509/verify.c
index 8ef697b..393b8a5 100644
--- a/lib/x509/verify.c
+++ b/lib/x509/verify.c
@@ -839,17 +839,23 @@ verify_sig (const gnutls_datum_t * tbs,
     }
 }
 
-gnutls_digest_algorithm_t _gnutls_dsa_q_to_hash(bigint_t q)
+gnutls_digest_algorithm_t
+_gnutls_dsa_q_to_hash (bigint_t q)
 {
-  int bits = _gnutls_mpi_get_nbits(q);
-
-  if (bits <= 160) {
-    return GNUTLS_DIG_SHA1;
-  } else if (bits <= 224) {
-    return GNUTLS_DIG_SHA224;
-  } else {
-    return GNUTLS_DIG_SHA256;
-  }
+  int bits = _gnutls_mpi_get_nbits (q);
+
+  if (bits <= 160)
+    {
+      return GNUTLS_DIG_SHA1;
+    }
+  else if (bits <= 224)
+    {
+      return GNUTLS_DIG_SHA224;
+    }
+  else
+    {
+      return GNUTLS_DIG_SHA256;
+    }
 }
 
 int
@@ -866,8 +872,7 @@ _gnutls_x509_verify_algorithm (gnutls_mac_algorithm_t * 
hash,
 
   issuer_params_size = MAX_PUBLIC_PARAMS_SIZE;
   ret =
-    _gnutls_x509_crt_get_mpis (issuer, issuer_params,
-                                  &issuer_params_size);
+    _gnutls_x509_crt_get_mpis (issuer, issuer_params, &issuer_params_size);
   if (ret < 0)
     {
       gnutls_assert ();
@@ -877,9 +882,9 @@ _gnutls_x509_verify_algorithm (gnutls_mac_algorithm_t * 
hash,
   switch (gnutls_x509_crt_get_pk_algorithm (issuer, NULL))
     {
     case GNUTLS_PK_DSA:
-      
+
       if (hash)
-       *hash = _gnutls_dsa_q_to_hash(issuer_params[1]);
+       *hash = _gnutls_dsa_q_to_hash (issuer_params[1]);
 
       ret = 0;
       break;
@@ -924,7 +929,7 @@ _gnutls_x509_verify_algorithm (gnutls_mac_algorithm_t * 
hash,
     }
 
 cleanup:
-    /* release allocated mpis */
+  /* release allocated mpis */
   for (i = 0; i < issuer_params_size; i++)
     {
       _gnutls_mpi_release (&issuer_params[i]);
diff --git a/tests/mini-x509-rehandshake.c b/tests/mini-x509-rehandshake.c
index feafa7e..66b7946 100644
--- a/tests/mini-x509-rehandshake.c
+++ b/tests/mini-x509-rehandshake.c
@@ -274,10 +274,10 @@ main (int argc, char *argv[])
        }
     }
   while (
-        /* Not done: */
-        !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
-        /* No error: */
-        && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
+         /* Not done: */
+         !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
+         /* No error: */
+         && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
 
   if (cret != GNUTLS_E_SUCCESS && sret != GNUTLS_E_SUCCESS)
     exit_code = 1;
diff --git a/tests/safe-renegotiation/srn0.c b/tests/safe-renegotiation/srn0.c
index 0d7e4bb..739103f 100644
--- a/tests/safe-renegotiation/srn0.c
+++ b/tests/safe-renegotiation/srn0.c
@@ -297,10 +297,10 @@ main (int argc, char *argv[])
        }
     }
   while (
-        /* Not done: */
-        !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
-        /* No error: */
-        && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
+         /* Not done: */
+         !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
+         /* No error: */
+         && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
 
   if (cret != GNUTLS_E_SUCCESS && sret != GNUTLS_E_SUCCESS)
     exit_code = 1;
@@ -308,7 +308,8 @@ main (int argc, char *argv[])
   if (!gnutls_safe_renegotiation_status (client) ||
       !gnutls_safe_renegotiation_status (server))
     {
-      tls_log_func (0, "Rehandshaked session not using safe renegotiation!\n");
+      tls_log_func (0,
+                   "Rehandshaked session not using safe renegotiation!\n");
       exit_code = EXIT_FAILURE;
     }
 
diff --git a/tests/safe-renegotiation/srn1.c b/tests/safe-renegotiation/srn1.c
index ec70dc5..f96fd83 100644
--- a/tests/safe-renegotiation/srn1.c
+++ b/tests/safe-renegotiation/srn1.c
@@ -300,12 +300,13 @@ main (int argc, char *argv[])
        break;
     }
   while (
-        /* Not done: */
-        !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
-        /* No error: */
-        && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
+         /* Not done: */
+         !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
+         /* No error: */
+         && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
 
-  if (cret != GNUTLS_E_SUCCESS && sret != GNUTLS_E_UNSAFE_RENEGOTIATION_DENIED)
+  if (cret != GNUTLS_E_SUCCESS
+      && sret != GNUTLS_E_UNSAFE_RENEGOTIATION_DENIED)
     exit_code = 1;
 
   if (gnutls_safe_renegotiation_status (client) ||
diff --git a/tests/safe-renegotiation/srn2.c b/tests/safe-renegotiation/srn2.c
index 05b83d0..2b4268c 100644
--- a/tests/safe-renegotiation/srn2.c
+++ b/tests/safe-renegotiation/srn2.c
@@ -300,12 +300,13 @@ main (int argc, char *argv[])
        break;
     }
   while (
-        /* Not done: */
-        !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
-        /* No error: */
-        && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
+         /* Not done: */
+         !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
+         /* No error: */
+         && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
 
-  if (cret != GNUTLS_E_UNSAFE_RENEGOTIATION_DENIED && sret != GNUTLS_E_SUCCESS)
+  if (cret != GNUTLS_E_UNSAFE_RENEGOTIATION_DENIED
+      && sret != GNUTLS_E_SUCCESS)
     exit_code = 1;
 
   if (gnutls_safe_renegotiation_status (client) ||
diff --git a/tests/safe-renegotiation/srn3.c b/tests/safe-renegotiation/srn3.c
index 9730b7d..8cd8230 100644
--- a/tests/safe-renegotiation/srn3.c
+++ b/tests/safe-renegotiation/srn3.c
@@ -193,8 +193,7 @@ main (int argc, char *argv[])
   gnutls_certificate_allocate_credentials (&clientx509cred);
   gnutls_init (&client, GNUTLS_CLIENT);
   gnutls_credentials_set (client, GNUTLS_CRD_CERTIFICATE, clientx509cred);
-  gnutls_priority_set_direct (client, "NORMAL:%SAFE_RENEGOTIATION",
-                             NULL);
+  gnutls_priority_set_direct (client, "NORMAL:%SAFE_RENEGOTIATION", NULL);
   gnutls_transport_set_push_function (client, client_push);
   gnutls_transport_set_pull_function (client, client_pull);
 
diff --git a/tests/safe-renegotiation/srn5.c b/tests/safe-renegotiation/srn5.c
index 3da57ad..e91dad4 100644
--- a/tests/safe-renegotiation/srn5.c
+++ b/tests/safe-renegotiation/srn5.c
@@ -297,10 +297,10 @@ main (int argc, char *argv[])
        }
     }
   while (
-        /* Not done: */
-        !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
-        /* No error: */
-        && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
+         /* Not done: */
+         !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
+         /* No error: */
+         && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
 
   if (cret != GNUTLS_E_SUCCESS && sret != GNUTLS_E_SUCCESS)
     exit_code = 1;
diff --git a/tests/safe-renegotiation/srn6.c b/tests/safe-renegotiation/srn6.c
index f677b83..0e7fb1b 100644
--- a/tests/safe-renegotiation/srn6.c
+++ b/tests/safe-renegotiation/srn6.c
@@ -297,10 +297,10 @@ main (int argc, char *argv[])
        }
     }
   while (
-        /* Not done: */
-        !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
-        /* No error: */
-        && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
+         /* Not done: */
+         !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
+         /* No error: */
+         && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
 
   if (cret != GNUTLS_E_SUCCESS && sret != GNUTLS_E_SUCCESS)
     exit_code = 1;
diff --git a/tests/safe-renegotiation/srn7.c b/tests/safe-renegotiation/srn7.c
index bd8141f..0add9eb 100644
--- a/tests/safe-renegotiation/srn7.c
+++ b/tests/safe-renegotiation/srn7.c
@@ -295,10 +295,10 @@ main (int argc, char *argv[])
        }
     }
   while (
-        /* Not done: */
-        !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
-        /* No error: */
-        && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
+         /* Not done: */
+         !(cret == GNUTLS_E_SUCCESS && sret == GNUTLS_E_SUCCESS)
+         /* No error: */
+         && (cret == GNUTLS_E_AGAIN || sret == GNUTLS_E_AGAIN));
 
   if (cret != GNUTLS_E_SUCCESS && sret != GNUTLS_E_SUCCESS)
     exit_code = 1;
@@ -306,7 +306,8 @@ main (int argc, char *argv[])
   if (!gnutls_safe_renegotiation_status (client) ||
       !gnutls_safe_renegotiation_status (server))
     {
-      tls_log_func (0, "Rehandshaked session not using safe renegotiation!\n");
+      tls_log_func (0,
+                   "Rehandshaked session not using safe renegotiation!\n");
       exit_code = EXIT_FAILURE;
     }
 


hooks/post-receive
-- 
GNU gnutls



reply via email to

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