gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gsasl_cmd.c
Go to the documentation of this file.
1 /*
2  File autogenerated by gengetopt version 2.22.6
3  generated with the following command:
4  gengetopt --unamed-opts=HOST [PORT] --no-handle-version --no-handle-help --input gsasl.ggo --file-name gsasl_cmd
5 
6  The developers of gengetopt consider the fixed text that goes in all
7  gengetopt output files to be in the public domain:
8  we make no copyright claims on it.
9 */
10 
11 /* If we use autoconf. */
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
15 
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <string.h>
19 
20 #ifndef FIX_UNUSED
21 #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
22 #endif
23 
24 #include <getopt.h>
25 
26 #include "gsasl_cmd.h"
27 
28 const char *gengetopt_args_info_purpose = "Authenticate user to a server using Simple Authentication and\nSecurity Layer. Currently IMAP and SMTP servers are supported. This\nis a command line interface for the GNU SASL library.";
29 
30 const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]... [HOST [PORT]]...";
31 
33 
35 
36 const char *gengetopt_args_info_help[] = {
37  " -h, --help Print help and exit",
38  " -V, --version Print version and exit",
39  "\nCommands:",
40  " -c, --client Act as client. (default=on)",
41  " -s, --server Act as server. (default=off)",
42  " --client-mechanisms Write name of supported client mechanisms\n separated by space to stdout. (default=off)",
43  " --server-mechanisms Write name of supported server mechanisms\n separated by space to stdout. (default=off)",
44  " -k, --mkpasswd Derive password. Provide --mechanism as\n SCRAM-SHA-1 or SCRAM-SHA-256. The required\n inputs are password (through --password or\n read from terminal) and optional inputs are\n iteration count (through --iteration-count,\n or defaulting to 65536) and salt (through\n --salt, or generated randomly). The output\n is a string of the form\n \"{mech}count,salt,stored-key,server-key[,salted-password]\"\n where \"mech\" is the mechanism, \"count\" is\n the number of times password was hashed,\n \"salt\" is the provided/generated\n base64-encoded salt, \"stored-key\" and\n \"server-key\" are the two derived and\n base64-encoded server-side keys. When\n --verbose is provided, \"salted-password\"\n will be included as the hex-encoded\n PBKDF2-derived password. (default=off)",
45  "\nNetwork options:",
46  " --connect=HOST[:PORT] Connect to TCP server and negotiate on stream\n instead of stdin/stdout. PORT is the protocol\n service, or an integer denoting the port, and\n defaults to 143 (imap) if not specified. Also\n sets the --hostname default.",
47  "\nGeneric options:",
48  " -d, --application-data After authentication, read data from stdin and\n run it through the mechanism's security layer\n and print it base64 encoded to stdout. The\n default is to terminate after authentication.\n (default=on)",
49  " --imap Use a IMAP-like logon procedure (client only).\n Also sets the --service default to 'imap'.\n (default=off)",
50  " --smtp Use a SMTP-like logon procedure (client only).\n Also sets the --service default to 'smtp'.\n (default=off)",
51  " -m, --mechanism=STRING Mechanism to use.",
52  " --no-client-first Disallow client to send data first (client\n only). (default=off)",
53  "\nSASL mechanism options (they are prompted for when required):",
54  " -n, --anonymous-token=STRING Token for anonymous authentication, usually\n mail address (ANONYMOUS only).",
55  " -a, --authentication-id=STRING\n Identity of credential owner.",
56  " -z, --authorization-id=STRING Identity to request service for.",
57  " -p, --password=STRING Password for authentication (insecure for\n non-testing purposes).",
58  " -r, --realm=STRING Realm. Defaults to hostname.",
59  " --passcode=NUMBER Passcode for authentication (SECURID only).",
60  " --service=STRING Set the requested service name (should be a\n registered GSSAPI host based service name).",
61  " --hostname=STRING Set the name of the server with the requested\n service.",
62  " --service-name=STRING Set the generic server name in case of a\n replicated server (DIGEST-MD5 only).",
63  " --enable-cram-md5-validate\n Validate CRAM-MD5 challenge and response\n interactively. (default=off)",
64  " --disable-cleartext-validate\n Disable cleartext validate hook, forcing server\n to prompt for password. (default=off)",
65  " --quality-of-protection=TYPE\n How application payload will be protected.\n 'qop-auth' means no protection, 'qop-int'\n means integrity protection, 'qop-conf' means\n integrity and confidentialiy protection.\n Currently only used by DIGEST-MD5, where the\n default is 'qop-int'.",
66  " --iteration-count=NUMBER Indicate PBKDF2 hash iteration count (SCRAM\n only). (default=`65536')",
67  " --salt=B64DATA Indicate PBKDF2 salt as base64-encoded string\n (SCRAM only).",
68  "\nSTARTTLS options:",
69  " --starttls Force use of STARTTLS. The default is to use\n STARTTLS when available. (default=off)",
70  " --no-starttls Unconditionally disable STARTTLS.\n (default=off)",
71  " --no-cb Don't use channel bindings from TLS.\n (default=off)",
72  " --x509-ca-file=FILE File containing one or more X.509 Certificate\n Authorities certificates in PEM format, used\n to verify the certificate received from the\n server. If not specified, verification uses\n system trust settings. If FILE is the empty\n string, don't fail on X.509 server\n certificates verification errors.",
73  " --x509-cert-file=FILE File containing client X.509 certificate in PEM\n format. Used together with --x509-key-file\n to specify the certificate/key pair.",
74  " --x509-key-file=FILE Private key for the client X.509 certificate in\n PEM format. Used together with\n --x509-key-file to specify the\n certificate/key pair.",
75  " --priority=STRING Cipher priority string.",
76  "\nOther options:",
77  " --verbose Produce verbose output. (default=off)",
78  " --quiet Don't produce any diagnostic output.\n (default=off)",
79  0
80 };
81 
82 typedef enum {ARG_NO
87 
88 static
90 static
92 
93 static int
94 cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
95  struct cmdline_parser_params *params, const char *additional_error);
96 
97 
98 static char *
99 gengetopt_strdup (const char *s);
100 
101 static
103 {
104  args_info->help_given = 0 ;
105  args_info->version_given = 0 ;
106  args_info->client_given = 0 ;
107  args_info->server_given = 0 ;
111  args_info->connect_given = 0 ;
113  args_info->imap_given = 0 ;
114  args_info->smtp_given = 0 ;
121  args_info->realm_given = 0 ;
123  args_info->service_given = 0 ;
130  args_info->salt_given = 0 ;
133  args_info->no_cb_given = 0 ;
138  args_info->verbose_given = 0 ;
139  args_info->quiet_given = 0 ;
140 }
141 
142 static
144 {
146  args_info->client_flag = 1;
147  args_info->server_flag = 0;
154  args_info->imap_flag = 0;
155  args_info->smtp_flag = 0;
187  args_info->no_cb_flag = 0;
196  args_info->verbose_flag = 0;
197  args_info->quiet_flag = 0;
198 
199 }
200 
201 static
203 {
204 
205 
242 
243 }
244 
245 void
247 {
248  printf ("%s %s\n",
251 
252  if (strlen(gengetopt_args_info_versiontext) > 0)
253  printf("\n%s\n", gengetopt_args_info_versiontext);
254 }
255 
256 static void print_help_common(void) {
258 
259  if (strlen(gengetopt_args_info_purpose) > 0)
260  printf("\n%s\n", gengetopt_args_info_purpose);
261 
262  if (strlen(gengetopt_args_info_usage) > 0)
263  printf("\n%s\n", gengetopt_args_info_usage);
264 
265  printf("\n");
266 
267  if (strlen(gengetopt_args_info_description) > 0)
268  printf("%s\n\n", gengetopt_args_info_description);
269 }
270 
271 void
273 {
274  int i = 0;
276  while (gengetopt_args_info_help[i])
277  printf("%s\n", gengetopt_args_info_help[i++]);
278 }
279 
280 void
282 {
286 
287  args_info->inputs = 0;
288  args_info->inputs_num = 0;
289 }
290 
291 void
293 {
294  if (params)
295  {
296  params->override = 0;
297  params->initialize = 1;
298  params->check_required = 1;
299  params->check_ambiguity = 0;
300  params->print_errors = 1;
301  }
302 }
303 
304 struct cmdline_parser_params *
306 {
307  struct cmdline_parser_params *params =
308  (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
310  return params;
311 }
312 
313 static void
315 {
316  if (*s)
317  {
318  free (*s);
319  *s = 0;
320  }
321 }
322 
323 
324 static void
326 {
327  unsigned int i;
363 
364 
365  for (i = 0; i < args_info->inputs_num; ++i)
366  free (args_info->inputs [i]);
367 
368  if (args_info->inputs_num)
369  free (args_info->inputs);
370 
372 }
373 
374 
375 static void
376 write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
377 {
378  FIX_UNUSED (values);
379  if (arg) {
380  fprintf(outfile, "%s=\"%s\"\n", opt, arg);
381  } else {
382  fprintf(outfile, "%s\n", opt);
383  }
384 }
385 
386 
387 int
389 {
390  int i = 0;
391 
392  if (!outfile)
393  {
394  fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE);
395  return EXIT_FAILURE;
396  }
397 
398  if (args_info->help_given)
399  write_into_file(outfile, "help", 0, 0 );
401  write_into_file(outfile, "version", 0, 0 );
402  if (args_info->client_given)
403  write_into_file(outfile, "client", 0, 0 );
404  if (args_info->server_given)
405  write_into_file(outfile, "server", 0, 0 );
407  write_into_file(outfile, "client-mechanisms", 0, 0 );
409  write_into_file(outfile, "server-mechanisms", 0, 0 );
411  write_into_file(outfile, "mkpasswd", 0, 0 );
413  write_into_file(outfile, "connect", args_info->connect_orig, 0);
415  write_into_file(outfile, "application-data", 0, 0 );
416  if (args_info->imap_given)
417  write_into_file(outfile, "imap", 0, 0 );
418  if (args_info->smtp_given)
419  write_into_file(outfile, "smtp", 0, 0 );
421  write_into_file(outfile, "mechanism", args_info->mechanism_orig, 0);
423  write_into_file(outfile, "no-client-first", 0, 0 );
425  write_into_file(outfile, "anonymous-token", args_info->anonymous_token_orig, 0);
427  write_into_file(outfile, "authentication-id", args_info->authentication_id_orig, 0);
429  write_into_file(outfile, "authorization-id", args_info->authorization_id_orig, 0);
431  write_into_file(outfile, "password", args_info->password_orig, 0);
432  if (args_info->realm_given)
433  write_into_file(outfile, "realm", args_info->realm_orig, 0);
435  write_into_file(outfile, "passcode", args_info->passcode_orig, 0);
437  write_into_file(outfile, "service", args_info->service_orig, 0);
439  write_into_file(outfile, "hostname", args_info->hostname_orig, 0);
441  write_into_file(outfile, "service-name", args_info->service_name_orig, 0);
443  write_into_file(outfile, "enable-cram-md5-validate", 0, 0 );
445  write_into_file(outfile, "disable-cleartext-validate", 0, 0 );
447  write_into_file(outfile, "quality-of-protection", args_info->quality_of_protection_orig, 0);
449  write_into_file(outfile, "iteration-count", args_info->iteration_count_orig, 0);
450  if (args_info->salt_given)
451  write_into_file(outfile, "salt", args_info->salt_orig, 0);
453  write_into_file(outfile, "starttls", 0, 0 );
455  write_into_file(outfile, "no-starttls", 0, 0 );
456  if (args_info->no_cb_given)
457  write_into_file(outfile, "no-cb", 0, 0 );
459  write_into_file(outfile, "x509-ca-file", args_info->x509_ca_file_orig, 0);
461  write_into_file(outfile, "x509-cert-file", args_info->x509_cert_file_orig, 0);
463  write_into_file(outfile, "x509-key-file", args_info->x509_key_file_orig, 0);
465  write_into_file(outfile, "priority", args_info->priority_orig, 0);
467  write_into_file(outfile, "verbose", 0, 0 );
468  if (args_info->quiet_given)
469  write_into_file(outfile, "quiet", 0, 0 );
470 
471 
472  i = EXIT_SUCCESS;
473  return i;
474 }
475 
476 int
478 {
479  FILE *outfile;
480  int i = 0;
481 
482  outfile = fopen(filename, "w");
483 
484  if (!outfile)
485  {
486  fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
487  return EXIT_FAILURE;
488  }
489 
490  i = cmdline_parser_dump(outfile, args_info);
491  fclose (outfile);
492 
493  return i;
494 }
495 
496 void
498 {
500 }
501 
502 /** @brief replacement of strdup, which is not standard */
503 char *
504 gengetopt_strdup (const char *s)
505 {
506  char *result = 0;
507  if (!s)
508  return result;
509 
510  result = (char*)malloc(strlen(s) + 1);
511  if (result == (char*)0)
512  return (char*)0;
513  strcpy(result, s);
514  return result;
515 }
516 
517 int
518 cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
519 {
520  return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
521 }
522 
523 int
524 cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
525  struct cmdline_parser_params *params)
526 {
527  int result;
528  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
529 
530  if (result == EXIT_FAILURE)
531  {
533  exit (EXIT_FAILURE);
534  }
535 
536  return result;
537 }
538 
539 int
540 cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
541 {
542  int result;
543  struct cmdline_parser_params params;
544 
545  params.override = override;
546  params.initialize = initialize;
548  params.check_ambiguity = 0;
549  params.print_errors = 1;
550 
551  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
552 
553  if (result == EXIT_FAILURE)
554  {
556  exit (EXIT_FAILURE);
557  }
558 
559  return result;
560 }
561 
562 int
563 cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
564 {
566  FIX_UNUSED (prog_name);
567  return EXIT_SUCCESS;
568 }
569 
570 
571 static char *package_name = 0;
572 
573 /**
574  * @brief updates an option
575  * @param field the generic pointer to the field to update
576  * @param orig_field the pointer to the orig field
577  * @param field_given the pointer to the number of occurrence of this option
578  * @param prev_given the pointer to the number of occurrence already seen
579  * @param value the argument for this option (if null no arg was specified)
580  * @param possible_values the possible values for this option (if specified)
581  * @param default_value the default value (in case the option only accepts fixed values)
582  * @param arg_type the type of this option
583  * @param check_ambiguity @see cmdline_parser_params.check_ambiguity
584  * @param override @see cmdline_parser_params.override
585  * @param no_free whether to free a possible previous value
586  * @param multiple_option whether this is a multiple option
587  * @param long_opt the corresponding long option
588  * @param short_opt the corresponding short option (or '-' if none)
589  * @param additional_error possible further error specification
590  */
591 static
592 int update_arg(void *field, char **orig_field,
593  unsigned int *field_given, unsigned int *prev_given,
594  char *value, const char *possible_values[],
595  const char *default_value,
597  int check_ambiguity, int override,
598  int no_free, int multiple_option,
599  const char *long_opt, char short_opt,
600  const char *additional_error)
601 {
602  char *stop_char = 0;
603  const char *val = value;
604  int found;
605  char **string_field;
606  FIX_UNUSED (field);
607 
608  stop_char = 0;
609  found = 0;
610 
611  if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
612  {
613  if (short_opt != '-')
614  fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n",
615  package_name, long_opt, short_opt,
616  (additional_error ? additional_error : ""));
617  else
618  fprintf (stderr, "%s: `--%s' option given more than once%s\n",
619  package_name, long_opt,
620  (additional_error ? additional_error : ""));
621  return 1; /* failure */
622  }
623 
624  FIX_UNUSED (default_value);
625 
626  if (field_given && *field_given && ! override)
627  return 0;
628  if (prev_given)
629  (*prev_given)++;
630  if (field_given)
631  (*field_given)++;
632  if (possible_values)
633  val = possible_values[found];
634 
635  switch(arg_type) {
636  case ARG_FLAG:
637  *((int *)field) = !*((int *)field);
638  break;
639  case ARG_INT:
640  if (val) *((int *)field) = strtol (val, &stop_char, 0);
641  break;
642  case ARG_STRING:
643  if (val) {
644  string_field = (char **)field;
645  if (!no_free && *string_field)
646  free (*string_field); /* free previous string */
647  *string_field = gengetopt_strdup (val);
648  }
649  break;
650  default:
651  break;
652  };
653 
654  /* check numeric conversion */
655  switch(arg_type) {
656  case ARG_INT:
657  if (val && !(stop_char && *stop_char == '\0')) {
658  fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val);
659  return 1; /* failure */
660  }
661  break;
662  default:
663  ;
664  };
665 
666  /* store the original value */
667  switch(arg_type) {
668  case ARG_NO:
669  case ARG_FLAG:
670  break;
671  default:
672  if (value && orig_field) {
673  if (no_free) {
674  *orig_field = value;
675  } else {
676  if (*orig_field)
677  free (*orig_field); /* free previous string */
678  *orig_field = gengetopt_strdup (value);
679  }
680  }
681  };
682 
683  return 0; /* OK */
684 }
685 
686 
687 int
689  int argc, char **argv, struct gengetopt_args_info *args_info,
690  struct cmdline_parser_params *params, const char *additional_error)
691 {
692  int c; /* Character of the parsed option. */
693 
694  int error_occurred = 0;
695  struct gengetopt_args_info local_args_info;
696 
697  int override;
698  int initialize;
699  int check_required;
700  int check_ambiguity;
701 
702  package_name = argv[0];
703 
704  override = params->override;
705  initialize = params->initialize;
706  check_required = params->check_required;
707  check_ambiguity = params->check_ambiguity;
708 
709  if (initialize)
711 
712  cmdline_parser_init (&local_args_info);
713 
714  optarg = 0;
715  optind = 0;
716  opterr = params->print_errors;
717  optopt = '?';
718 
719  while (1)
720  {
721  int option_index = 0;
722 
723  static struct option long_options[] = {
724  { "help", 0, NULL, 'h' },
725  { "version", 0, NULL, 'V' },
726  { "client", 0, NULL, 'c' },
727  { "server", 0, NULL, 's' },
728  { "client-mechanisms", 0, NULL, 0 },
729  { "server-mechanisms", 0, NULL, 0 },
730  { "mkpasswd", 0, NULL, 'k' },
731  { "connect", 1, NULL, 0 },
732  { "application-data", 0, NULL, 'd' },
733  { "imap", 0, NULL, 0 },
734  { "smtp", 0, NULL, 0 },
735  { "mechanism", 1, NULL, 'm' },
736  { "no-client-first", 0, NULL, 0 },
737  { "anonymous-token", 1, NULL, 'n' },
738  { "authentication-id", 1, NULL, 'a' },
739  { "authorization-id", 1, NULL, 'z' },
740  { "password", 1, NULL, 'p' },
741  { "realm", 1, NULL, 'r' },
742  { "passcode", 1, NULL, 0 },
743  { "service", 1, NULL, 0 },
744  { "hostname", 1, NULL, 0 },
745  { "service-name", 1, NULL, 0 },
746  { "enable-cram-md5-validate", 0, NULL, 0 },
747  { "disable-cleartext-validate", 0, NULL, 0 },
748  { "quality-of-protection", 1, NULL, 0 },
749  { "iteration-count", 1, NULL, 0 },
750  { "salt", 1, NULL, 0 },
751  { "starttls", 0, NULL, 0 },
752  { "no-starttls", 0, NULL, 0 },
753  { "no-cb", 0, NULL, 0 },
754  { "x509-ca-file", 1, NULL, 0 },
755  { "x509-cert-file", 1, NULL, 0 },
756  { "x509-key-file", 1, NULL, 0 },
757  { "priority", 1, NULL, 0 },
758  { "verbose", 0, NULL, 0 },
759  { "quiet", 0, NULL, 0 },
760  { 0, 0, 0, 0 }
761  };
762 
763  c = getopt_long (argc, argv, "hVcskdm:n:a:z:p:r:", long_options, &option_index);
764 
765  if (c == -1) break; /* Exit from `while (1)' loop. */
766 
767  switch (c)
768  {
769  case 'h': /* Print help and exit. */
770 
771 
772  if (update_arg( 0 ,
773  0 , &(args_info->help_given),
774  &(local_args_info.help_given), optarg, 0, 0, ARG_NO,
775  check_ambiguity, override, 0, 0,
776  "help", 'h',
777  additional_error))
778  goto failure;
779  cmdline_parser_free (&local_args_info);
780  return 0;
781 
782  break;
783  case 'V': /* Print version and exit. */
784 
785 
786  if (update_arg( 0 ,
787  0 , &(args_info->version_given),
788  &(local_args_info.version_given), optarg, 0, 0, ARG_NO,
789  check_ambiguity, override, 0, 0,
790  "version", 'V',
791  additional_error))
792  goto failure;
793  cmdline_parser_free (&local_args_info);
794  return 0;
795 
796  break;
797  case 'c': /* Act as client.. */
798 
799 
800  if (update_arg((void *)&(args_info->client_flag), 0, &(args_info->client_given),
801  &(local_args_info.client_given), optarg, 0, 0, ARG_FLAG,
802  check_ambiguity, override, 1, 0, "client", 'c',
803  additional_error))
804  goto failure;
805 
806  break;
807  case 's': /* Act as server.. */
808 
809 
810  if (update_arg((void *)&(args_info->server_flag), 0, &(args_info->server_given),
811  &(local_args_info.server_given), optarg, 0, 0, ARG_FLAG,
812  check_ambiguity, override, 1, 0, "server", 's',
813  additional_error))
814  goto failure;
815 
816  break;
817  case 'k': /* Derive password. Provide --mechanism as SCRAM-SHA-1 or SCRAM-SHA-256. The required inputs are password (through --password or read from terminal) and optional inputs are iteration count (through --iteration-count, or defaulting to 65536) and salt (through --salt, or generated randomly). The output is a string of the form \"{mech}count,salt,stored-key,server-key[,salted-password]\" where \"mech\" is the mechanism, \"count\" is the number of times password was hashed, \"salt\" is the provided/generated base64-encoded salt, \"stored-key\" and \"server-key\" are the two derived and base64-encoded server-side keys. When --verbose is provided, \"salted-password\" will be included as the hex-encoded PBKDF2-derived password.. */
818 
819 
821  &(local_args_info.mkpasswd_given), optarg, 0, 0, ARG_FLAG,
822  check_ambiguity, override, 1, 0, "mkpasswd", 'k',
823  additional_error))
824  goto failure;
825 
826  break;
827  case 'd': /* After authentication, read data from stdin and run it through the mechanism's security layer and print it base64 encoded to stdout. The default is to terminate after authentication.. */
828 
829 
831  &(local_args_info.application_data_given), optarg, 0, 0, ARG_FLAG,
832  check_ambiguity, override, 1, 0, "application-data", 'd',
833  additional_error))
834  goto failure;
835 
836  break;
837  case 'm': /* Mechanism to use.. */
838 
839 
840  if (update_arg( (void *)&(args_info->mechanism_arg),
842  &(local_args_info.mechanism_given), optarg, 0, 0, ARG_STRING,
843  check_ambiguity, override, 0, 0,
844  "mechanism", 'm',
845  additional_error))
846  goto failure;
847 
848  break;
849  case 'n': /* Token for anonymous authentication, usually mail address (ANONYMOUS only).. */
850 
851 
852  if (update_arg( (void *)&(args_info->anonymous_token_arg),
854  &(local_args_info.anonymous_token_given), optarg, 0, 0, ARG_STRING,
855  check_ambiguity, override, 0, 0,
856  "anonymous-token", 'n',
857  additional_error))
858  goto failure;
859 
860  break;
861  case 'a': /* Identity of credential owner.. */
862 
863 
864  if (update_arg( (void *)&(args_info->authentication_id_arg),
866  &(local_args_info.authentication_id_given), optarg, 0, 0, ARG_STRING,
867  check_ambiguity, override, 0, 0,
868  "authentication-id", 'a',
869  additional_error))
870  goto failure;
871 
872  break;
873  case 'z': /* Identity to request service for.. */
874 
875 
876  if (update_arg( (void *)&(args_info->authorization_id_arg),
878  &(local_args_info.authorization_id_given), optarg, 0, 0, ARG_STRING,
879  check_ambiguity, override, 0, 0,
880  "authorization-id", 'z',
881  additional_error))
882  goto failure;
883 
884  break;
885  case 'p': /* Password for authentication (insecure for non-testing purposes).. */
886 
887 
888  if (update_arg( (void *)&(args_info->password_arg),
890  &(local_args_info.password_given), optarg, 0, 0, ARG_STRING,
891  check_ambiguity, override, 0, 0,
892  "password", 'p',
893  additional_error))
894  goto failure;
895 
896  break;
897  case 'r': /* Realm. Defaults to hostname.. */
898 
899 
900  if (update_arg( (void *)&(args_info->realm_arg),
902  &(local_args_info.realm_given), optarg, 0, 0, ARG_STRING,
903  check_ambiguity, override, 0, 0,
904  "realm", 'r',
905  additional_error))
906  goto failure;
907 
908  break;
909 
910  case 0: /* Long option with no short option */
911  /* Write name of supported client mechanisms separated by space to stdout.. */
912  if (strcmp (long_options[option_index].name, "client-mechanisms") == 0)
913  {
914 
915 
917  &(local_args_info.client_mechanisms_given), optarg, 0, 0, ARG_FLAG,
918  check_ambiguity, override, 1, 0, "client-mechanisms", '-',
919  additional_error))
920  goto failure;
921 
922  }
923  /* Write name of supported server mechanisms separated by space to stdout.. */
924  else if (strcmp (long_options[option_index].name, "server-mechanisms") == 0)
925  {
926 
927 
929  &(local_args_info.server_mechanisms_given), optarg, 0, 0, ARG_FLAG,
930  check_ambiguity, override, 1, 0, "server-mechanisms", '-',
931  additional_error))
932  goto failure;
933 
934  }
935  /* Connect to TCP server and negotiate on stream instead of stdin/stdout. PORT is the protocol service, or an integer denoting the port, and defaults to 143 (imap) if not specified. Also sets the --hostname default.. */
936  else if (strcmp (long_options[option_index].name, "connect") == 0)
937  {
938 
939 
940  if (update_arg( (void *)&(args_info->connect_arg),
942  &(local_args_info.connect_given), optarg, 0, 0, ARG_STRING,
943  check_ambiguity, override, 0, 0,
944  "connect", '-',
945  additional_error))
946  goto failure;
947 
948  }
949  /* Use a IMAP-like logon procedure (client only). Also sets the --service default to 'imap'.. */
950  else if (strcmp (long_options[option_index].name, "imap") == 0)
951  {
952 
953 
954  if (update_arg((void *)&(args_info->imap_flag), 0, &(args_info->imap_given),
955  &(local_args_info.imap_given), optarg, 0, 0, ARG_FLAG,
956  check_ambiguity, override, 1, 0, "imap", '-',
957  additional_error))
958  goto failure;
959 
960  }
961  /* Use a SMTP-like logon procedure (client only). Also sets the --service default to 'smtp'.. */
962  else if (strcmp (long_options[option_index].name, "smtp") == 0)
963  {
964 
965 
966  if (update_arg((void *)&(args_info->smtp_flag), 0, &(args_info->smtp_given),
967  &(local_args_info.smtp_given), optarg, 0, 0, ARG_FLAG,
968  check_ambiguity, override, 1, 0, "smtp", '-',
969  additional_error))
970  goto failure;
971 
972  }
973  /* Disallow client to send data first (client only).. */
974  else if (strcmp (long_options[option_index].name, "no-client-first") == 0)
975  {
976 
977 
979  &(local_args_info.no_client_first_given), optarg, 0, 0, ARG_FLAG,
980  check_ambiguity, override, 1, 0, "no-client-first", '-',
981  additional_error))
982  goto failure;
983 
984  }
985  /* Passcode for authentication (SECURID only).. */
986  else if (strcmp (long_options[option_index].name, "passcode") == 0)
987  {
988 
989 
990  if (update_arg( (void *)&(args_info->passcode_arg),
992  &(local_args_info.passcode_given), optarg, 0, 0, ARG_STRING,
993  check_ambiguity, override, 0, 0,
994  "passcode", '-',
995  additional_error))
996  goto failure;
997 
998  }
999  /* Set the requested service name (should be a registered GSSAPI host based service name).. */
1000  else if (strcmp (long_options[option_index].name, "service") == 0)
1001  {
1002 
1003 
1004  if (update_arg( (void *)&(args_info->service_arg),
1006  &(local_args_info.service_given), optarg, 0, 0, ARG_STRING,
1007  check_ambiguity, override, 0, 0,
1008  "service", '-',
1009  additional_error))
1010  goto failure;
1011 
1012  }
1013  /* Set the name of the server with the requested service.. */
1014  else if (strcmp (long_options[option_index].name, "hostname") == 0)
1015  {
1016 
1017 
1018  if (update_arg( (void *)&(args_info->hostname_arg),
1020  &(local_args_info.hostname_given), optarg, 0, 0, ARG_STRING,
1021  check_ambiguity, override, 0, 0,
1022  "hostname", '-',
1023  additional_error))
1024  goto failure;
1025 
1026  }
1027  /* Set the generic server name in case of a replicated server (DIGEST-MD5 only).. */
1028  else if (strcmp (long_options[option_index].name, "service-name") == 0)
1029  {
1030 
1031 
1032  if (update_arg( (void *)&(args_info->service_name_arg),
1034  &(local_args_info.service_name_given), optarg, 0, 0, ARG_STRING,
1035  check_ambiguity, override, 0, 0,
1036  "service-name", '-',
1037  additional_error))
1038  goto failure;
1039 
1040  }
1041  /* Validate CRAM-MD5 challenge and response interactively.. */
1042  else if (strcmp (long_options[option_index].name, "enable-cram-md5-validate") == 0)
1043  {
1044 
1045 
1047  &(local_args_info.enable_cram_md5_validate_given), optarg, 0, 0, ARG_FLAG,
1048  check_ambiguity, override, 1, 0, "enable-cram-md5-validate", '-',
1049  additional_error))
1050  goto failure;
1051 
1052  }
1053  /* Disable cleartext validate hook, forcing server to prompt for password.. */
1054  else if (strcmp (long_options[option_index].name, "disable-cleartext-validate") == 0)
1055  {
1056 
1057 
1059  &(local_args_info.disable_cleartext_validate_given), optarg, 0, 0, ARG_FLAG,
1060  check_ambiguity, override, 1, 0, "disable-cleartext-validate", '-',
1061  additional_error))
1062  goto failure;
1063 
1064  }
1065  /* How application payload will be protected. 'qop-auth' means no protection, 'qop-int' means integrity protection, 'qop-conf' means integrity and confidentialiy protection. Currently only used by DIGEST-MD5, where the default is 'qop-int'.. */
1066  else if (strcmp (long_options[option_index].name, "quality-of-protection") == 0)
1067  {
1068 
1069 
1072  &(local_args_info.quality_of_protection_given), optarg, 0, 0, ARG_STRING,
1073  check_ambiguity, override, 0, 0,
1074  "quality-of-protection", '-',
1075  additional_error))
1076  goto failure;
1077 
1078  }
1079  /* Indicate PBKDF2 hash iteration count (SCRAM only).. */
1080  else if (strcmp (long_options[option_index].name, "iteration-count") == 0)
1081  {
1082 
1083 
1084  if (update_arg( (void *)&(args_info->iteration_count_arg),
1086  &(local_args_info.iteration_count_given), optarg, 0, "65536", ARG_INT,
1087  check_ambiguity, override, 0, 0,
1088  "iteration-count", '-',
1089  additional_error))
1090  goto failure;
1091 
1092  }
1093  /* Indicate PBKDF2 salt as base64-encoded string (SCRAM only).. */
1094  else if (strcmp (long_options[option_index].name, "salt") == 0)
1095  {
1096 
1097 
1098  if (update_arg( (void *)&(args_info->salt_arg),
1100  &(local_args_info.salt_given), optarg, 0, 0, ARG_STRING,
1101  check_ambiguity, override, 0, 0,
1102  "salt", '-',
1103  additional_error))
1104  goto failure;
1105 
1106  }
1107  /* Force use of STARTTLS. The default is to use STARTTLS when available.. */
1108  else if (strcmp (long_options[option_index].name, "starttls") == 0)
1109  {
1110 
1111 
1112  if (update_arg((void *)&(args_info->starttls_flag), 0, &(args_info->starttls_given),
1113  &(local_args_info.starttls_given), optarg, 0, 0, ARG_FLAG,
1114  check_ambiguity, override, 1, 0, "starttls", '-',
1115  additional_error))
1116  goto failure;
1117 
1118  }
1119  /* Unconditionally disable STARTTLS.. */
1120  else if (strcmp (long_options[option_index].name, "no-starttls") == 0)
1121  {
1122 
1123 
1125  &(local_args_info.no_starttls_given), optarg, 0, 0, ARG_FLAG,
1126  check_ambiguity, override, 1, 0, "no-starttls", '-',
1127  additional_error))
1128  goto failure;
1129 
1130  }
1131  /* Don't use channel bindings from TLS.. */
1132  else if (strcmp (long_options[option_index].name, "no-cb") == 0)
1133  {
1134 
1135 
1136  if (update_arg((void *)&(args_info->no_cb_flag), 0, &(args_info->no_cb_given),
1137  &(local_args_info.no_cb_given), optarg, 0, 0, ARG_FLAG,
1138  check_ambiguity, override, 1, 0, "no-cb", '-',
1139  additional_error))
1140  goto failure;
1141 
1142  }
1143  /* File containing one or more X.509 Certificate Authorities certificates in PEM format, used to verify the certificate received from the server. If not specified, verification uses system trust settings. If FILE is the empty string, don't fail on X.509 server certificates verification errors.. */
1144  else if (strcmp (long_options[option_index].name, "x509-ca-file") == 0)
1145  {
1146 
1147 
1148  if (update_arg( (void *)&(args_info->x509_ca_file_arg),
1150  &(local_args_info.x509_ca_file_given), optarg, 0, 0, ARG_STRING,
1151  check_ambiguity, override, 0, 0,
1152  "x509-ca-file", '-',
1153  additional_error))
1154  goto failure;
1155 
1156  }
1157  /* File containing client X.509 certificate in PEM format. Used together with --x509-key-file to specify the certificate/key pair.. */
1158  else if (strcmp (long_options[option_index].name, "x509-cert-file") == 0)
1159  {
1160 
1161 
1162  if (update_arg( (void *)&(args_info->x509_cert_file_arg),
1164  &(local_args_info.x509_cert_file_given), optarg, 0, 0, ARG_STRING,
1165  check_ambiguity, override, 0, 0,
1166  "x509-cert-file", '-',
1167  additional_error))
1168  goto failure;
1169 
1170  }
1171  /* Private key for the client X.509 certificate in PEM format. Used together with --x509-key-file to specify the certificate/key pair.. */
1172  else if (strcmp (long_options[option_index].name, "x509-key-file") == 0)
1173  {
1174 
1175 
1176  if (update_arg( (void *)&(args_info->x509_key_file_arg),
1178  &(local_args_info.x509_key_file_given), optarg, 0, 0, ARG_STRING,
1179  check_ambiguity, override, 0, 0,
1180  "x509-key-file", '-',
1181  additional_error))
1182  goto failure;
1183 
1184  }
1185  /* Cipher priority string.. */
1186  else if (strcmp (long_options[option_index].name, "priority") == 0)
1187  {
1188 
1189 
1190  if (update_arg( (void *)&(args_info->priority_arg),
1192  &(local_args_info.priority_given), optarg, 0, 0, ARG_STRING,
1193  check_ambiguity, override, 0, 0,
1194  "priority", '-',
1195  additional_error))
1196  goto failure;
1197 
1198  }
1199  /* Produce verbose output.. */
1200  else if (strcmp (long_options[option_index].name, "verbose") == 0)
1201  {
1202 
1203 
1204  if (update_arg((void *)&(args_info->verbose_flag), 0, &(args_info->verbose_given),
1205  &(local_args_info.verbose_given), optarg, 0, 0, ARG_FLAG,
1206  check_ambiguity, override, 1, 0, "verbose", '-',
1207  additional_error))
1208  goto failure;
1209 
1210  }
1211  /* Don't produce any diagnostic output.. */
1212  else if (strcmp (long_options[option_index].name, "quiet") == 0)
1213  {
1214 
1215 
1216  if (update_arg((void *)&(args_info->quiet_flag), 0, &(args_info->quiet_given),
1217  &(local_args_info.quiet_given), optarg, 0, 0, ARG_FLAG,
1218  check_ambiguity, override, 1, 0, "quiet", '-',
1219  additional_error))
1220  goto failure;
1221 
1222  }
1223 
1224  break;
1225  case '?': /* Invalid option. */
1226  /* `getopt_long' already printed an error message. */
1227  goto failure;
1228 
1229  default: /* bug: option not considered. */
1230  fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : ""));
1231  abort ();
1232  } /* switch */
1233  } /* while */
1234 
1235 
1236 
1237 
1238  cmdline_parser_release (&local_args_info);
1239 
1240  if ( error_occurred )
1241  return (EXIT_FAILURE);
1242 
1243  if (optind < argc)
1244  {
1245  int i = 0 ;
1246  int found_prog_name = 0;
1247  /* whether program name, i.e., argv[0], is in the remaining args
1248  (this may happen with some implementations of getopt,
1249  but surely not with the one included by gengetopt) */
1250 
1251  i = optind;
1252  while (i < argc)
1253  if (argv[i++] == argv[0]) {
1254  found_prog_name = 1;
1255  break;
1256  }
1257  i = 0;
1258 
1259  args_info->inputs_num = argc - optind - found_prog_name;
1260  args_info->inputs =
1261  (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
1262  while (optind < argc)
1263  if (argv[optind++] != argv[0])
1264  args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ;
1265  }
1266 
1267  return 0;
1268 
1269 failure:
1270 
1271  cmdline_parser_release (&local_args_info);
1272  return (EXIT_FAILURE);
1273 }
static struct @1 values[]
int optopt
Definition: getopt.c:115
__BEGIN_DECLS char * optarg
Definition: getopt.c:89
int optind
Definition: getopt.c:104
int opterr
Definition: getopt.c:109
int getopt_long(int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW _GL_ARG_NONNULL((2
arg_type
Definition: printf-args.h:50
#define NULL
Definition: stddef.in.h:72
#define EXIT_SUCCESS
Definition: stdlib.in.h:123
#define EXIT_FAILURE
Definition: stdlib.in.h:128
struct gengetopt_args_info args_info
Definition: gsasl.c:37
static char * package_name
Definition: gsasl_cmd.c:571
const char * gengetopt_args_info_versiontext
Definition: gsasl_cmd.c:32
static char * gengetopt_strdup(const char *s)
replacement of strdup, which is not standard
Definition: gsasl_cmd.c:504
static int update_arg(void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error)
updates an option
Definition: gsasl_cmd.c:592
int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
Definition: gsasl_cmd.c:388
static void free_string_field(char **s)
Definition: gsasl_cmd.c:314
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
Definition: gsasl_cmd.c:518
static void clear_given(struct gengetopt_args_info *args_info)
Definition: gsasl_cmd.c:102
static void clear_args(struct gengetopt_args_info *args_info)
Definition: gsasl_cmd.c:143
static void init_args_info(struct gengetopt_args_info *args_info)
Definition: gsasl_cmd.c:202
int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
Definition: gsasl_cmd.c:477
const char * gengetopt_args_info_purpose
the purpose string of the program
Definition: gsasl_cmd.c:28
static void write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
Definition: gsasl_cmd.c:376
const char * gengetopt_args_info_help[]
all the lines making the help output
Definition: gsasl_cmd.c:36
int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
Definition: gsasl_cmd.c:540
int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name)
Definition: gsasl_cmd.c:563
cmdline_parser_arg_type
Definition: gsasl_cmd.c:82
@ ARG_STRING
Definition: gsasl_cmd.c:84
@ ARG_INT
Definition: gsasl_cmd.c:85
@ ARG_NO
Definition: gsasl_cmd.c:82
@ ARG_FLAG
Definition: gsasl_cmd.c:83
#define FIX_UNUSED(X)
Definition: gsasl_cmd.c:21
void cmdline_parser_print_version(void)
Definition: gsasl_cmd.c:246
const char * gengetopt_args_info_usage
the usage string of the program
Definition: gsasl_cmd.c:30
int cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
Definition: gsasl_cmd.c:524
void cmdline_parser_init(struct gengetopt_args_info *args_info)
Definition: gsasl_cmd.c:281
const char * gengetopt_args_info_description
the description string of the program
Definition: gsasl_cmd.c:34
static void cmdline_parser_release(struct gengetopt_args_info *args_info)
Definition: gsasl_cmd.c:325
static int cmdline_parser_internal(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error)
Definition: gsasl_cmd.c:688
void cmdline_parser_print_help(void)
Definition: gsasl_cmd.c:272
static void print_help_common(void)
Definition: gsasl_cmd.c:256
void cmdline_parser_free(struct gengetopt_args_info *args_info)
Definition: gsasl_cmd.c:497
void cmdline_parser_params_init(struct cmdline_parser_params *params)
Definition: gsasl_cmd.c:292
struct cmdline_parser_params * cmdline_parser_params_create(void)
Definition: gsasl_cmd.c:305
The header file for the command line option parser generated by GNU Gengetopt version 2....
#define CMDLINE_PARSER_VERSION
the program version
Definition: gsasl_cmd.h:38
#define CMDLINE_PARSER_PACKAGE_NAME
the complete program name (used for help and version)
Definition: gsasl_cmd.h:32
#define CMDLINE_PARSER_PACKAGE
the program name (used for printing errors)
Definition: gsasl_cmd.h:24
const char * name
Definition: error.c:43
unsigned char c
The additional parameters to pass to parser functions.
Definition: gsasl_cmd.h:176
int print_errors
whether getopt_long should print an error message for a bad option (default 1)
Definition: gsasl_cmd.h:181
int check_required
whether to check that all required options were provided (default 1)
Definition: gsasl_cmd.h:179
int check_ambiguity
whether to check for options already specified in the option structure gengetopt_args_info (default 0...
Definition: gsasl_cmd.h:180
int initialize
whether to initialize the option structure gengetopt_args_info (default 1)
Definition: gsasl_cmd.h:178
int override
whether to override possibly already present options (default 0)
Definition: gsasl_cmd.h:177
Where the command line options are stored.
Definition: gsasl_cmd.h:43
const char * no_client_first_help
Disallow client to send data first (client only). help description.
Definition: gsasl_cmd.h:69
unsigned int service_given
Whether service was given.
Definition: gsasl_cmd.h:152
char * hostname_orig
Set the name of the server with the requested service. original value given at command line.
Definition: gsasl_cmd.h:92
unsigned int server_mechanisms_given
Whether server-mechanisms was given.
Definition: gsasl_cmd.h:138
const char * imap_help
Use a IMAP-like logon procedure (client only). Also sets the –service default to 'imap'....
Definition: gsasl_cmd.h:62
int mkpasswd_flag
Derive password. Provide –mechanism as SCRAM-SHA-1 or SCRAM-SHA-256. The required inputs are password...
Definition: gsasl_cmd.h:54
char * salt_arg
Indicate PBKDF2 salt as base64-encoded string (SCRAM only)..
Definition: gsasl_cmd.h:107
unsigned int x509_key_file_given
Whether x509-key-file was given.
Definition: gsasl_cmd.h:165
char * priority_arg
Cipher priority string..
Definition: gsasl_cmd.h:125
int client_flag
Act as client. (default=on).
Definition: gsasl_cmd.h:46
unsigned int client_given
Whether client was given.
Definition: gsasl_cmd.h:135
unsigned int service_name_given
Whether service-name was given.
Definition: gsasl_cmd.h:154
const char * verbose_help
Produce verbose output. help description.
Definition: gsasl_cmd.h:129
char * passcode_orig
Passcode for authentication (SECURID only). original value given at command line.
Definition: gsasl_cmd.h:86
char * connect_arg
Connect to TCP server and negotiate on stream instead of stdin/stdout. PORT is the protocol service,...
Definition: gsasl_cmd.h:56
const char * x509_key_file_help
Private key for the client X.509 certificate in PEM format. Used together with –x509-key-file to spec...
Definition: gsasl_cmd.h:124
char * anonymous_token_arg
Token for anonymous authentication, usually mail address (ANONYMOUS only)..
Definition: gsasl_cmd.h:70
char * anonymous_token_orig
Token for anonymous authentication, usually mail address (ANONYMOUS only). original value given at co...
Definition: gsasl_cmd.h:71
char * service_arg
Set the requested service name (should be a registered GSSAPI host based service name)....
Definition: gsasl_cmd.h:88
int enable_cram_md5_validate_flag
Validate CRAM-MD5 challenge and response interactively. (default=off).
Definition: gsasl_cmd.h:97
int quiet_flag
Don't produce any diagnostic output. (default=off).
Definition: gsasl_cmd.h:130
unsigned int priority_given
Whether priority was given.
Definition: gsasl_cmd.h:166
char * password_arg
Password for authentication (insecure for non-testing purposes)..
Definition: gsasl_cmd.h:79
const char * service_name_help
Set the generic server name in case of a replicated server (DIGEST-MD5 only). help description.
Definition: gsasl_cmd.h:96
char * mechanism_orig
Mechanism to use. original value given at command line.
Definition: gsasl_cmd.h:66
unsigned inputs_num
unamed options number
Definition: gsasl_cmd.h:171
const char * smtp_help
Use a SMTP-like logon procedure (client only). Also sets the –service default to 'smtp'....
Definition: gsasl_cmd.h:64
const char * priority_help
Cipher priority string. help description.
Definition: gsasl_cmd.h:127
char * service_orig
Set the requested service name (should be a registered GSSAPI host based service name)....
Definition: gsasl_cmd.h:89
char * connect_orig
Connect to TCP server and negotiate on stream instead of stdin/stdout. PORT is the protocol service,...
Definition: gsasl_cmd.h:57
const char * quality_of_protection_help
How application payload will be protected. 'qop-auth' means no protection, 'qop-int' means integrity ...
Definition: gsasl_cmd.h:103
unsigned int imap_given
Whether imap was given.
Definition: gsasl_cmd.h:142
unsigned int x509_cert_file_given
Whether x509-cert-file was given.
Definition: gsasl_cmd.h:164
const char * realm_help
Realm. Defaults to hostname. help description.
Definition: gsasl_cmd.h:84
unsigned int no_cb_given
Whether no-cb was given.
Definition: gsasl_cmd.h:162
unsigned int authentication_id_given
Whether authentication-id was given.
Definition: gsasl_cmd.h:147
unsigned int iteration_count_given
Whether iteration-count was given.
Definition: gsasl_cmd.h:158
char * authorization_id_arg
Identity to request service for..
Definition: gsasl_cmd.h:76
unsigned int starttls_given
Whether starttls was given.
Definition: gsasl_cmd.h:160
char * priority_orig
Cipher priority string. original value given at command line.
Definition: gsasl_cmd.h:126
unsigned int disable_cleartext_validate_given
Whether disable-cleartext-validate was given.
Definition: gsasl_cmd.h:156
const char * authentication_id_help
Identity of credential owner. help description.
Definition: gsasl_cmd.h:75
unsigned int realm_given
Whether realm was given.
Definition: gsasl_cmd.h:150
const char * service_help
Set the requested service name (should be a registered GSSAPI host based service name)....
Definition: gsasl_cmd.h:90
int no_starttls_flag
Unconditionally disable STARTTLS. (default=off).
Definition: gsasl_cmd.h:112
unsigned int no_starttls_given
Whether no-starttls was given.
Definition: gsasl_cmd.h:161
unsigned int anonymous_token_given
Whether anonymous-token was given.
Definition: gsasl_cmd.h:146
unsigned int smtp_given
Whether smtp was given.
Definition: gsasl_cmd.h:143
const char * enable_cram_md5_validate_help
Validate CRAM-MD5 challenge and response interactively. help description.
Definition: gsasl_cmd.h:98
char * x509_ca_file_orig
File containing one or more X.509 Certificate Authorities certificates in PEM format,...
Definition: gsasl_cmd.h:117
int server_mechanisms_flag
Write name of supported server mechanisms separated by space to stdout. (default=off).
Definition: gsasl_cmd.h:52
char * realm_arg
Realm. Defaults to hostname..
Definition: gsasl_cmd.h:82
char * x509_key_file_orig
Private key for the client X.509 certificate in PEM format. Used together with –x509-key-file to spec...
Definition: gsasl_cmd.h:123
const char * server_mechanisms_help
Write name of supported server mechanisms separated by space to stdout. help description.
Definition: gsasl_cmd.h:53
const char * password_help
Password for authentication (insecure for non-testing purposes). help description.
Definition: gsasl_cmd.h:81
const char * authorization_id_help
Identity to request service for. help description.
Definition: gsasl_cmd.h:78
int server_flag
Act as server. (default=off).
Definition: gsasl_cmd.h:48
char * passcode_arg
Passcode for authentication (SECURID only)..
Definition: gsasl_cmd.h:85
char * hostname_arg
Set the name of the server with the requested service..
Definition: gsasl_cmd.h:91
int disable_cleartext_validate_flag
Disable cleartext validate hook, forcing server to prompt for password. (default=off).
Definition: gsasl_cmd.h:99
char * authorization_id_orig
Identity to request service for. original value given at command line.
Definition: gsasl_cmd.h:77
int imap_flag
Use a IMAP-like logon procedure (client only). Also sets the –service default to 'imap'....
Definition: gsasl_cmd.h:61
char * password_orig
Password for authentication (insecure for non-testing purposes). original value given at command line...
Definition: gsasl_cmd.h:80
const char * anonymous_token_help
Token for anonymous authentication, usually mail address (ANONYMOUS only). help description.
Definition: gsasl_cmd.h:72
int no_client_first_flag
Disallow client to send data first (client only). (default=off).
Definition: gsasl_cmd.h:68
char * realm_orig
Realm. Defaults to hostname. original value given at command line.
Definition: gsasl_cmd.h:83
char ** inputs
unamed options (options without names)
Definition: gsasl_cmd.h:170
unsigned int hostname_given
Whether hostname was given.
Definition: gsasl_cmd.h:153
char * service_name_orig
Set the generic server name in case of a replicated server (DIGEST-MD5 only). original value given at...
Definition: gsasl_cmd.h:95
unsigned int no_client_first_given
Whether no-client-first was given.
Definition: gsasl_cmd.h:145
const char * quiet_help
Don't produce any diagnostic output. help description.
Definition: gsasl_cmd.h:131
unsigned int mechanism_given
Whether mechanism was given.
Definition: gsasl_cmd.h:144
int application_data_flag
After authentication, read data from stdin and run it through the mechanism's security layer and prin...
Definition: gsasl_cmd.h:59
const char * application_data_help
After authentication, read data from stdin and run it through the mechanism's security layer and prin...
Definition: gsasl_cmd.h:60
int verbose_flag
Produce verbose output. (default=off).
Definition: gsasl_cmd.h:128
unsigned int enable_cram_md5_validate_given
Whether enable-cram-md5-validate was given.
Definition: gsasl_cmd.h:155
char * x509_ca_file_arg
File containing one or more X.509 Certificate Authorities certificates in PEM format,...
Definition: gsasl_cmd.h:116
unsigned int application_data_given
Whether application-data was given.
Definition: gsasl_cmd.h:141
const char * disable_cleartext_validate_help
Disable cleartext validate hook, forcing server to prompt for password. help description.
Definition: gsasl_cmd.h:100
const char * x509_cert_file_help
File containing client X.509 certificate in PEM format. Used together with –x509-key-file to specify ...
Definition: gsasl_cmd.h:121
int no_cb_flag
Don't use channel bindings from TLS. (default=off).
Definition: gsasl_cmd.h:114
unsigned int help_given
Whether help was given.
Definition: gsasl_cmd.h:133
const char * salt_help
Indicate PBKDF2 salt as base64-encoded string (SCRAM only). help description.
Definition: gsasl_cmd.h:109
unsigned int authorization_id_given
Whether authorization-id was given.
Definition: gsasl_cmd.h:148
int iteration_count_arg
Indicate PBKDF2 hash iteration count (SCRAM only). (default='65536').
Definition: gsasl_cmd.h:104
unsigned int connect_given
Whether connect was given.
Definition: gsasl_cmd.h:140
const char * x509_ca_file_help
File containing one or more X.509 Certificate Authorities certificates in PEM format,...
Definition: gsasl_cmd.h:118
char * x509_cert_file_orig
File containing client X.509 certificate in PEM format. Used together with –x509-key-file to specify ...
Definition: gsasl_cmd.h:120
unsigned int quiet_given
Whether quiet was given.
Definition: gsasl_cmd.h:168
int smtp_flag
Use a SMTP-like logon procedure (client only). Also sets the –service default to 'smtp'....
Definition: gsasl_cmd.h:63
int starttls_flag
Force use of STARTTLS. The default is to use STARTTLS when available. (default=off).
Definition: gsasl_cmd.h:110
const char * hostname_help
Set the name of the server with the requested service. help description.
Definition: gsasl_cmd.h:93
char * x509_cert_file_arg
File containing client X.509 certificate in PEM format. Used together with –x509-key-file to specify ...
Definition: gsasl_cmd.h:119
const char * passcode_help
Passcode for authentication (SECURID only). help description.
Definition: gsasl_cmd.h:87
char * mechanism_arg
Mechanism to use..
Definition: gsasl_cmd.h:65
const char * starttls_help
Force use of STARTTLS. The default is to use STARTTLS when available. help description.
Definition: gsasl_cmd.h:111
int client_mechanisms_flag
Write name of supported client mechanisms separated by space to stdout. (default=off).
Definition: gsasl_cmd.h:50
const char * client_help
Act as client. help description.
Definition: gsasl_cmd.h:47
char * service_name_arg
Set the generic server name in case of a replicated server (DIGEST-MD5 only)..
Definition: gsasl_cmd.h:94
unsigned int version_given
Whether version was given.
Definition: gsasl_cmd.h:134
const char * connect_help
Connect to TCP server and negotiate on stream instead of stdin/stdout. PORT is the protocol service,...
Definition: gsasl_cmd.h:58
unsigned int salt_given
Whether salt was given.
Definition: gsasl_cmd.h:159
char * x509_key_file_arg
Private key for the client X.509 certificate in PEM format. Used together with –x509-key-file to spec...
Definition: gsasl_cmd.h:122
unsigned int mkpasswd_given
Whether mkpasswd was given.
Definition: gsasl_cmd.h:139
char * quality_of_protection_arg
How application payload will be protected. 'qop-auth' means no protection, 'qop-int' means integrity ...
Definition: gsasl_cmd.h:101
const char * mkpasswd_help
Derive password. Provide –mechanism as SCRAM-SHA-1 or SCRAM-SHA-256. The required inputs are password...
Definition: gsasl_cmd.h:55
unsigned int quality_of_protection_given
Whether quality-of-protection was given.
Definition: gsasl_cmd.h:157
unsigned int passcode_given
Whether passcode was given.
Definition: gsasl_cmd.h:151
char * quality_of_protection_orig
How application payload will be protected. 'qop-auth' means no protection, 'qop-int' means integrity ...
Definition: gsasl_cmd.h:102
const char * version_help
Print version and exit help description.
Definition: gsasl_cmd.h:45
unsigned int verbose_given
Whether verbose was given.
Definition: gsasl_cmd.h:167
char * authentication_id_orig
Identity of credential owner. original value given at command line.
Definition: gsasl_cmd.h:74
const char * server_help
Act as server. help description.
Definition: gsasl_cmd.h:49
unsigned int client_mechanisms_given
Whether client-mechanisms was given.
Definition: gsasl_cmd.h:137
const char * client_mechanisms_help
Write name of supported client mechanisms separated by space to stdout. help description.
Definition: gsasl_cmd.h:51
unsigned int x509_ca_file_given
Whether x509-ca-file was given.
Definition: gsasl_cmd.h:163
char * authentication_id_arg
Identity of credential owner..
Definition: gsasl_cmd.h:73
const char * iteration_count_help
Indicate PBKDF2 hash iteration count (SCRAM only). help description.
Definition: gsasl_cmd.h:106
char * iteration_count_orig
Indicate PBKDF2 hash iteration count (SCRAM only). original value given at command line.
Definition: gsasl_cmd.h:105
char * salt_orig
Indicate PBKDF2 salt as base64-encoded string (SCRAM only). original value given at command line.
Definition: gsasl_cmd.h:108
unsigned int password_given
Whether password was given.
Definition: gsasl_cmd.h:149
const char * mechanism_help
Mechanism to use. help description.
Definition: gsasl_cmd.h:67
unsigned int server_given
Whether server was given.
Definition: gsasl_cmd.h:136
const char * no_starttls_help
Unconditionally disable STARTTLS. help description.
Definition: gsasl_cmd.h:113
const char * no_cb_help
Don't use channel bindings from TLS. help description.
Definition: gsasl_cmd.h:115
const char * help_help
Print help and exit help description.
Definition: gsasl_cmd.h:44