https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412022-01-21T18:51:43Zlighty labsLighttpd - Bug #3140: lighttpd build failure on macOS 10.13 and earlierhttps://redmine.lighttpd.net/issues/3140?journal_id=130652022-01-21T18:51:43Zgstrauss
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Patch Pending</i></li><li><strong>Target version</strong> changed from <i>1.4.xx</i> to <i>1.4.65</i></li></ul><p>Apparently the following in rand.c needs to be modified for 10.14+<br /><pre>
#if defined(__APPLE__) && defined(__MACH__)
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101000 /* OS X 10.10+ */
#undef HAVE_ARC4RANDOM_BUF
#define HAVE_CCRANDOMGENERATEBYTES
#include <CommonCrypto/CommonRandom.h>
#endif
#endif
</pre></p>
<p>Does this work? It will need to be a patch in macports until the next lighttpd release.<br /><pre>
--- a/src/rand.c
+++ b/src/rand.c
@@ -82,7 +82,7 @@
#include <sys/ioctl.h>
#endif
#if defined(__APPLE__) && defined(__MACH__)
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101000 /* OS X 10.10+ */
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101400 /* OS X 10.14+ */
#undef HAVE_ARC4RANDOM_BUF
#define HAVE_CCRANDOMGENERATEBYTES
#include <CommonCrypto/CommonRandom.h>
</pre></p> Lighttpd - Bug #3140: lighttpd build failure on macOS 10.13 and earlierhttps://redmine.lighttpd.net/issues/3140?journal_id=130672022-01-21T18:52:36Zgstrauss
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-3 priority-lowest closed" href="/issues/3129">Feature #3129</a>: rand macOs case handling update</i> added</li></ul> Lighttpd - Bug #3140: lighttpd build failure on macOS 10.13 and earlierhttps://redmine.lighttpd.net/issues/3140?journal_id=130712022-01-21T19:01:26Zryandesign
<ul></ul><p>I think it should be possible to use CommonCrypto from 10.10 onwards but according to <a class="external" href="https://github.com/openssl/openssl/pull/16409/files">https://github.com/openssl/openssl/pull/16409/files</a> you might just need to #include <CommonCrypto/CommonCryptoError.h>. Let me test that on 10.13 and get back to you.</p> Lighttpd - Bug #3140: lighttpd build failure on macOS 10.13 and earlierhttps://redmine.lighttpd.net/issues/3140?journal_id=130722022-01-21T19:10:50Zdevnexen
<ul></ul><p>that is the right thing to do indeed sorry for the trouble.</p> Lighttpd - Bug #3140: lighttpd build failure on macOS 10.13 and earlierhttps://redmine.lighttpd.net/issues/3140?journal_id=130732022-01-21T19:20:54Zryandesign
<ul></ul><p>It does compile on 10.13 when adding the CommonCryptoError.h include above the CommonRandom.h include.</p>
<p>But now I see <a class="external" href="https://github.com/openssl/openssl/commit/2f3b120401533db82e99ed28de5fc8aab1b76b33">https://github.com/openssl/openssl/commit/2f3b120401533db82e99ed28de5fc8aab1b76b33</a> in which openssl disabled the use of CommonCrypto for < 10.12 because "MacOS prior to 10.12 does not support random API correctly". Their test suite was apparently failing before this. I don't know if this was specific to openssl or if the problem would affect lighttpd too.</p>
<p>I tried running the test suite on 10.13 and 1 of 3 tests failed. Should I report that separately? I can try on < 10.12 and see if the result is different.</p> Lighttpd - Bug #3140: lighttpd build failure on macOS 10.13 and earlierhttps://redmine.lighttpd.net/issues/3140?journal_id=130742022-01-21T21:06:23Zgstrauss
<ul></ul><p>I consider use of <code>CCRandomGenerateBytes</code> to be an enhancement, but not required, so if not supported (or not supported well) on older versions of MacOS, it can be disabled IMO.</p>
<p>Please advise if you would like <code>CCRandomGenerateBytes</code> used only with 10.14+, or 10.12+ with <code>#include <CommonCrypto/CommonCryptoError.h></code>, or 10.10+ with <code>#include <CommonCrypto/CommonCryptoError.h></code>, and if you want <code>#include <CommonCrypto/CommonCryptoError.h></code> limited to < 10.14.</p>
<p>This is my current patch<br /><pre>
--- a/src/rand.c
+++ b/src/rand.c
@@ -82,9 +82,10 @@
#include <sys/ioctl.h>
#endif
#if defined(__APPLE__) && defined(__MACH__)
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101000 /* OS X 10.10+ */
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101200 /* OS X 10.12+ */
#undef HAVE_ARC4RANDOM_BUF
#define HAVE_CCRANDOMGENERATEBYTES
+#include <CommonCrypto/CommonCryptoError.h>
#include <CommonCrypto/CommonRandom.h>
#endif
#endif
</pre></p> Lighttpd - Bug #3140: lighttpd build failure on macOS 10.13 and earlierhttps://redmine.lighttpd.net/issues/3140?journal_id=130772022-01-22T17:20:05Zgstrauss
<ul><li><strong>Status</strong> changed from <i>Patch Pending</i> to <i>Fixed</i></li></ul><p>Applied in changeset <a class="changeset" title="[core] avoid CCRandomGenerateBytes on MacOS <10.12 (fixes #3140) (thx ryandesign) x-ref: "lig..." href="https://redmine.lighttpd.net/projects/lighttpd/repository/14/revisions/6791f71b20a127b5b0091020dd065f4f9c7cafb6">6791f71b20a127b5b0091020dd065f4f9c7cafb6</a>.</p>