ZF-9432: Zend_Crypt_DiffieHellman throws exception when trying to generate keys without first setting private key

Issue Type: Patch Created: 2010-03-16T05:58:15.000+0000 Last Updated: 2010-04-29T07:30:50.000+0000 Status: Resolved Fix version(s): - 1.10.5 (26/May/10)

Reporter: George Miroshnikov (laggyluke) Assignee: Pádraic Brady (padraic) Tags: - Zend_Crypt

Related issues: Attachments: - dh.patch


When I try to do something like this:

<pre class="highlight">
$dh = new Zend_Crypt_DiffieHellman(563, 5);

I get the following exception: {quote} Fatal error: Uncaught exception 'Zend_Crypt_DiffieHellman_Exception' with message 'invalid parameter; not a positive natural number' in /usr/lib/php/Zend/Crypt/DiffieHellman.php:312 {quote}

I'm attaching a one-liner fix and updated unit test to catch this.

P.S. This is my first actual code contribution after I signed CLA, please let me know if I did something wrong :)


Posted by Pádraic Brady (padraic) on 2010-04-29T07:30:50.000+0000

Resolved in r22052 - thanks for the patch! And you added a test too :P. Well done :).

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.