Bug 199119 - libmd conflicts with libcrypto
Summary: libmd conflicts with libcrypto
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.1-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 199357
  Show dependency treegraph
 
Reported: 2015-04-02 17:08 UTC by Thomas Quinot
Modified: 2017-02-23 16:08 UTC (History)
1 user (show)

See Also:


Attachments
patch to avoid the symbol clash (2.84 KB, patch)
2015-04-03 08:30 UTC, Thomas Quinot
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Quinot freebsd_committer freebsd_triage 2015-04-02 17:08:33 UTC
libmd provides symbols that have the same name, but (presumably) are not compatible, with libcrypto.

As a result, a program linked against libmd cannot connect to an LDAP server using SSL, because libldap will resolve symbols in libmd, whereas it expects those from libcrypto.

An annoying collateral is that crontab(1) will hang when using nss_ldap, because it is linked against libmd to get MD5.

Various solutions are possible:
  * link libmd statically in crontab(1)
  * add -lcrypto before -lmd when linking crontab(1)
  * make libmd symbols consistent (ABI-compatible) with those in libcrypto
  * use different syumbol names in libmd to avoid the clash
  * remove libmd symbols that duplicate functionality from libcrypto
  * deprecate libmd altogether and use other hash functions from libcrypto.
Comment 1 Thomas Quinot freebsd_committer freebsd_triage 2015-04-03 08:30:19 UTC
Created attachment 155151 [details]
patch to avoid the symbol clash
Comment 2 Thomas Quinot freebsd_committer freebsd_triage 2015-04-03 08:51:17 UTC
Patch submitted for review:
https://reviews.freebsd.org/D2216
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-05-10 13:22:34 UTC
A commit references this bug:

Author: thomas
Date: Sun May 10 13:21:40 UTC 2015
New revision: 282726
URL: https://svnweb.freebsd.org/changeset/base/282726

Log:
  Ensure libmd symbols do not clash with libcrypto

  Add a prefix to all symbols in libmd to avoid incompatibilites
  with same-named, but not binary compatible, symbols from libcrypto.

  Also introduce Weak aliases to avoid the need to rebuild dependent
  binaries and a major version bump.

  PR:		199119
  Differential Revision:	D2216
  Reviewed by:	roberto, delphij
  MFC after:	2 weeks

Changes:
  head/lib/libmd/md4.h
  head/lib/libmd/md4c.c
  head/lib/libmd/md5.h
  head/lib/libmd/md5c.c
  head/lib/libmd/mdXhl.c
  head/lib/libmd/ripemd.h
  head/lib/libmd/rmd160c.c
  head/lib/libmd/sha.h
  head/lib/libmd/sha1c.c
  head/lib/libmd/sha256.h
  head/lib/libmd/sha256c.c
  head/lib/libmd/sha512.h
  head/lib/libmd/sha512c.c
  head/lib/libmd/shadriver.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-02-23 16:08:22 UTC
A commit references this bug:

Author: avg
Date: Thu Feb 23 16:07:47 UTC 2017
New revision: 314144
URL: https://svnweb.freebsd.org/changeset/base/314144

Log:
  MFC r282726: Ensure libmd symbols do not clash with libcrypto

  Add a prefix to all symbols in libmd to avoid incompatibilites
  with same-named, but not binary compatible, symbols from libcrypto.

  Also introduce Weak aliases to avoid the need to rebuild dependent
  binaries and a major version bump.

  PR:		199119

Changes:
_U  stable/10/
  stable/10/lib/libmd/md4.h
  stable/10/lib/libmd/md4c.c
  stable/10/lib/libmd/md5.h
  stable/10/lib/libmd/md5c.c
  stable/10/lib/libmd/mdXhl.c
  stable/10/lib/libmd/ripemd.h
  stable/10/lib/libmd/rmd160c.c
  stable/10/lib/libmd/sha.h
  stable/10/lib/libmd/sha1c.c
  stable/10/lib/libmd/sha256.h
  stable/10/lib/libmd/sha256c.c
  stable/10/lib/libmd/sha512.h
  stable/10/lib/libmd/sha512c.c
  stable/10/lib/libmd/shadriver.c