php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73711 Segfault in openssl_pkey_new when generating DSA or DH key
Submitted: 2016-12-10 17:04 UTC Modified: 2016-12-14 19:23 UTC
From: margusk at gmail dot com Assigned: bukka (profile)
Status: Closed Package: OpenSSL related
PHP Version: 7.1.0 OS:
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: margusk at gmail dot com
New email:
PHP Version: OS:

 

 [2016-12-10 17:04 UTC] margusk at gmail dot com
Description:
------------
When generating new DSA or DH key using openssl_pkey_new(), then script terminates with Segmentation Fault.

The problem lies in method php_openssl_generate_private_key() (ext/openssl/openssl.c), where "dsaparam" and "dhparam" variables are not initialized.

Both PHP 7.0 and 7.1 are affected.

Test script:
---------------
<?php
    $k = openssl_pkey_new (array ("private_key_type" => OPENSSL_KEYTYPE_DSA));
    echo "Success!";
?>

Expected result:
----------------
Success!

Actual result:
--------------
Segmentation Fault

Patches

dsa-dh-keygen-segfault-fix (last revision 2016-12-10 17:06 UTC by margusk at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-14 19:23 UTC] bukka@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: bukka
 [2017-04-23 19:30 UTC] bukka@php.net
Automatic comment on behalf of bukka
Revision: http://git.php.net/?p=php-src.git;a=commit;h=366b1640d09b982ebc69001bcb476268ab668ab8
Log: Fix bug #73711 (Segfault in openssl_pkey_new when generating DSA or DH key)
 [2017-04-23 19:30 UTC] bukka@php.net
-Status: Assigned +Status: Closed
 [2017-04-23 19:32 UTC] bukka@php.net
Automatic comment on behalf of bukka
Revision: http://git.php.net/?p=php-src.git;a=commit;h=366b1640d09b982ebc69001bcb476268ab668ab8
Log: Fix bug #73711 (Segfault in openssl_pkey_new when generating DSA or DH key)
 [2017-04-23 19:34 UTC] bukka@php.net
Automatic comment on behalf of bukka
Revision: http://git.php.net/?p=php-src.git;a=commit;h=366b1640d09b982ebc69001bcb476268ab668ab8
Log: Fix bug #73711 (Segfault in openssl_pkey_new when generating DSA or DH key)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC