Bug 194841 - [PATCH] net/openldap24-server fix build with LibreSSL
Summary: [PATCH] net/openldap24-server 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: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-05 19:35 UTC by Bernard Spil
Modified: 2014-11-12 18:00 UTC (History)
0 users

See Also:
brnrd: maintainer-feedback? (delphij)


Attachments
patch to replace functions and types with DES_ versions (5.84 KB, patch)
2014-11-05 19:35 UTC, Bernard Spil
no flags Details | Diff
Patch disabling lmpasswd when LibreSSL is installed (769 bytes, patch)
2014-11-05 19:37 UTC, Bernard Spil
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernard Spil freebsd_committer 2014-11-05 19:35:31 UTC
Created attachment 149087 [details]
patch to replace functions and types with DES_ versions

OpenLDAP 2.4 fails to build with LibreSSL, error below
make.conf
WITH_OPENSSL_PORT=    yes
OPENSSL_SHLIBVER=     30
OPENSSL_PORT=         security/libressl

OpenLDAP is using des_* types and functions that were deprecated in 2002 by the OpenSSL product (and replaced with DES_*) and removed by LibreSSL April 2014

Created a patch for libraries/liblutil/passwd.c to upgrade to the recent DES_-versions

Upstream responded that this is due to building with --enable-lmpasswd and commented that lmpasswd should no longer be used.

Created a patch that disables lmpasswd when LibreSSL is used but suggest moving lmpasswd to an OPTION or removing it alltogether.

--- passwd.o ---
passwd.c:41:9: error: unknown type name 'des_cblock'; did you mean 'DES_cblock'?
typedef des_cblock des_key;
        ^~~~~~~~~~
        DES_cblock
/usr/local/include/openssl/des.h:73:23: note: 'DES_cblock' declared here
typedef unsigned char DES_cblock[8];
                      ^
passwd.c:42:9: error: unknown type name 'des_cblock'; did you mean 'DES_cblock'?
typedef des_cblock des_data_block;
        ^~~~~~~~~~
        DES_cblock
/usr/local/include/openssl/des.h:73:23: note: 'DES_cblock' declared here
typedef unsigned char DES_cblock[8];
                      ^
passwd.c:43:9: error: unknown type name 'des_key_schedule'; did you mean 'DES_key_schedule'?
typedef des_key_schedule des_context;
        ^~~~~~~~~~~~~~~~
        DES_key_schedule
/usr/local/include/openssl/des.h:87:7: note: 'DES_key_schedule' declared here
    } DES_key_schedule;
      ^
passwd.c:670:5: warning: implicit declaration of function 'des_set_odd_parity' is invalid in C99 [-Wimplicit-function-declaration]
    des_set_odd_parity( key );
    ^
passwd.c:867:2: warning: implicit declaration of function 'des_set_key_unchecked' is invalid in C99 [-Wimplicit-function-declaration]
        des_set_key_unchecked( &key, schedule );
        ^
passwd.c:868:2: warning: implicit declaration of function 'des_ecb_encrypt' is invalid in C99 [-Wimplicit-function-declaration]
        des_ecb_encrypt( &StdText, &PasswordHash1, schedule , DES_ENCRYPT );
        ^
3 warnings and 3 errors generated.
*** [passwd.o] Error code 1

make[4]: stopped in /usr/ports/net/openldap24-server/work/openldap-2.4.40/libraries/liblutil
1 error
Comment 1 Bugzilla Automation freebsd_committer 2014-11-05 19:35:31 UTC
Auto-assigned to maintainer delphij@FreeBSD.org
Comment 2 Bernard Spil freebsd_committer 2014-11-05 19:37:11 UTC
Created attachment 149088 [details]
Patch disabling lmpasswd when LibreSSL is installed

Suggest moving lmpasswd to an OPTION
Comment 3 commit-hook freebsd_committer 2014-11-12 17:59:47 UTC
A commit references this bug:

Author: delphij
Date: Wed Nov 12 17:59:35 UTC 2014
New revision: 372499
URL: https://svnweb.freebsd.org/changeset/ports/372499

Log:
   - Fix Perl dependency by converting the port from using
     bsd.port.{pre,post}.mk to options.mk. [1]
   - Fix build with LibreSSL. [2] [3]
   - Make LM Password optional and disable by default. [3]

  Reported by:	Lorenzo Perone <lorenzo.perone@bytesatwork.com> [1],
  		brd [1]
  Submitted by:	spil.oss@gmail.com [2]
  PR:		194841 [3]

Changes:
  head/net/openldap24-server/Makefile
  head/net/openldap24-server/files/patch-des
Comment 4 Xin LI freebsd_committer 2014-11-12 18:00:21 UTC
Committed, thanks!