[Git][NTPsec/ntpsec][master] Don't generate # into ASCIIfied keys.
Eric S. Raymond (@esr)
gitlab at mg.gitlab.com
Tue May 11 12:12:23 UTC 2021
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
fc50a701 by Eric S. Raymond at 2021-05-11T08:10:10-04:00
Don't generate # into ASCIIfied keys.
- - - - -
1 changed file:
- ntpclients/ntpkeygen.py
Changes:
=====================================
ntpclients/ntpkeygen.py
=====================================
@@ -33,7 +33,8 @@ try:
if asciified:
result = ''
for index in range(bytes):
- result += chr(0x21 + secrets.randbelow(0x5d))
+ # Start ASCII characters with 0x24 so as not to include comment-beginning #
+ result += chr(0x24 + secrets.randbelow(0x5a))
return result
else:
return secrets.token_hex(bytes)
@@ -43,7 +44,8 @@ except ImportError:
result = ''
if asciified:
for index in range(bytes):
- result += chr(random.randint(0x21, 0x7e))
+ # Start ASCII characters with 0x24 so as not to include comment-beginning #
+ result += chr(random.randint(0x24, 0x7e))
else:
for index in range(bytes):
result += "%02x" % random.randint(0x0, 0xff)
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/fc50a701faafe60f117473016868770df54a6444
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/fc50a701faafe60f117473016868770df54a6444
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/20210511/3f2897a9/attachment-0001.htm>
More information about the vc
mailing list