PHP 4.0 Bug #9177: crypt problems with openssl

From: Date: Thu, 08 Feb 2001 19:39:57 +0000
Subject: PHP 4.0 Bug #9177: crypt problems with openssl
Groups: php.dev 
Request: Send a blank email to php-dev+get-46051@lists.php.net to get a copy of this message
From: max@the-triumvirate.net Operating system: linux 2.2.18 (rh 6.2) PHP version: 4.0.4pl1 PHP Bug Type: *Install and Config Bug description: crypt problems with openssl MD5 crypt fails if PHP is compiled with openssl (specifically with the -lcrypto) If the .c file comes before the libraries, gcc won't recognize MD5 crypt: ----- blah.c ----- root# cat blah.c #include <crypt.h> main() { char salt[15], answer[40]; salt[0]='$'; salt[1]='1'; salt[2]='$'; salt[3]='r'; salt[4]='a'; salt[5]='s'; salt[6]='m'; salt[7]='u'; salt[8]='s'; salt[9]='l'; salt[10]='e'; salt[11]='$'; salt[12]='\0'; strcpy(answer,salt); strcat(answer,"rISCgZzpwk3UhDidwXvin0"); printf("%s\n%s\n", (char *)crypt("rasmuslerdorf",salt), answer); exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); } ---- blah.c before libraries ---- root# gcc -o blah blah.c \ -L/usr/local/openssl/lib -lcrypto -lcrypt root# ./blah $1Hat1hn6A1pw $1$rasmusle$rISCgZzpwk3UhDidwXvin0 ---- blah.c after libraries ----- root# gcc -o blah \ -L/usr/local/openssl/lib -lcrypto -lcrypt blah.c root# ./blah $1$rasmusle$rISCgZzpwk3UhDidwXvin0 $1$rasmusle$rISCgZzpwk3UhDidwXvin0 -- Edit Bug report at: http://bugs.php.net/?id=9177&edit=1

« previous php.dev (#46051) next »