flag = {
value = i;
- name = issuer-name;
+ name = ident;
ifdef = AUTOKEY;
arg-type = string;
- arg-name = issuer-name;
- descrip = "set issuer name";
+ arg-name = group;
+ descrip = "set Autokey group name";
doc = <<- _EndOfDoc_
- Set the issuer name to name. This is used for the issuer field
- in certificates and in the file name for host and sign keys.
+ Set the optional Autokey group name to name. This is used in
+ the file name of IFF, GQ, and MV client parameters files. In
+ that role, the default is the host name if this option is not
+ provided. The group name, if specified using -i/--ident or
+ using -s/--subject-name following an '@' character, is also a
+ part of the self-signed host certificate's subject and issuer
+ names in the form host@group and should match the 'crypto ident'
+ or 'server ident' configuration in ntpd's configuration file.
_EndOfDoc_;
};
value = s;
name = subject-name;
arg-type = string;
- arg-name = host;
+ arg-name = host@group;
ifdef = AUTOKEY;
- descrip = "set subject name";
+ descrip = "set host and optionally group name";
doc = <<- _EndOfDoc_
- Set the subject name to name. This is used as the subject field
- in certificates and in the file name for identity files.
+ Set the Autokey host name, and optionally, group name specified
+ following an '@' character. The host name is used in the file
+ name of generated host and signing certificates, without the
+ group name. The host name, and if provided, group name are used
+ in host@group form for the host certificate's subject and issuer
+ fields. Specifying '-s @group' is allowed, and results in
+ leaving the host name unchanged while appending @group to the
+ subject and issuer fields, as with -i group. The group name, or
+ if not provided, the host name are also used in the file names
+ of IFF, GQ, and MV client parameter files.
_EndOfDoc_;
};
u_int fstamp; /* NTP filestamp */
char *hostname = NULL; /* host name */
char *groupname = NULL; /* group name */
-char *certname = NULL; /* certificate subjetc/issuer name */
+char *certname = NULL; /* certificate subject/issuer name */
char *passwd1 = NULL; /* input private key password */
char *passwd2 = NULL; /* output private key password */
char filename[MAXFILENAME + 1]; /* file name */
{
struct timeval tv; /* initialization vector */
int md5key = 0; /* generate MD5 keys */
+ int optct; /* option count */
+ char * pch;
#ifdef AUTOKEY
X509 *cert = NULL; /* X509 certificate */
X509_EXTENSION *ext; /* X509v3 extension */
epoch = tv.tv_sec;
fstamp = (u_int)(epoch + JAN_1970);
- {
- int optct = ntpOptionProcess(&ntp_keygenOptions,
- argc, argv);
- argc -= optct;
- argv += optct;
- }
+ optct = ntpOptionProcess(&ntp_keygenOptions, argc, argv);
+ argc -= optct;
+ argv += optct;
#ifdef OPENSSL
if (SSLeay() == SSLEAY_VERSION_NUMBER)
scheme = OPT_ARG( CERTIFICATE );
if (HAVE_OPT( SUBJECT_NAME )) {
+
if (*OPT_ARG(SUBJECT_NAME) != '@') {
certname = estrdup(OPT_ARG(SUBJECT_NAME));
} else {
}
}
- if (HAVE_OPT( ISSUER_NAME ))
- groupname = estrdup(OPT_ARG( ISSUER_NAME ));
+ if (HAVE_OPT( IDENT ))
+ groupname = estrdup(OPT_ARG( IDENT ));
if (HAVE_OPT( LIFETIME ))
lifetime = OPT_VALUE_LIFETIME;