Created attachment 180709 [details] [patch] NSS option + other cleanup The attached patch adds an NSS option and some other cleanup. portlint - ok stage-qa - ok testport - ok (10/stable) Add NSS option: Before this patch, if nss is installed when chrony is built, there's a silent lib dependency on nss, and if nss is subsequently uninstalled chrony breaks due to a now missing library. I decided to turn it on by default: - it adds support for a number of more modern hashing algorithms (instead of only the default and less secure md5) - if NSS option is turned off, explicitly disable via configure option - nss is well maintained - I see the case for having NSS off by default. Many users of chrony just want the basic features, and don't need the extra security. Turning NSS off by default reduces dependency proliferation that is not necessary for many users. So feel free to remove 'OPTIONS_DEFAULT=NSS' before committing this patch. - Override default NSS_DESC since it's generic text is not very helpful for chrony's usage. The updated description is more specific regarding chrony's use of NSS. Other cleanup: - --infodir is not a valid configure option (since 2.3 I think) - USES=localbase instead of LDFLAGS - add explicit --without-tomcrypt [1] - add support for passing chronyd_flags to chronyd in rc.d script - fix some hard-coded /usr/local in examples [1] We could add a TOMCRYPT option which adds even more hashing algorithms. But libtomcrypt does not have wide exposure. There's some upstream security updates (also backported to debian's package) that have been around for years that were never added to freebsd's port. The added benefit of some extra less common hashing algorithms didn't seem worth adding an option. If we do add an option in the future, I believe it should be off by default in preference to nss.
(In reply to John Hein from comment #0) Thanks John! I'll take a look at this.
(In reply to John Hein from comment #0) Great patch. I agree about the dependency proliferation concern. The NSS package pulls in sqlite, which might seem strange and unnecessary to chrony users. On the other hand, quite a few popular packages depend on NSS, including Chromium, Firefox, Thunderbird, GDM, and LibreOffice, so they likely already have it installed if they're a desktop user. Since MD5 is such a weak hash, why is chrony still using it? Would disabling NSS essentially expose chrony users to security vulnerabilities? If so, what kind?
Regarding MD5, I haven't looked into its usage in chrony to see how safe or unsafe it is to use. In some cases like the MD5 flavor of HMAC, MD5 is coupled with an additional private key which makes the MD5 weaknesses much less important. Similarly MD5 + salt (as in /etc/passwd) with lots of iterations isn't as weak as a single md5 pass. But I haven't looked at chrony to see exactly how it uses md5. But, yes, even with other crypto sprinkled in, md5 is weaker, partially because it's less collision resistant and partially because it's a fast algorithm (which makes it somewhat easier to use brute force techniques), although a key generated with good entropy will mitigate that. Anyway, I don't have a problem leaving a user with only MD5. If that's what fits their use case, that's fine. I'd feel better leaving NSS on by default, but I haven't done enough analysis to feel strongly. If someone digs into the chrony code a bit to see how it uses md5, that would help inform the decision better. Either way, the user should understand the implications of the different options. As port maintainer, you can just make the call. Lots of people use unauthenticated ntp, so the crypto users will likely be in the minority and are more likely to be the ones who will investigate their options. Having it be an option is the most important first step. Tweaking the default setting can be done later.
Ping.
Comment on attachment 180709 [details] [patch] NSS option + other cleanup I've been wrestling on having the NSS dependency or not. I think we should, but if anyone has any strong reasons not to, please feel free to let us know.
I tried approving the patch, but it's not working for some reason...
Comment on attachment 180709 [details] [patch] NSS option + other cleanup Yonas, I'm not sure what you tried and what is "not working" for you (re: approving the patch). But I tried selecting the maintainer-approval (setting it to +) on the patch attachment, and it seemed to work fine. But since I am not the maintainer, I have now changed that maintainer-approval field (on the patch attachment) to ? with your email. If you want to approve the patch, just change the ? to + on the maintainer-approval field in the patch and submit. If that doesn't work, provide details about the failure.
(In reply to John Hein from comment #7) Thanks John, it seems to work now. I've approved the patch.
A commit references this bug: Author: rodrigo Date: Sat Nov 18 22:41:34 UTC 2017 New revision: 454465 URL: https://svnweb.freebsd.org/changeset/ports/454465 Log: Makes the NSS dependency explicit, and perform cleanup Bump PORTREVISION Before this patch if nss is installed when crony is built, there's a silent lib dependency on nss, and if nss is subsequently uninstalled chrony breaks. NSS is now turned on by default adding support for a number of more modern hashing algorithms than md5. Cleanup: - --infodir is not a valid configure option (since 2.3 I think) - USES=localbase instead of LDFLAGS - add explicit --without-tomcrypt [1] - add support for passing chronyd_flags to chronyd in rc.d script - fix some hard-coded /usr/local in examples PR: 217691 Submitted by: John Hein <z7dr6ut7gs@snkmail.com> Approved by: Yonas Yanfa <yonas@fizk.net> (maintainer) Changes: head/net/chrony/Makefile head/net/chrony/files/chronyd.in head/net/chrony/files/patch-examples_chrony.conf.example2 head/net/chrony/files/patch-examples_chrony.conf.example3
Committed with minor changes, thanks.
Created attachment 188127 [details] [patch] add missed lib dependency specification (In reply to Rodrigo Osorio from comment #10) Thanks. I just realized that a dependency is missing. Patch attached.
Re-open - see comment 11.
@yonas : waiting for maintainer approval
Committed, thanks.
A commit references this bug: Author: rodrigo Date: Mon Nov 20 13:50:00 UTC 2017 New revision: 454559 URL: https://svnweb.freebsd.org/changeset/ports/454559 Log: Add missing lib dependency in the original patch Bump PORTREVISION PR: 217691 Submitted by: John Hein <z7dr6ut7gs@snkmail.com> Approved by: Yonas Yanfa <yonas@fizk.net> Changes: head/net/chrony/Makefile