FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=15682&edit=1

ID: 15682
Updated by: daniel.oconnor@gmail.com
Reported By: hostmaster at shupp dot org
Summary: Invalid Parameter Exception due to missing argument
to setPrivateKey()
-Status: Open
+Status: Closed
Type: Bug
Package: Crypt_DiffieHellman
Operating System: Any
Package Version: 0.2.1
PHP Version: Irrelevant
-Assigned To:
+Assigned To: doconnor
Roadmap Versions:
New Comment:

-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.




Previous Comments:
------------------------------------------------------------------------

[2009-01-19 19:05:07] 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

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMay 24, '09 at 2:39p
activeMay 24, '09 at 2:39p
posts1
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase