From: Nikos Mavrogiannopoulos Date: Sat, 13 Oct 2012 10:20:30 +0000 (+0200) Subject: disable default extensions on --disable-extensions. X-Git-Tag: gnutls_3_1_4~103 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9754daef647fa5b313e83d5a59c01f7c4f5048b4;p=thirdparty%2Fgnutls.git disable default extensions on --disable-extensions. --- diff --git a/doc/invoke-gnutls-cli.texi b/doc/invoke-gnutls-cli.texi index ade332a005..089feeccf2 100644 --- a/doc/invoke-gnutls-cli.texi +++ b/doc/invoke-gnutls-cli.texi @@ -7,7 +7,7 @@ # # DO NOT EDIT THIS FILE (invoke-gnutls-cli.texi) # -# It has been AutoGen-ed October 7, 2012 at 10:36:28 AM by AutoGen 5.16 +# It has been AutoGen-ed October 13, 2012 at 09:27:08 AM by AutoGen 5.16 # From the definitions ../src/cli-args.def # and the template file agtexi-cmd.tpl @end ignore @@ -188,6 +188,12 @@ The client will indicate to the server in a TLS extension that it wants a OCSP s This is the ``connect, establish a plain session and start tls.'' option. The TLS session will be initiated when EOF or a SIGALRM is received. +@anchor{gnutls-cli disable-extensions} +@subheading disable-extensions option +@cindex gnutls-cli-disable-extensions + +This is the ``disable all the tls extensions'' option. +This option disables all TLS extensions. Deprecated option. Use the priority string. @anchor{gnutls-cli dh-bits} @subheading dh-bits option @cindex gnutls-cli-dh-bits diff --git a/src/cli-args.c b/src/cli-args.c index 819ac38d66..6c7a01a70f 100644 --- a/src/cli-args.c +++ b/src/cli-args.c @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (cli-args.c) * - * It has been AutoGen-ed October 7, 2012 at 01:02:46 PM by AutoGen 5.16 + * It has been AutoGen-ed October 13, 2012 at 09:26:42 AM by AutoGen 5.16 * From the definitions cli-args.def * and the template file options * diff --git a/src/cli-args.def b/src/cli-args.def index a23e0a58cc..072004fe78 100644 --- a/src/cli-args.def +++ b/src/cli-args.def @@ -125,7 +125,7 @@ flag = { flag = { name = disable-extensions; descrip = "Disable all the TLS extensions"; - doc = ""; + doc = "This option disables all TLS extensions. Deprecated option. Use the priority string."; }; flag = { diff --git a/src/cli-args.h b/src/cli-args.h index f2ad811dfd..7c3627816d 100644 --- a/src/cli-args.h +++ b/src/cli-args.h @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (cli-args.h) * - * It has been AutoGen-ed October 7, 2012 at 01:02:46 PM by AutoGen 5.16 + * It has been AutoGen-ed October 13, 2012 at 09:26:42 AM by AutoGen 5.16 * From the definitions cli-args.def * and the template file options * diff --git a/src/cli.c b/src/cli.c index a4bcc46564..7b04385000 100644 --- a/src/cli.c +++ b/src/cli.c @@ -89,6 +89,7 @@ const char *x509_cafile = NULL; const char *x509_crlfile = NULL; static int x509ctype; static int disable_extensions; +static unsigned int init_flags = GNUTLS_CLIENT; static const char * priorities = NULL; const char *psk_username = NULL; @@ -612,12 +613,12 @@ init_tls_session (const char *hostname) if (udp) { - gnutls_init (&session, GNUTLS_CLIENT|GNUTLS_DATAGRAM); + gnutls_init (&session, GNUTLS_DATAGRAM|init_flags); if (mtu) gnutls_dtls_set_mtu(session, mtu); } else - gnutls_init (&session, GNUTLS_CLIENT); + gnutls_init (&session, init_flags); if ((ret = gnutls_priority_set_direct (session, priorities, &err)) < 0) { @@ -671,21 +672,6 @@ init_tls_session (const char *hostname) if (HAVE_OPT(HEARTBEAT)) gnutls_heartbeat_enable (session, GNUTLS_HB_PEER_ALLOWED_TO_SEND); - /* OCSP status-request TLS extension */ - if (status_request_ocsp > 0 && disable_extensions == 0) - { - if (gnutls_ocsp_status_request_enable_client (session, NULL, 0, NULL) < 0) - { - fprintf (stderr, "Cannot set OCSP status request information.\n"); - exit (1); - } - } - -#ifdef ENABLE_SESSION_TICKET - if (disable_extensions == 0 && !HAVE_OPT(NOTICKET)t) - gnutls_session_ticket_enable_client (session); -#endif - return session; } @@ -1127,6 +1113,9 @@ const char* rest = NULL; } disable_extensions = HAVE_OPT( DISABLE_EXTENSIONS); + if (disable_extensions) + init_flags |= GNUTLS_NO_EXTENSIONS; + starttls = HAVE_OPT(STARTTLS); resume = HAVE_OPT(RESUME); rehandshake = HAVE_OPT(REHANDSHAKE);