]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls-cli: Print channel binding only in verbose mode.
authorSimon Josefsson <simon@josefsson.org>
Sat, 16 Oct 2010 06:57:08 +0000 (08:57 +0200)
committerSimon Josefsson <simon@josefsson.org>
Sat, 16 Oct 2010 06:57:08 +0000 (08:57 +0200)
Before it printed it after the 'Compression:' output, thus breaking
Emacs starttls.el string searches.

NEWS
src/common.c

diff --git a/NEWS b/NEWS
index b87f11c6ff392a28c8d99b6fd7b05b92ef57255a..6887cef58cd526da0e7f3ddfd07f32262259adce 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,10 @@ See the end for copying conditions.
 
 * Version 2.11.5 (unreleased)
 
+** gnutls-cli: Print channel binding only in verbose mode.
+Before it printed it after the 'Compression:' output, thus breaking
+Emacs starttls.el string searches.
+
 ** API and ABI modifications:
 No changes since last version.
 
index b270cd5f1f17bc596460f38e0e6202b1e0a7a574..661c770c75ce56d69829e82fa021d6dc6d9ad501 100644 (file)
@@ -488,23 +488,28 @@ print_info (gnutls_session_t session, const char *hostname, int insecure)
       printf ("- Session ID: %s\n", raw_to_string (id, id_size));
     }
 
-  {
-    gnutls_datum cb;
-    int rc;
+  if (verbose)
+    {
+      gnutls_datum cb;
+      int rc;
 
-    rc = gnutls_session_channel_binding (session, GNUTLS_CB_TLS_UNIQUE, &cb);
-    if (rc)
+      rc = gnutls_session_channel_binding (session, GNUTLS_CB_TLS_UNIQUE, &cb);
+      if (rc)
        fprintf (stderr, "Channel binding error: %s\n", gnutls_strerror (rc));
-    else
-      {
-       size_t i;
+      else
+       {
+         size_t i;
 
-       printf ("- Channel binding 'tls-unique': ");
-       for (i = 0; i < cb.size; i++)
-         printf ("%02x", cb.data[i]);
-       printf ("\n");
-      }
-  }
+         printf ("- Channel binding 'tls-unique': ");
+         for (i = 0; i < cb.size; i++)
+           printf ("%02x", cb.data[i]);
+         printf ("\n");
+       }
+    }
+
+  /* Warning: Do not print anything more here. The 'Compression:'
+     output MUST be the last non-verbose output.  This is used by
+     Emacs starttls.el code. */
 
   fflush (stdout);