#30273 [Opn->Fbk]: Apache crach when preforming openssl operations.
| From: | wez@php.net | Date: | Wed, 29 Sep 2004 12:36:32 +0000 |
| Subject: | #30273 [Opn->Fbk]: Apache crach when preforming openssl operations. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66870@lists.php.net to get a copy of this message | ||
ID: 30273
Updated by: wez@php.net
Reported By: oskar at lanstorm dot org
-Status: Open
+Status: Feedback
Bug Type: Apache related
Operating System: Linux 2.4.26-grsec
PHP Version: 5.0.2
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-09-29 13:34:45] oskar at lanstorm dot org
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 <oskar@lanstorm.org>',
'From' => 'oskar <oskar@lanstorm.org>'))) {
//szyfruj
if (openssl_pkcs7_encrypt('signed.txt', 'enc.txt', $key,
array('To' => 'Oskar <oskar@lanstorm.org>',
'From' => 'oskar <oskar@lanstorm.org>',
'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 this bug report at http://bugs.php.net/?id=30273&edit=1