From:             [EMAIL PROTECTED]
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]='$';
    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

---- blah.c after libraries -----
root# gcc -o blah \
  -L/usr/local/openssl/lib -lcrypto -lcrypt blah.c

root# ./blah

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to