diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-01 20:11:29 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-01 20:11:29 +0100 |
commit | f218562ece1267d0e0e3f36415463e385b5d266f (patch) | |
tree | 7ba7bdb8eb9252c58208023388d6dfc9a7ef0fef /src | |
parent | 20c1befdf6a6d3185ae910e0d5498022ca69930e (diff) | |
download | gnutls-f218562ece1267d0e0e3f36415463e385b5d266f.tar.gz |
Applied disable SNI patch from Daniel.
Diffstat (limited to 'src')
-rw-r--r-- | src/cli-args.c | 81 | ||||
-rw-r--r-- | src/cli-args.def | 6 | ||||
-rw-r--r-- | src/cli-args.h | 12 | ||||
-rw-r--r-- | src/cli.c | 4 |
4 files changed, 68 insertions, 35 deletions
diff --git a/src/cli-args.c b/src/cli-args.c index e2906456ed..083a308763 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 January 23, 2013 at 09:03:04 PM by AutoGen 5.16 + * It has been AutoGen-ed February 1, 2013 at 08:10:51 PM by AutoGen 5.16 * From the definitions cli-args.def * and the template file options * @@ -67,7 +67,7 @@ extern FILE * option_usage_fp; /* * gnutls-cli option static const strings */ -static char const gnutls_cli_opt_strs[3854] = +static char const gnutls_cli_opt_strs[3921] = /* 0 */ "gnutls-cli @VERSION@\n" "Copyright (C) 2000-2012 Free Software Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" @@ -214,23 +214,26 @@ static char const gnutls_cli_opt_strs[3854] = /* 3214 */ "Print a list of the supported algorithms and modes\0" /* 3265 */ "LIST\0" /* 3270 */ "list\0" -/* 3275 */ "Display extended usage information and exit\0" -/* 3319 */ "help\0" -/* 3324 */ "Extended usage information passed thru pager\0" -/* 3369 */ "more-help\0" -/* 3379 */ "Output version information and exit\0" -/* 3415 */ "version\0" -/* 3423 */ "GNUTLS_CLI\0" -/* 3434 */ "gnutls-cli - GnuTLS client - Ver. @VERSION@\n" +/* 3275 */ "Do not send a Server Name Indication (SNI)\0" +/* 3318 */ "DISABLE_SNI\0" +/* 3330 */ "disable-sni\0" +/* 3342 */ "Display extended usage information and exit\0" +/* 3386 */ "help\0" +/* 3391 */ "Extended usage information passed thru pager\0" +/* 3436 */ "more-help\0" +/* 3446 */ "Output version information and exit\0" +/* 3482 */ "version\0" +/* 3490 */ "GNUTLS_CLI\0" +/* 3501 */ "gnutls-cli - GnuTLS client - Ver. @VERSION@\n" "USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostname]\n\0" -/* 3547 */ "bug-gnutls@gnu.org\0" -/* 3566 */ "\n\n\0" -/* 3569 */ "\n" +/* 3614 */ "bug-gnutls@gnu.org\0" +/* 3633 */ "\n\n\0" +/* 3636 */ "\n" "Simple client program to set up a TLS connection to some other computer. It\n" "sets up a TLS connection and forwards data from the standard input to the\n" "secured socket and vice versa.\n\0" -/* 3753 */ "gnutls-cli @VERSION@\0" -/* 3774 */ "Usage: gnutls-cli [options] hostname\n" +/* 3820 */ "gnutls-cli @VERSION@\0" +/* 3841 */ "Usage: gnutls-cli [options] hostname\n" "gnutls-cli --help for usage instructions.\n"; /* @@ -607,13 +610,21 @@ static char const gnutls_cli_opt_strs[3854] = #define LIST_FLAGS (OPTST_DISABLED) /* + * disable-sni option description: + */ +#define DISABLE_SNI_DESC (gnutls_cli_opt_strs+3275) +#define DISABLE_SNI_NAME (gnutls_cli_opt_strs+3318) +#define DISABLE_SNI_name (gnutls_cli_opt_strs+3330) +#define DISABLE_SNI_FLAGS (OPTST_DISABLED) + +/* * Help/More_Help/Version option descriptions: */ -#define HELP_DESC (gnutls_cli_opt_strs+3275) -#define HELP_name (gnutls_cli_opt_strs+3319) +#define HELP_DESC (gnutls_cli_opt_strs+3342) +#define HELP_name (gnutls_cli_opt_strs+3386) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (gnutls_cli_opt_strs+3324) -#define MORE_HELP_name (gnutls_cli_opt_strs+3369) +#define MORE_HELP_DESC (gnutls_cli_opt_strs+3391) +#define MORE_HELP_name (gnutls_cli_opt_strs+3436) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC NULL @@ -626,8 +637,8 @@ static char const gnutls_cli_opt_strs[3854] = # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (gnutls_cli_opt_strs+3379) -#define VER_name (gnutls_cli_opt_strs+3415) +#define VER_DESC (gnutls_cli_opt_strs+3446) +#define VER_name (gnutls_cli_opt_strs+3482) /* * Declare option callback procedures */ @@ -1164,6 +1175,18 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name, /* disablement strs */ NULL, NULL }, + { /* entry idx, value */ 43, VALUE_OPT_DISABLE_SNI, + /* equiv idx, value */ 43, VALUE_OPT_DISABLE_SNI, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DISABLE_SNI_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --disable-sni */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DISABLE_SNI_DESC, DISABLE_SNI_NAME, DISABLE_SNI_name, + /* disablement strs */ NULL, NULL }, + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, /* equivalenced to */ NO_EQUIVALENT, @@ -1208,14 +1231,14 @@ static tOptDesc optDesc[OPTION_CT] = { * * Define the gnutls-cli Option Environment */ -#define zPROGNAME (gnutls_cli_opt_strs+3423) -#define zUsageTitle (gnutls_cli_opt_strs+3434) +#define zPROGNAME (gnutls_cli_opt_strs+3490) +#define zUsageTitle (gnutls_cli_opt_strs+3501) #define zRcName NULL #define apzHomeList NULL -#define zBugsAddr (gnutls_cli_opt_strs+3547) -#define zExplain (gnutls_cli_opt_strs+3566) -#define zDetail (gnutls_cli_opt_strs+3569) -#define zFullVersion (gnutls_cli_opt_strs+3753) +#define zBugsAddr (gnutls_cli_opt_strs+3614) +#define zExplain (gnutls_cli_opt_strs+3633) +#define zDetail (gnutls_cli_opt_strs+3636) +#define zFullVersion (gnutls_cli_opt_strs+3820) /* extracted from optcode.tlib near line 350 */ #if defined(ENABLE_NLS) @@ -1229,7 +1252,7 @@ static tOptDesc optDesc[OPTION_CT] = { #define gnutls_cli_full_usage (NULL) -#define gnutls_cli_short_usage (gnutls_cli_opt_strs+3774) +#define gnutls_cli_short_usage (gnutls_cli_opt_strs+3841) #endif /* not defined __doxygen__ */ @@ -1507,7 +1530,7 @@ tOptions gnutls_cliOptions = { NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, - 46 /* full option count */, 43 /* user option count */, + 47 /* full option count */, 44 /* user option count */, gnutls_cli_full_usage, gnutls_cli_short_usage, NULL, NULL, PKGDATADIR, gnutls_cli_packager_info diff --git a/src/cli-args.def b/src/cli-args.def index ea976edc00..5e663c09df 100644 --- a/src/cli-args.def +++ b/src/cli-args.def @@ -308,6 +308,12 @@ flag = { doc = "Print a list of the supported algorithms and modes. If a priority string is given then only the enabled ciphersuites are shown."; }; +flag = { + name = disable-sni; + descrip = "Do not send a Server Name Indication (SNI)"; + doc = ""; +}; + doc-section = { diff --git a/src/cli-args.h b/src/cli-args.h index e7809f48b9..0a9f8b955c 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 January 23, 2013 at 09:03:04 PM by AutoGen 5.16 + * It has been AutoGen-ed February 1, 2013 at 08:10:51 PM by AutoGen 5.16 * From the definitions cli-args.def * and the template file options * @@ -110,12 +110,13 @@ typedef enum { INDEX_OPT_BENCHMARK_TLS_KX = 40, INDEX_OPT_BENCHMARK_TLS_CIPHERS = 41, INDEX_OPT_LIST = 42, - INDEX_OPT_VERSION = 43, - INDEX_OPT_HELP = 44, - INDEX_OPT_MORE_HELP = 45 + INDEX_OPT_DISABLE_SNI = 43, + INDEX_OPT_VERSION = 44, + INDEX_OPT_HELP = 45, + INDEX_OPT_MORE_HELP = 46 } teOptIndex; -#define OPTION_CT 46 +#define OPTION_CT 47 #define GNUTLS_CLI_VERSION "@VERSION@" #define GNUTLS_CLI_FULL_VERSION "gnutls-cli @VERSION@" @@ -204,6 +205,7 @@ typedef enum { #define VALUE_OPT_BENCHMARK_TLS_KX 136 #define VALUE_OPT_BENCHMARK_TLS_CIPHERS 137 #define VALUE_OPT_LIST 'l' +#define VALUE_OPT_DISABLE_SNI 139 #define VALUE_OPT_HELP 'h' #define VALUE_OPT_MORE_HELP '!' #define VALUE_OPT_VERSION 'v' @@ -88,6 +88,7 @@ const char *x509_cafile = NULL; const char *x509_crlfile = NULL; static int x509ctype; static int disable_extensions; +static int disable_sni; static unsigned int init_flags = GNUTLS_CLIENT; static const char * priorities = NULL; @@ -630,7 +631,7 @@ init_tls_session (const char *hostname) /* allow the use of private ciphersuites. */ - if (disable_extensions == 0) + if (disable_extensions == 0 && disable_sni == 0) { if (!isdigit(hostname[0]) && strchr(hostname, ':') == 0) gnutls_server_name_set (session, GNUTLS_NAME_DNS, hostname, @@ -1131,6 +1132,7 @@ const char* rest = NULL; exit(0); } + disable_sni = HAVE_OPT(DISABLE_SNI); disable_extensions = HAVE_OPT( DISABLE_EXTENSIONS); if (disable_extensions) init_flags |= GNUTLS_NO_EXTENSIONS; |