Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 8438 - OpenSSL and crypt(), OpenSSL's crypt() is bad.
Summary: OpenSSL and crypt(), OpenSSL's crypt() is bad.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Daniel Ahlberg (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-26 19:38 UTC by Jason Jeremias
Modified: 2003-02-04 19:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
This patch will make it so OpenSSL with use the GLIBC crypt() function instead of its own. (openssl-0.9.6g-glibc.patch,1.55 KB, patch)
2002-09-26 19:42 UTC, Jason Jeremias
Details | Diff
The modified ebuild that will implement the patch. (openssl-0.9.6g-r1.ebuild,1.33 KB, text/plain)
2002-09-26 19:44 UTC, Jason Jeremias
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Jeremias 2002-09-26 19:38:37 UTC
The below text is from http://www.openldap.org/faq/data/cache/185.html

===========================================
Note about OpenSSL and crypt(): Current releases of OpenSSL (up to 0.9.6e at the
time of this writing) include a crypt() function in the OpenSSL crypto library.
This function implements the traditional 56-bit DES crypt() password algorithm.
On most Unix systems, the OpenSSL version of crypt() is not needed since crypt()
is usually a standard part of the Unix C libraries.

Newer Unix systems also support other password hash algorithms including MD5 and
DES-based hashing with longer than 8 significant password characters. On these
platforms, the OpenSSL crypt() function should not be used because it will not
support these newer hash algorithms, and so it will be incompatible with the
hashes generated by the platform's native tools.

Unfortunately the OpenSSL crypt() function is compiled by default when OpenSSL
is built, even though it is not needed (and frequently not useful) on most Unix
platforms. Furthermore, when OpenLDAP is built with OpenSSL, the OpenSSL
libraries will be linked before the native system's C libraries, so the native
version will not be used. This situation causes lots of problems when trying to
use the natively generated password hashes with OpenLDAP.

The solution is to rebuild the OpenSSL crypto library, with the crypt() function
commented out or otherwise disabled. This function is in crypto/des/fcrypt.c in
the OpenSSL source. After it is removed and the crypto library is rebuilt,
OpenLDAP will be able to use the OpenSSL library without any further problems.
If you're using dynamic/shared libraries, simply reinstalling libcrypto will be
enough to fix the problems. Otherwise you'll need to relink the OpenLDAP
binaries to get the correct behavior. 
======================================================

Gentoo's implementation of OpenSSL is affected by this.  I've got a patch and an
new ebuild to solve this problem.  I will attach them to this bug.

-Jason
Comment 1 Jason Jeremias 2002-09-26 19:42:52 UTC
Created attachment 4222 [details, diff]
This patch will make it so OpenSSL with use the GLIBC crypt() function instead of its own.

The patch makes it so OpenSSL uses the native (glibc) crypt() fuction instead
of the crypt function OpenSSL implements.  Note that this was already being don
for freebsd, next, and darwin in the stock code from openssl, why they didn't
do it for Linux systems is beyond me.  I've also read they will make this
change in the 0.9.7 release.
Comment 2 Jason Jeremias 2002-09-26 19:44:43 UTC
Created attachment 4223 [details]
The modified ebuild that will implement the patch.

This modified ebuild implements the patch attached to this bug.  I've tested it
on  a 1.2 (gcc 2.95) and a 1.4 (gcc 3.2) it works on both.

-Jason
Comment 3 SpanKY gentoo-dev 2002-09-26 21:28:47 UTC
this says 'up to 0.9.6e' ...
does this mean 'up to and including' or 'everything before' ?

because if its the 2nd one, then we dont really need this patch since portage 
only has 0.9.6e and 0.9.6g in it atm ...
Comment 4 Jason Jeremias 2002-09-26 21:46:52 UTC
I got that from a bug report on openldap.org.  0.9.6e was what was currently
available when that was written.  The patch provided is still needed as of
0.9.6g.  I know because I was affected by the problem and create the
patch/ebuild to fix the problem against 0.9.6g.

-Jason 
Comment 5 Daniel Ahlberg (RETIRED) gentoo-dev 2002-09-27 12:33:33 UTC
Updated, thanks for pointing this out.