Bug 215323 - net/ntp: fix build with LibreSSL
Summary: net/ntp: fix build with LibreSSL
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-15 16:50 UTC by Christian Weisgerber
Modified: 2016-12-15 20:23 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
ntp.patch (2.46 KB, patch)
2016-12-15 16:50 UTC, Christian Weisgerber
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Weisgerber freebsd_committer freebsd_triage 2016-12-15 16:50:47 UTC
Created attachment 177989 [details]
ntp.patch

Here is the required patch to allow building ntp with LibreSSL.

Explanation: ntp checks the OPENSSL_VERSION_NUMBER define to determine whether to use the OpenSSL 1.0 or 1.1 API, which are mutually incompatible. LibreSSL implements the 1.0 API but sets OPENSSL_VERSION_NUMBER to 0x20000000L, so the check ends up choosing the wrong API. The fix is this straightforward change:

-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-12-15 20:22:29 UTC
A commit references this bug:

Author: cy
Date: Thu Dec 15 20:22:15 UTC 2016
New revision: 428634
URL: https://svnweb.freebsd.org/changeset/ports/428634

Log:
  Fix build with LibreSSL.

  PR:		215323
  Submitted by:	naddy

Changes:
  head/net/ntp/Makefile
  head/net/ntp/files/patch-include_libssl__compat.h
  head/net/ntp/files/patch-libntp_libssl__compat.c
Comment 2 Cy Schubert freebsd_committer freebsd_triage 2016-12-15 20:23:15 UTC
Committed. Thanks for the patch.