Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.2.6

Bug #15682 Invalid Parameter Exception due to missing argument to setPrivateKey()
Submitted: 2009-01-20 00:05 UTC
From: shupp Assigned: doconnor
Status: Closed Package: Crypt_DiffieHellman (version 0.2.1)
PHP Version: Irrelevant OS: Any
Roadmaps: (Not assigned)    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 28 - 14 = ?

 
 [2009-01-20 00:05 UTC] shupp (Bill Shupp)
Description: ------------ In getPrivateKey(), if the private key has not yet been generated, the attempt to set the generated key fails because it is binary. There needs to be a second argument passed to setPrivateKey(), self::BINARY. See the attached patch that adds this. Test script: --------------- <?php require_once 'Crypt/Diffiehellman.php'; $prime = 563; $generator = 9; $dh = new Crypt_DiffieHellman($prime, $generator); $dh->generateKeys(); ?> Expected result: ---------------- (void) Actual result: -------------- Fatal error: Uncaught Crypt_DiffieHellman_Exception: invalid parameter; not a positive natural number in /Users/shupp/pear/PEAR/Crypt/DiffieHellman.php on line 377 #0 /Users/shupp/pear/PEAR/Crypt/DiffieHellman.php(377): Crypt_DiffieHellman->setPrivateKey('??') #1 /Users/shupp/pear/PEAR/Crypt/DiffieHellman.php(210): Crypt_DiffieHellman->getPrivateKey() #2 /Users/shupp/bug.php(9): Crypt_DiffieHellman->generateKeys() #3 {main} thrown in /Users/shupp/pear/PEAR/Crypt/DiffieHellman.php on line 362

Comments

 [2009-05-24 20:38 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Closed -Assigned To: +Assigned To: doconnor
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.