summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/util
diff options
context:
space:
mode:
authorgordon <gordon@FreeBSD.org>2018-03-07 05:58:24 +0000
committergordon <gordon@FreeBSD.org>2018-03-07 05:58:24 +0000
commit5f0a95d4d67b9661a44d76f8be22183785af0814 (patch)
treed12a586453bbbc83e599e0e2311907acb6e2e467 /contrib/ntp/util
parent722c1ce56e86ad17ed56adee959f19b00bc1ca93 (diff)
downloadFreeBSD-src-5f0a95d4d67b9661a44d76f8be22183785af0814.zip
FreeBSD-src-5f0a95d4d67b9661a44d76f8be22183785af0814.tar.gz
Fix multiple vulnerabilities in ntp. [SA-18:02.ntp]
Approved by: so Security: FreeBSD-SA-18:02.ntp Security: CVE-2018-7182 Security: CVE-2018-7170 Security: CVE-2018-7184 Security: CVE-2018-7185 Security: CVE-2018-7183
Diffstat (limited to 'contrib/ntp/util')
-rw-r--r--contrib/ntp/util/Makefile.in2
-rw-r--r--contrib/ntp/util/invoke-ntp-keygen.texi1049
-rw-r--r--contrib/ntp/util/ntp-keygen-opts.c317
-rw-r--r--contrib/ntp/util/ntp-keygen-opts.def1030
-rw-r--r--contrib/ntp/util/ntp-keygen-opts.h38
-rw-r--r--contrib/ntp/util/ntp-keygen.1ntp-keygenman1033
-rw-r--r--contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc988
-rw-r--r--contrib/ntp/util/ntp-keygen.html1047
-rw-r--r--contrib/ntp/util/ntp-keygen.man.in1033
-rw-r--r--contrib/ntp/util/ntp-keygen.mdoc.in988
10 files changed, 4308 insertions, 3217 deletions
diff --git a/contrib/ntp/util/Makefile.in b/contrib/ntp/util/Makefile.in
index 0e11d0d..a7ab7ee 100644
--- a/contrib/ntp/util/Makefile.in
+++ b/contrib/ntp/util/Makefile.in
@@ -110,6 +110,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ltsugar.m4 \
$(top_srcdir)/sntp/m4/ltversion.m4 \
$(top_srcdir)/sntp/m4/lt~obsolete.m4 \
+ $(top_srcdir)/sntp/m4/ntp_af_unspec.m4 \
$(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \
$(top_srcdir)/sntp/m4/ntp_compiler.m4 \
$(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \
@@ -1365,7 +1366,6 @@ install-exec-hook:
#
check-libntp: ../libntp/libntp.a
- @echo stamp > $@
../libntp/libntp.a:
cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
diff --git a/contrib/ntp/util/invoke-ntp-keygen.texi b/contrib/ntp/util/invoke-ntp-keygen.texi
index 33af826..2a8d401 100644
--- a/contrib/ntp/util/invoke-ntp-keygen.texi
+++ b/contrib/ntp/util/invoke-ntp-keygen.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp-keygen.texi)
#
-# It has been AutoGen-ed March 21, 2017 at 10:45:57 AM by AutoGen 5.18.5
+# It has been AutoGen-ed February 27, 2018 at 05:15:57 PM by AutoGen 5.18.5
# From the definitions ntp-keygen-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -15,26 +15,29 @@
This program generates cryptographic data files used by the NTPv4
authentication and identification schemes.
-It generates MD5 key files used in symmetric key cryptography.
-In addition, if the OpenSSL software library has been installed,
-it generates keys, certificate and identity files used in public key
-cryptography.
+It can generate message digest keys used in symmetric key cryptography and,
+if the OpenSSL software library has been installed, it can generate host keys,
+signing keys, certificates, and identity keys and parameters used in Autokey
+public key cryptography.
These files are used for cookie encryption,
-digital signature and challenge/response identification algorithms
+digital signature, and challenge/response identification algorithms
compatible with the Internet standard security infrastructure.
-All files are in PEM-encoded printable ASCII format,
-so they can be embedded as MIME attachments in mail to other sites
+The message digest symmetric keys file is generated in a format
+compatible with NTPv3.
+All other files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in email to other sites
and certificate authorities.
By default, files are not encrypted.
-When used to generate message digest keys, the program produces a file
-containing ten pseudo-random printable ASCII strings suitable for the
-MD5 message digest algorithm included in the distribution.
+When used to generate message digest symmetric keys, the program
+produces a file containing ten pseudo-random printable ASCII strings
+suitable for the MD5 message digest algorithm included in the
+distribution.
If the OpenSSL library is installed, it produces an additional ten
-hex-encoded random bit strings suitable for the SHA1 and other message
-digest algorithms.
-The message digest keys file must be distributed and stored
+hex-encoded random bit strings suitable for SHA1, AES-128-CMAC, and
+other message digest algorithms.
+The message digest symmetric keys file must be distributed and stored
using secure means beyond the scope of NTP itself.
Besides the keys used for ordinary NTP associations, additional keys
can be defined as passwords for the
@@ -54,222 +57,132 @@ other than Autokey.
Some files used by this program are encrypted using a private password.
The
@code{-p}
-option specifies the password for local encrypted files and the
+option specifies the read password for local encrypted files and the
@code{-q}
-option the password for encrypted files sent to remote sites.
+option the write password for encrypted files sent to remote sites.
If no password is specified, the host name returned by the Unix
-@code{gethostname()}
-function, normally the DNS name of the host is used.
+@code{hostname(1)}
+command, normally the DNS name of the host, is used as the the default read
+password, for convenience.
+The
+@code{ntp-keygen}
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
The
-@kbd{pw}
+@code{pw}
option of the
-@kbd{crypto}
+@code{crypto}
+@code{ntpd(1ntpdmdoc)}
configuration command specifies the read
password for previously encrypted local files.
-This must match the local password used by this program.
+This must match the local read password used by this program.
If not specified, the host name is used.
-Thus, if files are generated by this program without password,
+Thus, if files are generated by this program without an explicit password,
they can be read back by
-@kbd{ntpd}
-without password but only on the same host.
+@code{ntpd(1ntpdmdoc)}
+without specifying an explicit password but only on the same host.
+If the write password used for encryption is specified as the host name,
+these files can be read by that host with no explicit password.
Normally, encrypted files for each host are generated by that host and
used only by that host, although exceptions exist as noted later on
this page.
The symmetric keys file, normally called
-@kbd{ntp.keys},
+@file{ntp.keys},
is usually installed in
@file{/etc}.
Other files and links are usually installed in
@file{/usr/local/etc},
which is normally in a shared filesystem in
NFS-mounted networks and cannot be changed by shared clients.
-The location of the keys directory can be changed by the
-@kbd{keysdir}
-configuration command in such cases.
-Normally, this is in
-@file{/etc}.
+In these cases, NFS clients can specify the files in another
+directory such as
+@file{/etc}
+using the
+@code{keysdir}
+@code{ntpd(1ntpdmdoc)}
+configuration file command.
This program directs commentary and error messages to the standard
error stream
-@kbd{stderr}
+@file{stderr}
and remote files to the standard output stream
-@kbd{stdout}
+@file{stdout}
where they can be piped to other applications or redirected to files.
The names used for generated files and links all begin with the
string
-@kbd{ntpkey}
+@file{ntpkey*}
and include the file type, generating host and filestamp,
as described in the
-@quotedblleft{}Cryptographic Data Files@quotedblright{}
+@ref{Cryptographic Data Files}
section below.
-@subsubsection Running the Program
-To test and gain experience with Autokey concepts, log in as root and
-change to the keys directory, usually
-@file{/usr/local/etc}
-When run for the first time, or if all files with names beginning with
-@kbd{ntpkey}
-have been removed, use the
-@code{ntp-keygen}
-command without arguments to generate a
-default RSA host key and matching RSA-MD5 certificate with expiration
-date one year hence.
-If run again without options, the program uses the
-existing keys and parameters and generates only a new certificate with
-new expiration date one year hence.
-
-Run the command on as many hosts as necessary.
-Designate one of them as the trusted host (TH) using
-@code{ntp-keygen}
-with the
-@code{-T}
-option and configure it to synchronize from reliable Internet servers.
-Then configure the other hosts to synchronize to the TH directly or
-indirectly.
-A certificate trail is created when Autokey asks the immediately
-ascendant host towards the TH to sign its certificate, which is then
-provided to the immediately descendant host on request.
-All group hosts should have acyclic certificate trails ending on the TH.
-The host key is used to encrypt the cookie when required and so must be
-RSA type.
-By default, the host key is also the sign key used to encrypt
-signatures.
-A different sign key can be assigned using the
-@code{-S}
-option and this can be either RSA or DSA type.
-By default, the signature
-message digest type is MD5, but any combination of sign key type and
-message digest type supported by the OpenSSL library can be specified
-using the
-@code{-c}
-option.
-The rules say cryptographic media should be generated with proventic
-filestamps, which means the host should already be synchronized before
-this program is run.
-This of course creates a chicken-and-egg problem
-when the host is started for the first time.
-Accordingly, the host time
-should be set by some other means, such as eyeball-and-wristwatch, at
-least so that the certificate lifetime is within the current year.
-After that and when the host is synchronized to a proventic source, the
-certificate should be re-generated.
-
-Additional information on trusted groups and identity schemes is on the
-@quotedblleft{}Autokey Public-Key Authentication@quotedblright{}
-page.
-
-
-
-The
-@code{ntpd(1ntpdmdoc)}
-configuration command
-@code{crypto} @code{pw} @kbd{password}
-specifies the read password for previously encrypted files.
-The daemon expires on the spot if the password is missing
-or incorrect.
-For convenience, if a file has been previously encrypted,
-the default read password is the name of the host running
-the program.
-If the previous write password is specified as the host name,
-these files can be read by that host with no explicit password.
-
-
-File names begin with the prefix
-@code{ntpkey_}
-and end with the postfix
-@kbd{_hostname.filestamp},
-where
-@kbd{hostname}
-is the owner name, usually the string returned
-by the Unix gethostname() routine, and
-@kbd{filestamp}
-is the NTP seconds when the file was generated, in decimal digits.
-This both guarantees uniqueness and simplifies maintenance
-procedures, since all files can be quickly removed
-by a
-@code{rm} @code{ntpkey*}
-command or all files generated
-at a specific time can be removed by a
-@code{rm}
-@kbd{*filestamp}
-command.
-To further reduce the risk of misconfiguration,
-the first two lines of a file contain the file name
-and generation date and time as comments.
-
-All files are installed by default in the keys directory
-@file{/usr/local/etc},
-which is normally in a shared filesystem
-in NFS-mounted networks.
-The actual location of the keys directory
-and each file can be overridden by configuration commands,
-but this is not recommended.
-Normally, the files for each host are generated by that host
-and used only by that host, although exceptions exist
-as noted later on this page.
-
-Normally, files containing private values,
-including the host key, sign key and identification parameters,
-are permitted root read/write-only;
-while others containing public values are permitted world readable.
-Alternatively, files containing private values can be encrypted
-and these files permitted world readable,
-which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
-dependent clients can all be installed in the same shared directory.
-
-The recommended practice is to keep the file name extensions
-when installing a file and to install a soft link
-from the generic names specified elsewhere on this page
-to the generated files.
-This allows new file generations to be activated simply
-by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
-If a link is not present,
-@code{ntpd(1ntpdmdoc)}
-extracts the filestamp from the file itself.
-This allows clients to verify that the file and generation times
-are always current.
-The
-@code{ntp-keygen}
-program uses the same timestamp extension for all files generated
-at one time, so each generation is distinct and can be readily
-recognized in monitoring data.
-@subsubsection Running the program
+@subsubsection Running the Program
The safest way to run the
@code{ntp-keygen}
program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
+The recommended procedure is change to the
+@kbd{keys}
+directory, usually
@file{/usr/local/etc},
then run the program.
-When run for the first time,
-or if all
-@code{ntpkey}
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
+
+To test and gain experience with Autokey concepts, log in as root and
+change to the
+@kbd{keys}
+directory, usually
+@file{/usr/local/etc}.
+When run for the first time, or if all files with names beginning with
+@file{ntpkey*}
+have been removed, use the
+@code{ntp-keygen}
+command without arguments to generate a default
+@code{RSA}
+host key and matching
+@code{RSA-MD5}
+certificate file with expiration date one year hence,
which is all that is necessary in many cases.
The program also generates soft links from the generic names
to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+If run again without options, the program uses the
+existing keys and parameters and generates a new certificate file with
+new expiration date one year hence, and soft link.
-The host key is used to encrypt the cookie when required and so must be RSA type.
+The host key is used to encrypt the cookie when required and so must be
+@code{RSA}
+type.
By default, the host key is also the sign key used to encrypt signatures.
When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
+either
+@code{RSA}
+or
+@code{DSA}
+type.
+By default, the message digest type is
+@code{MD5},
+but any combination
of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
+can be specified, including those using the
+@code{AES128CMAC}, @code{MD2}, @code{MD5}, @code{MDC2}, @code{SHA}, @code{SHA1}
+and
+@code{RIPE160}
+message digest algorithms.
However, the scheme specified in the certificate must be compatible
with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Certificates using any digest algorithm are compatible with
+@code{RSA}
+sign keys;
+however, only
+@code{SHA}
+and
+@code{SHA1}
+certificates are compatible with
+@code{DSA}
+sign keys.
Private/public key files and certificates are compatible with
other OpenSSL applications and very likely other libraries as well.
@@ -280,19 +193,19 @@ However, the identification parameter files, although encoded
as the other files, are probably not compatible with anything other than Autokey.
Running the program as other than root and using the Unix
-@code{su}
+@code{su(1)}
command
to assume root may not work properly, since by default the OpenSSL library
looks for the random seed file
-@code{.rnd}
+@file{.rnd}
in the user home directory.
However, there should be only one
-@code{.rnd},
+@file{.rnd},
most conveniently
in the root directory, so it is convenient to define the
-@code{$RANDFILE}
+.Ev RANDFILE
environment variable used by the OpenSSL library as the path to
-@code{/.rnd}.
+@file{.rnd}.
Installing the keys as root might not work in NFS-mounted
shared file systems, as NFS clients may not be able to write
@@ -302,7 +215,8 @@ directory such as
@file{/etc}
using the
@code{keysdir}
-command.
+@code{ntpd(1ntpdmdoc)}
+configuration file command.
There is no need for one client to read the keys and certificates
of other clients or servers, as these data are obtained automatically
by the Autokey protocol.
@@ -317,7 +231,6 @@ as the subject and issuer fields, respectively, of the certificate.
The owner name is also used for the host and sign key files,
while the trusted name is used for the identity files.
-
All files are installed by default in the keys directory
@file{/usr/local/etc},
which is normally in a shared filesystem
@@ -336,8 +249,11 @@ while others containing public values are permitted world readable.
Alternatively, files containing private values can be encrypted
and these files permitted world readable,
which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
+Since uniqueness is insured by the
+@kbd{hostname}
+and
+@kbd{filestamp}
+file name extensions, the files for an NTP server and
dependent clients can all be installed in the same shared directory.
The recommended practice is to keep the file name extensions
@@ -346,107 +262,112 @@ from the generic names specified elsewhere on this page
to the generated files.
This allows new file generations to be activated simply
by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
+If a link is present,
+@code{ntpd(1ntpdmdoc)}
+follows it to the file name to extract the
+@kbd{filestamp}.
If a link is not present,
@code{ntpd(1ntpdmdoc)}
-extracts the filestamp from the file itself.
+extracts the
+@kbd{filestamp}
+from the file itself.
This allows clients to verify that the file and generation times
are always current.
The
@code{ntp-keygen}
-program uses the same timestamp extension for all files generated
+program uses the same
+@kbd{filestamp}
+extension for all files generated
at one time, so each generation is distinct and can be readily
recognized in monitoring data.
-@subsubsection Running the program
-The safest way to run the
+
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
@code{ntp-keygen}
-program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
-@file{/usr/local/etc},
-then run the program.
-When run for the first time,
-or if all
-@code{ntpkey}
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
-which is all that is necessary in many cases.
-The program also generates soft links from the generic names
-to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+with the
+@code{-T}
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
-The host key is used to encrypt the cookie when required and so must be RSA type.
-By default, the host key is also the sign key used to encrypt signatures.
-When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
-of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
-However, the scheme specified in the certificate must be compatible
-with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+@code{-S}
+option and this can be either
+@code{RSA}
+or
+@code{DSA}
+type.
+By default, the signature
+message digest type is
+@code{MD5},
+but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+@code{-c}
+option.
-Private/public key files and certificates are compatible with
-other OpenSSL applications and very likely other libraries as well.
-Certificates or certificate requests derived from them should be compatible
-with extant industry practice, although some users might find
-the interpretation of X509v3 extension fields somewhat liberal.
-However, the identification parameter files, although encoded
-as the other files, are probably not compatible with anything other than Autokey.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
-Running the program as other than root and using the Unix
-@code{su}
-command
-to assume root may not work properly, since by default the OpenSSL library
-looks for the random seed file
-@code{.rnd}
-in the user home directory.
-However, there should be only one
-@code{.rnd},
-most conveniently
-in the root directory, so it is convenient to define the
-@code{$RANDFILE}
-environment variable used by the OpenSSL library as the path to
-@code{/.rnd}.
+Additional information on trusted groups and identity schemes is on the
+@quotedblleft{}Autokey Public-Key Authentication@quotedblright{}
+page.
-Installing the keys as root might not work in NFS-mounted
-shared file systems, as NFS clients may not be able to write
-to the shared keys directory, even as root.
-In this case, NFS clients can specify the files in another
-directory such as
-@file{/etc}
-using the
-@code{keysdir}
+File names begin with the prefix
+@file{ntpkey}_
+and end with the suffix
+@file{_}@kbd{hostname}. @kbd{filestamp},
+where
+@kbd{hostname}
+is the owner name, usually the string returned
+by the Unix
+@code{hostname(1)}
+command, and
+@kbd{filestamp}
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+@code{rm} @file{ntpkey*}
+command or all files generated
+at a specific time can be removed by a
+@code{rm} @file{*}@kbd{filestamp}
command.
-There is no need for one client to read the keys and certificates
-of other clients or servers, as these data are obtained automatically
-by the Autokey protocol.
-
-Ordinarily, cryptographic files are generated by the host that uses them,
-but it is possible for a trusted agent (TA) to generate these files
-for other hosts; however, in such cases files should always be encrypted.
-The subject name and trusted name default to the hostname
-of the host generating the files, but can be changed by command line options.
-It is convenient to designate the owner name and trusted name
-as the subject and issuer fields, respectively, of the certificate.
-The owner name is also used for the host and sign key files,
-while the trusted name is used for the identity files.
-seconds.
-seconds.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
-s Trusted Hosts and Groups
+@subsubsection Trusted Hosts and Groups
Each cryptographic configuration involves selection of a signature scheme
and identification scheme, called a cryptotype,
as explained in the
@ref{Authentication Options}
section of
@code{ntp.conf(5)}.
-The default cryptotype uses RSA encryption, MD5 message digest
-and TC identification.
+The default cryptotype uses
+@code{RSA}
+encryption,
+@code{MD5}
+message digest
+and
+@code{TC}
+identification.
First, configure a NTP subnet including one or more low-stratum
trusted hosts from which all other hosts derive synchronization
directly or indirectly.
@@ -464,7 +385,7 @@ section of
On each trusted host as root, change to the keys directory.
To insure a fresh fileset, remove all
-@code{ntpkey}
+@file{ntpkey}
files.
Then run
@code{ntp-keygen}
@@ -489,7 +410,9 @@ is either
@code{RSA}
or
@code{DSA}.
-The most often need to do this is when a DSA-signed certificate is used.
+The most frequent need to do this is when a
+@code{DSA}-signed
+certificate is used.
If it is necessary to use a different certificate scheme than the default,
run
@code{ntp-keygen}
@@ -498,17 +421,17 @@ with the
option and selected
@kbd{scheme}
as needed.
-f
+If
@code{ntp-keygen}
is run again without these options, it generates a new certificate
-using the same scheme and sign key.
+using the same scheme and sign key, and soft link.
After setting up the environment it is advisable to update certificates
from time to time, if only to extend the validity interval.
Simply run
@code{ntp-keygen}
with the same flags as before to generate new certificates
-using existing keys.
+using existing keys, and soft links.
However, if the host or sign key is changed,
@code{ntpd(1ntpdmdoc)}
should be restarted.
@@ -517,15 +440,18 @@ When
is restarted, it loads any new files and restarts the protocol.
Other dependent hosts will continue as usual until signatures are refreshed,
at which time the protocol is restarted.
+
@subsubsection Identity Schemes
As mentioned on the Autonomous Authentication page,
-the default TC identity scheme is vulnerable to a middleman attack.
+the default
+@code{TC}
+identity scheme is vulnerable to a middleman attack.
However, there are more secure identity schemes available,
-including PC, IFF, GQ and MV described on the
-"Identification Schemes"
-page
-(maybe available at
-@code{http://www.eecis.udel.edu/%7emills/keygen.html}).
+including
+@code{PC}, @code{IFF}, @code{GQ}
+and
+@code{MV}
+schemes described below.
These schemes are based on a TA, one or more trusted hosts
and some number of nontrusted hosts.
Trusted hosts prove identity using values provided by the TA,
@@ -550,12 +476,15 @@ On trusted host alice run
@code{-P}
@code{-p} @kbd{password}
to generate the host key file
-@file{ntpkey_RSAkey_}@kbd{alice.filestamp}
+@file{ntpkey}_ @code{RSA} @file{key_alice.} @kbd{filestamp}
and trusted private certificate file
-@file{ntpkey_RSA-MD5_cert_}@kbd{alice.filestamp}.
+@file{ntpkey}_ @code{RSA-MD5} @code{_} @file{cert_alice.} @kbd{filestamp},
+and soft links.
Copy both files to all group hosts;
they replace the files which would be generated in other schemes.
-On each host bob install a soft link from the generic name
+On each host
+@kbd{bob}
+install a soft link from the generic name
@file{ntpkey_host_}@kbd{bob}
to the host key file and soft link
@file{ntpkey_cert_}@kbd{bob}
@@ -564,26 +493,34 @@ Note the generic links are on bob, but point to files generated
by trusted host alice.
In this scheme it is not possible to refresh
either the keys or certificates without copying them
-to all other hosts in the group.
+to all other hosts in the group, and recreating the soft links.
-For the IFF scheme proceed as in the TC scheme to generate keys
+For the
+@code{IFF}
+scheme proceed as in the
+@code{TC}
+scheme to generate keys
and certificates for all group hosts, then for every trusted host in the group,
-generate the IFF parameter file.
+generate the
+@code{IFF}
+parameter file.
On trusted host alice run
@code{ntp-keygen}
@code{-T}
@code{-I}
@code{-p} @kbd{password}
to produce her parameter file
-@file{ntpkey_IFFpar_}@kbd{alice.filestamp},
+@file{ntpkey_IFFpar_alice.}@kbd{filestamp},
which includes both server and client keys.
Copy this file to all group hosts that operate as both servers
and clients and install a soft link from the generic
-@file{ntpkey_iff_}@kbd{alice}
+@file{ntpkey_iff_alice}
to this file.
If there are no hosts restricted to operate only as clients,
there is nothing further to do.
-As the IFF scheme is independent
+As the
+@code{IFF}
+scheme is independent
of keys and certificates, these files can be refreshed as needed.
If a rogue client has the parameter file, it could masquerade
@@ -593,37 +530,53 @@ from the parameter file and distributed to all restricted clients.
After generating the parameter file, on alice run
@code{ntp-keygen}
@code{-e}
-and pipe the output to a file or mail program.
-Copy or mail this file to all restricted clients.
+and pipe the output to a file or email program.
+Copy or email this file to all restricted clients.
On these clients install a soft link from the generic
-@file{ntpkey_iff_}@kbd{alice}
+@file{ntpkey_iff_alice}
to this file.
To further protect the integrity of the keys,
each file can be encrypted with a secret password.
-For the GQ scheme proceed as in the TC scheme to generate keys
+For the
+@code{GQ}
+scheme proceed as in the
+@code{TC}
+scheme to generate keys
and certificates for all group hosts, then for every trusted host
-in the group, generate the IFF parameter file.
+in the group, generate the
+@code{IFF}
+parameter file.
On trusted host alice run
@code{ntp-keygen}
@code{-T}
@code{-G}
@code{-p} @kbd{password}
to produce her parameter file
-@file{ntpkey_GQpar_}@kbd{alice.filestamp},
+@file{ntpkey_GQpar_alice.}@kbd{filestamp},
which includes both server and client keys.
Copy this file to all group hosts and install a soft link
from the generic
-@file{ntpkey_gq_}@kbd{alice}
+@file{ntpkey_gq_alice}
to this file.
-In addition, on each host bob install a soft link
+In addition, on each host
+@kbd{bob}
+install a soft link
from generic
@file{ntpkey_gq_}@kbd{bob}
to this file.
-As the GQ scheme updates the GQ parameters file and certificate
+As the
+@code{GQ}
+scheme updates the
+@code{GQ}
+parameters file and certificate
at the same time, keys and certificates can be regenerated as needed.
-For the MV scheme, proceed as in the TC scheme to generate keys
+For the
+@code{MV}
+scheme, proceed as in the
+@code{TC}
+scheme to generate keys
and certificates for all group hosts.
For illustration assume trish is the TA, alice one of several trusted hosts
and bob one of her clients.
@@ -635,9 +588,9 @@ where
@kbd{n}
is the number of revokable keys (typically 5) to produce
the parameter file
-@file{ntpkeys_MVpar_}@kbd{trish.filestamp}
+@file{ntpkeys_MVpar_trish.}@kbd{filestamp}
and client key files
-@file{ntpkeys_MVkeyd_}@kbd{trish.filestamp}
+@file{ntpkeys_MVkey}@kbd{d} @kbd{_} @file{trish.} @kbd{filestamp}
where
@kbd{d}
is the key number (0 <
@@ -646,81 +599,220 @@ is the key number (0 <
@kbd{n}).
Copy the parameter file to alice and install a soft link
from the generic
-@file{ntpkey_mv_}@kbd{alice}
+@file{ntpkey_mv_alice}
to this file.
Copy one of the client key files to alice for later distribution
to her clients.
-It doesn't matter which client key file goes to alice,
+It does not matter which client key file goes to alice,
since they all work the same way.
-Alice copies the client key file to all of her cliens.
+Alice copies the client key file to all of her clients.
On client bob install a soft link from generic
-@file{ntpkey_mvkey_}@kbd{bob}
+@file{ntpkey_mvkey_bob}
to the client key file.
-As the MV scheme is independent of keys and certificates,
+As the
+@code{MV}
+scheme is independent of keys and certificates,
these files can be refreshed as needed.
+
@subsubsection Command Line Options
@table @asis
-@item @code{-c} @kbd{scheme}
-Select certificate message digest/signature encryption scheme.
+@item @code{-b} @code{--imbits}= @kbd{modulus}
+Set the number of bits in the identity modulus for generating identity keys to
+@kbd{modulus}
+bits.
+The number of bits in the identity modulus defaults to 256, but can be set to
+values from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+@item @code{-c} @code{--certificate}= @kbd{scheme}
+Select certificate signature encryption/message digest scheme.
The
@kbd{scheme}
can be one of the following:
-. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+@code{RSA-MD2}, @code{RSA-MD5}, @code{RSA-MDC2}, @code{RSA-SHA}, @code{RSA-SHA1}, @code{RSA-RIPEMD160}, @code{DSA-SHA},
or
@code{DSA-SHA1}.
-Note that RSA schemes must be used with a RSA sign key and DSA
-schemes must be used with a DSA sign key.
+Note that
+@code{RSA}
+schemes must be used with an
+@code{RSA}
+sign key and
+@code{DSA}
+schemes must be used with a
+@code{DSA}
+sign key.
The default without this option is
@code{RSA-MD5}.
-@item @code{-d}
-Enable debugging.
+If compatibility with FIPS 140-2 is required, either the
+@code{DSA-SHA}
+or
+@code{DSA-SHA1}
+scheme must be used.
+@item @code{-C} @code{--cipher}= @kbd{cipher}
+Select the OpenSSL cipher to encrypt the files containing private keys.
+The default without this option is three-key triple DES in CBC mode,
+@code{des-ede3-cbc}.
+The
+@code{openssl} @code{-h}
+command provided with OpenSSL displays available ciphers.
+@item @code{-d} @code{--debug-level}
+Increase debugging verbosity level.
This option displays the cryptographic data produced in eye-friendly billboards.
-@item @code{-e}
-Write the IFF client keys to the standard output.
-This is intended for automatic key distribution by mail.
-@item @code{-G}
-Generate parameters and keys for the GQ identification scheme,
-obsoleting any that may exist.
-@item @code{-g}
-Generate keys for the GQ identification scheme
-using the existing GQ parameters.
-If the GQ parameters do not yet exist, create them first.
-@item @code{-H}
-Generate new host keys, obsoleting any that may exist.
-@item @code{-I}
-Generate parameters for the IFF identification scheme,
-obsoleting any that may exist.
-@item @code{-i} @kbd{name}
-Set the suject name to
-@kbd{name}.
-This is used as the subject field in certificates
-and in the file name for host and sign keys.
-@item @code{-M}
-Generate MD5 keys, obsoleting any that may exist.
-@item @code{-P}
-Generate a private certificate.
+@item @code{-D} @code{--set-debug-level}= @kbd{level}
+Set the debugging verbosity to
+@kbd{level}.
+This option displays the cryptographic data produced in eye-friendly billboards.
+@item @code{-e} @code{--id-key}
+Write the
+@code{IFF}
+or
+@code{GQ}
+public parameters from the
+@kbd{IFFkey} @kbd{or} @kbd{GQkey}
+client keys file previously specified
+as unencrypted data to the standard output stream
+@file{stdout}.
+This is intended for automatic key distribution by email.
+@item @code{-G} @code{--gq-params}
+Generate a new encrypted
+@code{GQ}
+parameters and key file for the Guillou-Quisquater (GQ) identity scheme.
+This option is mutually exclusive with the
+@code{-I}
+and
+@code{-V}
+options.
+@item @code{-H} @code{--host-key}
+Generate a new encrypted
+@code{RSA}
+public/private host key file.
+@item @code{-I} @code{--iffkey}
+Generate a new encrypted
+@code{IFF}
+key file for the Schnorr (IFF) identity scheme.
+This option is mutually exclusive with the
+@code{-G}
+and
+Fl V
+options.
+@item @code{-i} @code{--ident}= @kbd{group}
+Set the optional Autokey group name to
+@kbd{group}.
+This is used in the identity scheme parameter file names of
+@code{IFF}, @code{GQ},
+and
+@code{MV}
+client parameters files.
+In that role, the default is the host name if no group is provided.
+The group name, if specified using
+@code{-i}
+or
+@code{-s}
+following an
+@quoteleft{}@@@quoteright{}
+character, is also used in certificate subject and issuer names in the form
+@kbd{host} @kbd{@@} @kbd{group}
+and should match the group specified via
+@code{crypto} @code{ident}
+or
+@code{server} @code{ident}
+in the ntpd configuration file.
+@item @code{-l} @code{--lifetime}= @kbd{days}
+Set the lifetime for certificate expiration to
+@kbd{days}.
+The default lifetime is one year (365 days).
+@item @code{-m} @code{--modulus}= @kbd{bits}
+Set the number of bits in the prime modulus for generating files to
+@kbd{bits}.
+The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+@item @code{-M} @code{--md5key}
+Generate a new symmetric keys file containing 10
+@code{MD5}
+keys, and if OpenSSL is available, 10
+@code{SHA}
+keys.
+An
+@code{MD5}
+key is a string of 20 random printable ASCII characters, while a
+@code{SHA}
+key is a string of 40 random hex digits.
+The file can be edited using a text editor to change the key type or key content.
+This option is mutually exclusive with all other options.
+@item @code{-p} @code{--password}= @kbd{passwd}
+Set the password for reading and writing encrypted files to
+@kbd{passwd}.
+These include the host, sign and identify key files.
+By default, the password is the string returned by the Unix
+@code{hostname}
+command.
+@item @code{-P} @code{--pvt-cert}
+Generate a new private certificate used by the
+@code{PC}
+identity scheme.
By default, the program generates public certificates.
-@item @code{-p} @kbd{password}
-Encrypt generated files containing private data with
-@kbd{password}
-and the DES-CBC algorithm.
-@item @code{-q}
-Set the password for reading files to password.
-@item @code{-S} @code{[@code{RSA} | @code{DSA}]}
-Generate a new sign key of the designated type,
-obsoleting any that may exist.
-By default, the program uses the host key as the sign key.
-@item @code{-s} @kbd{name}
-Set the issuer name to
-@kbd{name}.
-This is used for the issuer field in certificates
-and in the file name for identity files.
-@item @code{-T}
+Note: the PC identity scheme is not recommended for new installations.
+@item @code{-q} @code{--export-passwd}= @kbd{passwd}
+Set the password for writing encrypted
+@code{IFF}, @code{GQ} @code{and} @code{MV}
+identity files redirected to
+@file{stdout}
+to
+@kbd{passwd}.
+In effect, these files are decrypted with the
+@code{-p}
+password, then encrypted with the
+@code{-q}
+password.
+By default, the password is the string returned by the Unix
+@code{hostname}
+command.
+@item @code{-s} @code{--subject-key}= @code{[host]} @code{[@@ @kbd{group}]}
+Specify the Autokey host name, where
+@kbd{host}
+is the optional host name and
+@kbd{group}
+is the optional group name.
+The host name, and if provided, group name are used in
+@kbd{host} @kbd{@@} @kbd{group}
+form as certificate subject and issuer.
+Specifying
+@code{-s} @code{-@@} @kbd{group}
+is allowed, and results in leaving the host name unchanged, as with
+@code{-i} @kbd{group}.
+The group name, or if no group is provided, the host name are also used in the
+file names of
+@code{IFF}, @code{GQ},
+and
+@code{MV}
+identity scheme client parameter files.
+If
+@kbd{host}
+is not specified, the default host name is the string returned by the Unix
+@code{hostname}
+command.
+@item @code{-S} @code{--sign-key}= @code{[@code{RSA} | @code{DSA}]}
+Generate a new encrypted public/private sign key file of the specified type.
+By default, the sign key is the host key and has the same type.
+If compatibility with FIPS 140-2 is required, the sign key type must be
+@code{DSA}.
+@item @code{-T} @code{--trusted-cert}
Generate a trusted certificate.
By default, the program generates a non-trusted certificate.
-@item @code{-V} @kbd{nkeys}
-Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+@item @code{-V} @code{--mv-params} @kbd{nkeys}
+Generate
+@kbd{nkeys}
+encrypted server keys and parameters for the Mu-Varadharajan (MV)
+identity scheme.
+This option is mutually exclusive with the
+@code{-I}
+and
+@code{-G}
+options.
+Note: support for this option should be considered a work in progress.
@end table
+
@subsubsection Random Seed File
All cryptographically sound key generation schemes must have means
to randomize the entropy seed used to initialize
@@ -743,7 +835,7 @@ but are outside the scope of this page.
The entropy seed used by the OpenSSL library is contained in a file,
usually called
-@code{.rnd},
+@file{.rnd},
which must be available when starting the NTP daemon
or the
@code{ntp-keygen}
@@ -766,46 +858,124 @@ If the
.Ev RANDFILE
environment variable is not present,
the library will look for the
-@code{.rnd}
+@file{.rnd}
file in the user home directory.
+Since both the
+@code{ntp-keygen}
+program and
+@code{ntpd(1ntpdmdoc)}
+daemon must run as root, the logical place to put this file is in
+@file{/.rnd}
+or
+@file{/root/.rnd}.
If the file is not available or cannot be written,
the daemon exits with a message to the system log and the program
exits with a suitable error message.
+
@subsubsection Cryptographic Data Files
-All other file formats begin with two lines.
-The first contains the file name, including the generated host name
-and filestamp.
-The second contains the datestamp in conventional Unix date format.
-Lines beginning with # are considered comments and ignored by the
+All file formats begin with two nonencrypted lines.
+The first line contains the file name, including the generated host name
+and filestamp, in the format
+@file{ntpkey_}@kbd{key} @kbd{_} @kbd{name}. @kbd{filestamp},
+where
+@kbd{key}
+is the key or parameter type,
+@kbd{name}
+is the host or group name and
+@kbd{filestamp}
+is the filestamp (NTP seconds) when the file was created.
+By convention,
+@kbd{key}
+names in generated file names include both upper and lower case
+characters, while
+@kbd{key}
+names in generated link names include only lower case characters.
+The filestamp is not used in generated link names.
+The second line contains the datestamp in conventional Unix
+@file{date}
+format.
+Lines beginning with
+@quoteleft{}#@quoteright{}
+are considered comments and ignored by the
@code{ntp-keygen}
program and
@code{ntpd(1ntpdmdoc)}
daemon.
-Cryptographic values are encoded first using ASN.1 rules,
-then encrypted if necessary, and finally written PEM-encoded
-printable ASCII format preceded and followed by MIME content identifier lines.
-
-The format of the symmetric keys file is somewhat different
-than the other files in the interest of backward compatibility.
-Since DES-CBC is deprecated in NTPv4, the only key format of interest
-is MD5 alphanumeric strings.
-Following hte heard the keys are
-entered one per line in the format
+
+The remainder of the file contains cryptographic data, encoded first using ASN.1
+rules, then encrypted if necessary, and finally written in PEM-encoded
+printable ASCII text, preceded and followed by MIME content identifier lines.
+
+The format of the symmetric keys file, ordinarily named
+@file{ntp.keys},
+is somewhat different than the other files in the interest of backward compatibility.
+Ordinarily, the file is generated by this program, but it can be constructed
+and edited using an ordinary text editor.
+@verbatim
+# ntpkey_MD5key_bk.ntp.org.3595864945
+# Thu Dec 12 19:22:25 2013
+
+1 MD5 L";Nw<\`.I<f4U0)247"i # MD5 key
+2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key
+3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key
+4 MD5 Yue:tL[+vR)M\`n~bY,'? # MD5 key
+5 MD5 B;fx'Kgr/&4ZTbL6=RxA # MD5 key
+6 MD5 4eYwa\`o@}3i@@@@V@@..R9!l # MD5 key
+7 MD5 \`A.([h+;wTQ|xfi%Sn_! # MD5 key
+8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key
+9 MD5 3-5vcn*6l29DS?Xdsg)* # MD5 key
+10 MD5 2late4Me # MD5 key
+11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key
+12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key
+13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key
+14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key
+15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key
+16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key
+17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key
+18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key
+19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key
+20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key
+@end verbatim
+@example
+Figure 1. Typical Symmetric Key File
+@end example
+
+Figure 1 shows a typical symmetric keys file used by the reference
+implementation.
+Following the header the keys are entered one per line in the format
@example
@kbd{keyno} @kbd{type} @kbd{key}
@end example
where
@kbd{keyno}
-is a positive integer in the range 1-65,535,
+is a positive integer in the range 1-65534;
@kbd{type}
-is the string MD5 defining the key format and
+is the key type for the message digest algorithm, which in the absence of the
+OpenSSL library must be
+@code{MD5}
+to designate the MD5 message digest algorithm;
+if the OpenSSL library is installed, the key type can be any
+message digest algorithm supported by that library;
+however, if compatibility with FIPS 140-2 is required,
+the key type must be either
+@code{SHA}
+or
+@code{SHA1};
@kbd{key}
is the key itself,
-which is a printable ASCII string 16 characters or less in length.
-Each character is chosen from the 93 printable characters
-in the range 0x21 through 0x7f excluding space and the
+which is a printable ASCII string 20 characters or less in length:
+each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7e (
+@quoteleft{}@quoteright{}!
+through
+@quoteleft{}~@quoteright{}
+) excluding space and the
+@quoteleft{}#@quoteright{}
+character, and terminated by whitespace or a
@quoteleft{}#@quoteright{}
character.
+An OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which
+is truncated as necessary.
Note that the keys used by the
@code{ntpq(1ntpqmdoc)}
@@ -818,8 +988,8 @@ in human readable ASCII format.
The
@code{ntp-keygen}
-program generates a MD5 symmetric keys file
-@file{ntpkey_MD5key_}@kbd{hostname.filestamp}.
+program generates a symmetric keys file
+@file{ntpkey_MD5key_}@kbd{hostname}. @kbd{filestamp}.
Since the file contains private shared keys,
it should be visible only to root and distributed by secure means
to other subnet hosts.
@@ -853,13 +1023,13 @@ This software is released under the NTP license, <http://ntp.org/license>.
* ntp-keygen iffkey:: iffkey option (-I)
* ntp-keygen ident:: ident option (-i)
* ntp-keygen lifetime:: lifetime option (-l)
-* ntp-keygen md5key:: md5key option (-M)
* ntp-keygen modulus:: modulus option (-m)
+* ntp-keygen md5key:: md5key option (-M)
* ntp-keygen pvt-cert:: pvt-cert option (-P)
* ntp-keygen password:: password option (-p)
* ntp-keygen export-passwd:: export-passwd option (-q)
-* ntp-keygen sign-key:: sign-key option (-S)
* ntp-keygen subject-name:: subject-name option (-s)
+* ntp-keygen sign-key:: sign-key option (-S)
* ntp-keygen trusted-cert:: trusted-cert option (-T)
* ntp-keygen mv-params:: mv-params option (-V)
* ntp-keygen mv-keys:: mv-keys option (-v)
@@ -886,17 +1056,14 @@ with a status code of 0.
@exampleindent 0
@example
-ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p10-beta
-Usage: ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p245
+USAGE: ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
Flg Arg Option-Name Description
- -b Num imbits identity modulus bits
- - it must be in the range:
- 256 to 2048
-c Str certificate certificate scheme
-C Str cipher privatekey cipher
-d no debug-level Increase debug verbosity level
- may appear multiple times
- -D Num set-debug-level Set the debug verbosity level
+ -D Str set-debug-level Set the debug verbosity level
- may appear multiple times
-e no id-key Write IFF or GQ identity keys
-G no gq-params Generate GQ parameters and keys
@@ -906,34 +1073,35 @@ Usage: ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
-l Num lifetime set certificate lifetime
-M no md5key generate MD5 keys
-m Num modulus modulus
- - it must be in the range:
+ - It must be in the range:
256 to 2048
-P no pvt-cert generate PC private certificate
- -p Str password local private password
- -q Str export-passwd export IFF or GQ group keys with password
+ -p Str pvt-passwd output private password
+ -q Str get-pvt-passwd input private password
-S Str sign-key generate sign key (RSA or DSA)
-s Str subject-name set host and optionally group name
-T no trusted-cert trusted certificate (TC scheme)
-V Num mv-params generate <num> MV parameters
-v Num mv-keys update <num> MV keys
- opt version output version information and exit
- -? no help display extended usage information and exit
- -! no more-help extended usage information passed thru pager
- -> opt save-opts save the option state to a config file
- -< Str load-opts load options from a config file
- - disabled as '--no-load-opts'
+ opt version Output version information and exit
+ -? no help Display extended usage information and exit
+ -! no more-help Extended usage information passed thru pager
+ -> opt save-opts Save the option state to a config file
+ -< Str load-opts Load options from a config file
+ - disabled as --no-load-opts
- may appear multiple times
Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.
+
The following option preset mechanisms are supported:
- reading file $HOME/.ntprc
- reading file ./.ntprc
- examining environment variables named NTP_KEYGEN_*
-Please send bug reports to: <http://bugs.ntp.org, bugs@@ntp.org>
+please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org
@end example
@exampleindent 4
@@ -967,10 +1135,10 @@ must be compiled in by defining @code{AUTOKEY} during the compilation.
@end itemize
scheme is one of
-RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+RSA-MD2, RSA-MD5, RSA-MDC2, RSA-SHA, RSA-SHA1, RSA-RIPEMD160,
DSA-SHA, or DSA-SHA1.
-Select the certificate message digest/signature encryption scheme.
+Select the certificate signature encryption/message digest scheme.
Note that RSA schemes must be used with a RSA sign key and DSA
schemes must be used with a DSA sign key. The default without
this option is RSA-MD5.
@@ -990,7 +1158,7 @@ must be compiled in by defining @code{AUTOKEY} during the compilation.
Select the cipher which is used to encrypt the files containing
private keys. The default is three-key triple DES in CBC mode,
-equivalent to "@code{-C des-ede3-cbc". The openssl tool lists ciphers
+equivalent to "@code{-C des-ede3-cbc}". The openssl tool lists ciphers
available in "@code{openssl -h}" output.
@node ntp-keygen id-key
@subsection id-key option (-e)
@@ -1005,8 +1173,9 @@ This option has some usage constraints. It:
must be compiled in by defining @code{AUTOKEY} during the compilation.
@end itemize
-Write the IFF or GQ client keys to the standard output. This is
-intended for automatic key distribution by mail.
+Write the public parameters from the IFF or GQ client keys to
+the standard output.
+This is intended for automatic key distribution by email.
@node ntp-keygen gq-params
@subsection gq-params option (-G)
@cindex ntp-keygen-gq-params
@@ -1069,11 +1238,11 @@ 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 @code{-i/--ident} or
-using @code{-s/--subject-name} following an '@code{@}' character,
-is also a part of the self-signed host certificate's subject and
-issuer names in the form @code{host@group} and should match the
-'@code{crypto ident}' or '@code{server ident}' configuration in
-@code{ntpd}'s configuration file.
+using @code{-s/--subject-name} following an '@code{@@}' character,
+is also a part of the self-signed host certificate subject and
+issuer names in the form @code{host@@group} and should match the
+'@code{crypto ident}' or '@code{server ident}' configuration in the
+@code{ntpd} configuration file.
@node ntp-keygen lifetime
@subsection lifetime option (-l)
@cindex ntp-keygen-lifetime
@@ -1089,17 +1258,11 @@ must be compiled in by defining @code{AUTOKEY} during the compilation.
@end itemize
Set the certificate expiration to lifetime days from now.
-@node ntp-keygen md5key
-@subsection md5key option (-M)
-@cindex ntp-keygen-md5key
-
-This is the ``generate md5 keys'' option.
-Generate MD5 keys, obsoleting any that may exist.
@node ntp-keygen modulus
@subsection modulus option (-m)
@cindex ntp-keygen-modulus
-This is the ``modulus'' option.
+This is the ``prime modulus'' option.
This option takes a number argument @file{modulus}.
@noindent
@@ -1110,6 +1273,12 @@ must be compiled in by defining @code{AUTOKEY} during the compilation.
@end itemize
The number of bits in the prime modulus. The default is 512.
+@node ntp-keygen md5key
+@subsection md5key option (-M)
+@cindex ntp-keygen-md5key
+
+This is the ``generate symmetric keys'' option.
+Generate symmetric keys, obsoleting any that may exist.
@node ntp-keygen pvt-cert
@subsection pvt-cert option (-P)
@cindex ntp-keygen-pvt-cert
@@ -1163,23 +1332,6 @@ encrypted with the DES-CBC algorithm and the specified password.
The same password must be specified to the remote ntpd via the
"crypto pw password" configuration command. See also the option
--id-key (-e) for unencrypted exports.
-@node ntp-keygen sign-key
-@subsection sign-key option (-S)
-@cindex ntp-keygen-sign-key
-
-This is the ``generate sign key (rsa or dsa)'' option.
-This option takes a string argument @file{sign}.
-
-@noindent
-This option has some usage constraints. It:
-@itemize @bullet
-@item
-must be compiled in by defining @code{AUTOKEY} during the compilation.
-@end itemize
-
-Generate a new sign key of the designated type, obsoleting any
-that may exist. By default, the program uses the host key as the
-sign key.
@node ntp-keygen subject-name
@subsection subject-name option (-s)
@cindex ntp-keygen-subject-name
@@ -1195,15 +1347,32 @@ must be compiled in by defining @code{AUTOKEY} during the compilation.
@end itemize
Set the Autokey host name, and optionally, group name specified
-following an '@code{@}' character. The host name is used in the file
+following an '@code{@@}' 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 @code{host@group} form for the host certificate's subject and issuer
-fields. Specifying '@code{-s @group}' is allowed, and results in
-leaving the host name unchanged while appending @code{@group} to the
+in @code{host@@group} form for the host certificate subject and issuer
+fields. Specifying '@code{-s @@group}' is allowed, and results in
+leaving the host name unchanged while appending @code{@@group} to the
subject and issuer fields, as with @code{-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.
+@node ntp-keygen sign-key
+@subsection sign-key option (-S)
+@cindex ntp-keygen-sign-key
+
+This is the ``generate sign key (rsa or dsa)'' option.
+This option takes a string argument @file{sign}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
@node ntp-keygen trusted-cert
@subsection trusted-cert option (-T)
@cindex ntp-keygen-trusted-cert
diff --git a/contrib/ntp/util/ntp-keygen-opts.c b/contrib/ntp/util/ntp-keygen-opts.c
index d3ab3ff..6c07f97 100644
--- a/contrib/ntp/util/ntp-keygen-opts.c
+++ b/contrib/ntp/util/ntp-keygen-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c)
*
- * It has been AutoGen-ed March 21, 2017 at 10:45:48 AM by AutoGen 5.18.5
+ * It has been AutoGen-ed February 27, 2018 at 05:15:44 PM by AutoGen 5.18.5
* From the definitions ntp-keygen-opts.def
* and the template file options
*
@@ -71,8 +71,8 @@ extern FILE * option_usage_fp;
/**
* static const strings for ntp-keygen options
*/
-static char const ntp_keygen_opt_strs[2422] =
-/* 0 */ "ntp-keygen (ntp) 4.2.8p10\n"
+static char const ntp_keygen_opt_strs[2442] =
+/* 0 */ "ntp-keygen (ntp) 4.2.8p11\n"
"Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -122,56 +122,57 @@ static char const ntp_keygen_opt_strs[2422] =
/* 1458 */ "set certificate lifetime\0"
/* 1483 */ "LIFETIME\0"
/* 1492 */ "lifetime\0"
-/* 1501 */ "generate MD5 keys\0"
-/* 1519 */ "MD5KEY\0"
-/* 1526 */ "md5key\0"
-/* 1533 */ "modulus\0"
-/* 1541 */ "MODULUS\0"
-/* 1549 */ "generate PC private certificate\0"
-/* 1581 */ "PVT_CERT\0"
-/* 1590 */ "pvt-cert\0"
-/* 1599 */ "local private password\0"
-/* 1622 */ "PASSWORD\0"
-/* 1631 */ "password\0"
-/* 1640 */ "export IFF or GQ group keys with password\0"
-/* 1682 */ "EXPORT_PASSWD\0"
-/* 1696 */ "export-passwd\0"
-/* 1710 */ "generate sign key (RSA or DSA)\0"
-/* 1741 */ "SIGN_KEY\0"
-/* 1750 */ "sign-key\0"
-/* 1759 */ "set host and optionally group name\0"
-/* 1794 */ "SUBJECT_NAME\0"
-/* 1807 */ "subject-name\0"
-/* 1820 */ "trusted certificate (TC scheme)\0"
-/* 1852 */ "TRUSTED_CERT\0"
-/* 1865 */ "trusted-cert\0"
-/* 1878 */ "generate <num> MV parameters\0"
-/* 1907 */ "MV_PARAMS\0"
-/* 1917 */ "mv-params\0"
-/* 1927 */ "update <num> MV keys\0"
-/* 1948 */ "MV_KEYS\0"
-/* 1956 */ "mv-keys\0"
-/* 1964 */ "display extended usage information and exit\0"
-/* 2008 */ "help\0"
-/* 2013 */ "extended usage information passed thru pager\0"
-/* 2058 */ "more-help\0"
-/* 2068 */ "output version information and exit\0"
-/* 2104 */ "version\0"
-/* 2112 */ "save the option state to a config file\0"
-/* 2151 */ "save-opts\0"
-/* 2161 */ "load options from a config file\0"
-/* 2193 */ "LOAD_OPTS\0"
-/* 2203 */ "no-load-opts\0"
-/* 2216 */ "no\0"
-/* 2219 */ "NTP_KEYGEN\0"
-/* 2230 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p10\n"
+/* 1501 */ "prime modulus\0"
+/* 1515 */ "MODULUS\0"
+/* 1523 */ "modulus\0"
+/* 1531 */ "generate symmetric keys\0"
+/* 1555 */ "MD5KEY\0"
+/* 1562 */ "md5key\0"
+/* 1569 */ "generate PC private certificate\0"
+/* 1601 */ "PVT_CERT\0"
+/* 1610 */ "pvt-cert\0"
+/* 1619 */ "local private password\0"
+/* 1642 */ "PASSWORD\0"
+/* 1651 */ "password\0"
+/* 1660 */ "export IFF or GQ group keys with password\0"
+/* 1702 */ "EXPORT_PASSWD\0"
+/* 1716 */ "export-passwd\0"
+/* 1730 */ "set host and optionally group name\0"
+/* 1765 */ "SUBJECT_NAME\0"
+/* 1778 */ "subject-name\0"
+/* 1791 */ "generate sign key (RSA or DSA)\0"
+/* 1822 */ "SIGN_KEY\0"
+/* 1831 */ "sign-key\0"
+/* 1840 */ "trusted certificate (TC scheme)\0"
+/* 1872 */ "TRUSTED_CERT\0"
+/* 1885 */ "trusted-cert\0"
+/* 1898 */ "generate <num> MV parameters\0"
+/* 1927 */ "MV_PARAMS\0"
+/* 1937 */ "mv-params\0"
+/* 1947 */ "update <num> MV keys\0"
+/* 1968 */ "MV_KEYS\0"
+/* 1976 */ "mv-keys\0"
+/* 1984 */ "display extended usage information and exit\0"
+/* 2028 */ "help\0"
+/* 2033 */ "extended usage information passed thru pager\0"
+/* 2078 */ "more-help\0"
+/* 2088 */ "output version information and exit\0"
+/* 2124 */ "version\0"
+/* 2132 */ "save the option state to a config file\0"
+/* 2171 */ "save-opts\0"
+/* 2181 */ "load options from a config file\0"
+/* 2213 */ "LOAD_OPTS\0"
+/* 2223 */ "no-load-opts\0"
+/* 2236 */ "no\0"
+/* 2239 */ "NTP_KEYGEN\0"
+/* 2250 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p11\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
-/* 2345 */ "$HOME\0"
-/* 2351 */ ".\0"
-/* 2353 */ ".ntprc\0"
-/* 2360 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/* 2394 */ "\n\0"
-/* 2396 */ "ntp-keygen (ntp) 4.2.8p10";
+/* 2365 */ "$HOME\0"
+/* 2371 */ ".\0"
+/* 2373 */ ".ntprc\0"
+/* 2380 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 2414 */ "\n\0"
+/* 2416 */ "ntp-keygen (ntp) 4.2.8p11";
/**
* imbits option description:
@@ -384,27 +385,15 @@ static char const ntp_keygen_opt_strs[2422] =
#endif /* AUTOKEY */
/**
- * md5key option description:
- */
-/** Descriptive text for the md5key option */
-#define MD5KEY_DESC (ntp_keygen_opt_strs+1501)
-/** Upper-cased name for the md5key option */
-#define MD5KEY_NAME (ntp_keygen_opt_strs+1519)
-/** Name string for the md5key option */
-#define MD5KEY_name (ntp_keygen_opt_strs+1526)
-/** Compiled in flag settings for the md5key option */
-#define MD5KEY_FLAGS (OPTST_DISABLED)
-
-/**
* modulus option description:
*/
#ifdef AUTOKEY
/** Descriptive text for the modulus option */
-#define MODULUS_DESC (ntp_keygen_opt_strs+1533)
+#define MODULUS_DESC (ntp_keygen_opt_strs+1501)
/** Upper-cased name for the modulus option */
-#define MODULUS_NAME (ntp_keygen_opt_strs+1541)
+#define MODULUS_NAME (ntp_keygen_opt_strs+1515)
/** Name string for the modulus option */
-#define MODULUS_name (ntp_keygen_opt_strs+1533)
+#define MODULUS_name (ntp_keygen_opt_strs+1523)
/** Compiled in flag settings for the modulus option */
#define MODULUS_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -417,15 +406,27 @@ static char const ntp_keygen_opt_strs[2422] =
#endif /* AUTOKEY */
/**
+ * md5key option description:
+ */
+/** Descriptive text for the md5key option */
+#define MD5KEY_DESC (ntp_keygen_opt_strs+1531)
+/** Upper-cased name for the md5key option */
+#define MD5KEY_NAME (ntp_keygen_opt_strs+1555)
+/** Name string for the md5key option */
+#define MD5KEY_name (ntp_keygen_opt_strs+1562)
+/** Compiled in flag settings for the md5key option */
+#define MD5KEY_FLAGS (OPTST_DISABLED)
+
+/**
* pvt-cert option description:
*/
#ifdef AUTOKEY
/** Descriptive text for the pvt-cert option */
-#define PVT_CERT_DESC (ntp_keygen_opt_strs+1549)
+#define PVT_CERT_DESC (ntp_keygen_opt_strs+1569)
/** Upper-cased name for the pvt-cert option */
-#define PVT_CERT_NAME (ntp_keygen_opt_strs+1581)
+#define PVT_CERT_NAME (ntp_keygen_opt_strs+1601)
/** Name string for the pvt-cert option */
-#define PVT_CERT_name (ntp_keygen_opt_strs+1590)
+#define PVT_CERT_name (ntp_keygen_opt_strs+1610)
/** Compiled in flag settings for the pvt-cert option */
#define PVT_CERT_FLAGS (OPTST_DISABLED)
@@ -441,11 +442,11 @@ static char const ntp_keygen_opt_strs[2422] =
*/
#ifdef AUTOKEY
/** Descriptive text for the password option */
-#define PASSWORD_DESC (ntp_keygen_opt_strs+1599)
+#define PASSWORD_DESC (ntp_keygen_opt_strs+1619)
/** Upper-cased name for the password option */
-#define PASSWORD_NAME (ntp_keygen_opt_strs+1622)
+#define PASSWORD_NAME (ntp_keygen_opt_strs+1642)
/** Name string for the password option */
-#define PASSWORD_name (ntp_keygen_opt_strs+1631)
+#define PASSWORD_name (ntp_keygen_opt_strs+1651)
/** Compiled in flag settings for the password option */
#define PASSWORD_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -462,11 +463,11 @@ static char const ntp_keygen_opt_strs[2422] =
*/
#ifdef AUTOKEY
/** Descriptive text for the export-passwd option */
-#define EXPORT_PASSWD_DESC (ntp_keygen_opt_strs+1640)
+#define EXPORT_PASSWD_DESC (ntp_keygen_opt_strs+1660)
/** Upper-cased name for the export-passwd option */
-#define EXPORT_PASSWD_NAME (ntp_keygen_opt_strs+1682)
+#define EXPORT_PASSWD_NAME (ntp_keygen_opt_strs+1702)
/** Name string for the export-passwd option */
-#define EXPORT_PASSWD_name (ntp_keygen_opt_strs+1696)
+#define EXPORT_PASSWD_name (ntp_keygen_opt_strs+1716)
/** Compiled in flag settings for the export-passwd option */
#define EXPORT_PASSWD_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -479,36 +480,15 @@ static char const ntp_keygen_opt_strs[2422] =
#endif /* AUTOKEY */
/**
- * sign-key option description:
- */
-#ifdef AUTOKEY
-/** Descriptive text for the sign-key option */
-#define SIGN_KEY_DESC (ntp_keygen_opt_strs+1710)
-/** Upper-cased name for the sign-key option */
-#define SIGN_KEY_NAME (ntp_keygen_opt_strs+1741)
-/** Name string for the sign-key option */
-#define SIGN_KEY_name (ntp_keygen_opt_strs+1750)
-/** Compiled in flag settings for the sign-key option */
-#define SIGN_KEY_FLAGS (OPTST_DISABLED \
- | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
-
-#else /* disable sign-key */
-#define SIGN_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
-#define SIGN_KEY_NAME NULL
-#define SIGN_KEY_DESC NULL
-#define SIGN_KEY_name NULL
-#endif /* AUTOKEY */
-
-/**
* subject-name option description:
*/
#ifdef AUTOKEY
/** Descriptive text for the subject-name option */
-#define SUBJECT_NAME_DESC (ntp_keygen_opt_strs+1759)
+#define SUBJECT_NAME_DESC (ntp_keygen_opt_strs+1730)
/** Upper-cased name for the subject-name option */
-#define SUBJECT_NAME_NAME (ntp_keygen_opt_strs+1794)
+#define SUBJECT_NAME_NAME (ntp_keygen_opt_strs+1765)
/** Name string for the subject-name option */
-#define SUBJECT_NAME_name (ntp_keygen_opt_strs+1807)
+#define SUBJECT_NAME_name (ntp_keygen_opt_strs+1778)
/** Compiled in flag settings for the subject-name option */
#define SUBJECT_NAME_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -521,15 +501,36 @@ static char const ntp_keygen_opt_strs[2422] =
#endif /* AUTOKEY */
/**
+ * sign-key option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the sign-key option */
+#define SIGN_KEY_DESC (ntp_keygen_opt_strs+1791)
+/** Upper-cased name for the sign-key option */
+#define SIGN_KEY_NAME (ntp_keygen_opt_strs+1822)
+/** Name string for the sign-key option */
+#define SIGN_KEY_name (ntp_keygen_opt_strs+1831)
+/** Compiled in flag settings for the sign-key option */
+#define SIGN_KEY_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable sign-key */
+#define SIGN_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define SIGN_KEY_NAME NULL
+#define SIGN_KEY_DESC NULL
+#define SIGN_KEY_name NULL
+#endif /* AUTOKEY */
+
+/**
* trusted-cert option description:
*/
#ifdef AUTOKEY
/** Descriptive text for the trusted-cert option */
-#define TRUSTED_CERT_DESC (ntp_keygen_opt_strs+1820)
+#define TRUSTED_CERT_DESC (ntp_keygen_opt_strs+1840)
/** Upper-cased name for the trusted-cert option */
-#define TRUSTED_CERT_NAME (ntp_keygen_opt_strs+1852)
+#define TRUSTED_CERT_NAME (ntp_keygen_opt_strs+1872)
/** Name string for the trusted-cert option */
-#define TRUSTED_CERT_name (ntp_keygen_opt_strs+1865)
+#define TRUSTED_CERT_name (ntp_keygen_opt_strs+1885)
/** Compiled in flag settings for the trusted-cert option */
#define TRUSTED_CERT_FLAGS (OPTST_DISABLED)
@@ -545,11 +546,11 @@ static char const ntp_keygen_opt_strs[2422] =
*/
#ifdef AUTOKEY
/** Descriptive text for the mv-params option */
-#define MV_PARAMS_DESC (ntp_keygen_opt_strs+1878)
+#define MV_PARAMS_DESC (ntp_keygen_opt_strs+1898)
/** Upper-cased name for the mv-params option */
-#define MV_PARAMS_NAME (ntp_keygen_opt_strs+1907)
+#define MV_PARAMS_NAME (ntp_keygen_opt_strs+1927)
/** Name string for the mv-params option */
-#define MV_PARAMS_name (ntp_keygen_opt_strs+1917)
+#define MV_PARAMS_name (ntp_keygen_opt_strs+1937)
/** Compiled in flag settings for the mv-params option */
#define MV_PARAMS_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -566,11 +567,11 @@ static char const ntp_keygen_opt_strs[2422] =
*/
#ifdef AUTOKEY
/** Descriptive text for the mv-keys option */
-#define MV_KEYS_DESC (ntp_keygen_opt_strs+1927)
+#define MV_KEYS_DESC (ntp_keygen_opt_strs+1947)
/** Upper-cased name for the mv-keys option */
-#define MV_KEYS_NAME (ntp_keygen_opt_strs+1948)
+#define MV_KEYS_NAME (ntp_keygen_opt_strs+1968)
/** Name string for the mv-keys option */
-#define MV_KEYS_name (ntp_keygen_opt_strs+1956)
+#define MV_KEYS_name (ntp_keygen_opt_strs+1976)
/** Compiled in flag settings for the mv-keys option */
#define MV_KEYS_FLAGS (OPTST_DISABLED \
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -585,11 +586,11 @@ static char const ntp_keygen_opt_strs[2422] =
/*
* Help/More_Help/Version option descriptions:
*/
-#define HELP_DESC (ntp_keygen_opt_strs+1964)
-#define HELP_name (ntp_keygen_opt_strs+2008)
+#define HELP_DESC (ntp_keygen_opt_strs+1984)
+#define HELP_name (ntp_keygen_opt_strs+2028)
#ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC (ntp_keygen_opt_strs+2013)
-#define MORE_HELP_name (ntp_keygen_opt_strs+2058)
+#define MORE_HELP_DESC (ntp_keygen_opt_strs+2033)
+#define MORE_HELP_name (ntp_keygen_opt_strs+2078)
#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
#else
#define MORE_HELP_DESC HELP_DESC
@@ -602,14 +603,14 @@ static char const ntp_keygen_opt_strs[2422] =
# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
#endif
-#define VER_DESC (ntp_keygen_opt_strs+2068)
-#define VER_name (ntp_keygen_opt_strs+2104)
-#define SAVE_OPTS_DESC (ntp_keygen_opt_strs+2112)
-#define SAVE_OPTS_name (ntp_keygen_opt_strs+2151)
-#define LOAD_OPTS_DESC (ntp_keygen_opt_strs+2161)
-#define LOAD_OPTS_NAME (ntp_keygen_opt_strs+2193)
-#define NO_LOAD_OPTS_name (ntp_keygen_opt_strs+2203)
-#define LOAD_OPTS_pfx (ntp_keygen_opt_strs+2216)
+#define VER_DESC (ntp_keygen_opt_strs+2088)
+#define VER_name (ntp_keygen_opt_strs+2124)
+#define SAVE_OPTS_DESC (ntp_keygen_opt_strs+2132)
+#define SAVE_OPTS_name (ntp_keygen_opt_strs+2171)
+#define LOAD_OPTS_DESC (ntp_keygen_opt_strs+2181)
+#define LOAD_OPTS_NAME (ntp_keygen_opt_strs+2213)
+#define NO_LOAD_OPTS_name (ntp_keygen_opt_strs+2223)
+#define LOAD_OPTS_pfx (ntp_keygen_opt_strs+2236)
#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
/**
* Declare option callback procedures
@@ -772,28 +773,28 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ LIFETIME_DESC, LIFETIME_NAME, LIFETIME_name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 11, VALUE_OPT_MD5KEY,
- /* equiv idx, value */ 11, VALUE_OPT_MD5KEY,
+ { /* entry idx, value */ 11, VALUE_OPT_MODULUS,
+ /* equiv idx, value */ 11, VALUE_OPT_MODULUS,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
- /* opt state flags */ MD5KEY_FLAGS, 0,
- /* last opt argumnt */ { NULL }, /* --md5key */
+ /* opt state flags */ MODULUS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --modulus */
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
- /* option proc */ NULL,
- /* desc, NAME, name */ MD5KEY_DESC, MD5KEY_NAME, MD5KEY_name,
+ /* option proc */ doOptModulus,
+ /* desc, NAME, name */ MODULUS_DESC, MODULUS_NAME, MODULUS_name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 12, VALUE_OPT_MODULUS,
- /* equiv idx, value */ 12, VALUE_OPT_MODULUS,
+ { /* entry idx, value */ 12, VALUE_OPT_MD5KEY,
+ /* equiv idx, value */ 12, VALUE_OPT_MD5KEY,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
- /* opt state flags */ MODULUS_FLAGS, 0,
- /* last opt argumnt */ { NULL }, /* --modulus */
+ /* opt state flags */ MD5KEY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --md5key */
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
- /* option proc */ doOptModulus,
- /* desc, NAME, name */ MODULUS_DESC, MODULUS_NAME, MODULUS_name,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ MD5KEY_DESC, MD5KEY_NAME, MD5KEY_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 13, VALUE_OPT_PVT_CERT,
@@ -832,28 +833,28 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ EXPORT_PASSWD_DESC, EXPORT_PASSWD_NAME, EXPORT_PASSWD_name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 16, VALUE_OPT_SIGN_KEY,
- /* equiv idx, value */ 16, VALUE_OPT_SIGN_KEY,
+ { /* entry idx, value */ 16, VALUE_OPT_SUBJECT_NAME,
+ /* equiv idx, value */ 16, VALUE_OPT_SUBJECT_NAME,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
- /* opt state flags */ SIGN_KEY_FLAGS, 0,
- /* last opt argumnt */ { NULL }, /* --sign-key */
+ /* opt state flags */ SUBJECT_NAME_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --subject-name */
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
- /* desc, NAME, name */ SIGN_KEY_DESC, SIGN_KEY_NAME, SIGN_KEY_name,
+ /* desc, NAME, name */ SUBJECT_NAME_DESC, SUBJECT_NAME_NAME, SUBJECT_NAME_name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 17, VALUE_OPT_SUBJECT_NAME,
- /* equiv idx, value */ 17, VALUE_OPT_SUBJECT_NAME,
+ { /* entry idx, value */ 17, VALUE_OPT_SIGN_KEY,
+ /* equiv idx, value */ 17, VALUE_OPT_SIGN_KEY,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
- /* opt state flags */ SUBJECT_NAME_FLAGS, 0,
- /* last opt argumnt */ { NULL }, /* --subject-name */
+ /* opt state flags */ SIGN_KEY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --sign-key */
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
- /* desc, NAME, name */ SUBJECT_NAME_DESC, SUBJECT_NAME_NAME, SUBJECT_NAME_name,
+ /* desc, NAME, name */ SIGN_KEY_DESC, SIGN_KEY_NAME, SIGN_KEY_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 18, VALUE_OPT_TRUSTED_CERT,
@@ -960,24 +961,24 @@ static tOptDesc optDesc[OPTION_CT] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** Reference to the upper cased version of ntp-keygen. */
-#define zPROGNAME (ntp_keygen_opt_strs+2219)
+#define zPROGNAME (ntp_keygen_opt_strs+2239)
/** Reference to the title line for ntp-keygen usage. */
-#define zUsageTitle (ntp_keygen_opt_strs+2230)
+#define zUsageTitle (ntp_keygen_opt_strs+2250)
/** ntp-keygen configuration file name. */
-#define zRcName (ntp_keygen_opt_strs+2353)
+#define zRcName (ntp_keygen_opt_strs+2373)
/** Directories to search for ntp-keygen config files. */
static char const * const apzHomeList[3] = {
- ntp_keygen_opt_strs+2345,
- ntp_keygen_opt_strs+2351,
+ ntp_keygen_opt_strs+2365,
+ ntp_keygen_opt_strs+2371,
NULL };
/** The ntp-keygen program bug email address. */
-#define zBugsAddr (ntp_keygen_opt_strs+2360)
+#define zBugsAddr (ntp_keygen_opt_strs+2380)
/** Clarification/explanation of what ntp-keygen does. */
-#define zExplain (ntp_keygen_opt_strs+2394)
+#define zExplain (ntp_keygen_opt_strs+2414)
/** Extra detail explaining what ntp-keygen does. */
#define zDetail (NULL)
/** The full version string for ntp-keygen. */
-#define zFullVersion (ntp_keygen_opt_strs+2396)
+#define zFullVersion (ntp_keygen_opt_strs+2416)
/* extracted from optcode.tlib near line 364 */
#if defined(ENABLE_NLS)
@@ -1309,7 +1310,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntp_keygenOptions.pzCopyright */
- puts(_("ntp-keygen (ntp) 4.2.8p10\n\
+ puts(_("ntp-keygen (ntp) 4.2.8p11\n\
Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -1363,10 +1364,10 @@ implied warranty.\n"));
puts(_("set certificate lifetime"));
/* referenced via ntp_keygenOptions.pOptDesc->pzText */
- puts(_("generate MD5 keys"));
+ puts(_("prime modulus"));
/* referenced via ntp_keygenOptions.pOptDesc->pzText */
- puts(_("modulus"));
+ puts(_("generate symmetric keys"));
/* referenced via ntp_keygenOptions.pOptDesc->pzText */
puts(_("generate PC private certificate"));
@@ -1378,10 +1379,10 @@ implied warranty.\n"));
puts(_("export IFF or GQ group keys with password"));
/* referenced via ntp_keygenOptions.pOptDesc->pzText */
- puts(_("generate sign key (RSA or DSA)"));
+ puts(_("set host and optionally group name"));
/* referenced via ntp_keygenOptions.pOptDesc->pzText */
- puts(_("set host and optionally group name"));
+ puts(_("generate sign key (RSA or DSA)"));
/* referenced via ntp_keygenOptions.pOptDesc->pzText */
puts(_("trusted certificate (TC scheme)"));
@@ -1408,14 +1409,14 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntp_keygenOptions.pzUsageTitle */
- puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p10\n\
+ puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p11\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
/* referenced via ntp_keygenOptions.pzExplain */
puts(_("\n"));
/* referenced via ntp_keygenOptions.pzFullVersion */
- puts(_("ntp-keygen (ntp) 4.2.8p10"));
+ puts(_("ntp-keygen (ntp) 4.2.8p11"));
/* referenced via ntp_keygenOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/util/ntp-keygen-opts.def b/contrib/ntp/util/ntp-keygen-opts.def
index 3088cf5..f8c39c4 100644
--- a/contrib/ntp/util/ntp-keygen-opts.def
+++ b/contrib/ntp/util/ntp-keygen-opts.def
@@ -35,10 +35,10 @@ flag = {
descrip = "certificate scheme";
doc = <<- _EndOfDoc_
scheme is one of
- RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+ RSA-MD2, RSA-MD5, RSA-MDC2, RSA-SHA, RSA-SHA1, RSA-RIPEMD160,
DSA-SHA, or DSA-SHA1.
- Select the certificate message digest/signature encryption scheme.
+ Select the certificate signature encryption/message digest scheme.
Note that RSA schemes must be used with a RSA sign key and DSA
schemes must be used with a DSA sign key. The default without
this option is RSA-MD5.
@@ -55,7 +55,7 @@ flag = {
doc = <<- _EndOfDoc_
Select the cipher which is used to encrypt the files containing
private keys. The default is three-key triple DES in CBC mode,
- equivalent to "@code{-C des-ede3-cbc". The openssl tool lists ciphers
+ equivalent to "@code{-C des-ede3-cbc}". The openssl tool lists ciphers
available in "@code{openssl -h}" output.
_EndOfDoc_;
};
@@ -68,8 +68,9 @@ flag = {
ifdef = AUTOKEY;
descrip = "Write IFF or GQ identity keys";
doc = <<- _EndOfDoc_
- Write the IFF or GQ client keys to the standard output. This is
- intended for automatic key distribution by mail.
+ Write the public parameters from the IFF or GQ client keys to
+ the standard output.
+ This is intended for automatic key distribution by email.
_EndOfDoc_;
};
@@ -117,11 +118,11 @@ flag = {
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 @code{-i/--ident} or
- using @code{-s/--subject-name} following an '@code{@}' character,
- is also a part of the self-signed host certificate's subject and
- issuer names in the form @code{host@group} and should match the
- '@code{crypto ident}' or '@code{server ident}' configuration in
- @code{ntpd}'s configuration file.
+ using @code{-s/--subject-name} following an '@code{@@}' character,
+ is also a part of the self-signed host certificate subject and
+ issuer names in the form @code{host@@group} and should match the
+ '@code{crypto ident}' or '@code{server ident}' configuration in the
+ @code{ntpd} configuration file.
_EndOfDoc_;
};
@@ -138,28 +139,28 @@ flag = {
};
flag = {
- value = M;
- name = md5key;
- descrip = "generate MD5 keys";
- doc = <<- _EndOfDoc_
- Generate MD5 keys, obsoleting any that may exist.
- _EndOfDoc_;
-};
-
-flag = {
value = m;
name = modulus;
arg-type = number;
arg-name = modulus;
arg-range = '256->2048';
ifdef = AUTOKEY;
- descrip = "modulus";
+ descrip = "prime modulus";
doc = <<- _EndOfDoc_
The number of bits in the prime modulus. The default is 512.
_EndOfDoc_;
};
flag = {
+ value = M;
+ name = md5key;
+ descrip = "generate symmetric keys";
+ doc = <<- _EndOfDoc_
+ Generate symmetric keys, obsoleting any that may exist.
+ _EndOfDoc_;
+};
+
+flag = {
value = P;
name = pvt-cert;
ifdef = AUTOKEY;
@@ -203,20 +204,6 @@ flag = {
};
flag = {
- value = S;
- name = sign-key;
- arg-type = string;
- arg-name = sign;
- ifdef = AUTOKEY;
- descrip = "generate sign key (RSA or DSA)";
- doc = <<- _EndOfDoc_
- Generate a new sign key of the designated type, obsoleting any
- that may exist. By default, the program uses the host key as the
- sign key.
- _EndOfDoc_;
-};
-
-flag = {
value = s;
name = subject-name;
arg-type = string;
@@ -225,12 +212,12 @@ flag = {
descrip = "set host and optionally group name";
doc = <<- _EndOfDoc_
Set the Autokey host name, and optionally, group name specified
- following an '@code{@}' character. The host name is used in the file
+ following an '@code{@@}' 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 @code{host@group} form for the host certificate's subject and issuer
- fields. Specifying '@code{-s @group}' is allowed, and results in
- leaving the host name unchanged while appending @code{@group} to the
+ in @code{host@@group} form for the host certificate subject and issuer
+ fields. Specifying '@code{-s @@group}' is allowed, and results in
+ leaving the host name unchanged while appending @code{@@group} to the
subject and issuer fields, as with @code{-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.
@@ -238,6 +225,20 @@ flag = {
};
flag = {
+ value = S;
+ name = sign-key;
+ arg-type = string;
+ arg-name = sign;
+ ifdef = AUTOKEY;
+ descrip = "generate sign key (RSA or DSA)";
+ doc = <<- _EndOfDoc_
+ Generate a new sign key of the designated type, obsoleting any
+ that may exist. By default, the program uses the host key as the
+ sign key.
+ _EndOfDoc_;
+};
+
+flag = {
value = T;
name = trusted-cert;
ifdef = AUTOKEY;
@@ -280,26 +281,29 @@ doc-section = {
ds-text = <<- _END_PROG_MDOC_DESCRIP
This program generates cryptographic data files used by the NTPv4
authentication and identification schemes.
-It generates MD5 key files used in symmetric key cryptography.
-In addition, if the OpenSSL software library has been installed,
-it generates keys, certificate and identity files used in public key
-cryptography.
+It can generate message digest keys used in symmetric key cryptography and,
+if the OpenSSL software library has been installed, it can generate host keys,
+signing keys, certificates, and identity keys and parameters used in Autokey
+public key cryptography.
These files are used for cookie encryption,
-digital signature and challenge/response identification algorithms
+digital signature, and challenge/response identification algorithms
compatible with the Internet standard security infrastructure.
.Pp
-All files are in PEM-encoded printable ASCII format,
-so they can be embedded as MIME attachments in mail to other sites
+The message digest symmetric keys file is generated in a format
+compatible with NTPv3.
+All other files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in email to other sites
and certificate authorities.
By default, files are not encrypted.
.Pp
-When used to generate message digest keys, the program produces a file
-containing ten pseudo-random printable ASCII strings suitable for the
-MD5 message digest algorithm included in the distribution.
+When used to generate message digest symmetric keys, the program
+produces a file containing ten pseudo-random printable ASCII strings
+suitable for the MD5 message digest algorithm included in the
+distribution.
If the OpenSSL library is installed, it produces an additional ten
-hex-encoded random bit strings suitable for the SHA1 and other message
-digest algorithms.
-The message digest keys file must be distributed and stored
+hex-encoded random bit strings suitable for SHA1, AES-128-CMAC, and
+other message digest algorithms.
+The message digest symmetric keys file must be distributed and stored
using secure means beyond the scope of NTP itself.
Besides the keys used for ordinary NTP associations, additional keys
can be defined as passwords for the
@@ -319,222 +323,132 @@ other than Autokey.
Some files used by this program are encrypted using a private password.
The
.Fl p
-option specifies the password for local encrypted files and the
+option specifies the read password for local encrypted files and the
.Fl q
-option the password for encrypted files sent to remote sites.
+option the write password for encrypted files sent to remote sites.
If no password is specified, the host name returned by the Unix
-.Fn gethostname
-function, normally the DNS name of the host is used.
+.Xr hostname 1
+command, normally the DNS name of the host, is used as the the default read
+password, for convenience.
+The
+.Nm
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
.Pp
The
-.Ar pw
+.Cm pw
option of the
-.Ar crypto
+.Ic crypto
+.Xr ntpd 1ntpdmdoc
configuration command specifies the read
password for previously encrypted local files.
-This must match the local password used by this program.
+This must match the local read password used by this program.
If not specified, the host name is used.
-Thus, if files are generated by this program without password,
+Thus, if files are generated by this program without an explicit password,
they can be read back by
-.Ar ntpd
-without password but only on the same host.
+.Xr ntpd 1ntpdmdoc
+without specifying an explicit password but only on the same host.
+If the write password used for encryption is specified as the host name,
+these files can be read by that host with no explicit password.
.Pp
Normally, encrypted files for each host are generated by that host and
used only by that host, although exceptions exist as noted later on
this page.
The symmetric keys file, normally called
-.Ar ntp.keys ,
+.Pa ntp.keys ,
is usually installed in
.Pa /etc .
Other files and links are usually installed in
.Pa /usr/local/etc ,
which is normally in a shared filesystem in
NFS-mounted networks and cannot be changed by shared clients.
-The location of the keys directory can be changed by the
-.Ar keysdir
-configuration command in such cases.
-Normally, this is in
-.Pa /etc .
+In these cases, NFS clients can specify the files in another
+directory such as
+.Pa /etc
+using the
+.Ic keysdir
+.Xr ntpd 1ntpdmdoc
+configuration file command.
.Pp
This program directs commentary and error messages to the standard
error stream
-.Ar stderr
+.Pa stderr
and remote files to the standard output stream
-.Ar stdout
+.Pa stdout
where they can be piped to other applications or redirected to files.
The names used for generated files and links all begin with the
string
-.Ar ntpkey
+.Pa ntpkey\&*
and include the file type, generating host and filestamp,
as described in the
-.Dq Cryptographic Data Files
+.Sx "Cryptographic Data Files"
section below.
-.Ss Running the Program
-To test and gain experience with Autokey concepts, log in as root and
-change to the keys directory, usually
-.Pa /usr/local/etc
-When run for the first time, or if all files with names beginning with
-.Ar ntpkey
-have been removed, use the
-.Nm
-command without arguments to generate a
-default RSA host key and matching RSA-MD5 certificate with expiration
-date one year hence.
-If run again without options, the program uses the
-existing keys and parameters and generates only a new certificate with
-new expiration date one year hence.
-.Pp
-Run the command on as many hosts as necessary.
-Designate one of them as the trusted host (TH) using
-.Nm
-with the
-.Fl T
-option and configure it to synchronize from reliable Internet servers.
-Then configure the other hosts to synchronize to the TH directly or
-indirectly.
-A certificate trail is created when Autokey asks the immediately
-ascendant host towards the TH to sign its certificate, which is then
-provided to the immediately descendant host on request.
-All group hosts should have acyclic certificate trails ending on the TH.
-.Pp
-The host key is used to encrypt the cookie when required and so must be
-RSA type.
-By default, the host key is also the sign key used to encrypt
-signatures.
-A different sign key can be assigned using the
-.Fl S
-option and this can be either RSA or DSA type.
-By default, the signature
-message digest type is MD5, but any combination of sign key type and
-message digest type supported by the OpenSSL library can be specified
-using the
-.Fl c
-option.
-The rules say cryptographic media should be generated with proventic
-filestamps, which means the host should already be synchronized before
-this program is run.
-This of course creates a chicken-and-egg problem
-when the host is started for the first time.
-Accordingly, the host time
-should be set by some other means, such as eyeball-and-wristwatch, at
-least so that the certificate lifetime is within the current year.
-After that and when the host is synchronized to a proventic source, the
-certificate should be re-generated.
-.Pp
-Additional information on trusted groups and identity schemes is on the
-.Dq Autokey Public-Key Authentication
-page.
-
-.Pp
-The
-.Xr ntpd 1ntpdmdoc
-configuration command
-.Ic crypto pw Ar password
-specifies the read password for previously encrypted files.
-The daemon expires on the spot if the password is missing
-or incorrect.
-For convenience, if a file has been previously encrypted,
-the default read password is the name of the host running
-the program.
-If the previous write password is specified as the host name,
-these files can be read by that host with no explicit password.
-
-.Pp
-File names begin with the prefix
-.Cm ntpkey_
-and end with the postfix
-.Ar _hostname.filestamp ,
-where
-.Ar hostname
-is the owner name, usually the string returned
-by the Unix gethostname() routine, and
-.Ar filestamp
-is the NTP seconds when the file was generated, in decimal digits.
-This both guarantees uniqueness and simplifies maintenance
-procedures, since all files can be quickly removed
-by a
-.Ic rm ntpkey\&*
-command or all files generated
-at a specific time can be removed by a
-.Ic rm
-.Ar \&*filestamp
-command.
-To further reduce the risk of misconfiguration,
-the first two lines of a file contain the file name
-and generation date and time as comments.
-.Pp
-All files are installed by default in the keys directory
-.Pa /usr/local/etc ,
-which is normally in a shared filesystem
-in NFS-mounted networks.
-The actual location of the keys directory
-and each file can be overridden by configuration commands,
-but this is not recommended.
-Normally, the files for each host are generated by that host
-and used only by that host, although exceptions exist
-as noted later on this page.
-.Pp
-Normally, files containing private values,
-including the host key, sign key and identification parameters,
-are permitted root read/write-only;
-while others containing public values are permitted world readable.
-Alternatively, files containing private values can be encrypted
-and these files permitted world readable,
-which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
-dependent clients can all be installed in the same shared directory.
-.Pp
-The recommended practice is to keep the file name extensions
-when installing a file and to install a soft link
-from the generic names specified elsewhere on this page
-to the generated files.
-This allows new file generations to be activated simply
-by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
-If a link is not present,
-.Xr ntpd 1ntpdmdoc
-extracts the filestamp from the file itself.
-This allows clients to verify that the file and generation times
-are always current.
-The
-.Nm
-program uses the same timestamp extension for all files generated
-at one time, so each generation is distinct and can be readily
-recognized in monitoring data.
-.Ss Running the program
+.Ss Running the Program
The safest way to run the
.Nm
program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
+The recommended procedure is change to the
+.Ar keys
+directory, usually
.Pa /usr/local/etc ,
then run the program.
-When run for the first time,
-or if all
-.Cm ntpkey
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
+.Pp
+To test and gain experience with Autokey concepts, log in as root and
+change to the
+.Ar keys
+directory, usually
+.Pa /usr/local/etc .
+When run for the first time, or if all files with names beginning with
+.Pa ntpkey\&*
+have been removed, use the
+.Nm
+command without arguments to generate a default
+.Cm RSA
+host key and matching
+.Cm RSA-MD5
+certificate file with expiration date one year hence,
which is all that is necessary in many cases.
The program also generates soft links from the generic names
to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+If run again without options, the program uses the
+existing keys and parameters and generates a new certificate file with
+new expiration date one year hence, and soft link.
.Pp
-The host key is used to encrypt the cookie when required and so must be RSA type.
+The host key is used to encrypt the cookie when required and so must be
+.Cm RSA
+type.
By default, the host key is also the sign key used to encrypt signatures.
When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
+either
+.Cm RSA
+or
+.Cm DSA
+type.
+By default, the message digest type is
+.Cm MD5 ,
+but any combination
of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
+can be specified, including those using the
+.Cm AES128CMAC , MD2 , MD5 , MDC2 , SHA , SHA1
+and
+.Cm RIPE160
+message digest algorithms.
However, the scheme specified in the certificate must be compatible
with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Certificates using any digest algorithm are compatible with
+.Cm RSA
+sign keys;
+however, only
+.Cm SHA
+and
+.Cm SHA1
+certificates are compatible with
+.Cm DSA
+sign keys.
.Pp
Private/public key files and certificates are compatible with
other OpenSSL applications and very likely other libraries as well.
@@ -545,19 +459,19 @@ However, the identification parameter files, although encoded
as the other files, are probably not compatible with anything other than Autokey.
.Pp
Running the program as other than root and using the Unix
-.Ic su
+.Xr su 1
command
to assume root may not work properly, since by default the OpenSSL library
looks for the random seed file
-.Cm .rnd
+.Pa .rnd
in the user home directory.
However, there should be only one
-.Cm .rnd ,
+.Pa .rnd ,
most conveniently
in the root directory, so it is convenient to define the
-.Cm $RANDFILE
+.Ev RANDFILE
environment variable used by the OpenSSL library as the path to
-.Cm /.rnd .
+.Pa .rnd .
.Pp
Installing the keys as root might not work in NFS-mounted
shared file systems, as NFS clients may not be able to write
@@ -567,7 +481,8 @@ directory such as
.Pa /etc
using the
.Ic keysdir
-command.
+.Xr ntpd 1ntpdmdoc
+configuration file command.
There is no need for one client to read the keys and certificates
of other clients or servers, as these data are obtained automatically
by the Autokey protocol.
@@ -581,7 +496,6 @@ It is convenient to designate the owner name and trusted name
as the subject and issuer fields, respectively, of the certificate.
The owner name is also used for the host and sign key files,
while the trusted name is used for the identity files.
-
.Pp
All files are installed by default in the keys directory
.Pa /usr/local/etc ,
@@ -601,8 +515,11 @@ while others containing public values are permitted world readable.
Alternatively, files containing private values can be encrypted
and these files permitted world readable,
which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
+Since uniqueness is insured by the
+.Ar hostname
+and
+.Ar filestamp
+file name extensions, the files for an NTP server and
dependent clients can all be installed in the same shared directory.
.Pp
The recommended practice is to keep the file name extensions
@@ -611,107 +528,112 @@ from the generic names specified elsewhere on this page
to the generated files.
This allows new file generations to be activated simply
by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
+If a link is present,
+.Xr ntpd 1ntpdmdoc
+follows it to the file name to extract the
+.Ar filestamp .
If a link is not present,
.Xr ntpd 1ntpdmdoc
-extracts the filestamp from the file itself.
+extracts the
+.Ar filestamp
+from the file itself.
This allows clients to verify that the file and generation times
are always current.
The
.Nm
-program uses the same timestamp extension for all files generated
+program uses the same
+.Ar filestamp
+extension for all files generated
at one time, so each generation is distinct and can be readily
recognized in monitoring data.
-.Ss Running the program
-The safest way to run the
+.Pp
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
.Nm
-program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
-.Pa /usr/local/etc ,
-then run the program.
-When run for the first time,
-or if all
-.Cm ntpkey
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
-which is all that is necessary in many cases.
-The program also generates soft links from the generic names
-to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+with the
+.Fl T
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
.Pp
-The host key is used to encrypt the cookie when required and so must be RSA type.
-By default, the host key is also the sign key used to encrypt signatures.
-When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
-of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
-However, the scheme specified in the certificate must be compatible
-with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+.Fl S
+option and this can be either
+.Cm RSA
+or
+.Cm DSA
+type.
+By default, the signature
+message digest type is
+.Cm MD5 ,
+but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+.Fl c
+option.
.Pp
-Private/public key files and certificates are compatible with
-other OpenSSL applications and very likely other libraries as well.
-Certificates or certificate requests derived from them should be compatible
-with extant industry practice, although some users might find
-the interpretation of X509v3 extension fields somewhat liberal.
-However, the identification parameter files, although encoded
-as the other files, are probably not compatible with anything other than Autokey.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
.Pp
-Running the program as other than root and using the Unix
-.Ic su
-command
-to assume root may not work properly, since by default the OpenSSL library
-looks for the random seed file
-.Cm .rnd
-in the user home directory.
-However, there should be only one
-.Cm .rnd ,
-most conveniently
-in the root directory, so it is convenient to define the
-.Cm $RANDFILE
-environment variable used by the OpenSSL library as the path to
-.Cm /.rnd .
+Additional information on trusted groups and identity schemes is on the
+.Dq Autokey Public-Key Authentication
+page.
.Pp
-Installing the keys as root might not work in NFS-mounted
-shared file systems, as NFS clients may not be able to write
-to the shared keys directory, even as root.
-In this case, NFS clients can specify the files in another
-directory such as
-.Pa /etc
-using the
-.Ic keysdir
+File names begin with the prefix
+.Pa ntpkey Ns _
+and end with the suffix
+.Pa _ Ns Ar hostname . Ar filestamp ,
+where
+.Ar hostname
+is the owner name, usually the string returned
+by the Unix
+.Xr hostname 1
+command, and
+.Ar filestamp
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+.Ic rm Pa ntpkey\&*
+command or all files generated
+at a specific time can be removed by a
+.Ic rm Pa \&* Ns Ar filestamp
command.
-There is no need for one client to read the keys and certificates
-of other clients or servers, as these data are obtained automatically
-by the Autokey protocol.
-.Pp
-Ordinarily, cryptographic files are generated by the host that uses them,
-but it is possible for a trusted agent (TA) to generate these files
-for other hosts; however, in such cases files should always be encrypted.
-The subject name and trusted name default to the hostname
-of the host generating the files, but can be changed by command line options.
-It is convenient to designate the owner name and trusted name
-as the subject and issuer fields, respectively, of the certificate.
-The owner name is also used for the host and sign key files,
-while the trusted name is used for the identity files.
-seconds.
-seconds.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
-s Trusted Hosts and Groups
+.Ss Trusted Hosts and Groups
Each cryptographic configuration involves selection of a signature scheme
and identification scheme, called a cryptotype,
as explained in the
.Sx Authentication Options
section of
.Xr ntp.conf 5 .
-The default cryptotype uses RSA encryption, MD5 message digest
-and TC identification.
+The default cryptotype uses
+.Cm RSA
+encryption,
+.Cm MD5
+message digest
+and
+.Cm TC
+identification.
First, configure a NTP subnet including one or more low-stratum
trusted hosts from which all other hosts derive synchronization
directly or indirectly.
@@ -729,7 +651,7 @@ section of
.Pp
On each trusted host as root, change to the keys directory.
To insure a fresh fileset, remove all
-.Cm ntpkey
+.Pa ntpkey
files.
Then run
.Nm
@@ -754,7 +676,9 @@ is either
.Cm RSA
or
.Cm DSA .
-The most often need to do this is when a DSA-signed certificate is used.
+The most frequent need to do this is when a
+.Cm DSA Ns -signed
+certificate is used.
If it is necessary to use a different certificate scheme than the default,
run
.Nm
@@ -763,17 +687,17 @@ with the
option and selected
.Ar scheme
as needed.
-f
+If
.Nm
is run again without these options, it generates a new certificate
-using the same scheme and sign key.
+using the same scheme and sign key, and soft link.
.Pp
After setting up the environment it is advisable to update certificates
from time to time, if only to extend the validity interval.
Simply run
.Nm
with the same flags as before to generate new certificates
-using existing keys.
+using existing keys, and soft links.
However, if the host or sign key is changed,
.Xr ntpd 1ntpdmdoc
should be restarted.
@@ -782,15 +706,18 @@ When
is restarted, it loads any new files and restarts the protocol.
Other dependent hosts will continue as usual until signatures are refreshed,
at which time the protocol is restarted.
+
.Ss Identity Schemes
As mentioned on the Autonomous Authentication page,
-the default TC identity scheme is vulnerable to a middleman attack.
+the default
+.Cm TC
+identity scheme is vulnerable to a middleman attack.
However, there are more secure identity schemes available,
-including PC, IFF, GQ and MV described on the
-.Qq Identification Schemes
-page
-(maybe available at
-.Li http://www.eecis.udel.edu/%7emills/keygen.html ) .
+including
+.Cm PC , IFF , GQ
+and
+.Cm MV
+schemes described below.
These schemes are based on a TA, one or more trusted hosts
and some number of nontrusted hosts.
Trusted hosts prove identity using values provided by the TA,
@@ -815,12 +742,15 @@ On trusted host alice run
.Fl P
.Fl p Ar password
to generate the host key file
-.Pa ntpkey_RSAkey_ Ns Ar alice.filestamp
+.Pa ntpkey Ns _ Cm RSA Pa key_alice. Ar filestamp
and trusted private certificate file
-.Pa ntpkey_RSA-MD5_cert_ Ns Ar alice.filestamp .
+.Pa ntpkey Ns _ Cm RSA-MD5 _ Pa cert_alice. Ar filestamp ,
+and soft links.
Copy both files to all group hosts;
they replace the files which would be generated in other schemes.
-On each host bob install a soft link from the generic name
+On each host
+.Ar bob
+install a soft link from the generic name
.Pa ntpkey_host_ Ns Ar bob
to the host key file and soft link
.Pa ntpkey_cert_ Ns Ar bob
@@ -829,26 +759,34 @@ Note the generic links are on bob, but point to files generated
by trusted host alice.
In this scheme it is not possible to refresh
either the keys or certificates without copying them
-to all other hosts in the group.
+to all other hosts in the group, and recreating the soft links.
.Pp
-For the IFF scheme proceed as in the TC scheme to generate keys
+For the
+.Cm IFF
+scheme proceed as in the
+.Cm TC
+scheme to generate keys
and certificates for all group hosts, then for every trusted host in the group,
-generate the IFF parameter file.
+generate the
+.Cm IFF
+parameter file.
On trusted host alice run
.Nm
.Fl T
.Fl I
.Fl p Ar password
to produce her parameter file
-.Pa ntpkey_IFFpar_ Ns Ar alice.filestamp ,
+.Pa ntpkey_IFFpar_alice. Ns Ar filestamp ,
which includes both server and client keys.
Copy this file to all group hosts that operate as both servers
and clients and install a soft link from the generic
-.Pa ntpkey_iff_ Ns Ar alice
+.Pa ntpkey_iff_alice
to this file.
If there are no hosts restricted to operate only as clients,
there is nothing further to do.
-As the IFF scheme is independent
+As the
+.Cm IFF
+scheme is independent
of keys and certificates, these files can be refreshed as needed.
.Pp
If a rogue client has the parameter file, it could masquerade
@@ -858,37 +796,53 @@ from the parameter file and distributed to all restricted clients.
After generating the parameter file, on alice run
.Nm
.Fl e
-and pipe the output to a file or mail program.
-Copy or mail this file to all restricted clients.
+and pipe the output to a file or email program.
+Copy or email this file to all restricted clients.
On these clients install a soft link from the generic
-.Pa ntpkey_iff_ Ns Ar alice
+.Pa ntpkey_iff_alice
to this file.
To further protect the integrity of the keys,
each file can be encrypted with a secret password.
.Pp
-For the GQ scheme proceed as in the TC scheme to generate keys
+For the
+.Cm GQ
+scheme proceed as in the
+.Cm TC
+scheme to generate keys
and certificates for all group hosts, then for every trusted host
-in the group, generate the IFF parameter file.
+in the group, generate the
+.Cm IFF
+parameter file.
On trusted host alice run
.Nm
.Fl T
.Fl G
.Fl p Ar password
to produce her parameter file
-.Pa ntpkey_GQpar_ Ns Ar alice.filestamp ,
+.Pa ntpkey_GQpar_alice. Ns Ar filestamp ,
which includes both server and client keys.
Copy this file to all group hosts and install a soft link
from the generic
-.Pa ntpkey_gq_ Ns Ar alice
+.Pa ntpkey_gq_alice
to this file.
-In addition, on each host bob install a soft link
+In addition, on each host
+.Ar bob
+install a soft link
from generic
.Pa ntpkey_gq_ Ns Ar bob
to this file.
-As the GQ scheme updates the GQ parameters file and certificate
+As the
+.Cm GQ
+scheme updates the
+.Cm GQ
+parameters file and certificate
at the same time, keys and certificates can be regenerated as needed.
.Pp
-For the MV scheme, proceed as in the TC scheme to generate keys
+For the
+.Cm MV
+scheme, proceed as in the
+.Cm TC
+scheme to generate keys
and certificates for all group hosts.
For illustration assume trish is the TA, alice one of several trusted hosts
and bob one of her clients.
@@ -900,9 +854,9 @@ where
.Ar n
is the number of revokable keys (typically 5) to produce
the parameter file
-.Pa ntpkeys_MVpar_ Ns Ar trish.filestamp
+.Pa ntpkeys_MVpar_trish. Ns Ar filestamp
and client key files
-.Pa ntpkeys_MVkeyd_ Ns Ar trish.filestamp
+.Pa ntpkeys_MVkey Ns Ar d _ Pa trish. Ar filestamp
where
.Ar d
is the key number (0 \&<
@@ -911,81 +865,220 @@ is the key number (0 \&<
.Ar n ) .
Copy the parameter file to alice and install a soft link
from the generic
-.Pa ntpkey_mv_ Ns Ar alice
+.Pa ntpkey_mv_alice
to this file.
Copy one of the client key files to alice for later distribution
to her clients.
-It doesn't matter which client key file goes to alice,
+It does not matter which client key file goes to alice,
since they all work the same way.
-Alice copies the client key file to all of her cliens.
+Alice copies the client key file to all of her clients.
On client bob install a soft link from generic
-.Pa ntpkey_mvkey_ Ns Ar bob
+.Pa ntpkey_mvkey_bob
to the client key file.
-As the MV scheme is independent of keys and certificates,
+As the
+.Cm MV
+scheme is independent of keys and certificates,
these files can be refreshed as needed.
+
.Ss Command Line Options
.Bl -tag -width indent
-.It Fl c Ar scheme
-Select certificate message digest/signature encryption scheme.
+.It Fl b Fl -imbits Ns = Ar modulus
+Set the number of bits in the identity modulus for generating identity keys to
+.Ar modulus
+bits.
+The number of bits in the identity modulus defaults to 256, but can be set to
+values from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+.It Fl c Fl -certificate Ns = Ar scheme
+Select certificate signature encryption/message digest scheme.
The
.Ar scheme
can be one of the following:
-. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+.Cm RSA-MD2 , RSA-MD5 , RSA-MDC2 , RSA-SHA , RSA-SHA1 , RSA-RIPEMD160 , DSA-SHA ,
or
.Cm DSA-SHA1 .
-Note that RSA schemes must be used with a RSA sign key and DSA
-schemes must be used with a DSA sign key.
+Note that
+.Cm RSA
+schemes must be used with an
+.Cm RSA
+sign key and
+.Cm DSA
+schemes must be used with a
+.Cm DSA
+sign key.
The default without this option is
.Cm RSA-MD5 .
-.It Fl d
-Enable debugging.
+If compatibility with FIPS 140-2 is required, either the
+.Cm DSA-SHA
+or
+.Cm DSA-SHA1
+scheme must be used.
+.It Fl C Fl -cipher Ns = Ar cipher
+Select the OpenSSL cipher to encrypt the files containing private keys.
+The default without this option is three-key triple DES in CBC mode,
+.Cm des-ede3-cbc .
+The
+.Ic openssl Fl h
+command provided with OpenSSL displays available ciphers.
+.It Fl d Fl -debug-level
+Increase debugging verbosity level.
+This option displays the cryptographic data produced in eye-friendly billboards.
+.It Fl D Fl -set-debug-level Ns = Ar level
+Set the debugging verbosity to
+.Ar level .
This option displays the cryptographic data produced in eye-friendly billboards.
-.It Fl e
-Write the IFF client keys to the standard output.
-This is intended for automatic key distribution by mail.
-.It Fl G
-Generate parameters and keys for the GQ identification scheme,
-obsoleting any that may exist.
-.It Fl g
-Generate keys for the GQ identification scheme
-using the existing GQ parameters.
-If the GQ parameters do not yet exist, create them first.
-.It Fl H
-Generate new host keys, obsoleting any that may exist.
-.It Fl I
-Generate parameters for the IFF identification scheme,
-obsoleting any that may exist.
-.It Fl i Ar name
-Set the suject name to
-.Ar name .
-This is used as the subject field in certificates
-and in the file name for host and sign keys.
-.It Fl M
-Generate MD5 keys, obsoleting any that may exist.
-.It Fl P
-Generate a private certificate.
+.It Fl e Fl -id-key
+Write the
+.Cm IFF
+or
+.Cm GQ
+public parameters from the
+.Ar IFFkey or GQkey
+client keys file previously specified
+as unencrypted data to the standard output stream
+.Pa stdout .
+This is intended for automatic key distribution by email.
+.It Fl G Fl -gq-params
+Generate a new encrypted
+.Cm GQ
+parameters and key file for the Guillou-Quisquater (GQ) identity scheme.
+This option is mutually exclusive with the
+.Fl I
+and
+.Fl V
+options.
+.It Fl H Fl -host-key
+Generate a new encrypted
+.Cm RSA
+public/private host key file.
+.It Fl I Fl -iffkey
+Generate a new encrypted
+.Cm IFF
+key file for the Schnorr (IFF) identity scheme.
+This option is mutually exclusive with the
+.Fl G
+and
+Fl V
+options.
+.It Fl i Fl -ident Ns = Ar group
+Set the optional Autokey group name to
+.Ar group .
+This is used in the identity scheme parameter file names of
+.Cm IFF , GQ ,
+and
+.Cm MV
+client parameters files.
+In that role, the default is the host name if no group is provided.
+The group name, if specified using
+.Fl i
+or
+.Fl s
+following an
+.Ql @@
+character, is also used in certificate subject and issuer names in the form
+.Ar host @@ group
+and should match the group specified via
+.Ic crypto Cm ident
+or
+.Ic server Cm ident
+in the ntpd configuration file.
+.It Fl l Fl -lifetime Ns = Ar days
+Set the lifetime for certificate expiration to
+.Ar days .
+The default lifetime is one year (365 days).
+.It Fl m Fl -modulus Ns = Ar bits
+Set the number of bits in the prime modulus for generating files to
+.Ar bits .
+The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+.It Fl M Fl -md5key
+Generate a new symmetric keys file containing 10
+.Cm MD5
+keys, and if OpenSSL is available, 10
+.Cm SHA
+keys.
+An
+.Cm MD5
+key is a string of 20 random printable ASCII characters, while a
+.Cm SHA
+key is a string of 40 random hex digits.
+The file can be edited using a text editor to change the key type or key content.
+This option is mutually exclusive with all other options.
+.It Fl p Fl -password Ns = Ar passwd
+Set the password for reading and writing encrypted files to
+.Ar passwd .
+These include the host, sign and identify key files.
+By default, the password is the string returned by the Unix
+.Ic hostname
+command.
+.It Fl P Fl -pvt-cert
+Generate a new private certificate used by the
+.Cm PC
+identity scheme.
By default, the program generates public certificates.
-.It Fl p Ar password
-Encrypt generated files containing private data with
-.Ar password
-and the DES-CBC algorithm.
-.It Fl q
-Set the password for reading files to password.
-.It Fl S Oo Cm RSA | DSA Oc
-Generate a new sign key of the designated type,
-obsoleting any that may exist.
-By default, the program uses the host key as the sign key.
-.It Fl s Ar name
-Set the issuer name to
-.Ar name .
-This is used for the issuer field in certificates
-and in the file name for identity files.
-.It Fl T
+Note: the PC identity scheme is not recommended for new installations.
+.It Fl q Fl -export-passwd Ns = Ar passwd
+Set the password for writing encrypted
+.Cm IFF , GQ and MV
+identity files redirected to
+.Pa stdout
+to
+.Ar passwd .
+In effect, these files are decrypted with the
+.Fl p
+password, then encrypted with the
+.Fl q
+password.
+By default, the password is the string returned by the Unix
+.Ic hostname
+command.
+.It Fl s Fl -subject-key Ns = Ar Oo host Oc Op @@ Ar group
+Specify the Autokey host name, where
+.Ar host
+is the optional host name and
+.Ar group
+is the optional group name.
+The host name, and if provided, group name are used in
+.Ar host @@ group
+form as certificate subject and issuer.
+Specifying
+.Fl s @@ Ar group
+is allowed, and results in leaving the host name unchanged, as with
+.Fl i Ar group .
+The group name, or if no group is provided, the host name are also used in the
+file names of
+.Cm IFF , GQ ,
+and
+.Cm MV
+identity scheme client parameter files.
+If
+.Ar host
+is not specified, the default host name is the string returned by the Unix
+.Ic hostname
+command.
+.It Fl S Fl -sign-key Ns = Op Cm RSA | DSA
+Generate a new encrypted public/private sign key file of the specified type.
+By default, the sign key is the host key and has the same type.
+If compatibility with FIPS 140-2 is required, the sign key type must be
+.Cm DSA .
+.It Fl T Fl -trusted-cert
Generate a trusted certificate.
By default, the program generates a non-trusted certificate.
-.It Fl V Ar nkeys
-Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+.It Fl V Fl -mv-params Ar nkeys
+Generate
+.Ar nkeys
+encrypted server keys and parameters for the Mu-Varadharajan (MV)
+identity scheme.
+This option is mutually exclusive with the
+.Fl I
+and
+.Fl G
+options.
+Note: support for this option should be considered a work in progress.
.El
+
.Ss Random Seed File
All cryptographically sound key generation schemes must have means
to randomize the entropy seed used to initialize
@@ -1008,14 +1101,14 @@ but are outside the scope of this page.
.Pp
The entropy seed used by the OpenSSL library is contained in a file,
usually called
-.Cm .rnd ,
+.Pa .rnd ,
which must be available when starting the NTP daemon
or the
.Nm
program.
The NTP daemon will first look for the file
using the path specified by the
-.Ic randfile
+.Cm randfile
subcommand of the
.Ic crypto
configuration command.
@@ -1031,44 +1124,120 @@ If the
.Ev RANDFILE
environment variable is not present,
the library will look for the
-.Cm .rnd
+.Pa .rnd
file in the user home directory.
+Since both the
+.Nm
+program and
+.Xr ntpd 1ntpdmdoc
+daemon must run as root, the logical place to put this file is in
+.Pa /.rnd
+or
+.Pa /root/.rnd .
If the file is not available or cannot be written,
the daemon exits with a message to the system log and the program
exits with a suitable error message.
+
.Ss Cryptographic Data Files
-All other file formats begin with two lines.
-The first contains the file name, including the generated host name
-and filestamp.
-The second contains the datestamp in conventional Unix date format.
-Lines beginning with # are considered comments and ignored by the
+All file formats begin with two nonencrypted lines.
+The first line contains the file name, including the generated host name
+and filestamp, in the format
+.Pa ntpkey_ Ns Ar key _ Ar name . Ar filestamp ,
+where
+.Ar key
+is the key or parameter type,
+.Ar name
+is the host or group name and
+.Ar filestamp
+is the filestamp (NTP seconds) when the file was created.
+By convention,
+.Ar key
+names in generated file names include both upper and lower case
+characters, while
+.Ar key
+names in generated link names include only lower case characters.
+The filestamp is not used in generated link names.
+The second line contains the datestamp in conventional Unix
+.Pa date
+format.
+Lines beginning with
+.Ql #
+are considered comments and ignored by the
.Nm
program and
.Xr ntpd 1ntpdmdoc
daemon.
-Cryptographic values are encoded first using ASN.1 rules,
-then encrypted if necessary, and finally written PEM-encoded
-printable ASCII format preceded and followed by MIME content identifier lines.
.Pp
-The format of the symmetric keys file is somewhat different
-than the other files in the interest of backward compatibility.
-Since DES-CBC is deprecated in NTPv4, the only key format of interest
-is MD5 alphanumeric strings.
-Following hte heard the keys are
-entered one per line in the format
-.D1 Ar keyno type key
+The remainder of the file contains cryptographic data, encoded first using ASN.1
+rules, then encrypted if necessary, and finally written in PEM-encoded
+printable ASCII text, preceded and followed by MIME content identifier lines.
+.Pp
+The format of the symmetric keys file, ordinarily named
+.Pa ntp.keys ,
+is somewhat different than the other files in the interest of backward compatibility.
+Ordinarily, the file is generated by this program, but it can be constructed
+and edited using an ordinary text editor.
+.Bd -literal -unfilled -offset center
+# ntpkey_MD5key_bk.ntp.org.3595864945
+# Thu Dec 12 19:22:25 2013
+
+1 MD5 L";Nw<\`.I<f4U0)247"i # MD5 key
+2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key
+3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key
+4 MD5 Yue:tL[+vR)M\`n~bY,'? # MD5 key
+5 MD5 B;fx'Kgr/&4ZTbL6=RxA # MD5 key
+6 MD5 4eYwa\`o@}3i@@@@V@@..R9!l # MD5 key
+7 MD5 \`A.([h+;wTQ|xfi%Sn_! # MD5 key
+8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key
+9 MD5 3-5vcn*6l29DS?Xdsg)* # MD5 key
+10 MD5 2late4Me # MD5 key
+11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key
+12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key
+13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key
+14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key
+15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key
+16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key
+17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key
+18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key
+19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key
+20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key
+.Ed
+.D1 Figure 1. Typical Symmetric Key File
+.Pp
+Figure 1 shows a typical symmetric keys file used by the reference
+implementation.
+Following the header the keys are entered one per line in the format
+.D1 Ar keyno Ar type Ar key
where
.Ar keyno
-is a positive integer in the range 1-65,535,
+is a positive integer in the range 1-65534;
.Ar type
-is the string MD5 defining the key format and
+is the key type for the message digest algorithm, which in the absence of the
+OpenSSL library must be
+.Cm MD5
+to designate the MD5 message digest algorithm;
+if the OpenSSL library is installed, the key type can be any
+message digest algorithm supported by that library;
+however, if compatibility with FIPS 140-2 is required,
+the key type must be either
+.Cm SHA
+or
+.Cm SHA1 ;
.Ar key
is the key itself,
-which is a printable ASCII string 16 characters or less in length.
-Each character is chosen from the 93 printable characters
-in the range 0x21 through 0x7f excluding space and the
+which is a printable ASCII string 20 characters or less in length:
+each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7e (
+.Ql !
+through
+.Ql ~
+\&) excluding space and the
+.Ql #
+character, and terminated by whitespace or a
.Ql #
character.
+An OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which
+is truncated as necessary.
.Pp
Note that the keys used by the
.Xr ntpq 1ntpqmdoc
@@ -1081,8 +1250,8 @@ in human readable ASCII format.
.Pp
The
.Nm
-program generates a MD5 symmetric keys file
-.Pa ntpkey_MD5key_ Ns Ar hostname.filestamp .
+program generates a symmetric keys file
+.Pa ntpkey_MD5key_ Ns Ar hostname Ns . Ns Ar filestamp .
Since the file contains private shared keys,
it should be visible only to root and distributed by secure means
to other subnet hosts.
@@ -1107,18 +1276,6 @@ doc-section = {
ds-type = 'USAGE';
ds-format = 'mdoc';
ds-text = <<- _END_MDOC_USAGE
-The
-.Fl p Ar password
-option specifies the write password and
-.Fl q Ar password
-option the read password for previously encrypted files.
-The
-.Nm
-program prompts for the password if it reads an encrypted file
-and the password is missing or incorrect.
-If an encrypted file is read successfully and
-no write password is specified, the read password is used
-as the write password by default.
_END_MDOC_USAGE;
};
@@ -1134,10 +1291,7 @@ doc-section = {
ds-type = 'BUGS';
ds-format = 'mdoc';
ds-text = <<- _END_MDOC_BUGS
-It can take quite a while to generate some cryptographic values,
-from one to several minutes with modern architectures
-such as UltraSPARC and up to tens of minutes to an hour
-with older architectures such as SPARC IPC.
+It can take quite a while to generate some cryptographic values.
.Pp
Please report bugs to http://bugs.ntp.org .
_END_MDOC_BUGS;
diff --git a/contrib/ntp/util/ntp-keygen-opts.h b/contrib/ntp/util/ntp-keygen-opts.h
index 15881c2..ab9e8ca 100644
--- a/contrib/ntp/util/ntp-keygen-opts.h
+++ b/contrib/ntp/util/ntp-keygen-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h)
*
- * It has been AutoGen-ed March 21, 2017 at 10:45:47 AM by AutoGen 5.18.5
+ * It has been AutoGen-ed February 27, 2018 at 05:15:43 PM by AutoGen 5.18.5
* From the definitions ntp-keygen-opts.def
* and the template file options
*
@@ -75,13 +75,13 @@ typedef enum {
INDEX_OPT_IFFKEY = 8,
INDEX_OPT_IDENT = 9,
INDEX_OPT_LIFETIME = 10,
- INDEX_OPT_MD5KEY = 11,
- INDEX_OPT_MODULUS = 12,
+ INDEX_OPT_MODULUS = 11,
+ INDEX_OPT_MD5KEY = 12,
INDEX_OPT_PVT_CERT = 13,
INDEX_OPT_PASSWORD = 14,
INDEX_OPT_EXPORT_PASSWD = 15,
- INDEX_OPT_SIGN_KEY = 16,
- INDEX_OPT_SUBJECT_NAME = 17,
+ INDEX_OPT_SUBJECT_NAME = 16,
+ INDEX_OPT_SIGN_KEY = 17,
INDEX_OPT_TRUSTED_CERT = 18,
INDEX_OPT_MV_PARAMS = 19,
INDEX_OPT_MV_KEYS = 20,
@@ -94,9 +94,9 @@ typedef enum {
/** count of all options for ntp-keygen */
#define OPTION_CT 26
/** ntp-keygen version */
-#define NTP_KEYGEN_VERSION "4.2.8p10"
+#define NTP_KEYGEN_VERSION "4.2.8p11"
/** Full ntp-keygen version text */
-#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p10"
+#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p11"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
@@ -193,14 +193,14 @@ typedef enum {
# warning undefining LIFETIME due to option name conflict
# undef LIFETIME
# endif
-# ifdef MD5KEY
-# warning undefining MD5KEY due to option name conflict
-# undef MD5KEY
-# endif
# ifdef MODULUS
# warning undefining MODULUS due to option name conflict
# undef MODULUS
# endif
+# ifdef MD5KEY
+# warning undefining MD5KEY due to option name conflict
+# undef MD5KEY
+# endif
# ifdef PVT_CERT
# warning undefining PVT_CERT due to option name conflict
# undef PVT_CERT
@@ -213,14 +213,14 @@ typedef enum {
# warning undefining EXPORT_PASSWD due to option name conflict
# undef EXPORT_PASSWD
# endif
-# ifdef SIGN_KEY
-# warning undefining SIGN_KEY due to option name conflict
-# undef SIGN_KEY
-# endif
# ifdef SUBJECT_NAME
# warning undefining SUBJECT_NAME due to option name conflict
# undef SUBJECT_NAME
# endif
+# ifdef SIGN_KEY
+# warning undefining SIGN_KEY due to option name conflict
+# undef SIGN_KEY
+# endif
# ifdef TRUSTED_CERT
# warning undefining TRUSTED_CERT due to option name conflict
# undef TRUSTED_CERT
@@ -245,13 +245,13 @@ typedef enum {
# undef IFFKEY
# undef IDENT
# undef LIFETIME
-# undef MD5KEY
# undef MODULUS
+# undef MD5KEY
# undef PVT_CERT
# undef PASSWORD
# undef EXPORT_PASSWD
-# undef SIGN_KEY
# undef SUBJECT_NAME
+# undef SIGN_KEY
# undef TRUSTED_CERT
# undef MV_PARAMS
# undef MV_KEYS
@@ -280,16 +280,16 @@ typedef enum {
#ifdef AUTOKEY
#define OPT_VALUE_LIFETIME (DESC(LIFETIME).optArg.argInt)
#endif /* AUTOKEY */
-#define VALUE_OPT_MD5KEY 'M'
#define VALUE_OPT_MODULUS 'm'
#ifdef AUTOKEY
#define OPT_VALUE_MODULUS (DESC(MODULUS).optArg.argInt)
#endif /* AUTOKEY */
+#define VALUE_OPT_MD5KEY 'M'
#define VALUE_OPT_PVT_CERT 'P'
#define VALUE_OPT_PASSWORD 'p'
#define VALUE_OPT_EXPORT_PASSWD 'q'
-#define VALUE_OPT_SIGN_KEY 'S'
#define VALUE_OPT_SUBJECT_NAME 's'
+#define VALUE_OPT_SIGN_KEY 'S'
#define VALUE_OPT_TRUSTED_CERT 'T'
#define VALUE_OPT_MV_PARAMS 'V'
#ifdef AUTOKEY
diff --git a/contrib/ntp/util/ntp-keygen.1ntp-keygenman b/contrib/ntp/util/ntp-keygen.1ntp-keygenman
index 1a309ee..5b942d8 100644
--- a/contrib/ntp/util/ntp-keygen.1ntp-keygenman
+++ b/contrib/ntp/util/ntp-keygen.1ntp-keygenman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-keygen 1ntp-keygenman "21 Mar 2017" "ntp (4.2.8p10)" "User Commands"
+.TH ntp-keygen 1ntp-keygenman "27 Feb 2018" "ntp (4.2.8p11)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-uUaiiy/ag-lVaahy)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-bBa46V/ag-nBaW5V)
.\"
-.\" It has been AutoGen-ed March 21, 2017 at 10:45:54 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed February 27, 2018 at 05:15:53 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -36,30 +36,33 @@ All arguments must be options.
.SH DESCRIPTION
This program generates cryptographic data files used by the NTPv4
authentication and identification schemes.
-It generates MD5 key files used in symmetric key cryptography.
-In addition, if the OpenSSL software library has been installed,
-it generates keys, certificate and identity files used in public key
-cryptography.
+It can generate message digest keys used in symmetric key cryptography and,
+if the OpenSSL software library has been installed, it can generate host keys,
+signing keys, certificates, and identity keys and parameters used in Autokey
+public key cryptography.
These files are used for cookie encryption,
-digital signature and challenge/response identification algorithms
+digital signature, and challenge/response identification algorithms
compatible with the Internet standard security infrastructure.
.sp \n(Ppu
.ne 2
-All files are in PEM-encoded printable ASCII format,
-so they can be embedded as MIME attachments in mail to other sites
+The message digest symmetric keys file is generated in a format
+compatible with NTPv3.
+All other files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in email to other sites
and certificate authorities.
By default, files are not encrypted.
.sp \n(Ppu
.ne 2
-When used to generate message digest keys, the program produces a file
-containing ten pseudo-random printable ASCII strings suitable for the
-MD5 message digest algorithm included in the distribution.
+When used to generate message digest symmetric keys, the program
+produces a file containing ten pseudo-random printable ASCII strings
+suitable for the MD5 message digest algorithm included in the
+distribution.
If the OpenSSL library is installed, it produces an additional ten
-hex-encoded random bit strings suitable for the SHA1 and other message
-digest algorithms.
-The message digest keys file must be distributed and stored
+hex-encoded random bit strings suitable for SHA1, AES-128-CMAC, and
+other message digest algorithms.
+The message digest symmetric keys file must be distributed and stored
using secure means beyond the scope of NTP itself.
Besides the keys used for ordinary NTP associations, additional keys
can be defined as passwords for the
@@ -83,27 +86,38 @@ other than Autokey.
Some files used by this program are encrypted using a private password.
The
\f\*[B-Font]\-p\f[]
-option specifies the password for local encrypted files and the
+option specifies the read password for local encrypted files and the
\f\*[B-Font]\-q\f[]
-option the password for encrypted files sent to remote sites.
+option the write password for encrypted files sent to remote sites.
If no password is specified, the host name returned by the Unix
-\fBgethostname\f[]\fR()\f[]
-function, normally the DNS name of the host is used.
+\fChostname\f[]\fR(1)\f[]
+command, normally the DNS name of the host, is used as the the default read
+password, for convenience.
+The
+\f\*[B-Font]ntp-keygen\fP
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
.sp \n(Ppu
.ne 2
The
-\f\*[I-Font]pw\f[]
+\f\*[B-Font]pw\f[]
option of the
-\f\*[I-Font]crypto\f[]
+\f\*[B-Font]crypto\f[]
+\fCntpd\f[]\fR(1ntpdmdoc)\f[]
configuration command specifies the read
password for previously encrypted local files.
-This must match the local password used by this program.
+This must match the local read password used by this program.
If not specified, the host name is used.
-Thus, if files are generated by this program without password,
+Thus, if files are generated by this program without an explicit password,
they can be read back by
-\f\*[I-Font]ntpd\f[]
-without password but only on the same host.
+\fCntpd\f[]\fR(1ntpdmdoc)\f[]
+without specifying an explicit password but only on the same host.
+If the write password used for encryption is specified as the host name,
+these files can be read by that host with no explicit password.
.sp \n(Ppu
.ne 2
@@ -111,215 +125,102 @@ Normally, encrypted files for each host are generated by that host and
used only by that host, although exceptions exist as noted later on
this page.
The symmetric keys file, normally called
-\f\*[I-Font]ntp.keys\f[],
+\fIntp.keys\f[],
is usually installed in
\fI/etc\f[].
Other files and links are usually installed in
\fI/usr/local/etc\f[],
which is normally in a shared filesystem in
NFS-mounted networks and cannot be changed by shared clients.
-The location of the keys directory can be changed by the
-\f\*[I-Font]keysdir\f[]
-configuration command in such cases.
-Normally, this is in
-\fI/etc\f[].
+In these cases, NFS clients can specify the files in another
+directory such as
+\fI/etc\f[]
+using the
+\f\*[B-Font]keysdir\f[]
+\fCntpd\f[]\fR(1ntpdmdoc)\f[]
+configuration file command.
.sp \n(Ppu
.ne 2
This program directs commentary and error messages to the standard
error stream
-\f\*[I-Font]stderr\f[]
+\fIstderr\f[]
and remote files to the standard output stream
-\f\*[I-Font]stdout\f[]
+\fIstdout\f[]
where they can be piped to other applications or redirected to files.
The names used for generated files and links all begin with the
string
-\f\*[I-Font]ntpkey\f[]
+\fIntpkey\&*\f[]
and include the file type, generating host and filestamp,
as described in the
-\*[Lq]Cryptographic Data Files\*[Rq]
+\fICryptographic Data Files\f[]
section below.
.SS Running the Program
-To test and gain experience with Autokey concepts, log in as root and
-change to the keys directory, usually
-\fI/usr/local/etc\f[]
-When run for the first time, or if all files with names beginning with
-\f\*[I-Font]ntpkey\f[]
-have been removed, use the
-\f\*[B-Font]ntp-keygen\fP
-command without arguments to generate a
-default RSA host key and matching RSA-MD5 certificate with expiration
-date one year hence.
-If run again without options, the program uses the
-existing keys and parameters and generates only a new certificate with
-new expiration date one year hence.
-.sp \n(Ppu
-.ne 2
-
-Run the command on as many hosts as necessary.
-Designate one of them as the trusted host (TH) using
+The safest way to run the
\f\*[B-Font]ntp-keygen\fP
-with the
-\f\*[B-Font]\-T\f[]
-option and configure it to synchronize from reliable Internet servers.
-Then configure the other hosts to synchronize to the TH directly or
-indirectly.
-A certificate trail is created when Autokey asks the immediately
-ascendant host towards the TH to sign its certificate, which is then
-provided to the immediately descendant host on request.
-All group hosts should have acyclic certificate trails ending on the TH.
-.sp \n(Ppu
-.ne 2
-
-The host key is used to encrypt the cookie when required and so must be
-RSA type.
-By default, the host key is also the sign key used to encrypt
-signatures.
-A different sign key can be assigned using the
-\f\*[B-Font]\-S\f[]
-option and this can be either RSA or DSA type.
-By default, the signature
-message digest type is MD5, but any combination of sign key type and
-message digest type supported by the OpenSSL library can be specified
-using the
-\f\*[B-Font]\-c\f[]
-option.
-The rules say cryptographic media should be generated with proventic
-filestamps, which means the host should already be synchronized before
-this program is run.
-This of course creates a chicken-and-egg problem
-when the host is started for the first time.
-Accordingly, the host time
-should be set by some other means, such as eyeball-and-wristwatch, at
-least so that the certificate lifetime is within the current year.
-After that and when the host is synchronized to a proventic source, the
-certificate should be re-generated.
-.sp \n(Ppu
-.ne 2
-
-Additional information on trusted groups and identity schemes is on the
-\*[Lq]Autokey Public-Key Authentication\*[Rq]
-page.
-.sp \n(Ppu
-.ne 2
-
-The
-\fCntpd\f[]\fR(1ntpdmdoc)\f[]
-configuration command
-\f\*[B-Font]crypto\f[] \f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]
-specifies the read password for previously encrypted files.
-The daemon expires on the spot if the password is missing
-or incorrect.
-For convenience, if a file has been previously encrypted,
-the default read password is the name of the host running
-the program.
-If the previous write password is specified as the host name,
-these files can be read by that host with no explicit password.
-.sp \n(Ppu
-.ne 2
-
-File names begin with the prefix
-\f\*[B-Font]ntpkey_\f[]
-and end with the postfix
-\f\*[I-Font]_hostname.filestamp\f[],
-where
-\f\*[I-Font]hostname\f[]
-is the owner name, usually the string returned
-by the Unix gethostname() routine, and
-\f\*[I-Font]filestamp\f[]
-is the NTP seconds when the file was generated, in decimal digits.
-This both guarantees uniqueness and simplifies maintenance
-procedures, since all files can be quickly removed
-by a
-\f\*[B-Font]rm\f[] \f\*[B-Font]ntpkey\&*\f[]
-command or all files generated
-at a specific time can be removed by a
-\f\*[B-Font]rm\f[]
-\f\*[I-Font]\&*filestamp\f[]
-command.
-To further reduce the risk of misconfiguration,
-the first two lines of a file contain the file name
-and generation date and time as comments.
-.sp \n(Ppu
-.ne 2
-
-All files are installed by default in the keys directory
+program is logged in directly as root.
+The recommended procedure is change to the
+\f\*[I-Font]keys\f[]
+directory, usually
\fI/usr/local/etc\f[],
-which is normally in a shared filesystem
-in NFS-mounted networks.
-The actual location of the keys directory
-and each file can be overridden by configuration commands,
-but this is not recommended.
-Normally, the files for each host are generated by that host
-and used only by that host, although exceptions exist
-as noted later on this page.
-.sp \n(Ppu
-.ne 2
-
-Normally, files containing private values,
-including the host key, sign key and identification parameters,
-are permitted root read/write-only;
-while others containing public values are permitted world readable.
-Alternatively, files containing private values can be encrypted
-and these files permitted world readable,
-which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
-dependent clients can all be installed in the same shared directory.
+then run the program.
.sp \n(Ppu
.ne 2
-The recommended practice is to keep the file name extensions
-when installing a file and to install a soft link
-from the generic names specified elsewhere on this page
-to the generated files.
-This allows new file generations to be activated simply
-by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
-If a link is not present,
-\fCntpd\f[]\fR(1ntpdmdoc)\f[]
-extracts the filestamp from the file itself.
-This allows clients to verify that the file and generation times
-are always current.
-The
-\f\*[B-Font]ntp-keygen\fP
-program uses the same timestamp extension for all files generated
-at one time, so each generation is distinct and can be readily
-recognized in monitoring data.
-.SS Running the program
-The safest way to run the
+To test and gain experience with Autokey concepts, log in as root and
+change to the
+\f\*[I-Font]keys\f[]
+directory, usually
+\fI/usr/local/etc\f[].
+When run for the first time, or if all files with names beginning with
+\fIntpkey\&*\f[]
+have been removed, use the
\f\*[B-Font]ntp-keygen\fP
-program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
-\fI/usr/local/etc\f[],
-then run the program.
-When run for the first time,
-or if all
-\f\*[B-Font]ntpkey\f[]
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
+command without arguments to generate a default
+\f\*[B-Font]RSA\f[]
+host key and matching
+\f\*[B-Font]RSA-MD5\f[]
+certificate file with expiration date one year hence,
which is all that is necessary in many cases.
The program also generates soft links from the generic names
to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+If run again without options, the program uses the
+existing keys and parameters and generates a new certificate file with
+new expiration date one year hence, and soft link.
.sp \n(Ppu
.ne 2
-The host key is used to encrypt the cookie when required and so must be RSA type.
+The host key is used to encrypt the cookie when required and so must be
+\f\*[B-Font]RSA\f[]
+type.
By default, the host key is also the sign key used to encrypt signatures.
When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
+either
+\f\*[B-Font]RSA\f[]
+or
+\f\*[B-Font]DSA\f[]
+type.
+By default, the message digest type is
+\f\*[B-Font]MD5\f[],
+but any combination
of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
+can be specified, including those using the
+\f\*[B-Font]AES128CMAC\f[], \f\*[B-Font]MD2\f[], \f\*[B-Font]MD5\f[], \f\*[B-Font]MDC2\f[], \f\*[B-Font]SHA\f[], \f\*[B-Font]SHA1\f[]
+and
+\f\*[B-Font]RIPE160\f[]
+message digest algorithms.
However, the scheme specified in the certificate must be compatible
with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Certificates using any digest algorithm are compatible with
+\f\*[B-Font]RSA\f[]
+sign keys;
+however, only
+\f\*[B-Font]SHA\f[]
+and
+\f\*[B-Font]SHA1\f[]
+certificates are compatible with
+\f\*[B-Font]DSA\f[]
+sign keys.
.sp \n(Ppu
.ne 2
@@ -334,19 +235,19 @@ as the other files, are probably not compatible with anything other than Autokey
.ne 2
Running the program as other than root and using the Unix
-\f\*[B-Font]su\f[]
+\fCsu\f[]\fR(1)\f[]
command
to assume root may not work properly, since by default the OpenSSL library
looks for the random seed file
-\f\*[B-Font].rnd\f[]
+\fI.rnd\f[]
in the user home directory.
However, there should be only one
-\f\*[B-Font].rnd\f[],
+\fI.rnd\f[],
most conveniently
in the root directory, so it is convenient to define the
-\f\*[B-Font]$RANDFILE\f[]
+RANDFILE
environment variable used by the OpenSSL library as the path to
-\f\*[B-Font]/.rnd\f[].
+\fI.rnd\f[].
.sp \n(Ppu
.ne 2
@@ -358,7 +259,8 @@ directory such as
\fI/etc\f[]
using the
\f\*[B-Font]keysdir\f[]
-command.
+\fCntpd\f[]\fR(1ntpdmdoc)\f[]
+configuration file command.
There is no need for one client to read the keys and certificates
of other clients or servers, as these data are obtained automatically
by the Autokey protocol.
@@ -397,8 +299,11 @@ while others containing public values are permitted world readable.
Alternatively, files containing private values can be encrypted
and these files permitted world readable,
which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
+Since uniqueness is insured by the
+\f\*[I-Font]hostname\f[]
+and
+\f\*[I-Font]filestamp\f[]
+file name extensions, the files for an NTP server and
dependent clients can all be installed in the same shared directory.
.sp \n(Ppu
.ne 2
@@ -409,116 +314,121 @@ from the generic names specified elsewhere on this page
to the generated files.
This allows new file generations to be activated simply
by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
+If a link is present,
+\fCntpd\f[]\fR(1ntpdmdoc)\f[]
+follows it to the file name to extract the
+\f\*[I-Font]filestamp\f[].
If a link is not present,
\fCntpd\f[]\fR(1ntpdmdoc)\f[]
-extracts the filestamp from the file itself.
+extracts the
+\f\*[I-Font]filestamp\f[]
+from the file itself.
This allows clients to verify that the file and generation times
are always current.
The
\f\*[B-Font]ntp-keygen\fP
-program uses the same timestamp extension for all files generated
+program uses the same
+\f\*[I-Font]filestamp\f[]
+extension for all files generated
at one time, so each generation is distinct and can be readily
recognized in monitoring data.
-.SS Running the program
-The safest way to run the
-\f\*[B-Font]ntp-keygen\fP
-program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
-\fI/usr/local/etc\f[],
-then run the program.
-When run for the first time,
-or if all
-\f\*[B-Font]ntpkey\f[]
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
-which is all that is necessary in many cases.
-The program also generates soft links from the generic names
-to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
.sp \n(Ppu
.ne 2
-The host key is used to encrypt the cookie when required and so must be RSA type.
-By default, the host key is also the sign key used to encrypt signatures.
-When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
-of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
-However, the scheme specified in the certificate must be compatible
-with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
+\f\*[B-Font]ntp-keygen\fP
+with the
+\f\*[B-Font]\-T\f[]
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
.sp \n(Ppu
.ne 2
-Private/public key files and certificates are compatible with
-other OpenSSL applications and very likely other libraries as well.
-Certificates or certificate requests derived from them should be compatible
-with extant industry practice, although some users might find
-the interpretation of X509v3 extension fields somewhat liberal.
-However, the identification parameter files, although encoded
-as the other files, are probably not compatible with anything other than Autokey.
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+\f\*[B-Font]\-S\f[]
+option and this can be either
+\f\*[B-Font]RSA\f[]
+or
+\f\*[B-Font]DSA\f[]
+type.
+By default, the signature
+message digest type is
+\f\*[B-Font]MD5\f[],
+but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+\f\*[B-Font]\-c\f[]
+option.
.sp \n(Ppu
.ne 2
-Running the program as other than root and using the Unix
-\f\*[B-Font]su\f[]
-command
-to assume root may not work properly, since by default the OpenSSL library
-looks for the random seed file
-\f\*[B-Font].rnd\f[]
-in the user home directory.
-However, there should be only one
-\f\*[B-Font].rnd\f[],
-most conveniently
-in the root directory, so it is convenient to define the
-\f\*[B-Font]$RANDFILE\f[]
-environment variable used by the OpenSSL library as the path to
-\f\*[B-Font]/.rnd\f[].
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
.sp \n(Ppu
.ne 2
-Installing the keys as root might not work in NFS-mounted
-shared file systems, as NFS clients may not be able to write
-to the shared keys directory, even as root.
-In this case, NFS clients can specify the files in another
-directory such as
-\fI/etc\f[]
-using the
-\f\*[B-Font]keysdir\f[]
-command.
-There is no need for one client to read the keys and certificates
-of other clients or servers, as these data are obtained automatically
-by the Autokey protocol.
+Additional information on trusted groups and identity schemes is on the
+\*[Lq]Autokey Public-Key Authentication\*[Rq]
+page.
.sp \n(Ppu
.ne 2
-Ordinarily, cryptographic files are generated by the host that uses them,
-but it is possible for a trusted agent (TA) to generate these files
-for other hosts; however, in such cases files should always be encrypted.
-The subject name and trusted name default to the hostname
-of the host generating the files, but can be changed by command line options.
-It is convenient to designate the owner name and trusted name
-as the subject and issuer fields, respectively, of the certificate.
-The owner name is also used for the host and sign key files,
-while the trusted name is used for the identity files.
-seconds.
-seconds.
-s Trusted Hosts and Groups
+File names begin with the prefix
+\fIntpkey\f[]_
+and end with the suffix
+\fI_\f[]\f\*[I-Font]hostname\f[]. \f\*[I-Font]filestamp\f[],
+where
+\f\*[I-Font]hostname\f[]
+is the owner name, usually the string returned
+by the Unix
+\fChostname\f[]\fR(1)\f[]
+command, and
+\f\*[I-Font]filestamp\f[]
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+\f\*[B-Font]rm\f[] \fIntpkey\&*\f[]
+command or all files generated
+at a specific time can be removed by a
+\f\*[B-Font]rm\f[] \fI\&*\f[]\f\*[I-Font]filestamp\f[]
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+.SS Trusted Hosts and Groups
Each cryptographic configuration involves selection of a signature scheme
and identification scheme, called a cryptotype,
as explained in the
\fIAuthentication\f[] \fIOptions\f[]
section of
\fCntp.conf\f[]\fR(5)\f[].
-The default cryptotype uses RSA encryption, MD5 message digest
-and TC identification.
+The default cryptotype uses
+\f\*[B-Font]RSA\f[]
+encryption,
+\f\*[B-Font]MD5\f[]
+message digest
+and
+\f\*[B-Font]TC\f[]
+identification.
First, configure a NTP subnet including one or more low-stratum
trusted hosts from which all other hosts derive synchronization
directly or indirectly.
@@ -538,7 +448,7 @@ section of
On each trusted host as root, change to the keys directory.
To insure a fresh fileset, remove all
-\f\*[B-Font]ntpkey\f[]
+\fIntpkey\f[]
files.
Then run
\f\*[B-Font]ntp-keygen\fP
@@ -565,7 +475,9 @@ is either
\f\*[B-Font]RSA\f[]
or
\f\*[B-Font]DSA\f[].
-The most often need to do this is when a DSA-signed certificate is used.
+The most frequent need to do this is when a
+\f\*[B-Font]DSA\f[]\-signed
+certificate is used.
If it is necessary to use a different certificate scheme than the default,
run
\f\*[B-Font]ntp-keygen\fP
@@ -574,10 +486,10 @@ with the
option and selected
\f\*[I-Font]scheme\f[]
as needed.
-f
+If
\f\*[B-Font]ntp-keygen\fP
is run again without these options, it generates a new certificate
-using the same scheme and sign key.
+using the same scheme and sign key, and soft link.
.sp \n(Ppu
.ne 2
@@ -586,7 +498,7 @@ from time to time, if only to extend the validity interval.
Simply run
\f\*[B-Font]ntp-keygen\fP
with the same flags as before to generate new certificates
-using existing keys.
+using existing keys, and soft links.
However, if the host or sign key is changed,
\fCntpd\f[]\fR(1ntpdmdoc)\f[]
should be restarted.
@@ -597,13 +509,15 @@ Other dependent hosts will continue as usual until signatures are refreshed,
at which time the protocol is restarted.
.SS Identity Schemes
As mentioned on the Autonomous Authentication page,
-the default TC identity scheme is vulnerable to a middleman attack.
+the default
+\f\*[B-Font]TC\f[]
+identity scheme is vulnerable to a middleman attack.
However, there are more secure identity schemes available,
-including PC, IFF, GQ and MV described on the
-"Identification Schemes"
-page
-(maybe available at
-\f[C]http://www.eecis.udel.edu/%7emills/keygen.html\f[]).
+including
+\f\*[B-Font]PC\f[], \f\*[B-Font]IFF\f[], \f\*[B-Font]GQ\f[]
+and
+\f\*[B-Font]MV\f[]
+schemes described below.
These schemes are based on a TA, one or more trusted hosts
and some number of nontrusted hosts.
Trusted hosts prove identity using values provided by the TA,
@@ -632,12 +546,15 @@ On trusted host alice run
\f\*[B-Font]\-P\f[]
\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
to generate the host key file
-\fIntpkey_RSAkey_\f[]\f\*[I-Font]alice.filestamp\f[]
+\fIntpkey\f[]_ \f\*[B-Font]RSA\f[] \fIkey_alice.\f[] \f\*[I-Font]filestamp\f[]
and trusted private certificate file
-\fIntpkey_RSA-MD5_cert_\f[]\f\*[I-Font]alice.filestamp\f[].
+\fIntpkey\f[]_ \f\*[B-Font]RSA-MD5\f[] \f\*[B-Font]_\f[] \fIcert_alice.\f[] \f\*[I-Font]filestamp\f[],
+and soft links.
Copy both files to all group hosts;
they replace the files which would be generated in other schemes.
-On each host bob install a soft link from the generic name
+On each host
+\f\*[I-Font]bob\f[]
+install a soft link from the generic name
\fIntpkey_host_\f[]\f\*[I-Font]bob\f[]
to the host key file and soft link
\fIntpkey_cert_\f[]\f\*[I-Font]bob\f[]
@@ -646,28 +563,36 @@ Note the generic links are on bob, but point to files generated
by trusted host alice.
In this scheme it is not possible to refresh
either the keys or certificates without copying them
-to all other hosts in the group.
+to all other hosts in the group, and recreating the soft links.
.sp \n(Ppu
.ne 2
-For the IFF scheme proceed as in the TC scheme to generate keys
+For the
+\f\*[B-Font]IFF\f[]
+scheme proceed as in the
+\f\*[B-Font]TC\f[]
+scheme to generate keys
and certificates for all group hosts, then for every trusted host in the group,
-generate the IFF parameter file.
+generate the
+\f\*[B-Font]IFF\f[]
+parameter file.
On trusted host alice run
\f\*[B-Font]ntp-keygen\fP
\f\*[B-Font]\-T\f[]
\f\*[B-Font]\-I\f[]
\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
to produce her parameter file
-\fIntpkey_IFFpar_\f[]\f\*[I-Font]alice.filestamp\f[],
+\fIntpkey_IFFpar_alice.\f[]\f\*[I-Font]filestamp\f[],
which includes both server and client keys.
Copy this file to all group hosts that operate as both servers
and clients and install a soft link from the generic
-\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[]
+\fIntpkey_iff_alice\f[]
to this file.
If there are no hosts restricted to operate only as clients,
there is nothing further to do.
-As the IFF scheme is independent
+As the
+\f\*[B-Font]IFF\f[]
+scheme is independent
of keys and certificates, these files can be refreshed as needed.
.sp \n(Ppu
.ne 2
@@ -679,41 +604,57 @@ from the parameter file and distributed to all restricted clients.
After generating the parameter file, on alice run
\f\*[B-Font]ntp-keygen\fP
\f\*[B-Font]\-e\f[]
-and pipe the output to a file or mail program.
-Copy or mail this file to all restricted clients.
+and pipe the output to a file or email program.
+Copy or email this file to all restricted clients.
On these clients install a soft link from the generic
-\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[]
+\fIntpkey_iff_alice\f[]
to this file.
To further protect the integrity of the keys,
each file can be encrypted with a secret password.
.sp \n(Ppu
.ne 2
-For the GQ scheme proceed as in the TC scheme to generate keys
+For the
+\f\*[B-Font]GQ\f[]
+scheme proceed as in the
+\f\*[B-Font]TC\f[]
+scheme to generate keys
and certificates for all group hosts, then for every trusted host
-in the group, generate the IFF parameter file.
+in the group, generate the
+\f\*[B-Font]IFF\f[]
+parameter file.
On trusted host alice run
\f\*[B-Font]ntp-keygen\fP
\f\*[B-Font]\-T\f[]
\f\*[B-Font]\-G\f[]
\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
to produce her parameter file
-\fIntpkey_GQpar_\f[]\f\*[I-Font]alice.filestamp\f[],
+\fIntpkey_GQpar_alice.\f[]\f\*[I-Font]filestamp\f[],
which includes both server and client keys.
Copy this file to all group hosts and install a soft link
from the generic
-\fIntpkey_gq_\f[]\f\*[I-Font]alice\f[]
+\fIntpkey_gq_alice\f[]
to this file.
-In addition, on each host bob install a soft link
+In addition, on each host
+\f\*[I-Font]bob\f[]
+install a soft link
from generic
\fIntpkey_gq_\f[]\f\*[I-Font]bob\f[]
to this file.
-As the GQ scheme updates the GQ parameters file and certificate
+As the
+\f\*[B-Font]GQ\f[]
+scheme updates the
+\f\*[B-Font]GQ\f[]
+parameters file and certificate
at the same time, keys and certificates can be regenerated as needed.
.sp \n(Ppu
.ne 2
-For the MV scheme, proceed as in the TC scheme to generate keys
+For the
+\f\*[B-Font]MV\f[]
+scheme, proceed as in the
+\f\*[B-Font]TC\f[]
+scheme to generate keys
and certificates for all group hosts.
For illustration assume trish is the TA, alice one of several trusted hosts
and bob one of her clients.
@@ -725,9 +666,9 @@ where
\f\*[I-Font]n\f[]
is the number of revokable keys (typically 5) to produce
the parameter file
-\fIntpkeys_MVpar_\f[]\f\*[I-Font]trish.filestamp\f[]
+\fIntpkeys_MVpar_trish.\f[]\f\*[I-Font]filestamp\f[]
and client key files
-\fIntpkeys_MVkeyd_\f[]\f\*[I-Font]trish.filestamp\f[]
+\fIntpkeys_MVkey\f[]\f\*[I-Font]d\f[] \f\*[I-Font]_\f[] \fItrish.\f[] \f\*[I-Font]filestamp\f[]
where
\f\*[I-Font]d\f[]
is the key number (0 \&<
@@ -736,95 +677,236 @@ is the key number (0 \&<
\f\*[I-Font]n\f[]).
Copy the parameter file to alice and install a soft link
from the generic
-\fIntpkey_mv_\f[]\f\*[I-Font]alice\f[]
+\fIntpkey_mv_alice\f[]
to this file.
Copy one of the client key files to alice for later distribution
to her clients.
-It doesn't matter which client key file goes to alice,
+It does not matter which client key file goes to alice,
since they all work the same way.
-Alice copies the client key file to all of her cliens.
+Alice copies the client key file to all of her clients.
On client bob install a soft link from generic
-\fIntpkey_mvkey_\f[]\f\*[I-Font]bob\f[]
+\fIntpkey_mvkey_bob\f[]
to the client key file.
-As the MV scheme is independent of keys and certificates,
+As the
+\f\*[B-Font]MV\f[]
+scheme is independent of keys and certificates,
these files can be refreshed as needed.
.SS Command Line Options
.TP 7
-.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[]
-Select certificate message digest/signature encryption scheme.
+.NOP \f\*[B-Font]\-b\f[] \f\*[B-Font]\-\-imbits\f[]= \f\*[I-Font]modulus\f[]
+Set the number of bits in the identity modulus for generating identity keys to
+\f\*[I-Font]modulus\f[]
+bits.
+The number of bits in the identity modulus defaults to 256, but can be set to
+values from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+.TP 7
+.NOP \f\*[B-Font]\-c\f[] \f\*[B-Font]\-\-certificate\f[]= \f\*[I-Font]scheme\f[]
+Select certificate signature encryption/message digest scheme.
The
\f\*[I-Font]scheme\f[]
can be one of the following:
-. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+\f\*[B-Font]RSA-MD2\f[], \f\*[B-Font]RSA-MD5\f[], \f\*[B-Font]RSA-MDC2\f[], \f\*[B-Font]RSA-SHA\f[], \f\*[B-Font]RSA-SHA1\f[], \f\*[B-Font]RSA-RIPEMD160\f[], \f\*[B-Font]DSA-SHA\f[],
or
\f\*[B-Font]DSA-SHA1\f[].
-Note that RSA schemes must be used with a RSA sign key and DSA
-schemes must be used with a DSA sign key.
+Note that
+\f\*[B-Font]RSA\f[]
+schemes must be used with an
+\f\*[B-Font]RSA\f[]
+sign key and
+\f\*[B-Font]DSA\f[]
+schemes must be used with a
+\f\*[B-Font]DSA\f[]
+sign key.
The default without this option is
\f\*[B-Font]RSA-MD5\f[].
+If compatibility with FIPS 140-2 is required, either the
+\f\*[B-Font]DSA-SHA\f[]
+or
+\f\*[B-Font]DSA-SHA1\f[]
+scheme must be used.
.TP 7
-.NOP \f\*[B-Font]\-d\f[]
-Enable debugging.
+.NOP \f\*[B-Font]\-C\f[] \f\*[B-Font]\-\-cipher\f[]= \f\*[I-Font]cipher\f[]
+Select the OpenSSL cipher to encrypt the files containing private keys.
+The default without this option is three-key triple DES in CBC mode,
+\f\*[B-Font]des-ede3-cbc\f[].
+The
+\f\*[B-Font]openssl\f[] \f\*[B-Font]\-h\f[]
+command provided with OpenSSL displays available ciphers.
+.TP 7
+.NOP \f\*[B-Font]\-d\f[] \f\*[B-Font]\-\-debug-level\f[]
+Increase debugging verbosity level.
This option displays the cryptographic data produced in eye-friendly billboards.
.TP 7
-.NOP \f\*[B-Font]\-e\f[]
-Write the IFF client keys to the standard output.
-This is intended for automatic key distribution by mail.
+.NOP \f\*[B-Font]\-D\f[] \f\*[B-Font]\-\-set-debug-level\f[]= \f\*[I-Font]level\f[]
+Set the debugging verbosity to
+\f\*[I-Font]level\f[].
+This option displays the cryptographic data produced in eye-friendly billboards.
.TP 7
-.NOP \f\*[B-Font]\-G\f[]
-Generate parameters and keys for the GQ identification scheme,
-obsoleting any that may exist.
+.NOP \f\*[B-Font]\-e\f[] \f\*[B-Font]\-\-id-key\f[]
+Write the
+\f\*[B-Font]IFF\f[]
+or
+\f\*[B-Font]GQ\f[]
+public parameters from the
+\f\*[I-Font]IFFkey\f[] \f\*[I-Font]or\f[] \f\*[I-Font]GQkey\f[]
+client keys file previously specified
+as unencrypted data to the standard output stream
+\fIstdout\f[].
+This is intended for automatic key distribution by email.
.TP 7
-.NOP \f\*[B-Font]\-g\f[]
-Generate keys for the GQ identification scheme
-using the existing GQ parameters.
-If the GQ parameters do not yet exist, create them first.
+.NOP \f\*[B-Font]\-G\f[] \f\*[B-Font]\-\-gq-params\f[]
+Generate a new encrypted
+\f\*[B-Font]GQ\f[]
+parameters and key file for the Guillou-Quisquater (GQ) identity scheme.
+This option is mutually exclusive with the
+\f\*[B-Font]\-I\f[]
+and
+\f\*[B-Font]\-V\f[]
+options.
.TP 7
-.NOP \f\*[B-Font]\-H\f[]
-Generate new host keys, obsoleting any that may exist.
+.NOP \f\*[B-Font]\-H\f[] \f\*[B-Font]\-\-host-key\f[]
+Generate a new encrypted
+\f\*[B-Font]RSA\f[]
+public/private host key file.
.TP 7
-.NOP \f\*[B-Font]\-I\f[]
-Generate parameters for the IFF identification scheme,
-obsoleting any that may exist.
+.NOP \f\*[B-Font]\-I\f[] \f\*[B-Font]\-\-iffkey\f[]
+Generate a new encrypted
+\f\*[B-Font]IFF\f[]
+key file for the Schnorr (IFF) identity scheme.
+This option is mutually exclusive with the
+\f\*[B-Font]\-G\f[]
+and
+Fl V
+options.
.TP 7
-.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]name\f[]
-Set the suject name to
-\f\*[I-Font]name\f[].
-This is used as the subject field in certificates
-and in the file name for host and sign keys.
+.NOP \f\*[B-Font]\-i\f[] \f\*[B-Font]\-\-ident\f[]= \f\*[I-Font]group\f[]
+Set the optional Autokey group name to
+\f\*[I-Font]group\f[].
+This is used in the identity scheme parameter file names of
+\f\*[B-Font]IFF\f[], \f\*[B-Font]GQ\f[],
+and
+\f\*[B-Font]MV\f[]
+client parameters files.
+In that role, the default is the host name if no group is provided.
+The group name, if specified using
+\f\*[B-Font]\-i\f[]
+or
+\f\*[B-Font]\-s\f[]
+following an
+\[oq]@@\[cq]
+character, is also used in certificate subject and issuer names in the form
+\f\*[I-Font]host\f[] \f\*[I-Font]@@\f[] \f\*[I-Font]group\f[]
+and should match the group specified via
+\f\*[B-Font]crypto\f[] \f\*[B-Font]ident\f[]
+or
+\f\*[B-Font]server\f[] \f\*[B-Font]ident\f[]
+in the ntpd configuration file.
.TP 7
-.NOP \f\*[B-Font]\-M\f[]
-Generate MD5 keys, obsoleting any that may exist.
+.NOP \f\*[B-Font]\-l\f[] \f\*[B-Font]\-\-lifetime\f[]= \f\*[I-Font]days\f[]
+Set the lifetime for certificate expiration to
+\f\*[I-Font]days\f[].
+The default lifetime is one year (365 days).
.TP 7
-.NOP \f\*[B-Font]\-P\f[]
-Generate a private certificate.
-By default, the program generates public certificates.
+.NOP \f\*[B-Font]\-m\f[] \f\*[B-Font]\-\-modulus\f[]= \f\*[I-Font]bits\f[]
+Set the number of bits in the prime modulus for generating files to
+\f\*[I-Font]bits\f[].
+The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
.TP 7
-.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
-Encrypt generated files containing private data with
-\f\*[I-Font]password\f[]
-and the DES-CBC algorithm.
+.NOP \f\*[B-Font]\-M\f[] \f\*[B-Font]\-\-md5key\f[]
+Generate a new symmetric keys file containing 10
+\f\*[B-Font]MD5\f[]
+keys, and if OpenSSL is available, 10
+\f\*[B-Font]SHA\f[]
+keys.
+An
+\f\*[B-Font]MD5\f[]
+key is a string of 20 random printable ASCII characters, while a
+\f\*[B-Font]SHA\f[]
+key is a string of 40 random hex digits.
+The file can be edited using a text editor to change the key type or key content.
+This option is mutually exclusive with all other options.
.TP 7
-.NOP \f\*[B-Font]\-q\f[]
-Set the password for reading files to password.
+.NOP \f\*[B-Font]\-p\f[] \f\*[B-Font]\-\-password\f[]= \f\*[I-Font]passwd\f[]
+Set the password for reading and writing encrypted files to
+\f\*[I-Font]passwd\f[].
+These include the host, sign and identify key files.
+By default, the password is the string returned by the Unix
+\f\*[B-Font]hostname\f[]
+command.
.TP 7
-.NOP \f\*[B-Font]\-S\f[] [\f\*[B-Font]RSA\f[] | \f\*[B-Font]DSA\f[]]
-Generate a new sign key of the designated type,
-obsoleting any that may exist.
-By default, the program uses the host key as the sign key.
+.NOP \f\*[B-Font]\-P\f[] \f\*[B-Font]\-\-pvt-cert\f[]
+Generate a new private certificate used by the
+\f\*[B-Font]PC\f[]
+identity scheme.
+By default, the program generates public certificates.
+Note: the PC identity scheme is not recommended for new installations.
.TP 7
-.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]name\f[]
-Set the issuer name to
-\f\*[I-Font]name\f[].
-This is used for the issuer field in certificates
-and in the file name for identity files.
+.NOP \f\*[B-Font]\-q\f[] \f\*[B-Font]\-\-export-passwd\f[]= \f\*[I-Font]passwd\f[]
+Set the password for writing encrypted
+\f\*[B-Font]IFF\f[], \f\*[B-Font]GQ\f[] \f\*[B-Font]and\f[] \f\*[B-Font]MV\f[]
+identity files redirected to
+\fIstdout\f[]
+to
+\f\*[I-Font]passwd\f[].
+In effect, these files are decrypted with the
+\f\*[B-Font]\-p\f[]
+password, then encrypted with the
+\f\*[B-Font]\-q\f[]
+password.
+By default, the password is the string returned by the Unix
+\f\*[B-Font]hostname\f[]
+command.
.TP 7
-.NOP \f\*[B-Font]\-T\f[]
+.NOP \f\*[B-Font]\-s\f[] \f\*[B-Font]\-\-subject-key\f[]= [host] [@@ \f\*[I-Font]group\f[]]
+Specify the Autokey host name, where
+\f\*[I-Font]host\f[]
+is the optional host name and
+\f\*[I-Font]group\f[]
+is the optional group name.
+The host name, and if provided, group name are used in
+\f\*[I-Font]host\f[] \f\*[I-Font]@@\f[] \f\*[I-Font]group\f[]
+form as certificate subject and issuer.
+Specifying
+\f\*[B-Font]\-s\f[] \f\*[B-Font]\-@@\f[] \f\*[I-Font]group\f[]
+is allowed, and results in leaving the host name unchanged, as with
+\f\*[B-Font]\-i\f[] \f\*[I-Font]group\f[].
+The group name, or if no group is provided, the host name are also used in the
+file names of
+\f\*[B-Font]IFF\f[], \f\*[B-Font]GQ\f[],
+and
+\f\*[B-Font]MV\f[]
+identity scheme client parameter files.
+If
+\f\*[I-Font]host\f[]
+is not specified, the default host name is the string returned by the Unix
+\f\*[B-Font]hostname\f[]
+command.
+.TP 7
+.NOP \f\*[B-Font]\-S\f[] \f\*[B-Font]\-\-sign-key\f[]= [\f\*[B-Font]RSA\f[] | \f\*[B-Font]DSA\f[]]
+Generate a new encrypted public/private sign key file of the specified type.
+By default, the sign key is the host key and has the same type.
+If compatibility with FIPS 140-2 is required, the sign key type must be
+\f\*[B-Font]DSA\f[].
+.TP 7
+.NOP \f\*[B-Font]\-T\f[] \f\*[B-Font]\-\-trusted-cert\f[]
Generate a trusted certificate.
By default, the program generates a non-trusted certificate.
.TP 7
-.NOP \f\*[B-Font]\-V\f[] \f\*[I-Font]nkeys\f[]
-Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+.NOP \f\*[B-Font]\-V\f[] \f\*[B-Font]\-\-mv-params\f[] \f\*[I-Font]nkeys\f[]
+Generate
+\f\*[I-Font]nkeys\f[]
+encrypted server keys and parameters for the Mu-Varadharajan (MV)
+identity scheme.
+This option is mutually exclusive with the
+\f\*[B-Font]\-I\f[]
+and
+\f\*[B-Font]\-G\f[]
+options.
+Note: support for this option should be considered a work in progress.
.PP
.SS Random Seed File
All cryptographically sound key generation schemes must have means
@@ -852,7 +934,7 @@ but are outside the scope of this page.
The entropy seed used by the OpenSSL library is contained in a file,
usually called
-\f\*[B-Font].rnd\f[],
+\fI.rnd\f[],
which must be available when starting the NTP daemon
or the
\f\*[B-Font]ntp-keygen\fP
@@ -875,48 +957,131 @@ If the
RANDFILE
environment variable is not present,
the library will look for the
-\f\*[B-Font].rnd\f[]
+\fI.rnd\f[]
file in the user home directory.
+Since both the
+\f\*[B-Font]ntp-keygen\fP
+program and
+\fCntpd\f[]\fR(1ntpdmdoc)\f[]
+daemon must run as root, the logical place to put this file is in
+\fI/.rnd\f[]
+or
+\fI/root/.rnd\f[].
If the file is not available or cannot be written,
the daemon exits with a message to the system log and the program
exits with a suitable error message.
.SS Cryptographic Data Files
-All other file formats begin with two lines.
-The first contains the file name, including the generated host name
-and filestamp.
-The second contains the datestamp in conventional Unix date format.
-Lines beginning with # are considered comments and ignored by the
+All file formats begin with two nonencrypted lines.
+The first line contains the file name, including the generated host name
+and filestamp, in the format
+\fIntpkey_\f[]\f\*[I-Font]key\f[] \f\*[I-Font]_\f[] \f\*[I-Font]name\f[]. \f\*[I-Font]filestamp\f[],
+where
+\f\*[I-Font]key\f[]
+is the key or parameter type,
+\f\*[I-Font]name\f[]
+is the host or group name and
+\f\*[I-Font]filestamp\f[]
+is the filestamp (NTP seconds) when the file was created.
+By convention,
+\f\*[I-Font]key\f[]
+names in generated file names include both upper and lower case
+characters, while
+\f\*[I-Font]key\f[]
+names in generated link names include only lower case characters.
+The filestamp is not used in generated link names.
+The second line contains the datestamp in conventional Unix
+\fIdate\f[]
+format.
+Lines beginning with
+\[oq]#\[cq]
+are considered comments and ignored by the
\f\*[B-Font]ntp-keygen\fP
program and
\fCntpd\f[]\fR(1ntpdmdoc)\f[]
daemon.
-Cryptographic values are encoded first using ASN.1 rules,
-then encrypted if necessary, and finally written PEM-encoded
-printable ASCII format preceded and followed by MIME content identifier lines.
.sp \n(Ppu
.ne 2
-The format of the symmetric keys file is somewhat different
-than the other files in the interest of backward compatibility.
-Since DES-CBC is deprecated in NTPv4, the only key format of interest
-is MD5 alphanumeric strings.
-Following hte heard the keys are
-entered one per line in the format
+The remainder of the file contains cryptographic data, encoded first using ASN.1
+rules, then encrypted if necessary, and finally written in PEM-encoded
+printable ASCII text, preceded and followed by MIME content identifier lines.
+.sp \n(Ppu
+.ne 2
+
+The format of the symmetric keys file, ordinarily named
+\fIntp.keys\f[],
+is somewhat different than the other files in the interest of backward compatibility.
+Ordinarily, the file is generated by this program, but it can be constructed
+and edited using an ordinary text editor.
+.br
+.in +4
+.nf
+# ntpkey_MD5key_bk.ntp.org.3595864945
+# Thu Dec 12 19:22:25 2013
+1 MD5 L";Nw<\`.I<f4U0)247"i # MD5 key
+2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key
+3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key
+4 MD5 Yue:tL[+vR)M\`n~bY,'? # MD5 key
+5 MD5 B;fx'Kgr/&4ZTbL6=RxA # MD5 key
+6 MD5 4eYwa\`o}3i@@@@V@@..R9!l # MD5 key
+7 MD5 \`A.([h+;wTQ|xfi%Sn_! # MD5 key
+8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key
+9 MD5 3-5vcn*6l29DS?Xdsg)* # MD5 key
+10 MD5 2late4Me # MD5 key
+11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key
+12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key
+13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key
+14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key
+15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key
+16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key
+17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key
+18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key
+19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key
+20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key
+.in -4
+.fi
+.in +4
+Figure 1. Typical Symmetric Key File
+.in -4
+.sp \n(Ppu
+.ne 2
+
+Figure 1 shows a typical symmetric keys file used by the reference
+implementation.
+Following the header the keys are entered one per line in the format
.in +4
\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[]
.in -4
where
\f\*[I-Font]keyno\f[]
-is a positive integer in the range 1-65,535,
+is a positive integer in the range 1-65534;
\f\*[I-Font]type\f[]
-is the string MD5 defining the key format and
+is the key type for the message digest algorithm, which in the absence of the
+OpenSSL library must be
+\f\*[B-Font]MD5\f[]
+to designate the MD5 message digest algorithm;
+if the OpenSSL library is installed, the key type can be any
+message digest algorithm supported by that library;
+however, if compatibility with FIPS 140-2 is required,
+the key type must be either
+\f\*[B-Font]SHA\f[]
+or
+\f\*[B-Font]SHA1\f[];
\f\*[I-Font]key\f[]
is the key itself,
-which is a printable ASCII string 16 characters or less in length.
-Each character is chosen from the 93 printable characters
-in the range 0x21 through 0x7f excluding space and the
+which is a printable ASCII string 20 characters or less in length:
+each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7e (
+\[oq]\[cq]!
+through
+\[oq]~\[cq]
+\&) excluding space and the
+\[oq]#\[cq]
+character, and terminated by whitespace or a
\[oq]#\[cq]
character.
+An OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which
+is truncated as necessary.
.sp \n(Ppu
.ne 2
@@ -933,8 +1098,8 @@ in human readable ASCII format.
The
\f\*[B-Font]ntp-keygen\fP
-program generates a MD5 symmetric keys file
-\fIntpkey_MD5key_\f[]\f\*[I-Font]hostname.filestamp\f[].
+program generates a symmetric keys file
+\fIntpkey_MD5key_\f[]\f\*[I-Font]hostname\f[]. \f\*[I-Font]filestamp\f[].
Since the file contains private shared keys,
it should be visible only to root and distributed by secure means
to other subnet hosts.
@@ -973,10 +1138,10 @@ The number of bits in the identity modulus. The default is 256.
certificate scheme.
.sp
scheme is one of
-RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+RSA-MD2, RSA-MD5, RSA-MDC2, RSA-SHA, RSA-SHA1, RSA-RIPEMD160,
DSA-SHA, or DSA-SHA1.
.sp
-Select the certificate message digest/signature encryption scheme.
+Select the certificate signature encryption/message digest scheme.
Note that RSA schemes must be used with a RSA sign key and DSA
schemes must be used with a DSA sign key. The default without
this option is RSA-MD5.
@@ -986,7 +1151,7 @@ privatekey cipher.
.sp
Select the cipher which is used to encrypt the files containing
private keys. The default is three-key triple DES in CBC mode,
-equivalent to "@code{-C des-ede3-cbc". The openssl tool lists ciphers
+equivalent to "\fB-C des-ede3-cbc\fP". The openssl tool lists ciphers
available in "\fBopenssl \-h\fP" output.
.TP
.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
@@ -1003,8 +1168,9 @@ This option takes an integer number as its argument.
.NOP \f\*[B-Font]\-e\f[], \f\*[B-Font]\-\-id\-key\f[]
Write IFF or GQ identity keys.
.sp
-Write the IFF or GQ client keys to the standard output. This is
-intended for automatic key distribution by mail.
+Write the public parameters from the IFF or GQ client keys to
+the standard output.
+This is intended for automatic key distribution by email.
.TP
.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-gq\-params\f[]
Generate GQ parameters and keys.
@@ -1030,11 +1196,11 @@ 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 \fB-i/--ident\fP or
-using \fB-s/--subject-name\fP following an '\fB@\fP' character,
-is also a part of the self-signed host certificate's subject and
-issuer names in the form \fBhost@group\fP and should match the
-'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
-\fBntpd\fP's configuration file.
+using \fB-s/--subject-name\fP following an '\fB@@\fP' character,
+is also a part of the self-signed host certificate subject and
+issuer names in the form \fBhost@@group\fP and should match the
+'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in the
+\fBntpd\fP configuration file.
.TP
.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]lifetime\f[], \f\*[B-Font]\-\-lifetime\f[]=\f\*[I-Font]lifetime\f[]
set certificate lifetime.
@@ -1042,13 +1208,8 @@ This option takes an integer number as its argument.
.sp
Set the certificate expiration to lifetime days from now.
.TP
-.NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-md5key\f[]
-generate MD5 keys.
-.sp
-Generate MD5 keys, obsoleting any that may exist.
-.TP
.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]modulus\f[], \f\*[B-Font]\-\-modulus\f[]=\f\*[I-Font]modulus\f[]
-modulus.
+prime modulus.
This option takes an integer number as its argument.
The value of
\f\*[I-Font]modulus\f[]
@@ -1062,6 +1223,11 @@ in the range 256 through 2048
.sp
The number of bits in the prime modulus. The default is 512.
.TP
+.NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-md5key\f[]
+generate symmetric keys.
+.sp
+Generate symmetric keys, obsoleting any that may exist.
+.TP
.NOP \f\*[B-Font]\-P\f[], \f\*[B-Font]\-\-pvt\-cert\f[]
generate PC private certificate.
.sp
@@ -1086,27 +1252,27 @@ The same password must be specified to the remote ntpd via the
"crypto pw password" configuration command. See also the option
--id-key (-e) for unencrypted exports.
.TP
-.NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]sign\f[], \f\*[B-Font]\-\-sign\-key\f[]=\f\*[I-Font]sign\f[]
-generate sign key (RSA or DSA).
-.sp
-Generate a new sign key of the designated type, obsoleting any
-that may exist. By default, the program uses the host key as the
-sign key.
-.TP
.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]host@group\f[], \f\*[B-Font]\-\-subject\-name\f[]=\f\*[I-Font]host@group\f[]
set host and optionally group name.
.sp
Set the Autokey host name, and optionally, group name specified
-following an '\fB@\fP' character. The host name is used in the file
+following an '\fB@@\fP' 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 \fBhost@group\fP form for the host certificate's subject and issuer
-fields. Specifying '\fB-s @group\fP' is allowed, and results in
-leaving the host name unchanged while appending \fB@group\fP to the
+in \fBhost@@group\fP form for the host certificate subject and issuer
+fields. Specifying '\fB-s @@group\fP' is allowed, and results in
+leaving the host name unchanged while appending \fB@@group\fP to the
subject and issuer fields, as with \fB-i group\fP. 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.
.TP
+.NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]sign\f[], \f\*[B-Font]\-\-sign\-key\f[]=\f\*[I-Font]sign\f[]
+generate sign key (RSA or DSA).
+.sp
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
+.TP
.NOP \f\*[B-Font]\-T\f[], \f\*[B-Font]\-\-trusted\-cert\f[]
trusted certificate (TC scheme).
.sp
@@ -1162,18 +1328,6 @@ The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
If any of these are directories, then the file \fI.ntprc\fP
is searched for within those directories.
.SH USAGE
-The
-\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
-option specifies the write password and
-\f\*[B-Font]\-q\f[] \f\*[I-Font]password\f[]
-option the read password for previously encrypted files.
-The
-\f\*[B-Font]ntp-keygen\fP
-program prompts for the password if it reads an encrypted file
-and the password is missing or incorrect.
-If an encrypted file is read successfully and
-no write password is specified, the read password is used
-as the write password by default.
.SH "ENVIRONMENT"
See \fBOPTION PRESETS\fP for configuration environment variables.
.SH "FILES"
@@ -1200,10 +1354,7 @@ The University of Delaware and Network Time Foundation
Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH BUGS
-It can take quite a while to generate some cryptographic values,
-from one to several minutes with modern architectures
-such as UltraSPARC and up to tens of minutes to an hour
-with older architectures such as SPARC IPC.
+It can take quite a while to generate some cryptographic values.
.sp \n(Ppu
.ne 2
diff --git a/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc b/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc
index e20d55d..ba21087 100644
--- a/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc
+++ b/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc
@@ -1,9 +1,9 @@
-.Dd March 21 2017
+.Dd February 27 2018
.Dt NTP_KEYGEN 1ntp-keygenmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
.\"
-.\" It has been AutoGen-ed March 21, 2017 at 10:45:59 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed February 27, 2018 at 05:16:00 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -21,26 +21,29 @@ All arguments must be options.
.Sh DESCRIPTION
This program generates cryptographic data files used by the NTPv4
authentication and identification schemes.
-It generates MD5 key files used in symmetric key cryptography.
-In addition, if the OpenSSL software library has been installed,
-it generates keys, certificate and identity files used in public key
-cryptography.
+It can generate message digest keys used in symmetric key cryptography and,
+if the OpenSSL software library has been installed, it can generate host keys,
+signing keys, certificates, and identity keys and parameters used in Autokey
+public key cryptography.
These files are used for cookie encryption,
-digital signature and challenge/response identification algorithms
+digital signature, and challenge/response identification algorithms
compatible with the Internet standard security infrastructure.
.Pp
-All files are in PEM\-encoded printable ASCII format,
-so they can be embedded as MIME attachments in mail to other sites
+The message digest symmetric keys file is generated in a format
+compatible with NTPv3.
+All other files are in PEM\-encoded printable ASCII format,
+so they can be embedded as MIME attachments in email to other sites
and certificate authorities.
By default, files are not encrypted.
.Pp
-When used to generate message digest keys, the program produces a file
-containing ten pseudo\-random printable ASCII strings suitable for the
-MD5 message digest algorithm included in the distribution.
+When used to generate message digest symmetric keys, the program
+produces a file containing ten pseudo\-random printable ASCII strings
+suitable for the MD5 message digest algorithm included in the
+distribution.
If the OpenSSL library is installed, it produces an additional ten
-hex\-encoded random bit strings suitable for the SHA1 and other message
-digest algorithms.
-The message digest keys file must be distributed and stored
+hex\-encoded random bit strings suitable for SHA1, AES\-128\-CMAC, and
+other message digest algorithms.
+The message digest symmetric keys file must be distributed and stored
using secure means beyond the scope of NTP itself.
Besides the keys used for ordinary NTP associations, additional keys
can be defined as passwords for the
@@ -60,219 +63,131 @@ other than Autokey.
Some files used by this program are encrypted using a private password.
The
.Fl p
-option specifies the password for local encrypted files and the
+option specifies the read password for local encrypted files and the
.Fl q
-option the password for encrypted files sent to remote sites.
+option the write password for encrypted files sent to remote sites.
If no password is specified, the host name returned by the Unix
-.Fn gethostname
-function, normally the DNS name of the host is used.
+.Xr hostname 1
+command, normally the DNS name of the host, is used as the the default read
+password, for convenience.
+The
+.Nm
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
.Pp
The
-.Ar pw
+.Cm pw
option of the
-.Ar crypto
+.Ic crypto
+.Xr ntpd 1ntpdmdoc
configuration command specifies the read
password for previously encrypted local files.
-This must match the local password used by this program.
+This must match the local read password used by this program.
If not specified, the host name is used.
-Thus, if files are generated by this program without password,
+Thus, if files are generated by this program without an explicit password,
they can be read back by
-.Ar ntpd
-without password but only on the same host.
+.Xr ntpd 1ntpdmdoc
+without specifying an explicit password but only on the same host.
+If the write password used for encryption is specified as the host name,
+these files can be read by that host with no explicit password.
.Pp
Normally, encrypted files for each host are generated by that host and
used only by that host, although exceptions exist as noted later on
this page.
The symmetric keys file, normally called
-.Ar ntp.keys ,
+.Pa ntp.keys ,
is usually installed in
.Pa /etc .
Other files and links are usually installed in
.Pa /usr/local/etc ,
which is normally in a shared filesystem in
NFS\-mounted networks and cannot be changed by shared clients.
-The location of the keys directory can be changed by the
-.Ar keysdir
-configuration command in such cases.
-Normally, this is in
-.Pa /etc .
+In these cases, NFS clients can specify the files in another
+directory such as
+.Pa /etc
+using the
+.Ic keysdir
+.Xr ntpd 1ntpdmdoc
+configuration file command.
.Pp
This program directs commentary and error messages to the standard
error stream
-.Ar stderr
+.Pa stderr
and remote files to the standard output stream
-.Ar stdout
+.Pa stdout
where they can be piped to other applications or redirected to files.
The names used for generated files and links all begin with the
string
-.Ar ntpkey
+.Pa ntpkey\&*
and include the file type, generating host and filestamp,
as described in the
-.Dq Cryptographic Data Files
+.Sx "Cryptographic Data Files"
section below.
.Ss Running the Program
-To test and gain experience with Autokey concepts, log in as root and
-change to the keys directory, usually
-.Pa /usr/local/etc
-When run for the first time, or if all files with names beginning with
-.Ar ntpkey
-have been removed, use the
-.Nm
-command without arguments to generate a
-default RSA host key and matching RSA\-MD5 certificate with expiration
-date one year hence.
-If run again without options, the program uses the
-existing keys and parameters and generates only a new certificate with
-new expiration date one year hence.
-.Pp
-Run the command on as many hosts as necessary.
-Designate one of them as the trusted host (TH) using
-.Nm
-with the
-.Fl T
-option and configure it to synchronize from reliable Internet servers.
-Then configure the other hosts to synchronize to the TH directly or
-indirectly.
-A certificate trail is created when Autokey asks the immediately
-ascendant host towards the TH to sign its certificate, which is then
-provided to the immediately descendant host on request.
-All group hosts should have acyclic certificate trails ending on the TH.
-.Pp
-The host key is used to encrypt the cookie when required and so must be
-RSA type.
-By default, the host key is also the sign key used to encrypt
-signatures.
-A different sign key can be assigned using the
-.Fl S
-option and this can be either RSA or DSA type.
-By default, the signature
-message digest type is MD5, but any combination of sign key type and
-message digest type supported by the OpenSSL library can be specified
-using the
-.Fl c
-option.
-The rules say cryptographic media should be generated with proventic
-filestamps, which means the host should already be synchronized before
-this program is run.
-This of course creates a chicken\-and\-egg problem
-when the host is started for the first time.
-Accordingly, the host time
-should be set by some other means, such as eyeball\-and\-wristwatch, at
-least so that the certificate lifetime is within the current year.
-After that and when the host is synchronized to a proventic source, the
-certificate should be re\-generated.
-.Pp
-Additional information on trusted groups and identity schemes is on the
-.Dq Autokey Public\-Key Authentication
-page.
-.Pp
-The
-.Xr ntpd 1ntpdmdoc
-configuration command
-.Ic crypto pw Ar password
-specifies the read password for previously encrypted files.
-The daemon expires on the spot if the password is missing
-or incorrect.
-For convenience, if a file has been previously encrypted,
-the default read password is the name of the host running
-the program.
-If the previous write password is specified as the host name,
-these files can be read by that host with no explicit password.
-.Pp
-File names begin with the prefix
-.Cm ntpkey_
-and end with the postfix
-.Ar _hostname.filestamp ,
-where
-.Ar hostname
-is the owner name, usually the string returned
-by the Unix gethostname() routine, and
-.Ar filestamp
-is the NTP seconds when the file was generated, in decimal digits.
-This both guarantees uniqueness and simplifies maintenance
-procedures, since all files can be quickly removed
-by a
-.Ic rm ntpkey\&*
-command or all files generated
-at a specific time can be removed by a
-.Ic rm
-.Ar \&*filestamp
-command.
-To further reduce the risk of misconfiguration,
-the first two lines of a file contain the file name
-and generation date and time as comments.
-.Pp
-All files are installed by default in the keys directory
-.Pa /usr/local/etc ,
-which is normally in a shared filesystem
-in NFS\-mounted networks.
-The actual location of the keys directory
-and each file can be overridden by configuration commands,
-but this is not recommended.
-Normally, the files for each host are generated by that host
-and used only by that host, although exceptions exist
-as noted later on this page.
-.Pp
-Normally, files containing private values,
-including the host key, sign key and identification parameters,
-are permitted root read/write\-only;
-while others containing public values are permitted world readable.
-Alternatively, files containing private values can be encrypted
-and these files permitted world readable,
-which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
-dependent clients can all be installed in the same shared directory.
-.Pp
-The recommended practice is to keep the file name extensions
-when installing a file and to install a soft link
-from the generic names specified elsewhere on this page
-to the generated files.
-This allows new file generations to be activated simply
-by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
-If a link is not present,
-.Xr ntpd 1ntpdmdoc
-extracts the filestamp from the file itself.
-This allows clients to verify that the file and generation times
-are always current.
-The
-.Nm
-program uses the same timestamp extension for all files generated
-at one time, so each generation is distinct and can be readily
-recognized in monitoring data.
-.Ss Running the program
The safest way to run the
.Nm
program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
+The recommended procedure is change to the
+.Ar keys
+directory, usually
.Pa /usr/local/etc ,
then run the program.
-When run for the first time,
-or if all
-.Cm ntpkey
-files have been removed,
-the program generates a RSA host key file and matching RSA\-MD5 certificate file,
+.Pp
+To test and gain experience with Autokey concepts, log in as root and
+change to the
+.Ar keys
+directory, usually
+.Pa /usr/local/etc .
+When run for the first time, or if all files with names beginning with
+.Pa ntpkey\&*
+have been removed, use the
+.Nm
+command without arguments to generate a default
+.Cm RSA
+host key and matching
+.Cm RSA\-MD5
+certificate file with expiration date one year hence,
which is all that is necessary in many cases.
The program also generates soft links from the generic names
to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+If run again without options, the program uses the
+existing keys and parameters and generates a new certificate file with
+new expiration date one year hence, and soft link.
.Pp
-The host key is used to encrypt the cookie when required and so must be RSA type.
+The host key is used to encrypt the cookie when required and so must be
+.Cm RSA
+type.
By default, the host key is also the sign key used to encrypt signatures.
When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
+either
+.Cm RSA
+or
+.Cm DSA
+type.
+By default, the message digest type is
+.Cm MD5 ,
+but any combination
of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
+can be specified, including those using the
+.Cm AES128CMAC , MD2 , MD5 , MDC2 , SHA , SHA1
+and
+.Cm RIPE160
+message digest algorithms.
However, the scheme specified in the certificate must be compatible
with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Certificates using any digest algorithm are compatible with
+.Cm RSA
+sign keys;
+however, only
+.Cm SHA
+and
+.Cm SHA1
+certificates are compatible with
+.Cm DSA
+sign keys.
.Pp
Private/public key files and certificates are compatible with
other OpenSSL applications and very likely other libraries as well.
@@ -283,19 +198,19 @@ However, the identification parameter files, although encoded
as the other files, are probably not compatible with anything other than Autokey.
.Pp
Running the program as other than root and using the Unix
-.Ic su
+.Xr su 1
command
to assume root may not work properly, since by default the OpenSSL library
looks for the random seed file
-.Cm .rnd
+.Pa .rnd
in the user home directory.
However, there should be only one
-.Cm .rnd ,
+.Pa .rnd ,
most conveniently
in the root directory, so it is convenient to define the
-.Cm $RANDFILE
+.Ev RANDFILE
environment variable used by the OpenSSL library as the path to
-.Cm /.rnd .
+.Pa .rnd .
.Pp
Installing the keys as root might not work in NFS\-mounted
shared file systems, as NFS clients may not be able to write
@@ -305,7 +220,8 @@ directory such as
.Pa /etc
using the
.Ic keysdir
-command.
+.Xr ntpd 1ntpdmdoc
+configuration file command.
There is no need for one client to read the keys and certificates
of other clients or servers, as these data are obtained automatically
by the Autokey protocol.
@@ -338,8 +254,11 @@ while others containing public values are permitted world readable.
Alternatively, files containing private values can be encrypted
and these files permitted world readable,
which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
+Since uniqueness is insured by the
+.Ar hostname
+and
+.Ar filestamp
+file name extensions, the files for an NTP server and
dependent clients can all be installed in the same shared directory.
.Pp
The recommended practice is to keep the file name extensions
@@ -348,106 +267,111 @@ from the generic names specified elsewhere on this page
to the generated files.
This allows new file generations to be activated simply
by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
+If a link is present,
+.Xr ntpd 1ntpdmdoc
+follows it to the file name to extract the
+.Ar filestamp .
If a link is not present,
.Xr ntpd 1ntpdmdoc
-extracts the filestamp from the file itself.
+extracts the
+.Ar filestamp
+from the file itself.
This allows clients to verify that the file and generation times
are always current.
The
.Nm
-program uses the same timestamp extension for all files generated
+program uses the same
+.Ar filestamp
+extension for all files generated
at one time, so each generation is distinct and can be readily
recognized in monitoring data.
-.Ss Running the program
-The safest way to run the
+.Pp
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
.Nm
-program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
-.Pa /usr/local/etc ,
-then run the program.
-When run for the first time,
-or if all
-.Cm ntpkey
-files have been removed,
-the program generates a RSA host key file and matching RSA\-MD5 certificate file,
-which is all that is necessary in many cases.
-The program also generates soft links from the generic names
-to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+with the
+.Fl T
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
.Pp
-The host key is used to encrypt the cookie when required and so must be RSA type.
-By default, the host key is also the sign key used to encrypt signatures.
-When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
-of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
-However, the scheme specified in the certificate must be compatible
-with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+.Fl S
+option and this can be either
+.Cm RSA
+or
+.Cm DSA
+type.
+By default, the signature
+message digest type is
+.Cm MD5 ,
+but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+.Fl c
+option.
.Pp
-Private/public key files and certificates are compatible with
-other OpenSSL applications and very likely other libraries as well.
-Certificates or certificate requests derived from them should be compatible
-with extant industry practice, although some users might find
-the interpretation of X509v3 extension fields somewhat liberal.
-However, the identification parameter files, although encoded
-as the other files, are probably not compatible with anything other than Autokey.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken\-and\-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball\-and\-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re\-generated.
.Pp
-Running the program as other than root and using the Unix
-.Ic su
-command
-to assume root may not work properly, since by default the OpenSSL library
-looks for the random seed file
-.Cm .rnd
-in the user home directory.
-However, there should be only one
-.Cm .rnd ,
-most conveniently
-in the root directory, so it is convenient to define the
-.Cm $RANDFILE
-environment variable used by the OpenSSL library as the path to
-.Cm /.rnd .
+Additional information on trusted groups and identity schemes is on the
+.Dq Autokey Public\-Key Authentication
+page.
.Pp
-Installing the keys as root might not work in NFS\-mounted
-shared file systems, as NFS clients may not be able to write
-to the shared keys directory, even as root.
-In this case, NFS clients can specify the files in another
-directory such as
-.Pa /etc
-using the
-.Ic keysdir
+File names begin with the prefix
+.Pa ntpkey Ns _
+and end with the suffix
+.Pa _ Ns Ar hostname . Ar filestamp ,
+where
+.Ar hostname
+is the owner name, usually the string returned
+by the Unix
+.Xr hostname 1
+command, and
+.Ar filestamp
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+.Ic rm Pa ntpkey\&*
+command or all files generated
+at a specific time can be removed by a
+.Ic rm Pa \&* Ns Ar filestamp
command.
-There is no need for one client to read the keys and certificates
-of other clients or servers, as these data are obtained automatically
-by the Autokey protocol.
-.Pp
-Ordinarily, cryptographic files are generated by the host that uses them,
-but it is possible for a trusted agent (TA) to generate these files
-for other hosts; however, in such cases files should always be encrypted.
-The subject name and trusted name default to the hostname
-of the host generating the files, but can be changed by command line options.
-It is convenient to designate the owner name and trusted name
-as the subject and issuer fields, respectively, of the certificate.
-The owner name is also used for the host and sign key files,
-while the trusted name is used for the identity files.
-seconds.
-seconds.
-s Trusted Hosts and Groups
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+.Ss Trusted Hosts and Groups
Each cryptographic configuration involves selection of a signature scheme
and identification scheme, called a cryptotype,
as explained in the
.Sx Authentication Options
section of
.Xr ntp.conf 5 .
-The default cryptotype uses RSA encryption, MD5 message digest
-and TC identification.
+The default cryptotype uses
+.Cm RSA
+encryption,
+.Cm MD5
+message digest
+and
+.Cm TC
+identification.
First, configure a NTP subnet including one or more low\-stratum
trusted hosts from which all other hosts derive synchronization
directly or indirectly.
@@ -465,7 +389,7 @@ section of
.Pp
On each trusted host as root, change to the keys directory.
To insure a fresh fileset, remove all
-.Cm ntpkey
+.Pa ntpkey
files.
Then run
.Nm
@@ -490,7 +414,9 @@ is either
.Cm RSA
or
.Cm DSA .
-The most often need to do this is when a DSA\-signed certificate is used.
+The most frequent need to do this is when a
+.Cm DSA Ns \-signed
+certificate is used.
If it is necessary to use a different certificate scheme than the default,
run
.Nm
@@ -499,17 +425,17 @@ with the
option and selected
.Ar scheme
as needed.
-f
+If
.Nm
is run again without these options, it generates a new certificate
-using the same scheme and sign key.
+using the same scheme and sign key, and soft link.
.Pp
After setting up the environment it is advisable to update certificates
from time to time, if only to extend the validity interval.
Simply run
.Nm
with the same flags as before to generate new certificates
-using existing keys.
+using existing keys, and soft links.
However, if the host or sign key is changed,
.Xr ntpd 1ntpdmdoc
should be restarted.
@@ -520,13 +446,15 @@ Other dependent hosts will continue as usual until signatures are refreshed,
at which time the protocol is restarted.
.Ss Identity Schemes
As mentioned on the Autonomous Authentication page,
-the default TC identity scheme is vulnerable to a middleman attack.
+the default
+.Cm TC
+identity scheme is vulnerable to a middleman attack.
However, there are more secure identity schemes available,
-including PC, IFF, GQ and MV described on the
-.Qq Identification Schemes
-page
-(maybe available at
-.Li http://www.eecis.udel.edu/%7emills/keygen.html ) .
+including
+.Cm PC , IFF , GQ
+and
+.Cm MV
+schemes described below.
These schemes are based on a TA, one or more trusted hosts
and some number of nontrusted hosts.
Trusted hosts prove identity using values provided by the TA,
@@ -551,12 +479,15 @@ On trusted host alice run
.Fl P
.Fl p Ar password
to generate the host key file
-.Pa ntpkey_RSAkey_ Ns Ar alice.filestamp
+.Pa ntpkey Ns _ Cm RSA Pa key_alice. Ar filestamp
and trusted private certificate file
-.Pa ntpkey_RSA\-MD5_cert_ Ns Ar alice.filestamp .
+.Pa ntpkey Ns _ Cm RSA\-MD5 _ Pa cert_alice. Ar filestamp ,
+and soft links.
Copy both files to all group hosts;
they replace the files which would be generated in other schemes.
-On each host bob install a soft link from the generic name
+On each host
+.Ar bob
+install a soft link from the generic name
.Pa ntpkey_host_ Ns Ar bob
to the host key file and soft link
.Pa ntpkey_cert_ Ns Ar bob
@@ -565,26 +496,34 @@ Note the generic links are on bob, but point to files generated
by trusted host alice.
In this scheme it is not possible to refresh
either the keys or certificates without copying them
-to all other hosts in the group.
+to all other hosts in the group, and recreating the soft links.
.Pp
-For the IFF scheme proceed as in the TC scheme to generate keys
+For the
+.Cm IFF
+scheme proceed as in the
+.Cm TC
+scheme to generate keys
and certificates for all group hosts, then for every trusted host in the group,
-generate the IFF parameter file.
+generate the
+.Cm IFF
+parameter file.
On trusted host alice run
.Nm
.Fl T
.Fl I
.Fl p Ar password
to produce her parameter file
-.Pa ntpkey_IFFpar_ Ns Ar alice.filestamp ,
+.Pa ntpkey_IFFpar_alice. Ns Ar filestamp ,
which includes both server and client keys.
Copy this file to all group hosts that operate as both servers
and clients and install a soft link from the generic
-.Pa ntpkey_iff_ Ns Ar alice
+.Pa ntpkey_iff_alice
to this file.
If there are no hosts restricted to operate only as clients,
there is nothing further to do.
-As the IFF scheme is independent
+As the
+.Cm IFF
+scheme is independent
of keys and certificates, these files can be refreshed as needed.
.Pp
If a rogue client has the parameter file, it could masquerade
@@ -594,37 +533,53 @@ from the parameter file and distributed to all restricted clients.
After generating the parameter file, on alice run
.Nm
.Fl e
-and pipe the output to a file or mail program.
-Copy or mail this file to all restricted clients.
+and pipe the output to a file or email program.
+Copy or email this file to all restricted clients.
On these clients install a soft link from the generic
-.Pa ntpkey_iff_ Ns Ar alice
+.Pa ntpkey_iff_alice
to this file.
To further protect the integrity of the keys,
each file can be encrypted with a secret password.
.Pp
-For the GQ scheme proceed as in the TC scheme to generate keys
+For the
+.Cm GQ
+scheme proceed as in the
+.Cm TC
+scheme to generate keys
and certificates for all group hosts, then for every trusted host
-in the group, generate the IFF parameter file.
+in the group, generate the
+.Cm IFF
+parameter file.
On trusted host alice run
.Nm
.Fl T
.Fl G
.Fl p Ar password
to produce her parameter file
-.Pa ntpkey_GQpar_ Ns Ar alice.filestamp ,
+.Pa ntpkey_GQpar_alice. Ns Ar filestamp ,
which includes both server and client keys.
Copy this file to all group hosts and install a soft link
from the generic
-.Pa ntpkey_gq_ Ns Ar alice
+.Pa ntpkey_gq_alice
to this file.
-In addition, on each host bob install a soft link
+In addition, on each host
+.Ar bob
+install a soft link
from generic
.Pa ntpkey_gq_ Ns Ar bob
to this file.
-As the GQ scheme updates the GQ parameters file and certificate
+As the
+.Cm GQ
+scheme updates the
+.Cm GQ
+parameters file and certificate
at the same time, keys and certificates can be regenerated as needed.
.Pp
-For the MV scheme, proceed as in the TC scheme to generate keys
+For the
+.Cm MV
+scheme, proceed as in the
+.Cm TC
+scheme to generate keys
and certificates for all group hosts.
For illustration assume trish is the TA, alice one of several trusted hosts
and bob one of her clients.
@@ -636,9 +591,9 @@ where
.Ar n
is the number of revokable keys (typically 5) to produce
the parameter file
-.Pa ntpkeys_MVpar_ Ns Ar trish.filestamp
+.Pa ntpkeys_MVpar_trish. Ns Ar filestamp
and client key files
-.Pa ntpkeys_MVkeyd_ Ns Ar trish.filestamp
+.Pa ntpkeys_MVkey Ns Ar d _ Pa trish. Ar filestamp
where
.Ar d
is the key number (0 \&<
@@ -647,80 +602,217 @@ is the key number (0 \&<
.Ar n ) .
Copy the parameter file to alice and install a soft link
from the generic
-.Pa ntpkey_mv_ Ns Ar alice
+.Pa ntpkey_mv_alice
to this file.
Copy one of the client key files to alice for later distribution
to her clients.
-It doesn't matter which client key file goes to alice,
+It does not matter which client key file goes to alice,
since they all work the same way.
-Alice copies the client key file to all of her cliens.
+Alice copies the client key file to all of her clients.
On client bob install a soft link from generic
-.Pa ntpkey_mvkey_ Ns Ar bob
+.Pa ntpkey_mvkey_bob
to the client key file.
-As the MV scheme is independent of keys and certificates,
+As the
+.Cm MV
+scheme is independent of keys and certificates,
these files can be refreshed as needed.
.Ss Command Line Options
.Bl -tag -width indent
-.It Fl c Ar scheme
-Select certificate message digest/signature encryption scheme.
+.It Fl b Fl \-imbits Ns = Ar modulus
+Set the number of bits in the identity modulus for generating identity keys to
+.Ar modulus
+bits.
+The number of bits in the identity modulus defaults to 256, but can be set to
+values from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+.It Fl c Fl \-certificate Ns = Ar scheme
+Select certificate signature encryption/message digest scheme.
The
.Ar scheme
can be one of the following:
-. Cm RSA\-MD2 , RSA\-MD5 , RSA\-SHA , RSA\-SHA1 , RSA\-MDC2 , RSA\-RIPEMD160 , DSA\-SHA ,
+.Cm RSA\-MD2 , RSA\-MD5 , RSA\-MDC2 , RSA\-SHA , RSA\-SHA1 , RSA\-RIPEMD160 , DSA\-SHA ,
or
.Cm DSA\-SHA1 .
-Note that RSA schemes must be used with a RSA sign key and DSA
-schemes must be used with a DSA sign key.
+Note that
+.Cm RSA
+schemes must be used with an
+.Cm RSA
+sign key and
+.Cm DSA
+schemes must be used with a
+.Cm DSA
+sign key.
The default without this option is
.Cm RSA\-MD5 .
-.It Fl d
-Enable debugging.
+If compatibility with FIPS 140\-2 is required, either the
+.Cm DSA\-SHA
+or
+.Cm DSA\-SHA1
+scheme must be used.
+.It Fl C Fl \-cipher Ns = Ar cipher
+Select the OpenSSL cipher to encrypt the files containing private keys.
+The default without this option is three\-key triple DES in CBC mode,
+.Cm des\-ede3\-cbc .
+The
+.Ic openssl Fl h
+command provided with OpenSSL displays available ciphers.
+.It Fl d Fl \-debug\-level
+Increase debugging verbosity level.
This option displays the cryptographic data produced in eye\-friendly billboards.
-.It Fl e
-Write the IFF client keys to the standard output.
-This is intended for automatic key distribution by mail.
-.It Fl G
-Generate parameters and keys for the GQ identification scheme,
-obsoleting any that may exist.
-.It Fl g
-Generate keys for the GQ identification scheme
-using the existing GQ parameters.
-If the GQ parameters do not yet exist, create them first.
-.It Fl H
-Generate new host keys, obsoleting any that may exist.
-.It Fl I
-Generate parameters for the IFF identification scheme,
-obsoleting any that may exist.
-.It Fl i Ar name
-Set the suject name to
-.Ar name .
-This is used as the subject field in certificates
-and in the file name for host and sign keys.
-.It Fl M
-Generate MD5 keys, obsoleting any that may exist.
-.It Fl P
-Generate a private certificate.
+.It Fl D Fl \-set\-debug\-level Ns = Ar level
+Set the debugging verbosity to
+.Ar level .
+This option displays the cryptographic data produced in eye\-friendly billboards.
+.It Fl e Fl \-id\-key
+Write the
+.Cm IFF
+or
+.Cm GQ
+public parameters from the
+.Ar IFFkey or GQkey
+client keys file previously specified
+as unencrypted data to the standard output stream
+.Pa stdout .
+This is intended for automatic key distribution by email.
+.It Fl G Fl \-gq\-params
+Generate a new encrypted
+.Cm GQ
+parameters and key file for the Guillou\-Quisquater (GQ) identity scheme.
+This option is mutually exclusive with the
+.Fl I
+and
+.Fl V
+options.
+.It Fl H Fl \-host\-key
+Generate a new encrypted
+.Cm RSA
+public/private host key file.
+.It Fl I Fl \-iffkey
+Generate a new encrypted
+.Cm IFF
+key file for the Schnorr (IFF) identity scheme.
+This option is mutually exclusive with the
+.Fl G
+and
+Fl V
+options.
+.It Fl i Fl \-ident Ns = Ar group
+Set the optional Autokey group name to
+.Ar group .
+This is used in the identity scheme parameter file names of
+.Cm IFF , GQ ,
+and
+.Cm MV
+client parameters files.
+In that role, the default is the host name if no group is provided.
+The group name, if specified using
+.Fl i
+or
+.Fl s
+following an
+.Ql @
+character, is also used in certificate subject and issuer names in the form
+.Ar host @ group
+and should match the group specified via
+.Ic crypto Cm ident
+or
+.Ic server Cm ident
+in the ntpd configuration file.
+.It Fl l Fl \-lifetime Ns = Ar days
+Set the lifetime for certificate expiration to
+.Ar days .
+The default lifetime is one year (365 days).
+.It Fl m Fl \-modulus Ns = Ar bits
+Set the number of bits in the prime modulus for generating files to
+.Ar bits .
+The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+.It Fl M Fl \-md5key
+Generate a new symmetric keys file containing 10
+.Cm MD5
+keys, and if OpenSSL is available, 10
+.Cm SHA
+keys.
+An
+.Cm MD5
+key is a string of 20 random printable ASCII characters, while a
+.Cm SHA
+key is a string of 40 random hex digits.
+The file can be edited using a text editor to change the key type or key content.
+This option is mutually exclusive with all other options.
+.It Fl p Fl \-password Ns = Ar passwd
+Set the password for reading and writing encrypted files to
+.Ar passwd .
+These include the host, sign and identify key files.
+By default, the password is the string returned by the Unix
+.Ic hostname
+command.
+.It Fl P Fl \-pvt\-cert
+Generate a new private certificate used by the
+.Cm PC
+identity scheme.
By default, the program generates public certificates.
-.It Fl p Ar password
-Encrypt generated files containing private data with
-.Ar password
-and the DES\-CBC algorithm.
-.It Fl q
-Set the password for reading files to password.
-.It Fl S Oo Cm RSA | DSA Oc
-Generate a new sign key of the designated type,
-obsoleting any that may exist.
-By default, the program uses the host key as the sign key.
-.It Fl s Ar name
-Set the issuer name to
-.Ar name .
-This is used for the issuer field in certificates
-and in the file name for identity files.
-.It Fl T
+Note: the PC identity scheme is not recommended for new installations.
+.It Fl q Fl \-export\-passwd Ns = Ar passwd
+Set the password for writing encrypted
+.Cm IFF , GQ and MV
+identity files redirected to
+.Pa stdout
+to
+.Ar passwd .
+In effect, these files are decrypted with the
+.Fl p
+password, then encrypted with the
+.Fl q
+password.
+By default, the password is the string returned by the Unix
+.Ic hostname
+command.
+.It Fl s Fl \-subject\-key Ns = Ar Oo host Oc Op @ Ar group
+Specify the Autokey host name, where
+.Ar host
+is the optional host name and
+.Ar group
+is the optional group name.
+The host name, and if provided, group name are used in
+.Ar host @ group
+form as certificate subject and issuer.
+Specifying
+.Fl s @ Ar group
+is allowed, and results in leaving the host name unchanged, as with
+.Fl i Ar group .
+The group name, or if no group is provided, the host name are also used in the
+file names of
+.Cm IFF , GQ ,
+and
+.Cm MV
+identity scheme client parameter files.
+If
+.Ar host
+is not specified, the default host name is the string returned by the Unix
+.Ic hostname
+command.
+.It Fl S Fl \-sign\-key Ns = Op Cm RSA | DSA
+Generate a new encrypted public/private sign key file of the specified type.
+By default, the sign key is the host key and has the same type.
+If compatibility with FIPS 140\-2 is required, the sign key type must be
+.Cm DSA .
+.It Fl T Fl \-trusted\-cert
Generate a trusted certificate.
By default, the program generates a non\-trusted certificate.
-.It Fl V Ar nkeys
-Generate parameters and keys for the Mu\-Varadharajan (MV) identification scheme.
+.It Fl V Fl \-mv\-params Ar nkeys
+Generate
+.Ar nkeys
+encrypted server keys and parameters for the Mu\-Varadharajan (MV)
+identity scheme.
+This option is mutually exclusive with the
+.Fl I
+and
+.Fl G
+options.
+Note: support for this option should be considered a work in progress.
.El
.Ss Random Seed File
All cryptographically sound key generation schemes must have means
@@ -744,14 +836,14 @@ but are outside the scope of this page.
.Pp
The entropy seed used by the OpenSSL library is contained in a file,
usually called
-.Cm .rnd ,
+.Pa .rnd ,
which must be available when starting the NTP daemon
or the
.Nm
program.
The NTP daemon will first look for the file
using the path specified by the
-.Ic randfile
+.Cm randfile
subcommand of the
.Ic crypto
configuration command.
@@ -767,44 +859,118 @@ If the
.Ev RANDFILE
environment variable is not present,
the library will look for the
-.Cm .rnd
+.Pa .rnd
file in the user home directory.
+Since both the
+.Nm
+program and
+.Xr ntpd 1ntpdmdoc
+daemon must run as root, the logical place to put this file is in
+.Pa /.rnd
+or
+.Pa /root/.rnd .
If the file is not available or cannot be written,
the daemon exits with a message to the system log and the program
exits with a suitable error message.
.Ss Cryptographic Data Files
-All other file formats begin with two lines.
-The first contains the file name, including the generated host name
-and filestamp.
-The second contains the datestamp in conventional Unix date format.
-Lines beginning with # are considered comments and ignored by the
+All file formats begin with two nonencrypted lines.
+The first line contains the file name, including the generated host name
+and filestamp, in the format
+.Pa ntpkey_ Ns Ar key _ Ar name . Ar filestamp ,
+where
+.Ar key
+is the key or parameter type,
+.Ar name
+is the host or group name and
+.Ar filestamp
+is the filestamp (NTP seconds) when the file was created.
+By convention,
+.Ar key
+names in generated file names include both upper and lower case
+characters, while
+.Ar key
+names in generated link names include only lower case characters.
+The filestamp is not used in generated link names.
+The second line contains the datestamp in conventional Unix
+.Pa date
+format.
+Lines beginning with
+.Ql #
+are considered comments and ignored by the
.Nm
program and
.Xr ntpd 1ntpdmdoc
daemon.
-Cryptographic values are encoded first using ASN.1 rules,
-then encrypted if necessary, and finally written PEM\-encoded
-printable ASCII format preceded and followed by MIME content identifier lines.
.Pp
-The format of the symmetric keys file is somewhat different
-than the other files in the interest of backward compatibility.
-Since DES\-CBC is deprecated in NTPv4, the only key format of interest
-is MD5 alphanumeric strings.
-Following hte heard the keys are
-entered one per line in the format
-.D1 Ar keyno type key
+The remainder of the file contains cryptographic data, encoded first using ASN.1
+rules, then encrypted if necessary, and finally written in PEM\-encoded
+printable ASCII text, preceded and followed by MIME content identifier lines.
+.Pp
+The format of the symmetric keys file, ordinarily named
+.Pa ntp.keys ,
+is somewhat different than the other files in the interest of backward compatibility.
+Ordinarily, the file is generated by this program, but it can be constructed
+and edited using an ordinary text editor.
+.Bd -literal -unfilled -offset center
+# ntpkey_MD5key_bk.ntp.org.3595864945
+# Thu Dec 12 19:22:25 2013
+1 MD5 L";Nw<\`.I<f4U0)247"i # MD5 key
+2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key
+3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key
+4 MD5 Yue:tL[+vR)M\`n~bY,'? # MD5 key
+5 MD5 B;fx'Kgr/&4ZTbL6=RxA # MD5 key
+6 MD5 4eYwa\`o}3i@@V@..R9!l # MD5 key
+7 MD5 \`A.([h+;wTQ|xfi%Sn_! # MD5 key
+8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key
+9 MD5 3\-5vcn*6l29DS?Xdsg)* # MD5 key
+10 MD5 2late4Me # MD5 key
+11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key
+12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key
+13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key
+14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key
+15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key
+16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key
+17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key
+18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key
+19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key
+20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key
+.Ed
+.D1 Figure 1. Typical Symmetric Key File
+.Pp
+Figure 1 shows a typical symmetric keys file used by the reference
+implementation.
+Following the header the keys are entered one per line in the format
+.D1 Ar keyno Ar type Ar key
where
.Ar keyno
-is a positive integer in the range 1\-65,535,
+is a positive integer in the range 1\-65534;
.Ar type
-is the string MD5 defining the key format and
+is the key type for the message digest algorithm, which in the absence of the
+OpenSSL library must be
+.Cm MD5
+to designate the MD5 message digest algorithm;
+if the OpenSSL library is installed, the key type can be any
+message digest algorithm supported by that library;
+however, if compatibility with FIPS 140\-2 is required,
+the key type must be either
+.Cm SHA
+or
+.Cm SHA1 ;
.Ar key
is the key itself,
-which is a printable ASCII string 16 characters or less in length.
-Each character is chosen from the 93 printable characters
-in the range 0x21 through 0x7f excluding space and the
+which is a printable ASCII string 20 characters or less in length:
+each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7e (
+.Ql !
+through
+.Ql ~
+\&) excluding space and the
+.Ql #
+character, and terminated by whitespace or a
.Ql #
character.
+An OpenSSL key consists of a hex\-encoded ASCII string of 40 characters, which
+is truncated as necessary.
.Pp
Note that the keys used by the
.Xr ntpq 1ntpqmdoc
@@ -817,8 +983,8 @@ in human readable ASCII format.
.Pp
The
.Nm
-program generates a MD5 symmetric keys file
-.Pa ntpkey_MD5key_ Ns Ar hostname.filestamp .
+program generates a symmetric keys file
+.Pa ntpkey_MD5key_ Ns Ar hostname Ns . Ns Ar filestamp .
Since the file contains private shared keys,
it should be visible only to root and distributed by secure means
to other subnet hosts.
@@ -856,10 +1022,10 @@ The number of bits in the identity modulus. The default is 256.
certificate scheme.
.sp
scheme is one of
-RSA\-MD2, RSA\-MD5, RSA\-SHA, RSA\-SHA1, RSA\-MDC2, RSA\-RIPEMD160,
+RSA\-MD2, RSA\-MD5, RSA\-MDC2, RSA\-SHA, RSA\-SHA1, RSA\-RIPEMD160,
DSA\-SHA, or DSA\-SHA1.
.sp
-Select the certificate message digest/signature encryption scheme.
+Select the certificate signature encryption/message digest scheme.
Note that RSA schemes must be used with a RSA sign key and DSA
schemes must be used with a DSA sign key. The default without
this option is RSA\-MD5.
@@ -868,7 +1034,7 @@ privatekey cipher.
.sp
Select the cipher which is used to encrypt the files containing
private keys. The default is three\-key triple DES in CBC mode,
-equivalent to "@code{\-C des\-ede3\-cbc". The openssl tool lists ciphers
+equivalent to "\fB\-C des\-ede3\-cbc\fP". The openssl tool lists ciphers
available in "\fBopenssl \-h\fP" output.
.It Fl d , Fl \-debug\-level
Increase debug verbosity level.
@@ -882,8 +1048,9 @@ This option takes an integer number as its argument.
.It Fl e , Fl \-id\-key
Write IFF or GQ identity keys.
.sp
-Write the IFF or GQ client keys to the standard output. This is
-intended for automatic key distribution by mail.
+Write the public parameters from the IFF or GQ client keys to
+the standard output.
+This is intended for automatic key distribution by email.
.It Fl G , Fl \-gq\-params
Generate GQ parameters and keys.
.sp
@@ -906,21 +1073,17 @@ 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 \fB\-i/\-\-ident\fP or
using \fB\-s/\-\-subject\-name\fP following an '\fB@\fP' character,
-is also a part of the self\-signed host certificate's subject and
+is also a part of the self\-signed host certificate subject and
issuer names in the form \fBhost@group\fP and should match the
-\'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
-\fBntpd\fP's configuration file.
+\'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in the
+\fBntpd\fP configuration file.
.It Fl l Ar lifetime , Fl \-lifetime Ns = Ns Ar lifetime
set certificate lifetime.
This option takes an integer number as its argument.
.sp
Set the certificate expiration to lifetime days from now.
-.It Fl M , Fl \-md5key
-generate MD5 keys.
-.sp
-Generate MD5 keys, obsoleting any that may exist.
.It Fl m Ar modulus , Fl \-modulus Ns = Ns Ar modulus
-modulus.
+prime modulus.
This option takes an integer number as its argument.
The value of
.Ar modulus
@@ -933,6 +1096,10 @@ in the range 256 through 2048
.in -4
.sp
The number of bits in the prime modulus. The default is 512.
+.It Fl M , Fl \-md5key
+generate symmetric keys.
+.sp
+Generate symmetric keys, obsoleting any that may exist.
.It Fl P , Fl \-pvt\-cert
generate PC private certificate.
.sp
@@ -954,12 +1121,6 @@ encrypted with the DES\-CBC algorithm and the specified password.
The same password must be specified to the remote ntpd via the
"crypto pw password" configuration command. See also the option
-\-id\-key (\-e) for unencrypted exports.
-.It Fl S Ar sign , Fl \-sign\-key Ns = Ns Ar sign
-generate sign key (RSA or DSA).
-.sp
-Generate a new sign key of the designated type, obsoleting any
-that may exist. By default, the program uses the host key as the
-sign key.
.It Fl s Ar host@group , Fl \-subject\-name Ns = Ns Ar host@group
set host and optionally group name.
.sp
@@ -967,12 +1128,18 @@ Set the Autokey host name, and optionally, group name specified
following an '\fB@\fP' 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 \fBhost@group\fP form for the host certificate's subject and issuer
+in \fBhost@group\fP form for the host certificate subject and issuer
fields. Specifying '\fB\-s @group\fP' is allowed, and results in
leaving the host name unchanged while appending \fB@group\fP to the
subject and issuer fields, as with \fB\-i group\fP. 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.
+.It Fl S Ar sign , Fl \-sign\-key Ns = Ns Ar sign
+generate sign key (RSA or DSA).
+.sp
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
.It Fl T , Fl \-trusted\-cert
trusted certificate (TC scheme).
.sp
@@ -1021,18 +1188,6 @@ The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
If any of these are directories, then the file \fI.ntprc\fP
is searched for within those directories.
.Sh USAGE
-The
-.Fl p Ar password
-option specifies the write password and
-.Fl q Ar password
-option the read password for previously encrypted files.
-The
-.Nm
-program prompts for the password if it reads an encrypted file
-and the password is missing or incorrect.
-If an encrypted file is read successfully and
-no write password is specified, the read password is used
-as the write password by default.
.Sh "ENVIRONMENT"
See \fBOPTION PRESETS\fP for configuration environment variables.
.Sh "FILES"
@@ -1056,10 +1211,7 @@ The University of Delaware and Network Time Foundation
Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh BUGS
-It can take quite a while to generate some cryptographic values,
-from one to several minutes with modern architectures
-such as UltraSPARC and up to tens of minutes to an hour
-with older architectures such as SPARC IPC.
+It can take quite a while to generate some cryptographic values.
.Pp
Please report bugs to http://bugs.ntp.org .
.Pp
diff --git a/contrib/ntp/util/ntp-keygen.html b/contrib/ntp/util/ntp-keygen.html
index b4fc629..854d055 100644
--- a/contrib/ntp/util/ntp-keygen.html
+++ b/contrib/ntp/util/ntp-keygen.html
@@ -70,7 +70,7 @@ All other files are in PEM-encoded
printable ASCII format so they can be embedded as MIME attachments in
mail to other sites.
- <p>This document applies to version 4.2.8p10 of <code>ntp-keygen</code>.
+ <p>This document applies to version 4.2.8p11 of <code>ntp-keygen</code>.
<div class="node">
<p><hr>
@@ -217,26 +217,29 @@ Autokey Public-Key Authentication page.
<p>This program generates cryptographic data files used by the NTPv4
authentication and identification schemes.
-It generates MD5 key files used in symmetric key cryptography.
-In addition, if the OpenSSL software library has been installed,
-it generates keys, certificate and identity files used in public key
-cryptography.
+It can generate message digest keys used in symmetric key cryptography and,
+if the OpenSSL software library has been installed, it can generate host keys,
+signing keys, certificates, and identity keys and parameters used in Autokey
+public key cryptography.
These files are used for cookie encryption,
-digital signature and challenge/response identification algorithms
+digital signature, and challenge/response identification algorithms
compatible with the Internet standard security infrastructure.
- <p>All files are in PEM-encoded printable ASCII format,
-so they can be embedded as MIME attachments in mail to other sites
+ <p>The message digest symmetric keys file is generated in a format
+compatible with NTPv3.
+All other files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in email to other sites
and certificate authorities.
By default, files are not encrypted.
- <p>When used to generate message digest keys, the program produces a file
-containing ten pseudo-random printable ASCII strings suitable for the
-MD5 message digest algorithm included in the distribution.
+ <p>When used to generate message digest symmetric keys, the program
+produces a file containing ten pseudo-random printable ASCII strings
+suitable for the MD5 message digest algorithm included in the
+distribution.
If the OpenSSL library is installed, it produces an additional ten
-hex-encoded random bit strings suitable for the SHA1 and other message
-digest algorithms.
-The message digest keys file must be distributed and stored
+hex-encoded random bit strings suitable for SHA1, AES-128-CMAC, and
+other message digest algorithms.
+The message digest symmetric keys file must be distributed and stored
using secure means beyond the scope of NTP itself.
Besides the keys used for ordinary NTP associations, additional keys
can be defined as passwords for the
@@ -256,223 +259,133 @@ other than Autokey.
<p>Some files used by this program are encrypted using a private password.
The
<code>-p</code>
-option specifies the password for local encrypted files and the
+option specifies the read password for local encrypted files and the
<code>-q</code>
-option the password for encrypted files sent to remote sites.
+option the write password for encrypted files sent to remote sites.
If no password is specified, the host name returned by the Unix
-<code>gethostname()</code>
-function, normally the DNS name of the host is used.
+<code>hostname(1)</code>
+command, normally the DNS name of the host, is used as the the default read
+password, for convenience.
+The
+<code>ntp-keygen</code>
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
<p>The
-<kbd>pw</kbd>
+<code>pw</code>
option of the
-<kbd>crypto</kbd>
+<code>crypto</code>
+<code>ntpd(1ntpdmdoc)</code>
configuration command specifies the read
password for previously encrypted local files.
-This must match the local password used by this program.
+This must match the local read password used by this program.
If not specified, the host name is used.
-Thus, if files are generated by this program without password,
+Thus, if files are generated by this program without an explicit password,
they can be read back by
-<kbd>ntpd</kbd>
-without password but only on the same host.
+<code>ntpd(1ntpdmdoc)</code>
+without specifying an explicit password but only on the same host.
+If the write password used for encryption is specified as the host name,
+these files can be read by that host with no explicit password.
<p>Normally, encrypted files for each host are generated by that host and
used only by that host, although exceptions exist as noted later on
this page.
The symmetric keys file, normally called
-<kbd>ntp.keys</kbd>,
+<span class="file">ntp.keys</span>,
is usually installed in
<span class="file">/etc</span>.
Other files and links are usually installed in
<span class="file">/usr/local/etc</span>,
which is normally in a shared filesystem in
NFS-mounted networks and cannot be changed by shared clients.
-The location of the keys directory can be changed by the
-<kbd>keysdir</kbd>
-configuration command in such cases.
-Normally, this is in
-<span class="file">/etc</span>.
+In these cases, NFS clients can specify the files in another
+directory such as
+<span class="file">/etc</span>
+using the
+<code>keysdir</code>
+<code>ntpd(1ntpdmdoc)</code>
+configuration file command.
<p>This program directs commentary and error messages to the standard
error stream
-<kbd>stderr</kbd>
+<span class="file">stderr</span>
and remote files to the standard output stream
-<kbd>stdout</kbd>
+<span class="file">stdout</span>
where they can be piped to other applications or redirected to files.
The names used for generated files and links all begin with the
string
-<kbd>ntpkey</kbd>
+<span class="file">ntpkey*</span>
and include the file type, generating host and filestamp,
as described in the
-Cryptographic Data Files
+<a href="#Cryptographic-Data-Files">Cryptographic Data Files</a>
section below.
<h5 class="subsubsection">Running the Program</h5>
-<p>To test and gain experience with Autokey concepts, log in as root and
-change to the keys directory, usually
-<span class="file">/usr/local/etc</span>
-When run for the first time, or if all files with names beginning with
-<kbd>ntpkey</kbd>
-have been removed, use the
-<code>ntp-keygen</code>
-command without arguments to generate a
-default RSA host key and matching RSA-MD5 certificate with expiration
-date one year hence.
-If run again without options, the program uses the
-existing keys and parameters and generates only a new certificate with
-new expiration date one year hence.
-
- <p>Run the command on as many hosts as necessary.
-Designate one of them as the trusted host (TH) using
-<code>ntp-keygen</code>
-with the
-<code>-T</code>
-option and configure it to synchronize from reliable Internet servers.
-Then configure the other hosts to synchronize to the TH directly or
-indirectly.
-A certificate trail is created when Autokey asks the immediately
-ascendant host towards the TH to sign its certificate, which is then
-provided to the immediately descendant host on request.
-All group hosts should have acyclic certificate trails ending on the TH.
-
- <p>The host key is used to encrypt the cookie when required and so must be
-RSA type.
-By default, the host key is also the sign key used to encrypt
-signatures.
-A different sign key can be assigned using the
-<code>-S</code>
-option and this can be either RSA or DSA type.
-By default, the signature
-message digest type is MD5, but any combination of sign key type and
-message digest type supported by the OpenSSL library can be specified
-using the
-<code>-c</code>
-option.
-The rules say cryptographic media should be generated with proventic
-filestamps, which means the host should already be synchronized before
-this program is run.
-This of course creates a chicken-and-egg problem
-when the host is started for the first time.
-Accordingly, the host time
-should be set by some other means, such as eyeball-and-wristwatch, at
-least so that the certificate lifetime is within the current year.
-After that and when the host is synchronized to a proventic source, the
-certificate should be re-generated.
-
- <p>Additional information on trusted groups and identity schemes is on the
-Autokey Public-Key Authentication
-page.
-
- <p>The
-<code>ntpd(1ntpdmdoc)</code>
-configuration command
-<code>crypto</code> <code>pw</code> <kbd>password</kbd>
-specifies the read password for previously encrypted files.
-The daemon expires on the spot if the password is missing
-or incorrect.
-For convenience, if a file has been previously encrypted,
-the default read password is the name of the host running
-the program.
-If the previous write password is specified as the host name,
-these files can be read by that host with no explicit password.
-
- <p>File names begin with the prefix
-<code>ntpkey_</code>
-and end with the postfix
-<kbd>_hostname.filestamp</kbd>,
-where
-<kbd>hostname</kbd>
-is the owner name, usually the string returned
-by the Unix gethostname() routine, and
-<kbd>filestamp</kbd>
-is the NTP seconds when the file was generated, in decimal digits.
-This both guarantees uniqueness and simplifies maintenance
-procedures, since all files can be quickly removed
-by a
-<code>rm</code> <code>ntpkey*</code>
-command or all files generated
-at a specific time can be removed by a
-<code>rm</code>
-<kbd>*filestamp</kbd>
-command.
-To further reduce the risk of misconfiguration,
-the first two lines of a file contain the file name
-and generation date and time as comments.
-
- <p>All files are installed by default in the keys directory
-<span class="file">/usr/local/etc</span>,
-which is normally in a shared filesystem
-in NFS-mounted networks.
-The actual location of the keys directory
-and each file can be overridden by configuration commands,
-but this is not recommended.
-Normally, the files for each host are generated by that host
-and used only by that host, although exceptions exist
-as noted later on this page.
-
- <p>Normally, files containing private values,
-including the host key, sign key and identification parameters,
-are permitted root read/write-only;
-while others containing public values are permitted world readable.
-Alternatively, files containing private values can be encrypted
-and these files permitted world readable,
-which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
-dependent clients can all be installed in the same shared directory.
-
- <p>The recommended practice is to keep the file name extensions
-when installing a file and to install a soft link
-from the generic names specified elsewhere on this page
-to the generated files.
-This allows new file generations to be activated simply
-by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
-If a link is not present,
-<code>ntpd(1ntpdmdoc)</code>
-extracts the filestamp from the file itself.
-This allows clients to verify that the file and generation times
-are always current.
-The
-<code>ntp-keygen</code>
-program uses the same timestamp extension for all files generated
-at one time, so each generation is distinct and can be readily
-recognized in monitoring data.
-
-<h5 class="subsubsection">Running the program</h5>
-
<p>The safest way to run the
<code>ntp-keygen</code>
program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
+The recommended procedure is change to the
+<kbd>keys</kbd>
+directory, usually
<span class="file">/usr/local/etc</span>,
-then run the program.
-When run for the first time,
-or if all
-<code>ntpkey</code>
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
+then run the program.
+
+ <p>To test and gain experience with Autokey concepts, log in as root and
+change to the
+<kbd>keys</kbd>
+directory, usually
+<span class="file">/usr/local/etc</span>.
+When run for the first time, or if all files with names beginning with
+<span class="file">ntpkey*</span>
+have been removed, use the
+<code>ntp-keygen</code>
+command without arguments to generate a default
+<code>RSA</code>
+host key and matching
+<code>RSA-MD5</code>
+certificate file with expiration date one year hence,
which is all that is necessary in many cases.
The program also generates soft links from the generic names
to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+If run again without options, the program uses the
+existing keys and parameters and generates a new certificate file with
+new expiration date one year hence, and soft link.
- <p>The host key is used to encrypt the cookie when required and so must be RSA type.
+ <p>The host key is used to encrypt the cookie when required and so must be
+<code>RSA</code>
+type.
By default, the host key is also the sign key used to encrypt signatures.
When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
+either
+<code>RSA</code>
+or
+<code>DSA</code>
+type.
+By default, the message digest type is
+<code>MD5</code>,
+but any combination
of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
+can be specified, including those using the
+<code>AES128CMAC</code>, <code>MD2</code>, <code>MD5</code>, <code>MDC2</code>, <code>SHA</code>, <code>SHA1</code>
+and
+<code>RIPE160</code>
+message digest algorithms.
However, the scheme specified in the certificate must be compatible
with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Certificates using any digest algorithm are compatible with
+<code>RSA</code>
+sign keys;
+however, only
+<code>SHA</code>
+and
+<code>SHA1</code>
+certificates are compatible with
+<code>DSA</code>
+sign keys.
<p>Private/public key files and certificates are compatible with
other OpenSSL applications and very likely other libraries as well.
@@ -483,19 +396,19 @@ However, the identification parameter files, although encoded
as the other files, are probably not compatible with anything other than Autokey.
<p>Running the program as other than root and using the Unix
-<code>su</code>
+<code>su(1)</code>
command
to assume root may not work properly, since by default the OpenSSL library
looks for the random seed file
-<code>.rnd</code>
+<span class="file">.rnd</span>
in the user home directory.
However, there should be only one
-<code>.rnd</code>,
+<span class="file">.rnd</span>,
most conveniently
in the root directory, so it is convenient to define the
-<code>$RANDFILE</code>
+.Ev RANDFILE
environment variable used by the OpenSSL library as the path to
-<code>/.rnd</code>.
+<span class="file">.rnd</span>.
<p>Installing the keys as root might not work in NFS-mounted
shared file systems, as NFS clients may not be able to write
@@ -505,7 +418,8 @@ directory such as
<span class="file">/etc</span>
using the
<code>keysdir</code>
-command.
+<code>ntpd(1ntpdmdoc)</code>
+configuration file command.
There is no need for one client to read the keys and certificates
of other clients or servers, as these data are obtained automatically
by the Autokey protocol.
@@ -538,8 +452,11 @@ while others containing public values are permitted world readable.
Alternatively, files containing private values can be encrypted
and these files permitted world readable,
which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
+Since uniqueness is insured by the
+<kbd>hostname</kbd>
+and
+<kbd>filestamp</kbd>
+file name extensions, the files for an NTP server and
dependent clients can all be installed in the same shared directory.
<p>The recommended practice is to keep the file name extensions
@@ -548,109 +465,113 @@ from the generic names specified elsewhere on this page
to the generated files.
This allows new file generations to be activated simply
by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
+If a link is present,
+<code>ntpd(1ntpdmdoc)</code>
+follows it to the file name to extract the
+<kbd>filestamp</kbd>.
If a link is not present,
<code>ntpd(1ntpdmdoc)</code>
-extracts the filestamp from the file itself.
+extracts the
+<kbd>filestamp</kbd>
+from the file itself.
This allows clients to verify that the file and generation times
are always current.
The
<code>ntp-keygen</code>
-program uses the same timestamp extension for all files generated
+program uses the same
+<kbd>filestamp</kbd>
+extension for all files generated
at one time, so each generation is distinct and can be readily
recognized in monitoring data.
-<h5 class="subsubsection">Running the program</h5>
-
-<p>The safest way to run the
+ <p>Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
<code>ntp-keygen</code>
-program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
-<span class="file">/usr/local/etc</span>,
-then run the program.
-When run for the first time,
-or if all
-<code>ntpkey</code>
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
-which is all that is necessary in many cases.
-The program also generates soft links from the generic names
-to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+with the
+<code>-T</code>
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
- <p>The host key is used to encrypt the cookie when required and so must be RSA type.
-By default, the host key is also the sign key used to encrypt signatures.
-When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
-of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
-However, the scheme specified in the certificate must be compatible
-with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+ <p>The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+<code>-S</code>
+option and this can be either
+<code>RSA</code>
+or
+<code>DSA</code>
+type.
+By default, the signature
+message digest type is
+<code>MD5</code>,
+but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+<code>-c</code>
+option.
- <p>Private/public key files and certificates are compatible with
-other OpenSSL applications and very likely other libraries as well.
-Certificates or certificate requests derived from them should be compatible
-with extant industry practice, although some users might find
-the interpretation of X509v3 extension fields somewhat liberal.
-However, the identification parameter files, although encoded
-as the other files, are probably not compatible with anything other than Autokey.
+ <p>The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
- <p>Running the program as other than root and using the Unix
-<code>su</code>
-command
-to assume root may not work properly, since by default the OpenSSL library
-looks for the random seed file
-<code>.rnd</code>
-in the user home directory.
-However, there should be only one
-<code>.rnd</code>,
-most conveniently
-in the root directory, so it is convenient to define the
-<code>$RANDFILE</code>
-environment variable used by the OpenSSL library as the path to
-<code>/.rnd</code>.
+ <p>Additional information on trusted groups and identity schemes is on the
+Autokey Public-Key Authentication
+page.
- <p>Installing the keys as root might not work in NFS-mounted
-shared file systems, as NFS clients may not be able to write
-to the shared keys directory, even as root.
-In this case, NFS clients can specify the files in another
-directory such as
-<span class="file">/etc</span>
-using the
-<code>keysdir</code>
+ <p>File names begin with the prefix
+<span class="file">ntpkey</span>_
+and end with the suffix
+<span class="file">_</span><kbd>hostname</kbd>. <kbd>filestamp</kbd>,
+where
+<kbd>hostname</kbd>
+is the owner name, usually the string returned
+by the Unix
+<code>hostname(1)</code>
+command, and
+<kbd>filestamp</kbd>
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+<code>rm</code> <span class="file">ntpkey*</span>
+command or all files generated
+at a specific time can be removed by a
+<code>rm</code> <span class="file">*</span><kbd>filestamp</kbd>
command.
-There is no need for one client to read the keys and certificates
-of other clients or servers, as these data are obtained automatically
-by the Autokey protocol.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
- <p>Ordinarily, cryptographic files are generated by the host that uses them,
-but it is possible for a trusted agent (TA) to generate these files
-for other hosts; however, in such cases files should always be encrypted.
-The subject name and trusted name default to the hostname
-of the host generating the files, but can be changed by command line options.
-It is convenient to designate the owner name and trusted name
-as the subject and issuer fields, respectively, of the certificate.
-The owner name is also used for the host and sign key files,
-while the trusted name is used for the identity files.
-seconds.
-seconds.
+<h5 class="subsubsection">Trusted Hosts and Groups</h5>
- <p>s Trusted Hosts and Groups
-Each cryptographic configuration involves selection of a signature scheme
+<p>Each cryptographic configuration involves selection of a signature scheme
and identification scheme, called a cryptotype,
as explained in the
<a href="#Authentication-Options">Authentication Options</a>
section of
<code>ntp.conf(5)</code>.
-The default cryptotype uses RSA encryption, MD5 message digest
-and TC identification.
+The default cryptotype uses
+<code>RSA</code>
+encryption,
+<code>MD5</code>
+message digest
+and
+<code>TC</code>
+identification.
First, configure a NTP subnet including one or more low-stratum
trusted hosts from which all other hosts derive synchronization
directly or indirectly.
@@ -668,7 +589,7 @@ section of
<p>On each trusted host as root, change to the keys directory.
To insure a fresh fileset, remove all
-<code>ntpkey</code>
+<span class="file">ntpkey</span>
files.
Then run
<code>ntp-keygen</code>
@@ -693,7 +614,9 @@ is either
<code>RSA</code>
or
<code>DSA</code>.
-The most often need to do this is when a DSA-signed certificate is used.
+The most frequent need to do this is when a
+<code>DSA</code>-signed
+certificate is used.
If it is necessary to use a different certificate scheme than the default,
run
<code>ntp-keygen</code>
@@ -702,17 +625,17 @@ with the
option and selected
<kbd>scheme</kbd>
as needed.
-f
+If
<code>ntp-keygen</code>
is run again without these options, it generates a new certificate
-using the same scheme and sign key.
+using the same scheme and sign key, and soft link.
<p>After setting up the environment it is advisable to update certificates
from time to time, if only to extend the validity interval.
Simply run
<code>ntp-keygen</code>
with the same flags as before to generate new certificates
-using existing keys.
+using existing keys, and soft links.
However, if the host or sign key is changed,
<code>ntpd(1ntpdmdoc)</code>
should be restarted.
@@ -725,13 +648,15 @@ at which time the protocol is restarted.
<h5 class="subsubsection">Identity Schemes</h5>
<p>As mentioned on the Autonomous Authentication page,
-the default TC identity scheme is vulnerable to a middleman attack.
+the default
+<code>TC</code>
+identity scheme is vulnerable to a middleman attack.
However, there are more secure identity schemes available,
-including PC, IFF, GQ and MV described on the
-"Identification Schemes"
-page
-(maybe available at
-<code>http://www.eecis.udel.edu/%7emills/keygen.html</code>).
+including
+<code>PC</code>, <code>IFF</code>, <code>GQ</code>
+and
+<code>MV</code>
+schemes described below.
These schemes are based on a TA, one or more trusted hosts
and some number of nontrusted hosts.
Trusted hosts prove identity using values provided by the TA,
@@ -756,12 +681,15 @@ On trusted host alice run
<code>-P</code>
<code>-p</code> <kbd>password</kbd>
to generate the host key file
-<span class="file">ntpkey_RSAkey_</span><kbd>alice.filestamp</kbd>
+<span class="file">ntpkey</span>_ <code>RSA</code> <span class="file">key_alice.</span> <kbd>filestamp</kbd>
and trusted private certificate file
-<span class="file">ntpkey_RSA-MD5_cert_</span><kbd>alice.filestamp</kbd>.
+<span class="file">ntpkey</span>_ <code>RSA-MD5</code> <code>_</code> <span class="file">cert_alice.</span> <kbd>filestamp</kbd>,
+and soft links.
Copy both files to all group hosts;
they replace the files which would be generated in other schemes.
-On each host bob install a soft link from the generic name
+On each host
+<kbd>bob</kbd>
+install a soft link from the generic name
<span class="file">ntpkey_host_</span><kbd>bob</kbd>
to the host key file and soft link
<span class="file">ntpkey_cert_</span><kbd>bob</kbd>
@@ -770,26 +698,34 @@ Note the generic links are on bob, but point to files generated
by trusted host alice.
In this scheme it is not possible to refresh
either the keys or certificates without copying them
-to all other hosts in the group.
+to all other hosts in the group, and recreating the soft links.
- <p>For the IFF scheme proceed as in the TC scheme to generate keys
+ <p>For the
+<code>IFF</code>
+scheme proceed as in the
+<code>TC</code>
+scheme to generate keys
and certificates for all group hosts, then for every trusted host in the group,
-generate the IFF parameter file.
+generate the
+<code>IFF</code>
+parameter file.
On trusted host alice run
<code>ntp-keygen</code>
<code>-T</code>
<code>-I</code>
<code>-p</code> <kbd>password</kbd>
to produce her parameter file
-<span class="file">ntpkey_IFFpar_</span><kbd>alice.filestamp</kbd>,
+<span class="file">ntpkey_IFFpar_alice.</span><kbd>filestamp</kbd>,
which includes both server and client keys.
Copy this file to all group hosts that operate as both servers
and clients and install a soft link from the generic
-<span class="file">ntpkey_iff_</span><kbd>alice</kbd>
+<span class="file">ntpkey_iff_alice</span>
to this file.
If there are no hosts restricted to operate only as clients,
there is nothing further to do.
-As the IFF scheme is independent
+As the
+<code>IFF</code>
+scheme is independent
of keys and certificates, these files can be refreshed as needed.
<p>If a rogue client has the parameter file, it could masquerade
@@ -799,37 +735,53 @@ from the parameter file and distributed to all restricted clients.
After generating the parameter file, on alice run
<code>ntp-keygen</code>
<code>-e</code>
-and pipe the output to a file or mail program.
-Copy or mail this file to all restricted clients.
+and pipe the output to a file or email program.
+Copy or email this file to all restricted clients.
On these clients install a soft link from the generic
-<span class="file">ntpkey_iff_</span><kbd>alice</kbd>
+<span class="file">ntpkey_iff_alice</span>
to this file.
To further protect the integrity of the keys,
each file can be encrypted with a secret password.
- <p>For the GQ scheme proceed as in the TC scheme to generate keys
+ <p>For the
+<code>GQ</code>
+scheme proceed as in the
+<code>TC</code>
+scheme to generate keys
and certificates for all group hosts, then for every trusted host
-in the group, generate the IFF parameter file.
+in the group, generate the
+<code>IFF</code>
+parameter file.
On trusted host alice run
<code>ntp-keygen</code>
<code>-T</code>
<code>-G</code>
<code>-p</code> <kbd>password</kbd>
to produce her parameter file
-<span class="file">ntpkey_GQpar_</span><kbd>alice.filestamp</kbd>,
+<span class="file">ntpkey_GQpar_alice.</span><kbd>filestamp</kbd>,
which includes both server and client keys.
Copy this file to all group hosts and install a soft link
from the generic
-<span class="file">ntpkey_gq_</span><kbd>alice</kbd>
+<span class="file">ntpkey_gq_alice</span>
to this file.
-In addition, on each host bob install a soft link
+In addition, on each host
+<kbd>bob</kbd>
+install a soft link
from generic
<span class="file">ntpkey_gq_</span><kbd>bob</kbd>
to this file.
-As the GQ scheme updates the GQ parameters file and certificate
+As the
+<code>GQ</code>
+scheme updates the
+<code>GQ</code>
+parameters file and certificate
at the same time, keys and certificates can be regenerated as needed.
- <p>For the MV scheme, proceed as in the TC scheme to generate keys
+ <p>For the
+<code>MV</code>
+scheme, proceed as in the
+<code>TC</code>
+scheme to generate keys
and certificates for all group hosts.
For illustration assume trish is the TA, alice one of several trusted hosts
and bob one of her clients.
@@ -841,9 +793,9 @@ where
<kbd>n</kbd>
is the number of revokable keys (typically 5) to produce
the parameter file
-<span class="file">ntpkeys_MVpar_</span><kbd>trish.filestamp</kbd>
+<span class="file">ntpkeys_MVpar_trish.</span><kbd>filestamp</kbd>
and client key files
-<span class="file">ntpkeys_MVkeyd_</span><kbd>trish.filestamp</kbd>
+<span class="file">ntpkeys_MVkey</span><kbd>d</kbd> <kbd>_</kbd> <span class="file">trish.</span> <kbd>filestamp</kbd>
where
<kbd>d</kbd>
is the key number (0 &lt;
@@ -852,66 +804,199 @@ is the key number (0 &lt;
<kbd>n</kbd>).
Copy the parameter file to alice and install a soft link
from the generic
-<span class="file">ntpkey_mv_</span><kbd>alice</kbd>
+<span class="file">ntpkey_mv_alice</span>
to this file.
Copy one of the client key files to alice for later distribution
to her clients.
-It doesn't matter which client key file goes to alice,
+It does not matter which client key file goes to alice,
since they all work the same way.
-Alice copies the client key file to all of her cliens.
+Alice copies the client key file to all of her clients.
On client bob install a soft link from generic
-<span class="file">ntpkey_mvkey_</span><kbd>bob</kbd>
+<span class="file">ntpkey_mvkey_bob</span>
to the client key file.
-As the MV scheme is independent of keys and certificates,
+As the
+<code>MV</code>
+scheme is independent of keys and certificates,
these files can be refreshed as needed.
<h5 class="subsubsection">Command Line Options</h5>
<dl>
-<dt><code>-c</code> <kbd>scheme</kbd><dd>Select certificate message digest/signature encryption scheme.
+<dt><code>-b</code> <code>--imbits</code>= <kbd>modulus</kbd><dd>Set the number of bits in the identity modulus for generating identity keys to
+<kbd>modulus</kbd>
+bits.
+The number of bits in the identity modulus defaults to 256, but can be set to
+values from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+<br><dt><code>-c</code> <code>--certificate</code>= <kbd>scheme</kbd><dd>Select certificate signature encryption/message digest scheme.
The
<kbd>scheme</kbd>
can be one of the following:
-. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+<code>RSA-MD2</code>, <code>RSA-MD5</code>, <code>RSA-MDC2</code>, <code>RSA-SHA</code>, <code>RSA-SHA1</code>, <code>RSA-RIPEMD160</code>, <code>DSA-SHA</code>,
or
<code>DSA-SHA1</code>.
-Note that RSA schemes must be used with a RSA sign key and DSA
-schemes must be used with a DSA sign key.
+Note that
+<code>RSA</code>
+schemes must be used with an
+<code>RSA</code>
+sign key and
+<code>DSA</code>
+schemes must be used with a
+<code>DSA</code>
+sign key.
The default without this option is
<code>RSA-MD5</code>.
-<br><dt><code>-d</code><dd>Enable debugging.
+If compatibility with FIPS 140-2 is required, either the
+<code>DSA-SHA</code>
+or
+<code>DSA-SHA1</code>
+scheme must be used.
+<br><dt><code>-C</code> <code>--cipher</code>= <kbd>cipher</kbd><dd>Select the OpenSSL cipher to encrypt the files containing private keys.
+The default without this option is three-key triple DES in CBC mode,
+<code>des-ede3-cbc</code>.
+The
+<code>openssl</code> <code>-h</code>
+command provided with OpenSSL displays available ciphers.
+<br><dt><code>-d</code> <code>--debug-level</code><dd>Increase debugging verbosity level.
This option displays the cryptographic data produced in eye-friendly billboards.
-<br><dt><code>-e</code><dd>Write the IFF client keys to the standard output.
-This is intended for automatic key distribution by mail.
-<br><dt><code>-G</code><dd>Generate parameters and keys for the GQ identification scheme,
-obsoleting any that may exist.
-<br><dt><code>-g</code><dd>Generate keys for the GQ identification scheme
-using the existing GQ parameters.
-If the GQ parameters do not yet exist, create them first.
-<br><dt><code>-H</code><dd>Generate new host keys, obsoleting any that may exist.
-<br><dt><code>-I</code><dd>Generate parameters for the IFF identification scheme,
-obsoleting any that may exist.
-<br><dt><code>-i</code> <kbd>name</kbd><dd>Set the suject name to
-<kbd>name</kbd>.
-This is used as the subject field in certificates
-and in the file name for host and sign keys.
-<br><dt><code>-M</code><dd>Generate MD5 keys, obsoleting any that may exist.
-<br><dt><code>-P</code><dd>Generate a private certificate.
+<br><dt><code>-D</code> <code>--set-debug-level</code>= <kbd>level</kbd><dd>Set the debugging verbosity to
+<kbd>level</kbd>.
+This option displays the cryptographic data produced in eye-friendly billboards.
+<br><dt><code>-e</code> <code>--id-key</code><dd>Write the
+<code>IFF</code>
+or
+<code>GQ</code>
+public parameters from the
+<kbd>IFFkey</kbd> <kbd>or</kbd> <kbd>GQkey</kbd>
+client keys file previously specified
+as unencrypted data to the standard output stream
+<span class="file">stdout</span>.
+This is intended for automatic key distribution by email.
+<br><dt><code>-G</code> <code>--gq-params</code><dd>Generate a new encrypted
+<code>GQ</code>
+parameters and key file for the Guillou-Quisquater (GQ) identity scheme.
+This option is mutually exclusive with the
+<code>-I</code>
+and
+<code>-V</code>
+options.
+<br><dt><code>-H</code> <code>--host-key</code><dd>Generate a new encrypted
+<code>RSA</code>
+public/private host key file.
+<br><dt><code>-I</code> <code>--iffkey</code><dd>Generate a new encrypted
+<code>IFF</code>
+key file for the Schnorr (IFF) identity scheme.
+This option is mutually exclusive with the
+<code>-G</code>
+and
+Fl V
+options.
+<br><dt><code>-i</code> <code>--ident</code>= <kbd>group</kbd><dd>Set the optional Autokey group name to
+<kbd>group</kbd>.
+This is used in the identity scheme parameter file names of
+<code>IFF</code>, <code>GQ</code>,
+and
+<code>MV</code>
+client parameters files.
+In that role, the default is the host name if no group is provided.
+The group name, if specified using
+<code>-i</code>
+or
+<code>-s</code>
+following an
+@
+character, is also used in certificate subject and issuer names in the form
+<kbd>host</kbd> <kbd>@</kbd> <kbd>group</kbd>
+and should match the group specified via
+<code>crypto</code> <code>ident</code>
+or
+<code>server</code> <code>ident</code>
+in the ntpd configuration file.
+<br><dt><code>-l</code> <code>--lifetime</code>= <kbd>days</kbd><dd>Set the lifetime for certificate expiration to
+<kbd>days</kbd>.
+The default lifetime is one year (365 days).
+<br><dt><code>-m</code> <code>--modulus</code>= <kbd>bits</kbd><dd>Set the number of bits in the prime modulus for generating files to
+<kbd>bits</kbd>.
+The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+<br><dt><code>-M</code> <code>--md5key</code><dd>Generate a new symmetric keys file containing 10
+<code>MD5</code>
+keys, and if OpenSSL is available, 10
+<code>SHA</code>
+keys.
+An
+<code>MD5</code>
+key is a string of 20 random printable ASCII characters, while a
+<code>SHA</code>
+key is a string of 40 random hex digits.
+The file can be edited using a text editor to change the key type or key content.
+This option is mutually exclusive with all other options.
+<br><dt><code>-p</code> <code>--password</code>= <kbd>passwd</kbd><dd>Set the password for reading and writing encrypted files to
+<kbd>passwd</kbd>.
+These include the host, sign and identify key files.
+By default, the password is the string returned by the Unix
+<code>hostname</code>
+command.
+<br><dt><code>-P</code> <code>--pvt-cert</code><dd>Generate a new private certificate used by the
+<code>PC</code>
+identity scheme.
By default, the program generates public certificates.
-<br><dt><code>-p</code> <kbd>password</kbd><dd>Encrypt generated files containing private data with
-<kbd>password</kbd>
-and the DES-CBC algorithm.
-<br><dt><code>-q</code><dd>Set the password for reading files to password.
-<br><dt><code>-S</code> <code>[RSA | DSA]</code><dd>Generate a new sign key of the designated type,
-obsoleting any that may exist.
-By default, the program uses the host key as the sign key.
-<br><dt><code>-s</code> <kbd>name</kbd><dd>Set the issuer name to
-<kbd>name</kbd>.
-This is used for the issuer field in certificates
-and in the file name for identity files.
-<br><dt><code>-T</code><dd>Generate a trusted certificate.
+Note: the PC identity scheme is not recommended for new installations.
+<br><dt><code>-q</code> <code>--export-passwd</code>= <kbd>passwd</kbd><dd>Set the password for writing encrypted
+<code>IFF</code>, <code>GQ</code> <code>and</code> <code>MV</code>
+identity files redirected to
+<span class="file">stdout</span>
+to
+<kbd>passwd</kbd>.
+In effect, these files are decrypted with the
+<code>-p</code>
+password, then encrypted with the
+<code>-q</code>
+password.
+By default, the password is the string returned by the Unix
+<code>hostname</code>
+command.
+<br><dt><code>-s</code> <code>--subject-key</code>= <code>[host]</code> <code>[@ </code><kbd>group</kbd><code>]</code><dd>Specify the Autokey host name, where
+<kbd>host</kbd>
+is the optional host name and
+<kbd>group</kbd>
+is the optional group name.
+The host name, and if provided, group name are used in
+<kbd>host</kbd> <kbd>@</kbd> <kbd>group</kbd>
+form as certificate subject and issuer.
+Specifying
+<code>-s</code> <code>-@</code> <kbd>group</kbd>
+is allowed, and results in leaving the host name unchanged, as with
+<code>-i</code> <kbd>group</kbd>.
+The group name, or if no group is provided, the host name are also used in the
+file names of
+<code>IFF</code>, <code>GQ</code>,
+and
+<code>MV</code>
+identity scheme client parameter files.
+If
+<kbd>host</kbd>
+is not specified, the default host name is the string returned by the Unix
+<code>hostname</code>
+command.
+<br><dt><code>-S</code> <code>--sign-key</code>= <code>[RSA | DSA]</code><dd>Generate a new encrypted public/private sign key file of the specified type.
+By default, the sign key is the host key and has the same type.
+If compatibility with FIPS 140-2 is required, the sign key type must be
+<code>DSA</code>.
+<br><dt><code>-T</code> <code>--trusted-cert</code><dd>Generate a trusted certificate.
By default, the program generates a non-trusted certificate.
-<br><dt><code>-V</code> <kbd>nkeys</kbd><dd>Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+<br><dt><code>-V</code> <code>--mv-params</code> <kbd>nkeys</kbd><dd>Generate
+<kbd>nkeys</kbd>
+encrypted server keys and parameters for the Mu-Varadharajan (MV)
+identity scheme.
+This option is mutually exclusive with the
+<code>-I</code>
+and
+<code>-G</code>
+options.
+Note: support for this option should be considered a work in progress.
</dl>
<h5 class="subsubsection">Random Seed File</h5>
@@ -937,7 +1022,7 @@ but are outside the scope of this page.
<p>The entropy seed used by the OpenSSL library is contained in a file,
usually called
-<code>.rnd</code>,
+<span class="file">.rnd</span>,
which must be available when starting the NTP daemon
or the
<code>ntp-keygen</code>
@@ -960,47 +1045,122 @@ If the
.Ev RANDFILE
environment variable is not present,
the library will look for the
-<code>.rnd</code>
+<span class="file">.rnd</span>
file in the user home directory.
+Since both the
+<code>ntp-keygen</code>
+program and
+<code>ntpd(1ntpdmdoc)</code>
+daemon must run as root, the logical place to put this file is in
+<span class="file">/.rnd</span>
+or
+<span class="file">/root/.rnd</span>.
If the file is not available or cannot be written,
the daemon exits with a message to the system log and the program
exits with a suitable error message.
<h5 class="subsubsection">Cryptographic Data Files</h5>
-<p>All other file formats begin with two lines.
-The first contains the file name, including the generated host name
-and filestamp.
-The second contains the datestamp in conventional Unix date format.
-Lines beginning with # are considered comments and ignored by the
+<p>All file formats begin with two nonencrypted lines.
+The first line contains the file name, including the generated host name
+and filestamp, in the format
+<span class="file">ntpkey_</span><kbd>key</kbd> <kbd>_</kbd> <kbd>name</kbd>. <kbd>filestamp</kbd>,
+where
+<kbd>key</kbd>
+is the key or parameter type,
+<kbd>name</kbd>
+is the host or group name and
+<kbd>filestamp</kbd>
+is the filestamp (NTP seconds) when the file was created.
+By convention,
+<kbd>key</kbd>
+names in generated file names include both upper and lower case
+characters, while
+<kbd>key</kbd>
+names in generated link names include only lower case characters.
+The filestamp is not used in generated link names.
+The second line contains the datestamp in conventional Unix
+<span class="file">date</span>
+format.
+Lines beginning with
+#
+are considered comments and ignored by the
<code>ntp-keygen</code>
program and
<code>ntpd(1ntpdmdoc)</code>
-daemon.
-Cryptographic values are encoded first using ASN.1 rules,
-then encrypted if necessary, and finally written PEM-encoded
-printable ASCII format preceded and followed by MIME content identifier lines.
-
- <p>The format of the symmetric keys file is somewhat different
-than the other files in the interest of backward compatibility.
-Since DES-CBC is deprecated in NTPv4, the only key format of interest
-is MD5 alphanumeric strings.
-Following hte heard the keys are
-entered one per line in the format
+daemon.
+
+ <p>The remainder of the file contains cryptographic data, encoded first using ASN.1
+rules, then encrypted if necessary, and finally written in PEM-encoded
+printable ASCII text, preceded and followed by MIME content identifier lines.
+
+ <p>The format of the symmetric keys file, ordinarily named
+<span class="file">ntp.keys</span>,
+is somewhat different than the other files in the interest of backward compatibility.
+Ordinarily, the file is generated by this program, but it can be constructed
+and edited using an ordinary text editor.
+<pre class="verbatim">
+# ntpkey_MD5key_bk.ntp.org.3595864945
+# Thu Dec 12 19:22:25 2013
+
+1 MD5 L";Nw&lt;\`.I&lt;f4U0)247"i # MD5 key
+2 MD5 &amp;>l0%XXK9O'51VwV&lt;xq~ # MD5 key
+3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key
+4 MD5 Yue:tL[+vR)M\`n~bY,'? # MD5 key
+5 MD5 B;fx'Kgr/&amp;4ZTbL6=RxA # MD5 key
+6 MD5 4eYwa\`o@}3i@@@@V@@..R9!l # MD5 key
+7 MD5 \`A.([h+;wTQ|xfi%Sn_! # MD5 key
+8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key
+9 MD5 3-5vcn*6l29DS?Xdsg)* # MD5 key
+10 MD5 2late4Me # MD5 key
+11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key
+12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key
+13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key
+14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key
+15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key
+16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key
+17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key
+18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key
+19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key
+20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key
+</pre>
+<pre class="example"> Figure 1. Typical Symmetric Key File
+</pre>
+ <p>Figure 1 shows a typical symmetric keys file used by the reference
+implementation.
+Following the header the keys are entered one per line in the format
<pre class="example"> <kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd>
</pre>
<p>where
<kbd>keyno</kbd>
-is a positive integer in the range 1-65,535,
+is a positive integer in the range 1-65534;
<kbd>type</kbd>
-is the string MD5 defining the key format and
+is the key type for the message digest algorithm, which in the absence of the
+OpenSSL library must be
+<code>MD5</code>
+to designate the MD5 message digest algorithm;
+if the OpenSSL library is installed, the key type can be any
+message digest algorithm supported by that library;
+however, if compatibility with FIPS 140-2 is required,
+the key type must be either
+<code>SHA</code>
+or
+<code>SHA1</code>;
<kbd>key</kbd>
is the key itself,
-which is a printable ASCII string 16 characters or less in length.
-Each character is chosen from the 93 printable characters
-in the range 0x21 through 0x7f excluding space and the
+which is a printable ASCII string 20 characters or less in length:
+each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7e (
+!
+through
+~
+) excluding space and the
+#
+character, and terminated by whitespace or a
#
-character.
+character.
+An OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which
+is truncated as necessary.
<p>Note that the keys used by the
<code>ntpq(1ntpqmdoc)</code>
@@ -1013,8 +1173,8 @@ in human readable ASCII format.
<p>The
<code>ntp-keygen</code>
-program generates a MD5 symmetric keys file
-<span class="file">ntpkey_MD5key_</span><kbd>hostname.filestamp</kbd>.
+program generates a symmetric keys file
+<span class="file">ntpkey_MD5key_</span><kbd>hostname</kbd>. <kbd>filestamp</kbd>.
Since the file contains private shared keys,
it should be visible only to root and distributed by secure means
to other subnet hosts.
@@ -1048,13 +1208,13 @@ This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
<li><a accesskey="8" href="#ntp_002dkeygen-iffkey">ntp-keygen iffkey</a>: iffkey option (-I)
<li><a accesskey="9" href="#ntp_002dkeygen-ident">ntp-keygen ident</a>: ident option (-i)
<li><a href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>: lifetime option (-l)
-<li><a href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>: md5key option (-M)
<li><a href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>: modulus option (-m)
+<li><a href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>: md5key option (-M)
<li><a href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>: pvt-cert option (-P)
<li><a href="#ntp_002dkeygen-password">ntp-keygen password</a>: password option (-p)
<li><a href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>: export-passwd option (-q)
-<li><a href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>: sign-key option (-S)
<li><a href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>: subject-name option (-s)
+<li><a href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>: sign-key option (-S)
<li><a href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>: trusted-cert option (-T)
<li><a href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>: mv-params option (-V)
<li><a href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a>: mv-keys option (-v)
@@ -1085,7 +1245,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p10-beta
+<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p10
Usage: ntp-keygen [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
Flg Arg Option-Name Description
-b Num imbits identity modulus bits
@@ -1103,15 +1263,15 @@ Usage: ntp-keygen [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&g
-I no iffkey generate IFF parameters
-i Str ident set Autokey group name
-l Num lifetime set certificate lifetime
- -M no md5key generate MD5 keys
- -m Num modulus modulus
+ -m Num modulus prime modulus
- it must be in the range:
256 to 2048
+ -M no md5key generate symmetric keys
-P no pvt-cert generate PC private certificate
-p Str password local private password
-q Str export-passwd export IFF or GQ group keys with password
- -S Str sign-key generate sign key (RSA or DSA)
-s Str subject-name set host and optionally group name
+ -S Str sign-key generate sign key (RSA or DSA)
-T no trusted-cert trusted certificate (TC scheme)
-V Num mv-params generate &lt;num&gt; MV parameters
-v Num mv-keys update &lt;num&gt; MV keys
@@ -1174,10 +1334,10 @@ This option takes a string argument <span class="file">scheme</span>.
</ul>
<p>scheme is one of
-RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+RSA-MD2, RSA-MD5, RSA-MDC2, RSA-SHA, RSA-SHA1, RSA-RIPEMD160,
DSA-SHA, or DSA-SHA1.
- <p>Select the certificate message digest/signature encryption scheme.
+ <p>Select the certificate signature encryption/message digest scheme.
Note that RSA schemes must be used with a RSA sign key and DSA
schemes must be used with a DSA sign key. The default without
this option is RSA-MD5.
@@ -1202,9 +1362,9 @@ This option takes a string argument <span class="file">cipher</span>.
<p>Select the cipher which is used to encrypt the files containing
private keys. The default is three-key triple DES in CBC mode,
-equivalent to "<code>-C des-ede3-cbc". The openssl tool lists ciphers
-available in "openssl -h" output.
-</code><div class="node">
+equivalent to "<code>-C des-ede3-cbc</code>". The openssl tool lists ciphers
+available in "<code>openssl -h</code>" output.
+<div class="node">
<p><hr>
<a name="ntp_002dkeygen-id_002dkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-gq_002dparams">ntp-keygen gq-params</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-cipher">ntp-keygen cipher</a>,
@@ -1222,8 +1382,9 @@ This is the &ldquo;write iff or gq identity keys&rdquo; option.
<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
</ul>
- <p>Write the IFF or GQ client keys to the standard output. This is
-intended for automatic key distribution by mail.
+ <p>Write the public parameters from the IFF or GQ client keys to
+the standard output.
+This is intended for automatic key distribution by email.
<div class="node">
<p><hr>
<a name="ntp_002dkeygen-gq_002dparams"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-host_002dkey">ntp-keygen host-key</a>,
@@ -1306,14 +1467,14 @@ This option takes a string argument <span class="file">group</span>.
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 <code>-i/--ident</code> or
-using <code>-s/--subject-name</code> following an '<code>}' character,
-is also a part of the self-signed host certificate's subject and
-issuer names in the form host
- <p>'crypto ident' or 'server ident' configuration in
-ntpd's configuration file.
-</code><div class="node">
+using <code>-s/--subject-name</code> following an '<code>@</code>' character,
+is also a part of the self-signed host certificate subject and
+issuer names in the form <code>host@group</code> and should match the
+'<code>crypto ident</code>' or '<code>server ident</code>' configuration in the
+<code>ntpd</code> configuration file.
+<div class="node">
<p><hr>
-<a name="ntp_002dkeygen-lifetime"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>,
+<a name="ntp_002dkeygen-lifetime"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-ident">ntp-keygen ident</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
<br>
@@ -1322,7 +1483,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen
<h4 class="subsection">lifetime option (-l)</h4>
<p><a name="index-ntp_002dkeygen_002dlifetime-12"></a>
-This is the ``set certificate lifetime'' option.
+This is the &ldquo;set certificate lifetime&rdquo; option.
This option takes a number argument <span class="file">lifetime</span>.
<p class="noindent">This option has some usage constraints. It:
@@ -1333,29 +1494,16 @@ This option takes a number argument <span class="file">lifetime</span>.
<p>Set the certificate expiration to lifetime days from now.
<div class="node">
<p><hr>
-<a name="ntp_002dkeygen-md5key"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>,
+<a name="ntp_002dkeygen-modulus"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
<br>
</div>
-<h4 class="subsection">md5key option (-M)</h4>
-
-<p><a name="index-ntp_002dkeygen_002dmd5key-13"></a>
-This is the ``generate md5 keys'' option.
-Generate MD5 keys, obsoleting any that may exist.
-<div class="node">
-<p><hr>
-<a name="ntp_002dkeygen-modulus"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>,
-Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
-<br>
-</div>
-
<h4 class="subsection">modulus option (-m)</h4>
-<p><a name="index-ntp_002dkeygen_002dmodulus-14"></a>
-This is the ``modulus'' option.
+<p><a name="index-ntp_002dkeygen_002dmodulus-13"></a>
+This is the &ldquo;prime modulus&rdquo; option.
This option takes a number argument <span class="file">modulus</span>.
<p class="noindent">This option has some usage constraints. It:
@@ -1366,16 +1514,29 @@ This option takes a number argument <span class="file">modulus</span>.
<p>The number of bits in the prime modulus. The default is 512.
<div class="node">
<p><hr>
-<a name="ntp_002dkeygen-pvt_002dcert"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-password">ntp-keygen password</a>,
+<a name="ntp_002dkeygen-md5key"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
<br>
</div>
+<h4 class="subsection">md5key option (-M)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dmd5key-14"></a>
+This is the &ldquo;generate symmetric keys&rdquo; option.
+Generate symmetric keys, obsoleting any that may exist.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-pvt_002dcert"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-password">ntp-keygen password</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
<h4 class="subsection">pvt-cert option (-P)</h4>
<p><a name="index-ntp_002dkeygen_002dpvt_002dcert-15"></a>
-This is the ``generate pc private certificate'' option.
+This is the &ldquo;generate pc private certificate&rdquo; option.
<p class="noindent">This option has some usage constraints. It:
<ul>
@@ -1395,7 +1556,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen
<h4 class="subsection">password option (-p)</h4>
<p><a name="index-ntp_002dkeygen_002dpassword-16"></a>
-This is the ``local private password'' option.
+This is the &ldquo;local private password&rdquo; option.
This option takes a string argument <span class="file">passwd</span>.
<p class="noindent">This option has some usage constraints. It:
@@ -1410,7 +1571,7 @@ configuration command. The default password is the local
hostname.
<div class="node">
<p><hr>
-<a name="ntp_002dkeygen-export_002dpasswd"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>,
+<a name="ntp_002dkeygen-export_002dpasswd"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-password">ntp-keygen password</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
<br>
@@ -1419,7 +1580,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen
<h4 class="subsection">export-passwd option (-q)</h4>
<p><a name="index-ntp_002dkeygen_002dexport_002dpasswd-17"></a>
-This is the ``export iff or gq group keys with password'' option.
+This is the &ldquo;export iff or gq group keys with password&rdquo; option.
This option takes a string argument <span class="file">passwd</span>.
<p class="noindent">This option has some usage constraints. It:
@@ -1431,62 +1592,62 @@ This option takes a string argument <span class="file">passwd</span>.
encrypted with the DES-CBC algorithm and the specified password.
The same password must be specified to the remote ntpd via the
"crypto pw password" configuration command. See also the option
---id-key (-e) for unencrypted exports.
+&ndash;id-key (-e) for unencrypted exports.
<div class="node">
<p><hr>
-<a name="ntp_002dkeygen-sign_002dkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>,
+<a name="ntp_002dkeygen-subject_002dname"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
<br>
</div>
-<h4 class="subsection">sign-key option (-S)</h4>
+<h4 class="subsection">subject-name option (-s)</h4>
-<p><a name="index-ntp_002dkeygen_002dsign_002dkey-18"></a>
-This is the ``generate sign key (rsa or dsa)'' option.
-This option takes a string argument <span class="file">sign</span>.
+<p><a name="index-ntp_002dkeygen_002dsubject_002dname-18"></a>
+This is the &ldquo;set host and optionally group name&rdquo; option.
+This option takes a string argument <span class="file">host@group</span>.
<p class="noindent">This option has some usage constraints. It:
<ul>
<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
</ul>
- <p>Generate a new sign key of the designated type, obsoleting any
-that may exist. By default, the program uses the host key as the
-sign key.
+ <p>Set the Autokey host name, and optionally, group name specified
+following an '<code>@</code>' 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 <code>host@group</code> form for the host certificate subject and issuer
+fields. Specifying '<code>-s @group</code>' is allowed, and results in
+leaving the host name unchanged while appending <code>@group</code> to the
+subject and issuer fields, as with <code>-i group</code>. 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.
<div class="node">
<p><hr>
-<a name="ntp_002dkeygen-subject_002dname"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>,
+<a name="ntp_002dkeygen-sign_002dkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
<br>
</div>
-<h4 class="subsection">subject-name option (-s)</h4>
+<h4 class="subsection">sign-key option (-S)</h4>
-<p><a name="index-ntp_002dkeygen_002dsubject_002dname-19"></a>
-This is the ``set host and optionally group name'' option.
-This option takes a string argument <span class="file">host@group</span>.
+<p><a name="index-ntp_002dkeygen_002dsign_002dkey-19"></a>
+This is the &ldquo;generate sign key (rsa or dsa)&rdquo; option.
+This option takes a string argument <span class="file">sign</span>.
<p class="noindent">This option has some usage constraints. It:
<ul>
<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
</ul>
- <p>Set the Autokey host name, and optionally, group name specified
-following an '<code>}' 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
- <p>fields. Specifying '-s
- <p>leaving the host name unchanged while appending
- <p>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.
-</code><div class="node">
+ <p>Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
+<div class="node">
<p><hr>
<a name="ntp_002dkeygen-trusted_002dcert"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
<br>
</div>
@@ -1494,7 +1655,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen
<h4 class="subsection">trusted-cert option (-T)</h4>
<p><a name="index-ntp_002dkeygen_002dtrusted_002dcert-20"></a>
-This is the ``trusted certificate (tc scheme)'' option.
+This is the &ldquo;trusted certificate (tc scheme)&rdquo; option.
<p class="noindent">This option has some usage constraints. It:
<ul>
@@ -1514,7 +1675,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen
<h4 class="subsection">mv-params option (-V)</h4>
<p><a name="index-ntp_002dkeygen_002dmv_002dparams-21"></a>
-This is the ``generate &lt;num&gt; mv parameters'' option.
+This is the &ldquo;generate &lt;num&gt; mv parameters&rdquo; option.
This option takes a number argument <span class="file">num</span>.
<p class="noindent">This option has some usage constraints. It:
@@ -1535,7 +1696,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen
<h4 class="subsection">mv-keys option (-v)</h4>
<p><a name="index-ntp_002dkeygen_002dmv_002dkeys-22"></a>
-This is the ``update &lt;num&gt; mv keys'' option.
+This is the &ldquo;update &lt;num&gt; mv keys&rdquo; option.
This option takes a number argument <span class="file">num</span>.
<p class="noindent">This option has some usage constraints. It:
diff --git a/contrib/ntp/util/ntp-keygen.man.in b/contrib/ntp/util/ntp-keygen.man.in
index bf2bb4a..71dcaa5 100644
--- a/contrib/ntp/util/ntp-keygen.man.in
+++ b/contrib/ntp/util/ntp-keygen.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-keygen @NTP_KEYGEN_MS@ "21 Mar 2017" "ntp (4.2.8p10)" "User Commands"
+.TH ntp-keygen @NTP_KEYGEN_MS@ "27 Feb 2018" "ntp (4.2.8p11)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-uUaiiy/ag-lVaahy)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-bBa46V/ag-nBaW5V)
.\"
-.\" It has been AutoGen-ed March 21, 2017 at 10:45:54 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed February 27, 2018 at 05:15:53 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -36,30 +36,33 @@ All arguments must be options.
.SH DESCRIPTION
This program generates cryptographic data files used by the NTPv4
authentication and identification schemes.
-It generates MD5 key files used in symmetric key cryptography.
-In addition, if the OpenSSL software library has been installed,
-it generates keys, certificate and identity files used in public key
-cryptography.
+It can generate message digest keys used in symmetric key cryptography and,
+if the OpenSSL software library has been installed, it can generate host keys,
+signing keys, certificates, and identity keys and parameters used in Autokey
+public key cryptography.
These files are used for cookie encryption,
-digital signature and challenge/response identification algorithms
+digital signature, and challenge/response identification algorithms
compatible with the Internet standard security infrastructure.
.sp \n(Ppu
.ne 2
-All files are in PEM-encoded printable ASCII format,
-so they can be embedded as MIME attachments in mail to other sites
+The message digest symmetric keys file is generated in a format
+compatible with NTPv3.
+All other files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in email to other sites
and certificate authorities.
By default, files are not encrypted.
.sp \n(Ppu
.ne 2
-When used to generate message digest keys, the program produces a file
-containing ten pseudo-random printable ASCII strings suitable for the
-MD5 message digest algorithm included in the distribution.
+When used to generate message digest symmetric keys, the program
+produces a file containing ten pseudo-random printable ASCII strings
+suitable for the MD5 message digest algorithm included in the
+distribution.
If the OpenSSL library is installed, it produces an additional ten
-hex-encoded random bit strings suitable for the SHA1 and other message
-digest algorithms.
-The message digest keys file must be distributed and stored
+hex-encoded random bit strings suitable for SHA1, AES-128-CMAC, and
+other message digest algorithms.
+The message digest symmetric keys file must be distributed and stored
using secure means beyond the scope of NTP itself.
Besides the keys used for ordinary NTP associations, additional keys
can be defined as passwords for the
@@ -83,27 +86,38 @@ other than Autokey.
Some files used by this program are encrypted using a private password.
The
\f\*[B-Font]\-p\f[]
-option specifies the password for local encrypted files and the
+option specifies the read password for local encrypted files and the
\f\*[B-Font]\-q\f[]
-option the password for encrypted files sent to remote sites.
+option the write password for encrypted files sent to remote sites.
If no password is specified, the host name returned by the Unix
-\fBgethostname\f[]\fR()\f[]
-function, normally the DNS name of the host is used.
+\fChostname\f[]\fR(1)\f[]
+command, normally the DNS name of the host, is used as the the default read
+password, for convenience.
+The
+\f\*[B-Font]ntp-keygen\fP
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
.sp \n(Ppu
.ne 2
The
-\f\*[I-Font]pw\f[]
+\f\*[B-Font]pw\f[]
option of the
-\f\*[I-Font]crypto\f[]
+\f\*[B-Font]crypto\f[]
+\fCntpd\f[]\fR(@NTPD_MS@)\f[]
configuration command specifies the read
password for previously encrypted local files.
-This must match the local password used by this program.
+This must match the local read password used by this program.
If not specified, the host name is used.
-Thus, if files are generated by this program without password,
+Thus, if files are generated by this program without an explicit password,
they can be read back by
-\f\*[I-Font]ntpd\f[]
-without password but only on the same host.
+\fCntpd\f[]\fR(@NTPD_MS@)\f[]
+without specifying an explicit password but only on the same host.
+If the write password used for encryption is specified as the host name,
+these files can be read by that host with no explicit password.
.sp \n(Ppu
.ne 2
@@ -111,215 +125,102 @@ Normally, encrypted files for each host are generated by that host and
used only by that host, although exceptions exist as noted later on
this page.
The symmetric keys file, normally called
-\f\*[I-Font]ntp.keys\f[],
+\fIntp.keys\f[],
is usually installed in
\fI/etc\f[].
Other files and links are usually installed in
\fI/usr/local/etc\f[],
which is normally in a shared filesystem in
NFS-mounted networks and cannot be changed by shared clients.
-The location of the keys directory can be changed by the
-\f\*[I-Font]keysdir\f[]
-configuration command in such cases.
-Normally, this is in
-\fI/etc\f[].
+In these cases, NFS clients can specify the files in another
+directory such as
+\fI/etc\f[]
+using the
+\f\*[B-Font]keysdir\f[]
+\fCntpd\f[]\fR(@NTPD_MS@)\f[]
+configuration file command.
.sp \n(Ppu
.ne 2
This program directs commentary and error messages to the standard
error stream
-\f\*[I-Font]stderr\f[]
+\fIstderr\f[]
and remote files to the standard output stream
-\f\*[I-Font]stdout\f[]
+\fIstdout\f[]
where they can be piped to other applications or redirected to files.
The names used for generated files and links all begin with the
string
-\f\*[I-Font]ntpkey\f[]
+\fIntpkey\&*\f[]
and include the file type, generating host and filestamp,
as described in the
-\*[Lq]Cryptographic Data Files\*[Rq]
+\fICryptographic Data Files\f[]
section below.
.SS Running the Program
-To test and gain experience with Autokey concepts, log in as root and
-change to the keys directory, usually
-\fI/usr/local/etc\f[]
-When run for the first time, or if all files with names beginning with
-\f\*[I-Font]ntpkey\f[]
-have been removed, use the
-\f\*[B-Font]ntp-keygen\fP
-command without arguments to generate a
-default RSA host key and matching RSA-MD5 certificate with expiration
-date one year hence.
-If run again without options, the program uses the
-existing keys and parameters and generates only a new certificate with
-new expiration date one year hence.
-.sp \n(Ppu
-.ne 2
-
-Run the command on as many hosts as necessary.
-Designate one of them as the trusted host (TH) using
+The safest way to run the
\f\*[B-Font]ntp-keygen\fP
-with the
-\f\*[B-Font]\-T\f[]
-option and configure it to synchronize from reliable Internet servers.
-Then configure the other hosts to synchronize to the TH directly or
-indirectly.
-A certificate trail is created when Autokey asks the immediately
-ascendant host towards the TH to sign its certificate, which is then
-provided to the immediately descendant host on request.
-All group hosts should have acyclic certificate trails ending on the TH.
-.sp \n(Ppu
-.ne 2
-
-The host key is used to encrypt the cookie when required and so must be
-RSA type.
-By default, the host key is also the sign key used to encrypt
-signatures.
-A different sign key can be assigned using the
-\f\*[B-Font]\-S\f[]
-option and this can be either RSA or DSA type.
-By default, the signature
-message digest type is MD5, but any combination of sign key type and
-message digest type supported by the OpenSSL library can be specified
-using the
-\f\*[B-Font]\-c\f[]
-option.
-The rules say cryptographic media should be generated with proventic
-filestamps, which means the host should already be synchronized before
-this program is run.
-This of course creates a chicken-and-egg problem
-when the host is started for the first time.
-Accordingly, the host time
-should be set by some other means, such as eyeball-and-wristwatch, at
-least so that the certificate lifetime is within the current year.
-After that and when the host is synchronized to a proventic source, the
-certificate should be re-generated.
-.sp \n(Ppu
-.ne 2
-
-Additional information on trusted groups and identity schemes is on the
-\*[Lq]Autokey Public-Key Authentication\*[Rq]
-page.
-.sp \n(Ppu
-.ne 2
-
-The
-\fCntpd\f[]\fR(@NTPD_MS@)\f[]
-configuration command
-\f\*[B-Font]crypto\f[] \f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]
-specifies the read password for previously encrypted files.
-The daemon expires on the spot if the password is missing
-or incorrect.
-For convenience, if a file has been previously encrypted,
-the default read password is the name of the host running
-the program.
-If the previous write password is specified as the host name,
-these files can be read by that host with no explicit password.
-.sp \n(Ppu
-.ne 2
-
-File names begin with the prefix
-\f\*[B-Font]ntpkey_\f[]
-and end with the postfix
-\f\*[I-Font]_hostname.filestamp\f[],
-where
-\f\*[I-Font]hostname\f[]
-is the owner name, usually the string returned
-by the Unix gethostname() routine, and
-\f\*[I-Font]filestamp\f[]
-is the NTP seconds when the file was generated, in decimal digits.
-This both guarantees uniqueness and simplifies maintenance
-procedures, since all files can be quickly removed
-by a
-\f\*[B-Font]rm\f[] \f\*[B-Font]ntpkey\&*\f[]
-command or all files generated
-at a specific time can be removed by a
-\f\*[B-Font]rm\f[]
-\f\*[I-Font]\&*filestamp\f[]
-command.
-To further reduce the risk of misconfiguration,
-the first two lines of a file contain the file name
-and generation date and time as comments.
-.sp \n(Ppu
-.ne 2
-
-All files are installed by default in the keys directory
+program is logged in directly as root.
+The recommended procedure is change to the
+\f\*[I-Font]keys\f[]
+directory, usually
\fI/usr/local/etc\f[],
-which is normally in a shared filesystem
-in NFS-mounted networks.
-The actual location of the keys directory
-and each file can be overridden by configuration commands,
-but this is not recommended.
-Normally, the files for each host are generated by that host
-and used only by that host, although exceptions exist
-as noted later on this page.
-.sp \n(Ppu
-.ne 2
-
-Normally, files containing private values,
-including the host key, sign key and identification parameters,
-are permitted root read/write-only;
-while others containing public values are permitted world readable.
-Alternatively, files containing private values can be encrypted
-and these files permitted world readable,
-which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
-dependent clients can all be installed in the same shared directory.
+then run the program.
.sp \n(Ppu
.ne 2
-The recommended practice is to keep the file name extensions
-when installing a file and to install a soft link
-from the generic names specified elsewhere on this page
-to the generated files.
-This allows new file generations to be activated simply
-by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
-If a link is not present,
-\fCntpd\f[]\fR(@NTPD_MS@)\f[]
-extracts the filestamp from the file itself.
-This allows clients to verify that the file and generation times
-are always current.
-The
-\f\*[B-Font]ntp-keygen\fP
-program uses the same timestamp extension for all files generated
-at one time, so each generation is distinct and can be readily
-recognized in monitoring data.
-.SS Running the program
-The safest way to run the
+To test and gain experience with Autokey concepts, log in as root and
+change to the
+\f\*[I-Font]keys\f[]
+directory, usually
+\fI/usr/local/etc\f[].
+When run for the first time, or if all files with names beginning with
+\fIntpkey\&*\f[]
+have been removed, use the
\f\*[B-Font]ntp-keygen\fP
-program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
-\fI/usr/local/etc\f[],
-then run the program.
-When run for the first time,
-or if all
-\f\*[B-Font]ntpkey\f[]
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
+command without arguments to generate a default
+\f\*[B-Font]RSA\f[]
+host key and matching
+\f\*[B-Font]RSA-MD5\f[]
+certificate file with expiration date one year hence,
which is all that is necessary in many cases.
The program also generates soft links from the generic names
to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+If run again without options, the program uses the
+existing keys and parameters and generates a new certificate file with
+new expiration date one year hence, and soft link.
.sp \n(Ppu
.ne 2
-The host key is used to encrypt the cookie when required and so must be RSA type.
+The host key is used to encrypt the cookie when required and so must be
+\f\*[B-Font]RSA\f[]
+type.
By default, the host key is also the sign key used to encrypt signatures.
When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
+either
+\f\*[B-Font]RSA\f[]
+or
+\f\*[B-Font]DSA\f[]
+type.
+By default, the message digest type is
+\f\*[B-Font]MD5\f[],
+but any combination
of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
+can be specified, including those using the
+\f\*[B-Font]AES128CMAC\f[], \f\*[B-Font]MD2\f[], \f\*[B-Font]MD5\f[], \f\*[B-Font]MDC2\f[], \f\*[B-Font]SHA\f[], \f\*[B-Font]SHA1\f[]
+and
+\f\*[B-Font]RIPE160\f[]
+message digest algorithms.
However, the scheme specified in the certificate must be compatible
with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Certificates using any digest algorithm are compatible with
+\f\*[B-Font]RSA\f[]
+sign keys;
+however, only
+\f\*[B-Font]SHA\f[]
+and
+\f\*[B-Font]SHA1\f[]
+certificates are compatible with
+\f\*[B-Font]DSA\f[]
+sign keys.
.sp \n(Ppu
.ne 2
@@ -334,19 +235,19 @@ as the other files, are probably not compatible with anything other than Autokey
.ne 2
Running the program as other than root and using the Unix
-\f\*[B-Font]su\f[]
+\fCsu\f[]\fR(1)\f[]
command
to assume root may not work properly, since by default the OpenSSL library
looks for the random seed file
-\f\*[B-Font].rnd\f[]
+\fI.rnd\f[]
in the user home directory.
However, there should be only one
-\f\*[B-Font].rnd\f[],
+\fI.rnd\f[],
most conveniently
in the root directory, so it is convenient to define the
-\f\*[B-Font]$RANDFILE\f[]
+RANDFILE
environment variable used by the OpenSSL library as the path to
-\f\*[B-Font]/.rnd\f[].
+\fI.rnd\f[].
.sp \n(Ppu
.ne 2
@@ -358,7 +259,8 @@ directory such as
\fI/etc\f[]
using the
\f\*[B-Font]keysdir\f[]
-command.
+\fCntpd\f[]\fR(@NTPD_MS@)\f[]
+configuration file command.
There is no need for one client to read the keys and certificates
of other clients or servers, as these data are obtained automatically
by the Autokey protocol.
@@ -397,8 +299,11 @@ while others containing public values are permitted world readable.
Alternatively, files containing private values can be encrypted
and these files permitted world readable,
which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
+Since uniqueness is insured by the
+\f\*[I-Font]hostname\f[]
+and
+\f\*[I-Font]filestamp\f[]
+file name extensions, the files for an NTP server and
dependent clients can all be installed in the same shared directory.
.sp \n(Ppu
.ne 2
@@ -409,116 +314,121 @@ from the generic names specified elsewhere on this page
to the generated files.
This allows new file generations to be activated simply
by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
+If a link is present,
+\fCntpd\f[]\fR(@NTPD_MS@)\f[]
+follows it to the file name to extract the
+\f\*[I-Font]filestamp\f[].
If a link is not present,
\fCntpd\f[]\fR(@NTPD_MS@)\f[]
-extracts the filestamp from the file itself.
+extracts the
+\f\*[I-Font]filestamp\f[]
+from the file itself.
This allows clients to verify that the file and generation times
are always current.
The
\f\*[B-Font]ntp-keygen\fP
-program uses the same timestamp extension for all files generated
+program uses the same
+\f\*[I-Font]filestamp\f[]
+extension for all files generated
at one time, so each generation is distinct and can be readily
recognized in monitoring data.
-.SS Running the program
-The safest way to run the
-\f\*[B-Font]ntp-keygen\fP
-program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
-\fI/usr/local/etc\f[],
-then run the program.
-When run for the first time,
-or if all
-\f\*[B-Font]ntpkey\f[]
-files have been removed,
-the program generates a RSA host key file and matching RSA-MD5 certificate file,
-which is all that is necessary in many cases.
-The program also generates soft links from the generic names
-to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
.sp \n(Ppu
.ne 2
-The host key is used to encrypt the cookie when required and so must be RSA type.
-By default, the host key is also the sign key used to encrypt signatures.
-When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
-of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
-However, the scheme specified in the certificate must be compatible
-with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
+\f\*[B-Font]ntp-keygen\fP
+with the
+\f\*[B-Font]\-T\f[]
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
.sp \n(Ppu
.ne 2
-Private/public key files and certificates are compatible with
-other OpenSSL applications and very likely other libraries as well.
-Certificates or certificate requests derived from them should be compatible
-with extant industry practice, although some users might find
-the interpretation of X509v3 extension fields somewhat liberal.
-However, the identification parameter files, although encoded
-as the other files, are probably not compatible with anything other than Autokey.
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+\f\*[B-Font]\-S\f[]
+option and this can be either
+\f\*[B-Font]RSA\f[]
+or
+\f\*[B-Font]DSA\f[]
+type.
+By default, the signature
+message digest type is
+\f\*[B-Font]MD5\f[],
+but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+\f\*[B-Font]\-c\f[]
+option.
.sp \n(Ppu
.ne 2
-Running the program as other than root and using the Unix
-\f\*[B-Font]su\f[]
-command
-to assume root may not work properly, since by default the OpenSSL library
-looks for the random seed file
-\f\*[B-Font].rnd\f[]
-in the user home directory.
-However, there should be only one
-\f\*[B-Font].rnd\f[],
-most conveniently
-in the root directory, so it is convenient to define the
-\f\*[B-Font]$RANDFILE\f[]
-environment variable used by the OpenSSL library as the path to
-\f\*[B-Font]/.rnd\f[].
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
.sp \n(Ppu
.ne 2
-Installing the keys as root might not work in NFS-mounted
-shared file systems, as NFS clients may not be able to write
-to the shared keys directory, even as root.
-In this case, NFS clients can specify the files in another
-directory such as
-\fI/etc\f[]
-using the
-\f\*[B-Font]keysdir\f[]
-command.
-There is no need for one client to read the keys and certificates
-of other clients or servers, as these data are obtained automatically
-by the Autokey protocol.
+Additional information on trusted groups and identity schemes is on the
+\*[Lq]Autokey Public-Key Authentication\*[Rq]
+page.
.sp \n(Ppu
.ne 2
-Ordinarily, cryptographic files are generated by the host that uses them,
-but it is possible for a trusted agent (TA) to generate these files
-for other hosts; however, in such cases files should always be encrypted.
-The subject name and trusted name default to the hostname
-of the host generating the files, but can be changed by command line options.
-It is convenient to designate the owner name and trusted name
-as the subject and issuer fields, respectively, of the certificate.
-The owner name is also used for the host and sign key files,
-while the trusted name is used for the identity files.
-seconds.
-seconds.
-s Trusted Hosts and Groups
+File names begin with the prefix
+\fIntpkey\f[]_
+and end with the suffix
+\fI_\f[]\f\*[I-Font]hostname\f[]. \f\*[I-Font]filestamp\f[],
+where
+\f\*[I-Font]hostname\f[]
+is the owner name, usually the string returned
+by the Unix
+\fChostname\f[]\fR(1)\f[]
+command, and
+\f\*[I-Font]filestamp\f[]
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+\f\*[B-Font]rm\f[] \fIntpkey\&*\f[]
+command or all files generated
+at a specific time can be removed by a
+\f\*[B-Font]rm\f[] \fI\&*\f[]\f\*[I-Font]filestamp\f[]
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+.SS Trusted Hosts and Groups
Each cryptographic configuration involves selection of a signature scheme
and identification scheme, called a cryptotype,
as explained in the
\fIAuthentication\f[] \fIOptions\f[]
section of
\fCntp.conf\f[]\fR(5)\f[].
-The default cryptotype uses RSA encryption, MD5 message digest
-and TC identification.
+The default cryptotype uses
+\f\*[B-Font]RSA\f[]
+encryption,
+\f\*[B-Font]MD5\f[]
+message digest
+and
+\f\*[B-Font]TC\f[]
+identification.
First, configure a NTP subnet including one or more low-stratum
trusted hosts from which all other hosts derive synchronization
directly or indirectly.
@@ -538,7 +448,7 @@ section of
On each trusted host as root, change to the keys directory.
To insure a fresh fileset, remove all
-\f\*[B-Font]ntpkey\f[]
+\fIntpkey\f[]
files.
Then run
\f\*[B-Font]ntp-keygen\fP
@@ -565,7 +475,9 @@ is either
\f\*[B-Font]RSA\f[]
or
\f\*[B-Font]DSA\f[].
-The most often need to do this is when a DSA-signed certificate is used.
+The most frequent need to do this is when a
+\f\*[B-Font]DSA\f[]\-signed
+certificate is used.
If it is necessary to use a different certificate scheme than the default,
run
\f\*[B-Font]ntp-keygen\fP
@@ -574,10 +486,10 @@ with the
option and selected
\f\*[I-Font]scheme\f[]
as needed.
-f
+If
\f\*[B-Font]ntp-keygen\fP
is run again without these options, it generates a new certificate
-using the same scheme and sign key.
+using the same scheme and sign key, and soft link.
.sp \n(Ppu
.ne 2
@@ -586,7 +498,7 @@ from time to time, if only to extend the validity interval.
Simply run
\f\*[B-Font]ntp-keygen\fP
with the same flags as before to generate new certificates
-using existing keys.
+using existing keys, and soft links.
However, if the host or sign key is changed,
\fCntpd\f[]\fR(@NTPD_MS@)\f[]
should be restarted.
@@ -597,13 +509,15 @@ Other dependent hosts will continue as usual until signatures are refreshed,
at which time the protocol is restarted.
.SS Identity Schemes
As mentioned on the Autonomous Authentication page,
-the default TC identity scheme is vulnerable to a middleman attack.
+the default
+\f\*[B-Font]TC\f[]
+identity scheme is vulnerable to a middleman attack.
However, there are more secure identity schemes available,
-including PC, IFF, GQ and MV described on the
-"Identification Schemes"
-page
-(maybe available at
-\f[C]http://www.eecis.udel.edu/%7emills/keygen.html\f[]).
+including
+\f\*[B-Font]PC\f[], \f\*[B-Font]IFF\f[], \f\*[B-Font]GQ\f[]
+and
+\f\*[B-Font]MV\f[]
+schemes described below.
These schemes are based on a TA, one or more trusted hosts
and some number of nontrusted hosts.
Trusted hosts prove identity using values provided by the TA,
@@ -632,12 +546,15 @@ On trusted host alice run
\f\*[B-Font]\-P\f[]
\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
to generate the host key file
-\fIntpkey_RSAkey_\f[]\f\*[I-Font]alice.filestamp\f[]
+\fIntpkey\f[]_ \f\*[B-Font]RSA\f[] \fIkey_alice.\f[] \f\*[I-Font]filestamp\f[]
and trusted private certificate file
-\fIntpkey_RSA-MD5_cert_\f[]\f\*[I-Font]alice.filestamp\f[].
+\fIntpkey\f[]_ \f\*[B-Font]RSA-MD5\f[] \f\*[B-Font]_\f[] \fIcert_alice.\f[] \f\*[I-Font]filestamp\f[],
+and soft links.
Copy both files to all group hosts;
they replace the files which would be generated in other schemes.
-On each host bob install a soft link from the generic name
+On each host
+\f\*[I-Font]bob\f[]
+install a soft link from the generic name
\fIntpkey_host_\f[]\f\*[I-Font]bob\f[]
to the host key file and soft link
\fIntpkey_cert_\f[]\f\*[I-Font]bob\f[]
@@ -646,28 +563,36 @@ Note the generic links are on bob, but point to files generated
by trusted host alice.
In this scheme it is not possible to refresh
either the keys or certificates without copying them
-to all other hosts in the group.
+to all other hosts in the group, and recreating the soft links.
.sp \n(Ppu
.ne 2
-For the IFF scheme proceed as in the TC scheme to generate keys
+For the
+\f\*[B-Font]IFF\f[]
+scheme proceed as in the
+\f\*[B-Font]TC\f[]
+scheme to generate keys
and certificates for all group hosts, then for every trusted host in the group,
-generate the IFF parameter file.
+generate the
+\f\*[B-Font]IFF\f[]
+parameter file.
On trusted host alice run
\f\*[B-Font]ntp-keygen\fP
\f\*[B-Font]\-T\f[]
\f\*[B-Font]\-I\f[]
\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
to produce her parameter file
-\fIntpkey_IFFpar_\f[]\f\*[I-Font]alice.filestamp\f[],
+\fIntpkey_IFFpar_alice.\f[]\f\*[I-Font]filestamp\f[],
which includes both server and client keys.
Copy this file to all group hosts that operate as both servers
and clients and install a soft link from the generic
-\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[]
+\fIntpkey_iff_alice\f[]
to this file.
If there are no hosts restricted to operate only as clients,
there is nothing further to do.
-As the IFF scheme is independent
+As the
+\f\*[B-Font]IFF\f[]
+scheme is independent
of keys and certificates, these files can be refreshed as needed.
.sp \n(Ppu
.ne 2
@@ -679,41 +604,57 @@ from the parameter file and distributed to all restricted clients.
After generating the parameter file, on alice run
\f\*[B-Font]ntp-keygen\fP
\f\*[B-Font]\-e\f[]
-and pipe the output to a file or mail program.
-Copy or mail this file to all restricted clients.
+and pipe the output to a file or email program.
+Copy or email this file to all restricted clients.
On these clients install a soft link from the generic
-\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[]
+\fIntpkey_iff_alice\f[]
to this file.
To further protect the integrity of the keys,
each file can be encrypted with a secret password.
.sp \n(Ppu
.ne 2
-For the GQ scheme proceed as in the TC scheme to generate keys
+For the
+\f\*[B-Font]GQ\f[]
+scheme proceed as in the
+\f\*[B-Font]TC\f[]
+scheme to generate keys
and certificates for all group hosts, then for every trusted host
-in the group, generate the IFF parameter file.
+in the group, generate the
+\f\*[B-Font]IFF\f[]
+parameter file.
On trusted host alice run
\f\*[B-Font]ntp-keygen\fP
\f\*[B-Font]\-T\f[]
\f\*[B-Font]\-G\f[]
\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
to produce her parameter file
-\fIntpkey_GQpar_\f[]\f\*[I-Font]alice.filestamp\f[],
+\fIntpkey_GQpar_alice.\f[]\f\*[I-Font]filestamp\f[],
which includes both server and client keys.
Copy this file to all group hosts and install a soft link
from the generic
-\fIntpkey_gq_\f[]\f\*[I-Font]alice\f[]
+\fIntpkey_gq_alice\f[]
to this file.
-In addition, on each host bob install a soft link
+In addition, on each host
+\f\*[I-Font]bob\f[]
+install a soft link
from generic
\fIntpkey_gq_\f[]\f\*[I-Font]bob\f[]
to this file.
-As the GQ scheme updates the GQ parameters file and certificate
+As the
+\f\*[B-Font]GQ\f[]
+scheme updates the
+\f\*[B-Font]GQ\f[]
+parameters file and certificate
at the same time, keys and certificates can be regenerated as needed.
.sp \n(Ppu
.ne 2
-For the MV scheme, proceed as in the TC scheme to generate keys
+For the
+\f\*[B-Font]MV\f[]
+scheme, proceed as in the
+\f\*[B-Font]TC\f[]
+scheme to generate keys
and certificates for all group hosts.
For illustration assume trish is the TA, alice one of several trusted hosts
and bob one of her clients.
@@ -725,9 +666,9 @@ where
\f\*[I-Font]n\f[]
is the number of revokable keys (typically 5) to produce
the parameter file
-\fIntpkeys_MVpar_\f[]\f\*[I-Font]trish.filestamp\f[]
+\fIntpkeys_MVpar_trish.\f[]\f\*[I-Font]filestamp\f[]
and client key files
-\fIntpkeys_MVkeyd_\f[]\f\*[I-Font]trish.filestamp\f[]
+\fIntpkeys_MVkey\f[]\f\*[I-Font]d\f[] \f\*[I-Font]_\f[] \fItrish.\f[] \f\*[I-Font]filestamp\f[]
where
\f\*[I-Font]d\f[]
is the key number (0 \&<
@@ -736,95 +677,236 @@ is the key number (0 \&<
\f\*[I-Font]n\f[]).
Copy the parameter file to alice and install a soft link
from the generic
-\fIntpkey_mv_\f[]\f\*[I-Font]alice\f[]
+\fIntpkey_mv_alice\f[]
to this file.
Copy one of the client key files to alice for later distribution
to her clients.
-It doesn't matter which client key file goes to alice,
+It does not matter which client key file goes to alice,
since they all work the same way.
-Alice copies the client key file to all of her cliens.
+Alice copies the client key file to all of her clients.
On client bob install a soft link from generic
-\fIntpkey_mvkey_\f[]\f\*[I-Font]bob\f[]
+\fIntpkey_mvkey_bob\f[]
to the client key file.
-As the MV scheme is independent of keys and certificates,
+As the
+\f\*[B-Font]MV\f[]
+scheme is independent of keys and certificates,
these files can be refreshed as needed.
.SS Command Line Options
.TP 7
-.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[]
-Select certificate message digest/signature encryption scheme.
+.NOP \f\*[B-Font]\-b\f[] \f\*[B-Font]\-\-imbits\f[]= \f\*[I-Font]modulus\f[]
+Set the number of bits in the identity modulus for generating identity keys to
+\f\*[I-Font]modulus\f[]
+bits.
+The number of bits in the identity modulus defaults to 256, but can be set to
+values from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+.TP 7
+.NOP \f\*[B-Font]\-c\f[] \f\*[B-Font]\-\-certificate\f[]= \f\*[I-Font]scheme\f[]
+Select certificate signature encryption/message digest scheme.
The
\f\*[I-Font]scheme\f[]
can be one of the following:
-. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+\f\*[B-Font]RSA-MD2\f[], \f\*[B-Font]RSA-MD5\f[], \f\*[B-Font]RSA-MDC2\f[], \f\*[B-Font]RSA-SHA\f[], \f\*[B-Font]RSA-SHA1\f[], \f\*[B-Font]RSA-RIPEMD160\f[], \f\*[B-Font]DSA-SHA\f[],
or
\f\*[B-Font]DSA-SHA1\f[].
-Note that RSA schemes must be used with a RSA sign key and DSA
-schemes must be used with a DSA sign key.
+Note that
+\f\*[B-Font]RSA\f[]
+schemes must be used with an
+\f\*[B-Font]RSA\f[]
+sign key and
+\f\*[B-Font]DSA\f[]
+schemes must be used with a
+\f\*[B-Font]DSA\f[]
+sign key.
The default without this option is
\f\*[B-Font]RSA-MD5\f[].
+If compatibility with FIPS 140-2 is required, either the
+\f\*[B-Font]DSA-SHA\f[]
+or
+\f\*[B-Font]DSA-SHA1\f[]
+scheme must be used.
.TP 7
-.NOP \f\*[B-Font]\-d\f[]
-Enable debugging.
+.NOP \f\*[B-Font]\-C\f[] \f\*[B-Font]\-\-cipher\f[]= \f\*[I-Font]cipher\f[]
+Select the OpenSSL cipher to encrypt the files containing private keys.
+The default without this option is three-key triple DES in CBC mode,
+\f\*[B-Font]des-ede3-cbc\f[].
+The
+\f\*[B-Font]openssl\f[] \f\*[B-Font]\-h\f[]
+command provided with OpenSSL displays available ciphers.
+.TP 7
+.NOP \f\*[B-Font]\-d\f[] \f\*[B-Font]\-\-debug-level\f[]
+Increase debugging verbosity level.
This option displays the cryptographic data produced in eye-friendly billboards.
.TP 7
-.NOP \f\*[B-Font]\-e\f[]
-Write the IFF client keys to the standard output.
-This is intended for automatic key distribution by mail.
+.NOP \f\*[B-Font]\-D\f[] \f\*[B-Font]\-\-set-debug-level\f[]= \f\*[I-Font]level\f[]
+Set the debugging verbosity to
+\f\*[I-Font]level\f[].
+This option displays the cryptographic data produced in eye-friendly billboards.
.TP 7
-.NOP \f\*[B-Font]\-G\f[]
-Generate parameters and keys for the GQ identification scheme,
-obsoleting any that may exist.
+.NOP \f\*[B-Font]\-e\f[] \f\*[B-Font]\-\-id-key\f[]
+Write the
+\f\*[B-Font]IFF\f[]
+or
+\f\*[B-Font]GQ\f[]
+public parameters from the
+\f\*[I-Font]IFFkey\f[] \f\*[I-Font]or\f[] \f\*[I-Font]GQkey\f[]
+client keys file previously specified
+as unencrypted data to the standard output stream
+\fIstdout\f[].
+This is intended for automatic key distribution by email.
.TP 7
-.NOP \f\*[B-Font]\-g\f[]
-Generate keys for the GQ identification scheme
-using the existing GQ parameters.
-If the GQ parameters do not yet exist, create them first.
+.NOP \f\*[B-Font]\-G\f[] \f\*[B-Font]\-\-gq-params\f[]
+Generate a new encrypted
+\f\*[B-Font]GQ\f[]
+parameters and key file for the Guillou-Quisquater (GQ) identity scheme.
+This option is mutually exclusive with the
+\f\*[B-Font]\-I\f[]
+and
+\f\*[B-Font]\-V\f[]
+options.
.TP 7
-.NOP \f\*[B-Font]\-H\f[]
-Generate new host keys, obsoleting any that may exist.
+.NOP \f\*[B-Font]\-H\f[] \f\*[B-Font]\-\-host-key\f[]
+Generate a new encrypted
+\f\*[B-Font]RSA\f[]
+public/private host key file.
.TP 7
-.NOP \f\*[B-Font]\-I\f[]
-Generate parameters for the IFF identification scheme,
-obsoleting any that may exist.
+.NOP \f\*[B-Font]\-I\f[] \f\*[B-Font]\-\-iffkey\f[]
+Generate a new encrypted
+\f\*[B-Font]IFF\f[]
+key file for the Schnorr (IFF) identity scheme.
+This option is mutually exclusive with the
+\f\*[B-Font]\-G\f[]
+and
+Fl V
+options.
.TP 7
-.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]name\f[]
-Set the suject name to
-\f\*[I-Font]name\f[].
-This is used as the subject field in certificates
-and in the file name for host and sign keys.
+.NOP \f\*[B-Font]\-i\f[] \f\*[B-Font]\-\-ident\f[]= \f\*[I-Font]group\f[]
+Set the optional Autokey group name to
+\f\*[I-Font]group\f[].
+This is used in the identity scheme parameter file names of
+\f\*[B-Font]IFF\f[], \f\*[B-Font]GQ\f[],
+and
+\f\*[B-Font]MV\f[]
+client parameters files.
+In that role, the default is the host name if no group is provided.
+The group name, if specified using
+\f\*[B-Font]\-i\f[]
+or
+\f\*[B-Font]\-s\f[]
+following an
+\[oq]@@\[cq]
+character, is also used in certificate subject and issuer names in the form
+\f\*[I-Font]host\f[] \f\*[I-Font]@@\f[] \f\*[I-Font]group\f[]
+and should match the group specified via
+\f\*[B-Font]crypto\f[] \f\*[B-Font]ident\f[]
+or
+\f\*[B-Font]server\f[] \f\*[B-Font]ident\f[]
+in the ntpd configuration file.
.TP 7
-.NOP \f\*[B-Font]\-M\f[]
-Generate MD5 keys, obsoleting any that may exist.
+.NOP \f\*[B-Font]\-l\f[] \f\*[B-Font]\-\-lifetime\f[]= \f\*[I-Font]days\f[]
+Set the lifetime for certificate expiration to
+\f\*[I-Font]days\f[].
+The default lifetime is one year (365 days).
.TP 7
-.NOP \f\*[B-Font]\-P\f[]
-Generate a private certificate.
-By default, the program generates public certificates.
+.NOP \f\*[B-Font]\-m\f[] \f\*[B-Font]\-\-modulus\f[]= \f\*[I-Font]bits\f[]
+Set the number of bits in the prime modulus for generating files to
+\f\*[I-Font]bits\f[].
+The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
.TP 7
-.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
-Encrypt generated files containing private data with
-\f\*[I-Font]password\f[]
-and the DES-CBC algorithm.
+.NOP \f\*[B-Font]\-M\f[] \f\*[B-Font]\-\-md5key\f[]
+Generate a new symmetric keys file containing 10
+\f\*[B-Font]MD5\f[]
+keys, and if OpenSSL is available, 10
+\f\*[B-Font]SHA\f[]
+keys.
+An
+\f\*[B-Font]MD5\f[]
+key is a string of 20 random printable ASCII characters, while a
+\f\*[B-Font]SHA\f[]
+key is a string of 40 random hex digits.
+The file can be edited using a text editor to change the key type or key content.
+This option is mutually exclusive with all other options.
.TP 7
-.NOP \f\*[B-Font]\-q\f[]
-Set the password for reading files to password.
+.NOP \f\*[B-Font]\-p\f[] \f\*[B-Font]\-\-password\f[]= \f\*[I-Font]passwd\f[]
+Set the password for reading and writing encrypted files to
+\f\*[I-Font]passwd\f[].
+These include the host, sign and identify key files.
+By default, the password is the string returned by the Unix
+\f\*[B-Font]hostname\f[]
+command.
.TP 7
-.NOP \f\*[B-Font]\-S\f[] [\f\*[B-Font]RSA\f[] | \f\*[B-Font]DSA\f[]]
-Generate a new sign key of the designated type,
-obsoleting any that may exist.
-By default, the program uses the host key as the sign key.
+.NOP \f\*[B-Font]\-P\f[] \f\*[B-Font]\-\-pvt-cert\f[]
+Generate a new private certificate used by the
+\f\*[B-Font]PC\f[]
+identity scheme.
+By default, the program generates public certificates.
+Note: the PC identity scheme is not recommended for new installations.
.TP 7
-.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]name\f[]
-Set the issuer name to
-\f\*[I-Font]name\f[].
-This is used for the issuer field in certificates
-and in the file name for identity files.
+.NOP \f\*[B-Font]\-q\f[] \f\*[B-Font]\-\-export-passwd\f[]= \f\*[I-Font]passwd\f[]
+Set the password for writing encrypted
+\f\*[B-Font]IFF\f[], \f\*[B-Font]GQ\f[] \f\*[B-Font]and\f[] \f\*[B-Font]MV\f[]
+identity files redirected to
+\fIstdout\f[]
+to
+\f\*[I-Font]passwd\f[].
+In effect, these files are decrypted with the
+\f\*[B-Font]\-p\f[]
+password, then encrypted with the
+\f\*[B-Font]\-q\f[]
+password.
+By default, the password is the string returned by the Unix
+\f\*[B-Font]hostname\f[]
+command.
.TP 7
-.NOP \f\*[B-Font]\-T\f[]
+.NOP \f\*[B-Font]\-s\f[] \f\*[B-Font]\-\-subject-key\f[]= [host] [@@ \f\*[I-Font]group\f[]]
+Specify the Autokey host name, where
+\f\*[I-Font]host\f[]
+is the optional host name and
+\f\*[I-Font]group\f[]
+is the optional group name.
+The host name, and if provided, group name are used in
+\f\*[I-Font]host\f[] \f\*[I-Font]@@\f[] \f\*[I-Font]group\f[]
+form as certificate subject and issuer.
+Specifying
+\f\*[B-Font]\-s\f[] \f\*[B-Font]\-@@\f[] \f\*[I-Font]group\f[]
+is allowed, and results in leaving the host name unchanged, as with
+\f\*[B-Font]\-i\f[] \f\*[I-Font]group\f[].
+The group name, or if no group is provided, the host name are also used in the
+file names of
+\f\*[B-Font]IFF\f[], \f\*[B-Font]GQ\f[],
+and
+\f\*[B-Font]MV\f[]
+identity scheme client parameter files.
+If
+\f\*[I-Font]host\f[]
+is not specified, the default host name is the string returned by the Unix
+\f\*[B-Font]hostname\f[]
+command.
+.TP 7
+.NOP \f\*[B-Font]\-S\f[] \f\*[B-Font]\-\-sign-key\f[]= [\f\*[B-Font]RSA\f[] | \f\*[B-Font]DSA\f[]]
+Generate a new encrypted public/private sign key file of the specified type.
+By default, the sign key is the host key and has the same type.
+If compatibility with FIPS 140-2 is required, the sign key type must be
+\f\*[B-Font]DSA\f[].
+.TP 7
+.NOP \f\*[B-Font]\-T\f[] \f\*[B-Font]\-\-trusted-cert\f[]
Generate a trusted certificate.
By default, the program generates a non-trusted certificate.
.TP 7
-.NOP \f\*[B-Font]\-V\f[] \f\*[I-Font]nkeys\f[]
-Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+.NOP \f\*[B-Font]\-V\f[] \f\*[B-Font]\-\-mv-params\f[] \f\*[I-Font]nkeys\f[]
+Generate
+\f\*[I-Font]nkeys\f[]
+encrypted server keys and parameters for the Mu-Varadharajan (MV)
+identity scheme.
+This option is mutually exclusive with the
+\f\*[B-Font]\-I\f[]
+and
+\f\*[B-Font]\-G\f[]
+options.
+Note: support for this option should be considered a work in progress.
.PP
.SS Random Seed File
All cryptographically sound key generation schemes must have means
@@ -852,7 +934,7 @@ but are outside the scope of this page.
The entropy seed used by the OpenSSL library is contained in a file,
usually called
-\f\*[B-Font].rnd\f[],
+\fI.rnd\f[],
which must be available when starting the NTP daemon
or the
\f\*[B-Font]ntp-keygen\fP
@@ -875,48 +957,131 @@ If the
RANDFILE
environment variable is not present,
the library will look for the
-\f\*[B-Font].rnd\f[]
+\fI.rnd\f[]
file in the user home directory.
+Since both the
+\f\*[B-Font]ntp-keygen\fP
+program and
+\fCntpd\f[]\fR(@NTPD_MS@)\f[]
+daemon must run as root, the logical place to put this file is in
+\fI/.rnd\f[]
+or
+\fI/root/.rnd\f[].
If the file is not available or cannot be written,
the daemon exits with a message to the system log and the program
exits with a suitable error message.
.SS Cryptographic Data Files
-All other file formats begin with two lines.
-The first contains the file name, including the generated host name
-and filestamp.
-The second contains the datestamp in conventional Unix date format.
-Lines beginning with # are considered comments and ignored by the
+All file formats begin with two nonencrypted lines.
+The first line contains the file name, including the generated host name
+and filestamp, in the format
+\fIntpkey_\f[]\f\*[I-Font]key\f[] \f\*[I-Font]_\f[] \f\*[I-Font]name\f[]. \f\*[I-Font]filestamp\f[],
+where
+\f\*[I-Font]key\f[]
+is the key or parameter type,
+\f\*[I-Font]name\f[]
+is the host or group name and
+\f\*[I-Font]filestamp\f[]
+is the filestamp (NTP seconds) when the file was created.
+By convention,
+\f\*[I-Font]key\f[]
+names in generated file names include both upper and lower case
+characters, while
+\f\*[I-Font]key\f[]
+names in generated link names include only lower case characters.
+The filestamp is not used in generated link names.
+The second line contains the datestamp in conventional Unix
+\fIdate\f[]
+format.
+Lines beginning with
+\[oq]#\[cq]
+are considered comments and ignored by the
\f\*[B-Font]ntp-keygen\fP
program and
\fCntpd\f[]\fR(@NTPD_MS@)\f[]
daemon.
-Cryptographic values are encoded first using ASN.1 rules,
-then encrypted if necessary, and finally written PEM-encoded
-printable ASCII format preceded and followed by MIME content identifier lines.
.sp \n(Ppu
.ne 2
-The format of the symmetric keys file is somewhat different
-than the other files in the interest of backward compatibility.
-Since DES-CBC is deprecated in NTPv4, the only key format of interest
-is MD5 alphanumeric strings.
-Following hte heard the keys are
-entered one per line in the format
+The remainder of the file contains cryptographic data, encoded first using ASN.1
+rules, then encrypted if necessary, and finally written in PEM-encoded
+printable ASCII text, preceded and followed by MIME content identifier lines.
+.sp \n(Ppu
+.ne 2
+
+The format of the symmetric keys file, ordinarily named
+\fIntp.keys\f[],
+is somewhat different than the other files in the interest of backward compatibility.
+Ordinarily, the file is generated by this program, but it can be constructed
+and edited using an ordinary text editor.
+.br
+.in +4
+.nf
+# ntpkey_MD5key_bk.ntp.org.3595864945
+# Thu Dec 12 19:22:25 2013
+1 MD5 L";Nw<\`.I<f4U0)247"i # MD5 key
+2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key
+3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key
+4 MD5 Yue:tL[+vR)M\`n~bY,'? # MD5 key
+5 MD5 B;fx'Kgr/&4ZTbL6=RxA # MD5 key
+6 MD5 4eYwa\`o}3i@@@@V@@..R9!l # MD5 key
+7 MD5 \`A.([h+;wTQ|xfi%Sn_! # MD5 key
+8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key
+9 MD5 3-5vcn*6l29DS?Xdsg)* # MD5 key
+10 MD5 2late4Me # MD5 key
+11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key
+12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key
+13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key
+14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key
+15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key
+16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key
+17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key
+18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key
+19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key
+20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key
+.in -4
+.fi
+.in +4
+Figure 1. Typical Symmetric Key File
+.in -4
+.sp \n(Ppu
+.ne 2
+
+Figure 1 shows a typical symmetric keys file used by the reference
+implementation.
+Following the header the keys are entered one per line in the format
.in +4
\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[]
.in -4
where
\f\*[I-Font]keyno\f[]
-is a positive integer in the range 1-65,535,
+is a positive integer in the range 1-65534;
\f\*[I-Font]type\f[]
-is the string MD5 defining the key format and
+is the key type for the message digest algorithm, which in the absence of the
+OpenSSL library must be
+\f\*[B-Font]MD5\f[]
+to designate the MD5 message digest algorithm;
+if the OpenSSL library is installed, the key type can be any
+message digest algorithm supported by that library;
+however, if compatibility with FIPS 140-2 is required,
+the key type must be either
+\f\*[B-Font]SHA\f[]
+or
+\f\*[B-Font]SHA1\f[];
\f\*[I-Font]key\f[]
is the key itself,
-which is a printable ASCII string 16 characters or less in length.
-Each character is chosen from the 93 printable characters
-in the range 0x21 through 0x7f excluding space and the
+which is a printable ASCII string 20 characters or less in length:
+each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7e (
+\[oq]\[cq]!
+through
+\[oq]~\[cq]
+\&) excluding space and the
+\[oq]#\[cq]
+character, and terminated by whitespace or a
\[oq]#\[cq]
character.
+An OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which
+is truncated as necessary.
.sp \n(Ppu
.ne 2
@@ -933,8 +1098,8 @@ in human readable ASCII format.
The
\f\*[B-Font]ntp-keygen\fP
-program generates a MD5 symmetric keys file
-\fIntpkey_MD5key_\f[]\f\*[I-Font]hostname.filestamp\f[].
+program generates a symmetric keys file
+\fIntpkey_MD5key_\f[]\f\*[I-Font]hostname\f[]. \f\*[I-Font]filestamp\f[].
Since the file contains private shared keys,
it should be visible only to root and distributed by secure means
to other subnet hosts.
@@ -973,10 +1138,10 @@ The number of bits in the identity modulus. The default is 256.
certificate scheme.
.sp
scheme is one of
-RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+RSA-MD2, RSA-MD5, RSA-MDC2, RSA-SHA, RSA-SHA1, RSA-RIPEMD160,
DSA-SHA, or DSA-SHA1.
.sp
-Select the certificate message digest/signature encryption scheme.
+Select the certificate signature encryption/message digest scheme.
Note that RSA schemes must be used with a RSA sign key and DSA
schemes must be used with a DSA sign key. The default without
this option is RSA-MD5.
@@ -986,7 +1151,7 @@ privatekey cipher.
.sp
Select the cipher which is used to encrypt the files containing
private keys. The default is three-key triple DES in CBC mode,
-equivalent to "@code{-C des-ede3-cbc". The openssl tool lists ciphers
+equivalent to "\fB-C des-ede3-cbc\fP". The openssl tool lists ciphers
available in "\fBopenssl \-h\fP" output.
.TP
.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
@@ -1003,8 +1168,9 @@ This option takes an integer number as its argument.
.NOP \f\*[B-Font]\-e\f[], \f\*[B-Font]\-\-id\-key\f[]
Write IFF or GQ identity keys.
.sp
-Write the IFF or GQ client keys to the standard output. This is
-intended for automatic key distribution by mail.
+Write the public parameters from the IFF or GQ client keys to
+the standard output.
+This is intended for automatic key distribution by email.
.TP
.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-gq\-params\f[]
Generate GQ parameters and keys.
@@ -1030,11 +1196,11 @@ 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 \fB-i/--ident\fP or
-using \fB-s/--subject-name\fP following an '\fB@\fP' character,
-is also a part of the self-signed host certificate's subject and
-issuer names in the form \fBhost@group\fP and should match the
-'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
-\fBntpd\fP's configuration file.
+using \fB-s/--subject-name\fP following an '\fB@@\fP' character,
+is also a part of the self-signed host certificate subject and
+issuer names in the form \fBhost@@group\fP and should match the
+'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in the
+\fBntpd\fP configuration file.
.TP
.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]lifetime\f[], \f\*[B-Font]\-\-lifetime\f[]=\f\*[I-Font]lifetime\f[]
set certificate lifetime.
@@ -1042,13 +1208,8 @@ This option takes an integer number as its argument.
.sp
Set the certificate expiration to lifetime days from now.
.TP
-.NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-md5key\f[]
-generate MD5 keys.
-.sp
-Generate MD5 keys, obsoleting any that may exist.
-.TP
.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]modulus\f[], \f\*[B-Font]\-\-modulus\f[]=\f\*[I-Font]modulus\f[]
-modulus.
+prime modulus.
This option takes an integer number as its argument.
The value of
\f\*[I-Font]modulus\f[]
@@ -1062,6 +1223,11 @@ in the range 256 through 2048
.sp
The number of bits in the prime modulus. The default is 512.
.TP
+.NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-md5key\f[]
+generate symmetric keys.
+.sp
+Generate symmetric keys, obsoleting any that may exist.
+.TP
.NOP \f\*[B-Font]\-P\f[], \f\*[B-Font]\-\-pvt\-cert\f[]
generate PC private certificate.
.sp
@@ -1086,27 +1252,27 @@ The same password must be specified to the remote ntpd via the
"crypto pw password" configuration command. See also the option
--id-key (-e) for unencrypted exports.
.TP
-.NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]sign\f[], \f\*[B-Font]\-\-sign\-key\f[]=\f\*[I-Font]sign\f[]
-generate sign key (RSA or DSA).
-.sp
-Generate a new sign key of the designated type, obsoleting any
-that may exist. By default, the program uses the host key as the
-sign key.
-.TP
.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]host@group\f[], \f\*[B-Font]\-\-subject\-name\f[]=\f\*[I-Font]host@group\f[]
set host and optionally group name.
.sp
Set the Autokey host name, and optionally, group name specified
-following an '\fB@\fP' character. The host name is used in the file
+following an '\fB@@\fP' 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 \fBhost@group\fP form for the host certificate's subject and issuer
-fields. Specifying '\fB-s @group\fP' is allowed, and results in
-leaving the host name unchanged while appending \fB@group\fP to the
+in \fBhost@@group\fP form for the host certificate subject and issuer
+fields. Specifying '\fB-s @@group\fP' is allowed, and results in
+leaving the host name unchanged while appending \fB@@group\fP to the
subject and issuer fields, as with \fB-i group\fP. 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.
.TP
+.NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]sign\f[], \f\*[B-Font]\-\-sign\-key\f[]=\f\*[I-Font]sign\f[]
+generate sign key (RSA or DSA).
+.sp
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
+.TP
.NOP \f\*[B-Font]\-T\f[], \f\*[B-Font]\-\-trusted\-cert\f[]
trusted certificate (TC scheme).
.sp
@@ -1162,18 +1328,6 @@ The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
If any of these are directories, then the file \fI.ntprc\fP
is searched for within those directories.
.SH USAGE
-The
-\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
-option specifies the write password and
-\f\*[B-Font]\-q\f[] \f\*[I-Font]password\f[]
-option the read password for previously encrypted files.
-The
-\f\*[B-Font]ntp-keygen\fP
-program prompts for the password if it reads an encrypted file
-and the password is missing or incorrect.
-If an encrypted file is read successfully and
-no write password is specified, the read password is used
-as the write password by default.
.SH "ENVIRONMENT"
See \fBOPTION PRESETS\fP for configuration environment variables.
.SH "FILES"
@@ -1200,10 +1354,7 @@ The University of Delaware and Network Time Foundation
Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH BUGS
-It can take quite a while to generate some cryptographic values,
-from one to several minutes with modern architectures
-such as UltraSPARC and up to tens of minutes to an hour
-with older architectures such as SPARC IPC.
+It can take quite a while to generate some cryptographic values.
.sp \n(Ppu
.ne 2
diff --git a/contrib/ntp/util/ntp-keygen.mdoc.in b/contrib/ntp/util/ntp-keygen.mdoc.in
index e00c61c..8ed42c0 100644
--- a/contrib/ntp/util/ntp-keygen.mdoc.in
+++ b/contrib/ntp/util/ntp-keygen.mdoc.in
@@ -1,9 +1,9 @@
-.Dd March 21 2017
+.Dd February 27 2018
.Dt NTP_KEYGEN @NTP_KEYGEN_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
.\"
-.\" It has been AutoGen-ed March 21, 2017 at 10:45:59 AM by AutoGen 5.18.5
+.\" It has been AutoGen-ed February 27, 2018 at 05:16:00 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -21,26 +21,29 @@ All arguments must be options.
.Sh DESCRIPTION
This program generates cryptographic data files used by the NTPv4
authentication and identification schemes.
-It generates MD5 key files used in symmetric key cryptography.
-In addition, if the OpenSSL software library has been installed,
-it generates keys, certificate and identity files used in public key
-cryptography.
+It can generate message digest keys used in symmetric key cryptography and,
+if the OpenSSL software library has been installed, it can generate host keys,
+signing keys, certificates, and identity keys and parameters used in Autokey
+public key cryptography.
These files are used for cookie encryption,
-digital signature and challenge/response identification algorithms
+digital signature, and challenge/response identification algorithms
compatible with the Internet standard security infrastructure.
.Pp
-All files are in PEM\-encoded printable ASCII format,
-so they can be embedded as MIME attachments in mail to other sites
+The message digest symmetric keys file is generated in a format
+compatible with NTPv3.
+All other files are in PEM\-encoded printable ASCII format,
+so they can be embedded as MIME attachments in email to other sites
and certificate authorities.
By default, files are not encrypted.
.Pp
-When used to generate message digest keys, the program produces a file
-containing ten pseudo\-random printable ASCII strings suitable for the
-MD5 message digest algorithm included in the distribution.
+When used to generate message digest symmetric keys, the program
+produces a file containing ten pseudo\-random printable ASCII strings
+suitable for the MD5 message digest algorithm included in the
+distribution.
If the OpenSSL library is installed, it produces an additional ten
-hex\-encoded random bit strings suitable for the SHA1 and other message
-digest algorithms.
-The message digest keys file must be distributed and stored
+hex\-encoded random bit strings suitable for SHA1, AES\-128\-CMAC, and
+other message digest algorithms.
+The message digest symmetric keys file must be distributed and stored
using secure means beyond the scope of NTP itself.
Besides the keys used for ordinary NTP associations, additional keys
can be defined as passwords for the
@@ -60,219 +63,131 @@ other than Autokey.
Some files used by this program are encrypted using a private password.
The
.Fl p
-option specifies the password for local encrypted files and the
+option specifies the read password for local encrypted files and the
.Fl q
-option the password for encrypted files sent to remote sites.
+option the write password for encrypted files sent to remote sites.
If no password is specified, the host name returned by the Unix
-.Fn gethostname
-function, normally the DNS name of the host is used.
+.Xr hostname 1
+command, normally the DNS name of the host, is used as the the default read
+password, for convenience.
+The
+.Nm
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
.Pp
The
-.Ar pw
+.Cm pw
option of the
-.Ar crypto
+.Ic crypto
+.Xr ntpd @NTPD_MS@
configuration command specifies the read
password for previously encrypted local files.
-This must match the local password used by this program.
+This must match the local read password used by this program.
If not specified, the host name is used.
-Thus, if files are generated by this program without password,
+Thus, if files are generated by this program without an explicit password,
they can be read back by
-.Ar ntpd
-without password but only on the same host.
+.Xr ntpd @NTPD_MS@
+without specifying an explicit password but only on the same host.
+If the write password used for encryption is specified as the host name,
+these files can be read by that host with no explicit password.
.Pp
Normally, encrypted files for each host are generated by that host and
used only by that host, although exceptions exist as noted later on
this page.
The symmetric keys file, normally called
-.Ar ntp.keys ,
+.Pa ntp.keys ,
is usually installed in
.Pa /etc .
Other files and links are usually installed in
.Pa /usr/local/etc ,
which is normally in a shared filesystem in
NFS\-mounted networks and cannot be changed by shared clients.
-The location of the keys directory can be changed by the
-.Ar keysdir
-configuration command in such cases.
-Normally, this is in
-.Pa /etc .
+In these cases, NFS clients can specify the files in another
+directory such as
+.Pa /etc
+using the
+.Ic keysdir
+.Xr ntpd @NTPD_MS@
+configuration file command.
.Pp
This program directs commentary and error messages to the standard
error stream
-.Ar stderr
+.Pa stderr
and remote files to the standard output stream
-.Ar stdout
+.Pa stdout
where they can be piped to other applications or redirected to files.
The names used for generated files and links all begin with the
string
-.Ar ntpkey
+.Pa ntpkey\&*
and include the file type, generating host and filestamp,
as described in the
-.Dq Cryptographic Data Files
+.Sx "Cryptographic Data Files"
section below.
.Ss Running the Program
-To test and gain experience with Autokey concepts, log in as root and
-change to the keys directory, usually
-.Pa /usr/local/etc
-When run for the first time, or if all files with names beginning with
-.Ar ntpkey
-have been removed, use the
-.Nm
-command without arguments to generate a
-default RSA host key and matching RSA\-MD5 certificate with expiration
-date one year hence.
-If run again without options, the program uses the
-existing keys and parameters and generates only a new certificate with
-new expiration date one year hence.
-.Pp
-Run the command on as many hosts as necessary.
-Designate one of them as the trusted host (TH) using
-.Nm
-with the
-.Fl T
-option and configure it to synchronize from reliable Internet servers.
-Then configure the other hosts to synchronize to the TH directly or
-indirectly.
-A certificate trail is created when Autokey asks the immediately
-ascendant host towards the TH to sign its certificate, which is then
-provided to the immediately descendant host on request.
-All group hosts should have acyclic certificate trails ending on the TH.
-.Pp
-The host key is used to encrypt the cookie when required and so must be
-RSA type.
-By default, the host key is also the sign key used to encrypt
-signatures.
-A different sign key can be assigned using the
-.Fl S
-option and this can be either RSA or DSA type.
-By default, the signature
-message digest type is MD5, but any combination of sign key type and
-message digest type supported by the OpenSSL library can be specified
-using the
-.Fl c
-option.
-The rules say cryptographic media should be generated with proventic
-filestamps, which means the host should already be synchronized before
-this program is run.
-This of course creates a chicken\-and\-egg problem
-when the host is started for the first time.
-Accordingly, the host time
-should be set by some other means, such as eyeball\-and\-wristwatch, at
-least so that the certificate lifetime is within the current year.
-After that and when the host is synchronized to a proventic source, the
-certificate should be re\-generated.
-.Pp
-Additional information on trusted groups and identity schemes is on the
-.Dq Autokey Public\-Key Authentication
-page.
-.Pp
-The
-.Xr ntpd @NTPD_MS@
-configuration command
-.Ic crypto pw Ar password
-specifies the read password for previously encrypted files.
-The daemon expires on the spot if the password is missing
-or incorrect.
-For convenience, if a file has been previously encrypted,
-the default read password is the name of the host running
-the program.
-If the previous write password is specified as the host name,
-these files can be read by that host with no explicit password.
-.Pp
-File names begin with the prefix
-.Cm ntpkey_
-and end with the postfix
-.Ar _hostname.filestamp ,
-where
-.Ar hostname
-is the owner name, usually the string returned
-by the Unix gethostname() routine, and
-.Ar filestamp
-is the NTP seconds when the file was generated, in decimal digits.
-This both guarantees uniqueness and simplifies maintenance
-procedures, since all files can be quickly removed
-by a
-.Ic rm ntpkey\&*
-command or all files generated
-at a specific time can be removed by a
-.Ic rm
-.Ar \&*filestamp
-command.
-To further reduce the risk of misconfiguration,
-the first two lines of a file contain the file name
-and generation date and time as comments.
-.Pp
-All files are installed by default in the keys directory
-.Pa /usr/local/etc ,
-which is normally in a shared filesystem
-in NFS\-mounted networks.
-The actual location of the keys directory
-and each file can be overridden by configuration commands,
-but this is not recommended.
-Normally, the files for each host are generated by that host
-and used only by that host, although exceptions exist
-as noted later on this page.
-.Pp
-Normally, files containing private values,
-including the host key, sign key and identification parameters,
-are permitted root read/write\-only;
-while others containing public values are permitted world readable.
-Alternatively, files containing private values can be encrypted
-and these files permitted world readable,
-which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
-dependent clients can all be installed in the same shared directory.
-.Pp
-The recommended practice is to keep the file name extensions
-when installing a file and to install a soft link
-from the generic names specified elsewhere on this page
-to the generated files.
-This allows new file generations to be activated simply
-by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
-If a link is not present,
-.Xr ntpd @NTPD_MS@
-extracts the filestamp from the file itself.
-This allows clients to verify that the file and generation times
-are always current.
-The
-.Nm
-program uses the same timestamp extension for all files generated
-at one time, so each generation is distinct and can be readily
-recognized in monitoring data.
-.Ss Running the program
The safest way to run the
.Nm
program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
+The recommended procedure is change to the
+.Ar keys
+directory, usually
.Pa /usr/local/etc ,
then run the program.
-When run for the first time,
-or if all
-.Cm ntpkey
-files have been removed,
-the program generates a RSA host key file and matching RSA\-MD5 certificate file,
+.Pp
+To test and gain experience with Autokey concepts, log in as root and
+change to the
+.Ar keys
+directory, usually
+.Pa /usr/local/etc .
+When run for the first time, or if all files with names beginning with
+.Pa ntpkey\&*
+have been removed, use the
+.Nm
+command without arguments to generate a default
+.Cm RSA
+host key and matching
+.Cm RSA\-MD5
+certificate file with expiration date one year hence,
which is all that is necessary in many cases.
The program also generates soft links from the generic names
to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+If run again without options, the program uses the
+existing keys and parameters and generates a new certificate file with
+new expiration date one year hence, and soft link.
.Pp
-The host key is used to encrypt the cookie when required and so must be RSA type.
+The host key is used to encrypt the cookie when required and so must be
+.Cm RSA
+type.
By default, the host key is also the sign key used to encrypt signatures.
When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
+either
+.Cm RSA
+or
+.Cm DSA
+type.
+By default, the message digest type is
+.Cm MD5 ,
+but any combination
of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
+can be specified, including those using the
+.Cm AES128CMAC , MD2 , MD5 , MDC2 , SHA , SHA1
+and
+.Cm RIPE160
+message digest algorithms.
However, the scheme specified in the certificate must be compatible
with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+Certificates using any digest algorithm are compatible with
+.Cm RSA
+sign keys;
+however, only
+.Cm SHA
+and
+.Cm SHA1
+certificates are compatible with
+.Cm DSA
+sign keys.
.Pp
Private/public key files and certificates are compatible with
other OpenSSL applications and very likely other libraries as well.
@@ -283,19 +198,19 @@ However, the identification parameter files, although encoded
as the other files, are probably not compatible with anything other than Autokey.
.Pp
Running the program as other than root and using the Unix
-.Ic su
+.Xr su 1
command
to assume root may not work properly, since by default the OpenSSL library
looks for the random seed file
-.Cm .rnd
+.Pa .rnd
in the user home directory.
However, there should be only one
-.Cm .rnd ,
+.Pa .rnd ,
most conveniently
in the root directory, so it is convenient to define the
-.Cm $RANDFILE
+.Ev RANDFILE
environment variable used by the OpenSSL library as the path to
-.Cm /.rnd .
+.Pa .rnd .
.Pp
Installing the keys as root might not work in NFS\-mounted
shared file systems, as NFS clients may not be able to write
@@ -305,7 +220,8 @@ directory such as
.Pa /etc
using the
.Ic keysdir
-command.
+.Xr ntpd @NTPD_MS@
+configuration file command.
There is no need for one client to read the keys and certificates
of other clients or servers, as these data are obtained automatically
by the Autokey protocol.
@@ -338,8 +254,11 @@ while others containing public values are permitted world readable.
Alternatively, files containing private values can be encrypted
and these files permitted world readable,
which simplifies maintenance in shared file systems.
-Since uniqueness is insured by the hostname and
-file name extensions, the files for a NFS server and
+Since uniqueness is insured by the
+.Ar hostname
+and
+.Ar filestamp
+file name extensions, the files for an NTP server and
dependent clients can all be installed in the same shared directory.
.Pp
The recommended practice is to keep the file name extensions
@@ -348,106 +267,111 @@ from the generic names specified elsewhere on this page
to the generated files.
This allows new file generations to be activated simply
by changing the link.
-If a link is present, ntpd follows it to the file name
-to extract the filestamp.
+If a link is present,
+.Xr ntpd @NTPD_MS@
+follows it to the file name to extract the
+.Ar filestamp .
If a link is not present,
.Xr ntpd @NTPD_MS@
-extracts the filestamp from the file itself.
+extracts the
+.Ar filestamp
+from the file itself.
This allows clients to verify that the file and generation times
are always current.
The
.Nm
-program uses the same timestamp extension for all files generated
+program uses the same
+.Ar filestamp
+extension for all files generated
at one time, so each generation is distinct and can be readily
recognized in monitoring data.
-.Ss Running the program
-The safest way to run the
+.Pp
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
.Nm
-program is logged in directly as root.
-The recommended procedure is change to the keys directory,
-usually
-.Pa /usr/local/etc ,
-then run the program.
-When run for the first time,
-or if all
-.Cm ntpkey
-files have been removed,
-the program generates a RSA host key file and matching RSA\-MD5 certificate file,
-which is all that is necessary in many cases.
-The program also generates soft links from the generic names
-to the respective files.
-If run again, the program uses the same host key file,
-but generates a new certificate file and link.
+with the
+.Fl T
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
.Pp
-The host key is used to encrypt the cookie when required and so must be RSA type.
-By default, the host key is also the sign key used to encrypt signatures.
-When necessary, a different sign key can be specified and this can be
-either RSA or DSA type.
-By default, the message digest type is MD5, but any combination
-of sign key type and message digest type supported by the OpenSSL library
-can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
-and RIPE160 message digest algorithms.
-However, the scheme specified in the certificate must be compatible
-with the sign key.
-Certificates using any digest algorithm are compatible with RSA sign keys;
-however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+.Fl S
+option and this can be either
+.Cm RSA
+or
+.Cm DSA
+type.
+By default, the signature
+message digest type is
+.Cm MD5 ,
+but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+.Fl c
+option.
.Pp
-Private/public key files and certificates are compatible with
-other OpenSSL applications and very likely other libraries as well.
-Certificates or certificate requests derived from them should be compatible
-with extant industry practice, although some users might find
-the interpretation of X509v3 extension fields somewhat liberal.
-However, the identification parameter files, although encoded
-as the other files, are probably not compatible with anything other than Autokey.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken\-and\-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball\-and\-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re\-generated.
.Pp
-Running the program as other than root and using the Unix
-.Ic su
-command
-to assume root may not work properly, since by default the OpenSSL library
-looks for the random seed file
-.Cm .rnd
-in the user home directory.
-However, there should be only one
-.Cm .rnd ,
-most conveniently
-in the root directory, so it is convenient to define the
-.Cm $RANDFILE
-environment variable used by the OpenSSL library as the path to
-.Cm /.rnd .
+Additional information on trusted groups and identity schemes is on the
+.Dq Autokey Public\-Key Authentication
+page.
.Pp
-Installing the keys as root might not work in NFS\-mounted
-shared file systems, as NFS clients may not be able to write
-to the shared keys directory, even as root.
-In this case, NFS clients can specify the files in another
-directory such as
-.Pa /etc
-using the
-.Ic keysdir
+File names begin with the prefix
+.Pa ntpkey Ns _
+and end with the suffix
+.Pa _ Ns Ar hostname . Ar filestamp ,
+where
+.Ar hostname
+is the owner name, usually the string returned
+by the Unix
+.Xr hostname 1
+command, and
+.Ar filestamp
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+.Ic rm Pa ntpkey\&*
+command or all files generated
+at a specific time can be removed by a
+.Ic rm Pa \&* Ns Ar filestamp
command.
-There is no need for one client to read the keys and certificates
-of other clients or servers, as these data are obtained automatically
-by the Autokey protocol.
-.Pp
-Ordinarily, cryptographic files are generated by the host that uses them,
-but it is possible for a trusted agent (TA) to generate these files
-for other hosts; however, in such cases files should always be encrypted.
-The subject name and trusted name default to the hostname
-of the host generating the files, but can be changed by command line options.
-It is convenient to designate the owner name and trusted name
-as the subject and issuer fields, respectively, of the certificate.
-The owner name is also used for the host and sign key files,
-while the trusted name is used for the identity files.
-seconds.
-seconds.
-s Trusted Hosts and Groups
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+.Ss Trusted Hosts and Groups
Each cryptographic configuration involves selection of a signature scheme
and identification scheme, called a cryptotype,
as explained in the
.Sx Authentication Options
section of
.Xr ntp.conf 5 .
-The default cryptotype uses RSA encryption, MD5 message digest
-and TC identification.
+The default cryptotype uses
+.Cm RSA
+encryption,
+.Cm MD5
+message digest
+and
+.Cm TC
+identification.
First, configure a NTP subnet including one or more low\-stratum
trusted hosts from which all other hosts derive synchronization
directly or indirectly.
@@ -465,7 +389,7 @@ section of
.Pp
On each trusted host as root, change to the keys directory.
To insure a fresh fileset, remove all
-.Cm ntpkey
+.Pa ntpkey
files.
Then run
.Nm
@@ -490,7 +414,9 @@ is either
.Cm RSA
or
.Cm DSA .
-The most often need to do this is when a DSA\-signed certificate is used.
+The most frequent need to do this is when a
+.Cm DSA Ns \-signed
+certificate is used.
If it is necessary to use a different certificate scheme than the default,
run
.Nm
@@ -499,17 +425,17 @@ with the
option and selected
.Ar scheme
as needed.
-f
+If
.Nm
is run again without these options, it generates a new certificate
-using the same scheme and sign key.
+using the same scheme and sign key, and soft link.
.Pp
After setting up the environment it is advisable to update certificates
from time to time, if only to extend the validity interval.
Simply run
.Nm
with the same flags as before to generate new certificates
-using existing keys.
+using existing keys, and soft links.
However, if the host or sign key is changed,
.Xr ntpd @NTPD_MS@
should be restarted.
@@ -520,13 +446,15 @@ Other dependent hosts will continue as usual until signatures are refreshed,
at which time the protocol is restarted.
.Ss Identity Schemes
As mentioned on the Autonomous Authentication page,
-the default TC identity scheme is vulnerable to a middleman attack.
+the default
+.Cm TC
+identity scheme is vulnerable to a middleman attack.
However, there are more secure identity schemes available,
-including PC, IFF, GQ and MV described on the
-.Qq Identification Schemes
-page
-(maybe available at
-.Li http://www.eecis.udel.edu/%7emills/keygen.html ) .
+including
+.Cm PC , IFF , GQ
+and
+.Cm MV
+schemes described below.
These schemes are based on a TA, one or more trusted hosts
and some number of nontrusted hosts.
Trusted hosts prove identity using values provided by the TA,
@@ -551,12 +479,15 @@ On trusted host alice run
.Fl P
.Fl p Ar password
to generate the host key file
-.Pa ntpkey_RSAkey_ Ns Ar alice.filestamp
+.Pa ntpkey Ns _ Cm RSA Pa key_alice. Ar filestamp
and trusted private certificate file
-.Pa ntpkey_RSA\-MD5_cert_ Ns Ar alice.filestamp .
+.Pa ntpkey Ns _ Cm RSA\-MD5 _ Pa cert_alice. Ar filestamp ,
+and soft links.
Copy both files to all group hosts;
they replace the files which would be generated in other schemes.
-On each host bob install a soft link from the generic name
+On each host
+.Ar bob
+install a soft link from the generic name
.Pa ntpkey_host_ Ns Ar bob
to the host key file and soft link
.Pa ntpkey_cert_ Ns Ar bob
@@ -565,26 +496,34 @@ Note the generic links are on bob, but point to files generated
by trusted host alice.
In this scheme it is not possible to refresh
either the keys or certificates without copying them
-to all other hosts in the group.
+to all other hosts in the group, and recreating the soft links.
.Pp
-For the IFF scheme proceed as in the TC scheme to generate keys
+For the
+.Cm IFF
+scheme proceed as in the
+.Cm TC
+scheme to generate keys
and certificates for all group hosts, then for every trusted host in the group,
-generate the IFF parameter file.
+generate the
+.Cm IFF
+parameter file.
On trusted host alice run
.Nm
.Fl T
.Fl I
.Fl p Ar password
to produce her parameter file
-.Pa ntpkey_IFFpar_ Ns Ar alice.filestamp ,
+.Pa ntpkey_IFFpar_alice. Ns Ar filestamp ,
which includes both server and client keys.
Copy this file to all group hosts that operate as both servers
and clients and install a soft link from the generic
-.Pa ntpkey_iff_ Ns Ar alice
+.Pa ntpkey_iff_alice
to this file.
If there are no hosts restricted to operate only as clients,
there is nothing further to do.
-As the IFF scheme is independent
+As the
+.Cm IFF
+scheme is independent
of keys and certificates, these files can be refreshed as needed.
.Pp
If a rogue client has the parameter file, it could masquerade
@@ -594,37 +533,53 @@ from the parameter file and distributed to all restricted clients.
After generating the parameter file, on alice run
.Nm
.Fl e
-and pipe the output to a file or mail program.
-Copy or mail this file to all restricted clients.
+and pipe the output to a file or email program.
+Copy or email this file to all restricted clients.
On these clients install a soft link from the generic
-.Pa ntpkey_iff_ Ns Ar alice
+.Pa ntpkey_iff_alice
to this file.
To further protect the integrity of the keys,
each file can be encrypted with a secret password.
.Pp
-For the GQ scheme proceed as in the TC scheme to generate keys
+For the
+.Cm GQ
+scheme proceed as in the
+.Cm TC
+scheme to generate keys
and certificates for all group hosts, then for every trusted host
-in the group, generate the IFF parameter file.
+in the group, generate the
+.Cm IFF
+parameter file.
On trusted host alice run
.Nm
.Fl T
.Fl G
.Fl p Ar password
to produce her parameter file
-.Pa ntpkey_GQpar_ Ns Ar alice.filestamp ,
+.Pa ntpkey_GQpar_alice. Ns Ar filestamp ,
which includes both server and client keys.
Copy this file to all group hosts and install a soft link
from the generic
-.Pa ntpkey_gq_ Ns Ar alice
+.Pa ntpkey_gq_alice
to this file.
-In addition, on each host bob install a soft link
+In addition, on each host
+.Ar bob
+install a soft link
from generic
.Pa ntpkey_gq_ Ns Ar bob
to this file.
-As the GQ scheme updates the GQ parameters file and certificate
+As the
+.Cm GQ
+scheme updates the
+.Cm GQ
+parameters file and certificate
at the same time, keys and certificates can be regenerated as needed.
.Pp
-For the MV scheme, proceed as in the TC scheme to generate keys
+For the
+.Cm MV
+scheme, proceed as in the
+.Cm TC
+scheme to generate keys
and certificates for all group hosts.
For illustration assume trish is the TA, alice one of several trusted hosts
and bob one of her clients.
@@ -636,9 +591,9 @@ where
.Ar n
is the number of revokable keys (typically 5) to produce
the parameter file
-.Pa ntpkeys_MVpar_ Ns Ar trish.filestamp
+.Pa ntpkeys_MVpar_trish. Ns Ar filestamp
and client key files
-.Pa ntpkeys_MVkeyd_ Ns Ar trish.filestamp
+.Pa ntpkeys_MVkey Ns Ar d _ Pa trish. Ar filestamp
where
.Ar d
is the key number (0 \&<
@@ -647,80 +602,217 @@ is the key number (0 \&<
.Ar n ) .
Copy the parameter file to alice and install a soft link
from the generic
-.Pa ntpkey_mv_ Ns Ar alice
+.Pa ntpkey_mv_alice
to this file.
Copy one of the client key files to alice for later distribution
to her clients.
-It doesn't matter which client key file goes to alice,
+It does not matter which client key file goes to alice,
since they all work the same way.
-Alice copies the client key file to all of her cliens.
+Alice copies the client key file to all of her clients.
On client bob install a soft link from generic
-.Pa ntpkey_mvkey_ Ns Ar bob
+.Pa ntpkey_mvkey_bob
to the client key file.
-As the MV scheme is independent of keys and certificates,
+As the
+.Cm MV
+scheme is independent of keys and certificates,
these files can be refreshed as needed.
.Ss Command Line Options
.Bl -tag -width indent
-.It Fl c Ar scheme
-Select certificate message digest/signature encryption scheme.
+.It Fl b Fl \-imbits Ns = Ar modulus
+Set the number of bits in the identity modulus for generating identity keys to
+.Ar modulus
+bits.
+The number of bits in the identity modulus defaults to 256, but can be set to
+values from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+.It Fl c Fl \-certificate Ns = Ar scheme
+Select certificate signature encryption/message digest scheme.
The
.Ar scheme
can be one of the following:
-. Cm RSA\-MD2 , RSA\-MD5 , RSA\-SHA , RSA\-SHA1 , RSA\-MDC2 , RSA\-RIPEMD160 , DSA\-SHA ,
+.Cm RSA\-MD2 , RSA\-MD5 , RSA\-MDC2 , RSA\-SHA , RSA\-SHA1 , RSA\-RIPEMD160 , DSA\-SHA ,
or
.Cm DSA\-SHA1 .
-Note that RSA schemes must be used with a RSA sign key and DSA
-schemes must be used with a DSA sign key.
+Note that
+.Cm RSA
+schemes must be used with an
+.Cm RSA
+sign key and
+.Cm DSA
+schemes must be used with a
+.Cm DSA
+sign key.
The default without this option is
.Cm RSA\-MD5 .
-.It Fl d
-Enable debugging.
+If compatibility with FIPS 140\-2 is required, either the
+.Cm DSA\-SHA
+or
+.Cm DSA\-SHA1
+scheme must be used.
+.It Fl C Fl \-cipher Ns = Ar cipher
+Select the OpenSSL cipher to encrypt the files containing private keys.
+The default without this option is three\-key triple DES in CBC mode,
+.Cm des\-ede3\-cbc .
+The
+.Ic openssl Fl h
+command provided with OpenSSL displays available ciphers.
+.It Fl d Fl \-debug\-level
+Increase debugging verbosity level.
This option displays the cryptographic data produced in eye\-friendly billboards.
-.It Fl e
-Write the IFF client keys to the standard output.
-This is intended for automatic key distribution by mail.
-.It Fl G
-Generate parameters and keys for the GQ identification scheme,
-obsoleting any that may exist.
-.It Fl g
-Generate keys for the GQ identification scheme
-using the existing GQ parameters.
-If the GQ parameters do not yet exist, create them first.
-.It Fl H
-Generate new host keys, obsoleting any that may exist.
-.It Fl I
-Generate parameters for the IFF identification scheme,
-obsoleting any that may exist.
-.It Fl i Ar name
-Set the suject name to
-.Ar name .
-This is used as the subject field in certificates
-and in the file name for host and sign keys.
-.It Fl M
-Generate MD5 keys, obsoleting any that may exist.
-.It Fl P
-Generate a private certificate.
+.It Fl D Fl \-set\-debug\-level Ns = Ar level
+Set the debugging verbosity to
+.Ar level .
+This option displays the cryptographic data produced in eye\-friendly billboards.
+.It Fl e Fl \-id\-key
+Write the
+.Cm IFF
+or
+.Cm GQ
+public parameters from the
+.Ar IFFkey or GQkey
+client keys file previously specified
+as unencrypted data to the standard output stream
+.Pa stdout .
+This is intended for automatic key distribution by email.
+.It Fl G Fl \-gq\-params
+Generate a new encrypted
+.Cm GQ
+parameters and key file for the Guillou\-Quisquater (GQ) identity scheme.
+This option is mutually exclusive with the
+.Fl I
+and
+.Fl V
+options.
+.It Fl H Fl \-host\-key
+Generate a new encrypted
+.Cm RSA
+public/private host key file.
+.It Fl I Fl \-iffkey
+Generate a new encrypted
+.Cm IFF
+key file for the Schnorr (IFF) identity scheme.
+This option is mutually exclusive with the
+.Fl G
+and
+Fl V
+options.
+.It Fl i Fl \-ident Ns = Ar group
+Set the optional Autokey group name to
+.Ar group .
+This is used in the identity scheme parameter file names of
+.Cm IFF , GQ ,
+and
+.Cm MV
+client parameters files.
+In that role, the default is the host name if no group is provided.
+The group name, if specified using
+.Fl i
+or
+.Fl s
+following an
+.Ql @
+character, is also used in certificate subject and issuer names in the form
+.Ar host @ group
+and should match the group specified via
+.Ic crypto Cm ident
+or
+.Ic server Cm ident
+in the ntpd configuration file.
+.It Fl l Fl \-lifetime Ns = Ar days
+Set the lifetime for certificate expiration to
+.Ar days .
+The default lifetime is one year (365 days).
+.It Fl m Fl \-modulus Ns = Ar bits
+Set the number of bits in the prime modulus for generating files to
+.Ar bits .
+The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
+Use the larger moduli with caution, as this can consume considerable computing
+resources and increases the size of authenticated packets.
+.It Fl M Fl \-md5key
+Generate a new symmetric keys file containing 10
+.Cm MD5
+keys, and if OpenSSL is available, 10
+.Cm SHA
+keys.
+An
+.Cm MD5
+key is a string of 20 random printable ASCII characters, while a
+.Cm SHA
+key is a string of 40 random hex digits.
+The file can be edited using a text editor to change the key type or key content.
+This option is mutually exclusive with all other options.
+.It Fl p Fl \-password Ns = Ar passwd
+Set the password for reading and writing encrypted files to
+.Ar passwd .
+These include the host, sign and identify key files.
+By default, the password is the string returned by the Unix
+.Ic hostname
+command.
+.It Fl P Fl \-pvt\-cert
+Generate a new private certificate used by the
+.Cm PC
+identity scheme.
By default, the program generates public certificates.
-.It Fl p Ar password
-Encrypt generated files containing private data with
-.Ar password
-and the DES\-CBC algorithm.
-.It Fl q
-Set the password for reading files to password.
-.It Fl S Oo Cm RSA | DSA Oc
-Generate a new sign key of the designated type,
-obsoleting any that may exist.
-By default, the program uses the host key as the sign key.
-.It Fl s Ar name
-Set the issuer name to
-.Ar name .
-This is used for the issuer field in certificates
-and in the file name for identity files.
-.It Fl T
+Note: the PC identity scheme is not recommended for new installations.
+.It Fl q Fl \-export\-passwd Ns = Ar passwd
+Set the password for writing encrypted
+.Cm IFF , GQ and MV
+identity files redirected to
+.Pa stdout
+to
+.Ar passwd .
+In effect, these files are decrypted with the
+.Fl p
+password, then encrypted with the
+.Fl q
+password.
+By default, the password is the string returned by the Unix
+.Ic hostname
+command.
+.It Fl s Fl \-subject\-key Ns = Ar Oo host Oc Op @ Ar group
+Specify the Autokey host name, where
+.Ar host
+is the optional host name and
+.Ar group
+is the optional group name.
+The host name, and if provided, group name are used in
+.Ar host @ group
+form as certificate subject and issuer.
+Specifying
+.Fl s @ Ar group
+is allowed, and results in leaving the host name unchanged, as with
+.Fl i Ar group .
+The group name, or if no group is provided, the host name are also used in the
+file names of
+.Cm IFF , GQ ,
+and
+.Cm MV
+identity scheme client parameter files.
+If
+.Ar host
+is not specified, the default host name is the string returned by the Unix
+.Ic hostname
+command.
+.It Fl S Fl \-sign\-key Ns = Op Cm RSA | DSA
+Generate a new encrypted public/private sign key file of the specified type.
+By default, the sign key is the host key and has the same type.
+If compatibility with FIPS 140\-2 is required, the sign key type must be
+.Cm DSA .
+.It Fl T Fl \-trusted\-cert
Generate a trusted certificate.
By default, the program generates a non\-trusted certificate.
-.It Fl V Ar nkeys
-Generate parameters and keys for the Mu\-Varadharajan (MV) identification scheme.
+.It Fl V Fl \-mv\-params Ar nkeys
+Generate
+.Ar nkeys
+encrypted server keys and parameters for the Mu\-Varadharajan (MV)
+identity scheme.
+This option is mutually exclusive with the
+.Fl I
+and
+.Fl G
+options.
+Note: support for this option should be considered a work in progress.
.El
.Ss Random Seed File
All cryptographically sound key generation schemes must have means
@@ -744,14 +836,14 @@ but are outside the scope of this page.
.Pp
The entropy seed used by the OpenSSL library is contained in a file,
usually called
-.Cm .rnd ,
+.Pa .rnd ,
which must be available when starting the NTP daemon
or the
.Nm
program.
The NTP daemon will first look for the file
using the path specified by the
-.Ic randfile
+.Cm randfile
subcommand of the
.Ic crypto
configuration command.
@@ -767,44 +859,118 @@ If the
.Ev RANDFILE
environment variable is not present,
the library will look for the
-.Cm .rnd
+.Pa .rnd
file in the user home directory.
+Since both the
+.Nm
+program and
+.Xr ntpd @NTPD_MS@
+daemon must run as root, the logical place to put this file is in
+.Pa /.rnd
+or
+.Pa /root/.rnd .
If the file is not available or cannot be written,
the daemon exits with a message to the system log and the program
exits with a suitable error message.
.Ss Cryptographic Data Files
-All other file formats begin with two lines.
-The first contains the file name, including the generated host name
-and filestamp.
-The second contains the datestamp in conventional Unix date format.
-Lines beginning with # are considered comments and ignored by the
+All file formats begin with two nonencrypted lines.
+The first line contains the file name, including the generated host name
+and filestamp, in the format
+.Pa ntpkey_ Ns Ar key _ Ar name . Ar filestamp ,
+where
+.Ar key
+is the key or parameter type,
+.Ar name
+is the host or group name and
+.Ar filestamp
+is the filestamp (NTP seconds) when the file was created.
+By convention,
+.Ar key
+names in generated file names include both upper and lower case
+characters, while
+.Ar key
+names in generated link names include only lower case characters.
+The filestamp is not used in generated link names.
+The second line contains the datestamp in conventional Unix
+.Pa date
+format.
+Lines beginning with
+.Ql #
+are considered comments and ignored by the
.Nm
program and
.Xr ntpd @NTPD_MS@
daemon.
-Cryptographic values are encoded first using ASN.1 rules,
-then encrypted if necessary, and finally written PEM\-encoded
-printable ASCII format preceded and followed by MIME content identifier lines.
.Pp
-The format of the symmetric keys file is somewhat different
-than the other files in the interest of backward compatibility.
-Since DES\-CBC is deprecated in NTPv4, the only key format of interest
-is MD5 alphanumeric strings.
-Following hte heard the keys are
-entered one per line in the format
-.D1 Ar keyno type key
+The remainder of the file contains cryptographic data, encoded first using ASN.1
+rules, then encrypted if necessary, and finally written in PEM\-encoded
+printable ASCII text, preceded and followed by MIME content identifier lines.
+.Pp
+The format of the symmetric keys file, ordinarily named
+.Pa ntp.keys ,
+is somewhat different than the other files in the interest of backward compatibility.
+Ordinarily, the file is generated by this program, but it can be constructed
+and edited using an ordinary text editor.
+.Bd -literal -unfilled -offset center
+# ntpkey_MD5key_bk.ntp.org.3595864945
+# Thu Dec 12 19:22:25 2013
+1 MD5 L";Nw<\`.I<f4U0)247"i # MD5 key
+2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key
+3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key
+4 MD5 Yue:tL[+vR)M\`n~bY,'? # MD5 key
+5 MD5 B;fx'Kgr/&4ZTbL6=RxA # MD5 key
+6 MD5 4eYwa\`o}3i@@V@..R9!l # MD5 key
+7 MD5 \`A.([h+;wTQ|xfi%Sn_! # MD5 key
+8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key
+9 MD5 3\-5vcn*6l29DS?Xdsg)* # MD5 key
+10 MD5 2late4Me # MD5 key
+11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key
+12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key
+13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key
+14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key
+15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key
+16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key
+17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key
+18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key
+19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key
+20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key
+.Ed
+.D1 Figure 1. Typical Symmetric Key File
+.Pp
+Figure 1 shows a typical symmetric keys file used by the reference
+implementation.
+Following the header the keys are entered one per line in the format
+.D1 Ar keyno Ar type Ar key
where
.Ar keyno
-is a positive integer in the range 1\-65,535,
+is a positive integer in the range 1\-65534;
.Ar type
-is the string MD5 defining the key format and
+is the key type for the message digest algorithm, which in the absence of the
+OpenSSL library must be
+.Cm MD5
+to designate the MD5 message digest algorithm;
+if the OpenSSL library is installed, the key type can be any
+message digest algorithm supported by that library;
+however, if compatibility with FIPS 140\-2 is required,
+the key type must be either
+.Cm SHA
+or
+.Cm SHA1 ;
.Ar key
is the key itself,
-which is a printable ASCII string 16 characters or less in length.
-Each character is chosen from the 93 printable characters
-in the range 0x21 through 0x7f excluding space and the
+which is a printable ASCII string 20 characters or less in length:
+each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7e (
+.Ql !
+through
+.Ql ~
+\&) excluding space and the
+.Ql #
+character, and terminated by whitespace or a
.Ql #
character.
+An OpenSSL key consists of a hex\-encoded ASCII string of 40 characters, which
+is truncated as necessary.
.Pp
Note that the keys used by the
.Xr ntpq @NTPQ_MS@
@@ -817,8 +983,8 @@ in human readable ASCII format.
.Pp
The
.Nm
-program generates a MD5 symmetric keys file
-.Pa ntpkey_MD5key_ Ns Ar hostname.filestamp .
+program generates a symmetric keys file
+.Pa ntpkey_MD5key_ Ns Ar hostname Ns . Ns Ar filestamp .
Since the file contains private shared keys,
it should be visible only to root and distributed by secure means
to other subnet hosts.
@@ -856,10 +1022,10 @@ The number of bits in the identity modulus. The default is 256.
certificate scheme.
.sp
scheme is one of
-RSA\-MD2, RSA\-MD5, RSA\-SHA, RSA\-SHA1, RSA\-MDC2, RSA\-RIPEMD160,
+RSA\-MD2, RSA\-MD5, RSA\-MDC2, RSA\-SHA, RSA\-SHA1, RSA\-RIPEMD160,
DSA\-SHA, or DSA\-SHA1.
.sp
-Select the certificate message digest/signature encryption scheme.
+Select the certificate signature encryption/message digest scheme.
Note that RSA schemes must be used with a RSA sign key and DSA
schemes must be used with a DSA sign key. The default without
this option is RSA\-MD5.
@@ -868,7 +1034,7 @@ privatekey cipher.
.sp
Select the cipher which is used to encrypt the files containing
private keys. The default is three\-key triple DES in CBC mode,
-equivalent to "@code{\-C des\-ede3\-cbc". The openssl tool lists ciphers
+equivalent to "\fB\-C des\-ede3\-cbc\fP". The openssl tool lists ciphers
available in "\fBopenssl \-h\fP" output.
.It Fl d , Fl \-debug\-level
Increase debug verbosity level.
@@ -882,8 +1048,9 @@ This option takes an integer number as its argument.
.It Fl e , Fl \-id\-key
Write IFF or GQ identity keys.
.sp
-Write the IFF or GQ client keys to the standard output. This is
-intended for automatic key distribution by mail.
+Write the public parameters from the IFF or GQ client keys to
+the standard output.
+This is intended for automatic key distribution by email.
.It Fl G , Fl \-gq\-params
Generate GQ parameters and keys.
.sp
@@ -906,21 +1073,17 @@ 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 \fB\-i/\-\-ident\fP or
using \fB\-s/\-\-subject\-name\fP following an '\fB@\fP' character,
-is also a part of the self\-signed host certificate's subject and
+is also a part of the self\-signed host certificate subject and
issuer names in the form \fBhost@group\fP and should match the
-\'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
-\fBntpd\fP's configuration file.
+\'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in the
+\fBntpd\fP configuration file.
.It Fl l Ar lifetime , Fl \-lifetime Ns = Ns Ar lifetime
set certificate lifetime.
This option takes an integer number as its argument.
.sp
Set the certificate expiration to lifetime days from now.
-.It Fl M , Fl \-md5key
-generate MD5 keys.
-.sp
-Generate MD5 keys, obsoleting any that may exist.
.It Fl m Ar modulus , Fl \-modulus Ns = Ns Ar modulus
-modulus.
+prime modulus.
This option takes an integer number as its argument.
The value of
.Ar modulus
@@ -933,6 +1096,10 @@ in the range 256 through 2048
.in -4
.sp
The number of bits in the prime modulus. The default is 512.
+.It Fl M , Fl \-md5key
+generate symmetric keys.
+.sp
+Generate symmetric keys, obsoleting any that may exist.
.It Fl P , Fl \-pvt\-cert
generate PC private certificate.
.sp
@@ -954,12 +1121,6 @@ encrypted with the DES\-CBC algorithm and the specified password.
The same password must be specified to the remote ntpd via the
"crypto pw password" configuration command. See also the option
-\-id\-key (\-e) for unencrypted exports.
-.It Fl S Ar sign , Fl \-sign\-key Ns = Ns Ar sign
-generate sign key (RSA or DSA).
-.sp
-Generate a new sign key of the designated type, obsoleting any
-that may exist. By default, the program uses the host key as the
-sign key.
.It Fl s Ar host@group , Fl \-subject\-name Ns = Ns Ar host@group
set host and optionally group name.
.sp
@@ -967,12 +1128,18 @@ Set the Autokey host name, and optionally, group name specified
following an '\fB@\fP' 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 \fBhost@group\fP form for the host certificate's subject and issuer
+in \fBhost@group\fP form for the host certificate subject and issuer
fields. Specifying '\fB\-s @group\fP' is allowed, and results in
leaving the host name unchanged while appending \fB@group\fP to the
subject and issuer fields, as with \fB\-i group\fP. 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.
+.It Fl S Ar sign , Fl \-sign\-key Ns = Ns Ar sign
+generate sign key (RSA or DSA).
+.sp
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
.It Fl T , Fl \-trusted\-cert
trusted certificate (TC scheme).
.sp
@@ -1021,18 +1188,6 @@ The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
If any of these are directories, then the file \fI.ntprc\fP
is searched for within those directories.
.Sh USAGE
-The
-.Fl p Ar password
-option specifies the write password and
-.Fl q Ar password
-option the read password for previously encrypted files.
-The
-.Nm
-program prompts for the password if it reads an encrypted file
-and the password is missing or incorrect.
-If an encrypted file is read successfully and
-no write password is specified, the read password is used
-as the write password by default.
.Sh "ENVIRONMENT"
See \fBOPTION PRESETS\fP for configuration environment variables.
.Sh "FILES"
@@ -1056,10 +1211,7 @@ The University of Delaware and Network Time Foundation
Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh BUGS
-It can take quite a while to generate some cryptographic values,
-from one to several minutes with modern architectures
-such as UltraSPARC and up to tens of minutes to an hour
-with older architectures such as SPARC IPC.
+It can take quite a while to generate some cryptographic values.
.Pp
Please report bugs to http://bugs.ntp.org .
.Pp
OpenPOWER on IntegriCloud