[Git][NTPsec/ntpsec][master] Remove -M option, a noop, and correct documentation

Richard Laager gitlab at mg.gitlab.com
Sun Dec 29 01:34:04 UTC 2019



Richard Laager pushed to branch master at NTPsec / ntpsec


Commits:
d0cc180d by Sanjeev Gupta at 2019-12-23T20:12:24+08:00
Remove -M option, a noop, and correct documentation

In commit d4691e602d8906ce2eff8fd1638dfa3b65cee3dd
Hal dropped support for the SHA1 and MD5 lines in
ntp.keys, and the code.

The man page still mentioned that -M , which is documented
by NTP Classic as:

    Generate a new keys file containing 10 MD5 keys and 10 SHA keys.
    An MD5 key is a string of 20 random printable ASCII characters,i
    while a SHA key is a string of 40 random hex digits.

was the default, and that ntpkeygen operated _always_ in
MD5 mode.

- - - - -


2 changed files:

- docs/includes/ntpkeygen-body.adoc
- ntpclients/ntpkeygen.py


Changes:

=====================================
docs/includes/ntpkeygen-body.adoc
=====================================
@@ -23,9 +23,6 @@ passwords for the link:ntpq.html[+ntpq+] utility program.
 [[cmd]]
 == Command Line Options
 
-+-M+, +--md5key+::
-  Dummy option for backward compatibility in old scripts.  This
-  program always runs in -M mode.
 +-V+, +--version+::
   Print the version string and exit.
 
@@ -74,6 +71,9 @@ https://docs.python.org/library/os.html#os.urandom[Python 3.5+].
 [[crypto]]
 == Cryptographic Data Files
 
+Unlike NTP Classic, this implementation generates only AES keys,
+not MD5 or SHA1.
+
 Since the file contains private shared keys, it should be visible
 only to root or ntp.
 
@@ -93,7 +93,7 @@ format:
 |====================================================================
 |Field	| Meaning
 |keyno	| Positive integer in the range 1-65,535
-|type	| Type of key (MD5, SHA-1, AES-CMAC etc.)
+|type	| Type of key (MD5, SHA-1, AES-CMAC etc). This program generates only AES.
 |key	| the actual key, printable ASCII or hex
 |====================================================================
 


=====================================
ntpclients/ntpkeygen.py
=====================================
@@ -84,17 +84,14 @@ def fheader(fileid,     # file name id
 
 if __name__ == '__main__':
     try:
-        (options, arguments) = getopt.getopt(sys.argv[1:], "hMV",
+        (options, arguments) = getopt.getopt(sys.argv[1:], "hV",
                                              ["help", "version"])
     except getopt.GetoptError as e:
         print(e)
         raise SystemExit(1)
 
     for (switch, val) in options:
-        if switch == '-M':
-            # dummy MD5 option for backwards compatibility, ignored
-            pass
-        elif switch in ("-h", "--help"):
+        if switch in ("-h", "--help"):
             print("usage: ntpkeygen")
             raise SystemExit(0)
         elif switch in ("-V", "--version"):



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/d0cc180deff68b9cf7c6cbd62a75496b5054ff29

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/d0cc180deff68b9cf7c6cbd62a75496b5054ff29
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20191229/3b67bdd1/attachment-0001.htm>


More information about the vc mailing list