php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13632 Configure fails to detect MD5 crypt()
Submitted: 2001-10-10 17:34 UTC Modified: 2001-10-11 16:19 UTC
From: victor at lab dot de Assigned:
Status: Closed Package: *Encryption and hash functions
PHP Version: 4.0CVS-2001-10-10 OS: Debian sid (Linux 2.2.19)
Private report: No CVE-ID: None
 [2001-10-10 17:34 UTC] victor at lab dot de
Hello folks,

the problems described in 9177 and 11648 still persist in
the current CVS version of PHP. configure fails to detect
that MD5 hash is available when compiled --with-openssl.

After grabbing fresh CVS version:
$ ./configure --with-openssl && make
<configure output>
$ ./php -v
4.0.8-dev

I grabbed the example from ext/standard/config.m4 and:

$ ./php -q
<?
print crypt("rasmuslerdorf", "$1$rasmusle$")."\n";
?>
$1Hat1hn6A1pw

this should be 'rISCgZzpwk3UhDidwXvin0' as in config.m4.
same with a c sample:

$ cat >test.c
#include <crypt.h>
main() {
        printf("%s\n", crypt("rasmuslerdorf", "$1$rasmusle$"));
}
$ gcc -lcrypto -lcrypt test.c 
$ ./a.out 
$1Hat1hn6A1pw

it it the linkage order that causes the trouble. the same
with lcrypto linked last yields in the correct:

$ gcc -lcrypt -lcrypto test.c 
$ ./a.out 
$1$rasmusle$rISCgZzpwk3UhDidwXvin0

the config used for these examples was:
* latest PHP CVS
* libcrypt-2.2.4
* openssl 0.9.6b

Victor

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-10 20:00 UTC] sniper@php.net
I tried the latest CVS with the same configure line
and MD5 is detected and works as it is supposed to.

Could you please give this information:

libphp4.la contents (the dependency_libs line)
versions of gcc, autoconf, libtool, automake and ld

--Jani

 [2001-10-10 20:32 UTC] victor at lab dot de
Hello Jani,

of course, here it goes:

# Libraries that this one depends upon.
dependency_libs=' -ldl -lcrypt -lresolv -ldl -lresolv -lcrypt -lpam -ldl -lcrypt -lssl -lcrypto -lresolv -lm -ldl -lnsl -lresolv -lc
rypt            '

gcc version 2.95.4 20011006 (Debian prerelease)

autoconf (GNU Autoconf) 2.52

automake (GNU automake) 1.5

ltmain.sh (GNU libtool) 1.4.2 (1.922.2.53 2001/09/11 03:18:52)

GNU ld 2.11.90.0.31

Hope this helps

Victor

 [2001-10-10 22:45 UTC] sniper@php.net
First of all, this is actually a bug in OpenSSL and I have
informed them about it (long ago) and it should be fixed
in next release of OpenSSL.

But as this works for me just fine and our dependancy_libs
lines are identical..do you happen to have multiple
libcrypt.* files in your system??

Also, you should be using libtool 1.4 (or 1.4.1) as there
have been reports that 1.4.2 is buggy.

--Jani

 [2001-10-11 16:19 UTC] victor at lab dot de
Hello Jani,

it turned out, that libtool really was the problem here. after downgrading to 1.4.1 it worked fine.

Thanks and sorry for any inconvenience.

Victor



 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC