*
* DO NOT EDIT THIS FILE (cli-args.c)
*
- * It has been AutoGen-ed January 21, 2012 at 01:58:52 AM by AutoGen 5.12
+ * It has been AutoGen-ed January 21, 2012 at 02:15:53 AM by AutoGen 5.12
* From the definitions cli-args.def
* and the template file options
*
doOptX509cafile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509crlfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptPgpkeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptPgpkeyring(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509keyfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509certfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
flag = {
name = x509cafile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "Certificate file or PKCS #11 URL to use";
doc = "";
};
flag = {
name = x509crlfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "CRL file to use";
doc = "";
};
flag = {
name = pgpkeyfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "PGP Key file to use";
doc = "";
};
flag = {
name = pgpkeyring;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "PGP Key ring file to use";
doc = "";
};
flag = {
name = pgpcertfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "PGP Public Key (certificate) file to use";
doc = "";
};
flag = {
name = x509keyfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "X.509 key file or PKCS #11 URL to use";
doc = "";
};
flag = {
name = x509certfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "X.509 Certificate file or PKCS #11 URL to use";
doc = "";
};
*
* DO NOT EDIT THIS FILE (cli-args.h)
*
- * It has been AutoGen-ed January 21, 2012 at 01:58:52 AM by AutoGen 5.12
+ * It has been AutoGen-ed January 21, 2012 at 02:15:53 AM by AutoGen 5.12
* From the definitions cli-args.def
* and the template file options
*
*
* DO NOT EDIT THIS FILE (serv-args.c)
*
- * It has been AutoGen-ed January 21, 2012 at 01:58:47 AM by AutoGen 5.12
+ * It has been AutoGen-ed January 21, 2012 at 02:14:19 AM by AutoGen 5.12
* From the definitions serv-args.def
* and the template file options
*
* Define the Gnutls_Serv Option Environment
*/
static char const zPROGNAME[12] = "GNUTLS_SERV";
-static char const zUsageTitle[101] =
+static char const zUsageTitle[100] =
"gnutls-serv - GnuTLS server - Ver. 3.0.12\n\
-USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n";
+USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n";
#define zRcName NULL
#define apzHomeList NULL
+ OPTPROC_SHORTOPT
+ OPTPROC_LONGOPT
+ OPTPROC_NO_REQ_OPT
- + OPTPROC_ARGS_REQ
- + OPTPROC_REORDER
+ + OPTPROC_NO_ARGS
+ OPTPROC_GNUUSAGE
+ OPTPROC_MISUSE ),
0, NULL, /* current option index, current option */
doOptDhparams(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509cafile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509crlfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptPgpkeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptPgpkeyring(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509keyfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509certfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509dsakeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509dsacertfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509ecckeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptX509ecccertfile(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptSrppasswd(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptSrppasswdconf(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
doOptPskpasswd(tOptions* pOptions, tOptDesc* pOptDesc)
{
static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
static tuFileMode mode;
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
gnu-usage;
no-misuse-usage;
disable-save;
-reorder-args;
-argument;
long-opts;
config-header = 'config.h';
export = '#include <gettext.h>';
flag = {
name = dhparams;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "DH params file to use";
doc = "";
};
flag = {
name = x509cafile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "Certificate file or PKCS #11 URL to use";
doc = "";
};
flag = {
name = x509crlfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "CRL file to use";
doc = "";
};
flag = {
name = pgpkeyfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "PGP Key file to use";
doc = "";
};
flag = {
name = pgpkeyring;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "PGP Key ring file to use";
doc = "";
};
flag = {
name = pgpcertfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "PGP Public Key (certificate) file to use";
doc = "";
};
flag = {
name = x509keyfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "X.509 key file or PKCS #11 URL to use";
doc = "";
};
flag = {
name = x509certfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "X.509 Certificate file or PKCS #11 URL to use";
doc = "";
};
flag = {
name = x509dsakeyfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "Alternative X.509 key file or PKCS #11 URL to use";
doc = "";
};
flag = {
name = x509dsacertfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "Alternative X.509 Certificate file or PKCS #11 URL to use";
doc = "";
};
flag = {
name = x509ecckeyfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "Alternative X.509 key file or PKCS #11 URL to use";
doc = "";
};
flag = {
name = x509ecccertfile;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "Alternative X.509 Certificate file or PKCS #11 URL to use";
doc = "";
};
flag = {
name = srppasswd;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "SRP password file to use";
doc = "";
};
flag = {
name = srppasswdconf;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "SRP password configuration file to use";
doc = "";
};
flag = {
name = pskpasswd;
arg-type = file;
- file-exists;
+ file-exists = yes;
descrip = "PSK password file to use";
doc = "";
};
*
* DO NOT EDIT THIS FILE (serv-args.h)
*
- * It has been AutoGen-ed January 21, 2012 at 01:58:47 AM by AutoGen 5.12
+ * It has been AutoGen-ed January 21, 2012 at 02:14:19 AM by AutoGen 5.12
* From the definitions serv-args.def
* and the template file options
*
static int x509ctype;
static int debug = 0;
-int verbose;
+int verbose = 1;
static int nodb;
static int noticket;
int require_cert;
char *crtinfo = NULL;
size_t ncrtinfo = 0;
- if (verbose != 0)
+ if (verbose == 0)
{
http_buffer = malloc (len);
if (http_buffer == NULL)
*ret_length =
sizeof (DEFAULT_DATA) + sizeof (HTTP_BEGIN) + sizeof (HTTP_END) - 3;
return http_buffer;
-
}
if (gnutls_certificate_type_get (session) == GNUTLS_CRT_X509)
sockets_init ();
- optionProcess( &gnutls_servOptions, argc, argv);
-
if (nodb == 0)
wrap_db_init ();
gl_fd_to_handle (accept_fd));
j->handshake_ok = 0;
- if (verbose == 0)
+ if (verbose != 0)
{
tt = time (0);
ctt = ctime (&tt);
else if (r == 0)
{
if (gnutls_session_is_resumed (j->tls_session) != 0
- && verbose == 0)
+ && verbose != 0)
printf ("*** This is a resumed session\n");
- if (verbose == 0)
+ if (verbose != 0)
{
printf ("\n* Successful handshake from %s\n",
human_addr ((struct sockaddr *)
else if (r == 0)
{
if (gnutls_session_is_resumed (j->tls_session) != 0
- && verbose == 0)
+ && verbose != 0)
printf ("*** This is a resumed session\n");
- if (verbose == 0)
+ if (verbose != 0)
{
printf ("- connection from %s\n",
human_addr ((struct sockaddr *)
static void cmd_parser (int argc, char **argv)
{
+ optionProcess( &gnutls_servOptions, argc, argv);
+
disable_client_cert = ENABLED_OPT(DISABLE_CLIENT_CERT);
require_cert = ENABLED_OPT(REQUIRE_CLIENT_CERT);
if (ENABLED_OPT(DEBUG))
debug = OPT_VALUE_DEBUG;
- verbose = !ENABLED_OPT(QUIET);
+ if (ENABLED_OPT(QUIET))
+ verbose = 0;
+
nodb = ENABLED_OPT(NODB);
noticket = ENABLED_OPT(NOTICKET);
- http = ENABLED_OPT(HTTP);
+ if (ENABLED_OPT(ECHO))
+ http = 0;
+ else http = 1;
if (ENABLED_OPT(X509FMTDER))
x509ctype = GNUTLS_X509_FMT_DER;
if (ENABLED_OPT(DHPARAMS))
dh_params_file = OPT_ARG(DHPARAMS);
- if (HAVE_OPT(X509KEYFILE))
+ if (ENABLED_OPT(X509KEYFILE))
x509_keyfile = OPT_ARG(X509KEYFILE);
- if (HAVE_OPT(X509CERTFILE))
+ if (ENABLED_OPT(X509CERTFILE))
x509_certfile = OPT_ARG(X509CERTFILE);
- if (HAVE_OPT(X509DSAKEYFILE))
+ if (ENABLED_OPT(X509DSAKEYFILE))
x509_dsakeyfile = OPT_ARG(X509DSAKEYFILE);
- if (HAVE_OPT(X509DSACERTFILE))
+ if (ENABLED_OPT(X509DSACERTFILE))
x509_dsacertfile = OPT_ARG(X509DSACERTFILE);
- if (HAVE_OPT(X509ECCKEYFILE))
+ if (ENABLED_OPT(X509ECCKEYFILE))
x509_ecckeyfile = OPT_ARG(X509ECCKEYFILE);
- if (HAVE_OPT(X509CERTFILE))
+ if (ENABLED_OPT(X509CERTFILE))
x509_ecccertfile = OPT_ARG(X509ECCCERTFILE);
- if (HAVE_OPT(X509CAFILE))
+ if (ENABLED_OPT(X509CAFILE))
x509_cafile = OPT_ARG(X509CAFILE);
- if (HAVE_OPT(X509CRLFILE))
+ if (ENABLED_OPT(X509CRLFILE))
x509_crlfile = OPT_ARG(X509CRLFILE);
- if (HAVE_OPT(PGPKEYFILE))
+ if (ENABLED_OPT(PGPKEYFILE))
pgp_keyfile = OPT_ARG(PGPKEYFILE);
- if (HAVE_OPT(PGPCERTFILE))
+ if (ENABLED_OPT(PGPCERTFILE))
pgp_certfile = OPT_ARG(PGPCERTFILE);
- if (HAVE_OPT(PGPKEYRING))
+ if (ENABLED_OPT(PGPKEYRING))
pgp_keyring = OPT_ARG(PGPKEYRING);
- if (HAVE_OPT(SRPPASSWD))
+ if (ENABLED_OPT(SRPPASSWD))
srp_passwd = OPT_ARG(SRPPASSWD);
- if (HAVE_OPT(SRPPASSWDCONF))
+ if (ENABLED_OPT(SRPPASSWDCONF))
srp_passwd_conf = OPT_ARG(SRPPASSWDCONF);
- if (HAVE_OPT(PSKPASSWD))
+ if (ENABLED_OPT(PSKPASSWD))
psk_passwd = OPT_ARG(PSKPASSWD);
}
*
* DO NOT EDIT THIS FILE (srptool-args.c)
*
- * It has been AutoGen-ed January 21, 2012 at 01:58:49 AM by AutoGen 5.12
+ * It has been AutoGen-ed January 21, 2012 at 02:15:51 AM by AutoGen 5.12
* From the definitions srptool-args.def
* and the template file options
*
static char const zPasswd_Conf_NAME[] = "PASSWD_CONF";
static char const zPasswd_Conf_Name[] = "passwd-conf";
#define PASSWD_CONF_FLAGS (OPTST_DISABLED \
- | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Create_Conf option description:
static char const zCreate_Conf_NAME[] = "CREATE_CONF";
static char const zCreate_Conf_Name[] = "create-conf";
#define CREATE_CONF_FLAGS (OPTST_DISABLED \
- | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
/*
* Help/More_Help/Version option descriptions:
optionStackArg, optionTimeDate, optionTimeVal,
optionUnstackArg, optionVersionStderr;
static tOptProc
- doOptCreate_Conf, doOptDebug, doOptPasswd_Conf, doUsageOpt;
+ doOptDebug, doUsageOpt;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
- /* option proc */ doOptPasswd_Conf,
+ /* option proc */ NULL,
/* desc, NAME, name */ zPasswd_ConfText, zPasswd_Conf_NAME, zPasswd_Conf_Name,
/* disablement strs */ NULL, NULL },
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
- /* option proc */ doOptCreate_Conf,
+ /* option proc */ NULL,
/* desc, NAME, name */ zCreate_ConfText, zCreate_Conf_NAME, zCreate_Conf_Name,
/* disablement strs */ NULL, NULL },
optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * For the passwd-conf option.
- */
-static void
-doOptPasswd_Conf(tOptions* pOptions, tOptDesc* pOptDesc)
-{
- static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
- static tuFileMode mode;
-#ifndef O_CLOEXEC
-# define O_CLOEXEC 0
-#endif
- mode.file_flags = O_CLOEXEC;
-
- optionFileCheck(pOptions, pOptDesc, type, mode);
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * For the create-conf option.
- */
-static void
-doOptCreate_Conf(tOptions* pOptions, tOptDesc* pOptDesc)
-{
- static teOptFileType const type =
- FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
- static tuFileMode mode;
-#ifndef O_CLOEXEC
-# define O_CLOEXEC 0
-#endif
- mode.file_flags = O_CLOEXEC;
-
- optionFileCheck(pOptions, pOptDesc, type, mode);
-}
/* extracted from optcode.tlib near line 666 */
#if ENABLE_NLS
flag = {
name = passwd-conf;
value = v;
- arg-type = file;
- file-exists;
+ arg-type = string;
descrip = "specify a password conf file.";
doc = "Specify a filename or a PKCS #11 URL to read the CAs from.";
};
flag = {
name = create-conf;
- arg-type = file;
+ arg-type = string;
descrip = "Generate a password configuration file.";
doc = "This generates a password configuration file (tpasswd.conf)
containing the required for TLS parameters.";
*
* DO NOT EDIT THIS FILE (srptool-args.h)
*
- * It has been AutoGen-ed January 21, 2012 at 01:58:49 AM by AutoGen 5.12
+ * It has been AutoGen-ed January 21, 2012 at 02:15:51 AM by AutoGen 5.12
* From the definitions srptool-args.def
* and the template file options
*