]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
disable default extensions on --disable-extensions.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 13 Oct 2012 10:20:30 +0000 (12:20 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 13 Oct 2012 11:20:03 +0000 (13:20 +0200)
doc/invoke-gnutls-cli.texi
src/cli-args.c
src/cli-args.def
src/cli-args.h
src/cli.c

index ade332a00531a247306a334a449864ad592d9370..089feeccf212520fd6cf7c8bc92cd6228c3ac37d 100644 (file)
@@ -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
index 819ac38d668d07e578b78fedc64f4a0841ca26db..6c7a01a70fab9c28dbee2fac42461fd88e866c20 100644 (file)
@@ -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
  *
index a23e0a58cceee942fd318355f810497157bad489..072004fe78be7cad8d27896b47b80ac809f13b2c 100644 (file)
@@ -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 = {
index f2ad811dfd2d80a64fe22caad5afe1c5ab025ed4..7c3627816db4bd89049fc61046b48c8c48173a11 100644 (file)
@@ -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
  *
index a4bcc465645b67746225acc8ef8bb26eba20ce5c..7b043850007c1981048cc3603bc244b93e3ca74d 100644 (file)
--- 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);