php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28552 openssl_pkcs7_encrypt segmentation fault
Submitted: 2004-05-28 01:06 UTC Modified: 2004-06-06 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: owen at name dot com Assigned:
Status: No Feedback Package: OpenSSL related
PHP Version: 4.3.6 OS: RedHat/Linux version 2.4.20-8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: owen at name dot com
New email:
PHP Version: OS:

 

 [2004-05-28 01:06 UTC] owen at name dot com
Description:
------------
When using openssl_pkcs7_encrypt, Apache seg faults. I can perform the same smime related function with openssl alone but not in PHP.

I have tried different sized messages, different headers, different certs, etc and it always seg faults.

Reproduce code:
---------------
            $headers_array = explode("\r\n", $header);
            $infilename = tempnam("/tmp/", "smime-in-");
            $outfilename = tempnam("/tmp/", "smime-out-");
            unlink($outfilename);

            $fp2 = fopen($infilename, "w");
            fwrite($fp2, $mimeData.substr($message, strpos($message, "\r\n\r\n") + 2)."\r\n");
            fclose($fp2);
            $cert = $cert_array[0];
            $encrypted = openssl_pkcs7_encrypt($infilename, $outfilename, $cert, $headers_array, 0);


Expected result:
----------------
smime encrypted data to be written to $outfilename.

Actual result:
--------------
When ran in a browser the page stays the same and doesn't move on to the page the code is being ran on and I get "child pid 5314 exit signal Segmentation fault (11)" in the Apache error log. When ran from the command line I get a sefmentation fault and a core dumped.

Here is the backtrace. Doesn't seem to be much there.

(gdb) bt
#0  0x08224f5d in PKCS7_dataInit ()
#1  0x08380160 in ?? ()


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-28 13:18 UTC] wez@php.net
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.

Please build a debug build and submit a new backtrace.
 [2004-06-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 07:01:29 2024 UTC