Issues

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

Description

When I try to do something like this:


$dh = new Zend_Crypt_DiffieHellman(563, 5);
$dh->generateKeys();

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 :)

Comments

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