From: Simon Josefsson Date: Sat, 16 Oct 2010 06:57:08 +0000 (+0200) Subject: gnutls-cli: Print channel binding only in verbose mode. X-Git-Tag: gnutls_2_11_5~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8e117f259e5fe0578d9986e75c0f46ca76ac317;p=thirdparty%2Fgnutls.git gnutls-cli: Print channel binding only in verbose mode. Before it printed it after the 'Compression:' output, thus breaking Emacs starttls.el string searches. --- diff --git a/NEWS b/NEWS index b87f11c6ff..6887cef58c 100644 --- 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. diff --git a/src/common.c b/src/common.c index b270cd5f1f..661c770c75 100644 --- a/src/common.c +++ b/src/common.c @@ -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);