From:             oskar at lanstorm dot org
Operating system: Linux 2.4.26-grsec
PHP version:      5.0.2
PHP Bug Type:     Apache related
Bug description:  Apache crach when preforming openssl operations.

Description:
------------
Hey.
I`ve tried to send encrypted and signed e-mail via php using the
openssl_pkcs7* functions and they crash my apache.
Code looks like this...

<?
$data = <<<EOD

To jest test wiadomosci.
Powinna byc zaszyfrowana i podpisana cyfrowo.

EOD;

$plik = fopen('oskar.pem', 'r');
$key=fread($plik, 10000);
fclose($plik);

// save message to file
$fp = fopen('msg.txt', 'w');
fwrite($fp, $data);
fclose($fp);

//podpisz
if (openssl_pkcs7_sign('msg.txt', 'signed.txt',
'file:///usr/local/apache/htdocs/oskar.pem',
    array('file:///usr/local/apache/htdocs/oskar.pem', 'pass'),
    array('To' => 'Oskar <[EMAIL PROTECTED]>',
            'From' => 'oskar <[EMAIL PROTECTED]>'))) {

//szyfruj
if (openssl_pkcs7_encrypt('signed.txt', 'enc.txt', $key,
    array('To' => 'Oskar <[EMAIL PROTECTED]>',
          'From' => 'oskar <[EMAIL PROTECTED]>',
          'Subject' => 'Zaszyfrowana i podpisana elektronicznie wiadomosc
ze strony www.'))) {
    // slij
    exec(ini_get('sendmail_path') . ' < enc.txt');
}
}
else {
echo(openssl_error_string());
}

?>

When i`m lunching the script apache child process segfault:|.

[Wed Sep 29 13:20:35 2004] [notice] child pid 2586 exit signal
Segmentation fault (11)

Everything else is ok.PHP works fine on "normal" (not using openssl
functions) scripts.But on this one it crash.Code is good because
somethimes it works and don`t crash.

Regards.



-- 
Edit bug report at http://bugs.php.net/?id=30273&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30273&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30273&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30273&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30273&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30273&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30273&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30273&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30273&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30273&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30273&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30273&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30273&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30273&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30273&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30273&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30273&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30273&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30273&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30273&r=mysqlcfg

Reply via email to