- fixed bug in setPublicKey function (thanks nicklong!)

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@110 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
Jim Wigginton 2010-06-19 12:01:21 +00:00
parent 94f48a97d4
commit dff1ab92d6

View File

@ -62,7 +62,7 @@
* @author Jim Wigginton <terrafrost@php.net>
* @copyright MMIX Jim Wigginton
* @license http://www.gnu.org/licenses/lgpl.txt
* @version $Id: RSA.php,v 1.15 2010-04-10 15:57:02 terrafrost Exp $
* @version $Id: RSA.php,v 1.16 2010-06-19 12:01:21 terrafrost Exp $
* @link http://phpseclib.sourceforge.net
*/
@ -1002,10 +1002,14 @@ class Crypt_RSA {
function setPublicKey($key, $type = CRYPT_RSA_PUBLIC_FORMAT_PKCS1)
{
$components = $this->_parseKey($key, $type);
if (empty($this->modulus) || !$this->modulus->equals($components['modulus'])) {
if ($components === false) {
return false;
}
$this->modulus = $components['modulus'];
$this->publicExponent = $components['publicExponent'];
return true;
}
/**