RSA: if setPublicKey is called unneccessarily return false

This commit is contained in:
terrafrost 2013-10-05 21:30:57 -05:00
parent d2f6362878
commit 402b7e8176

View File

@ -1474,6 +1474,11 @@ class Crypt_RSA {
*/
function setPublicKey($key = false, $type = false)
{
// if a public key has already been loaded return false
if (isset($this->publicExponent)) {
return false;
}
if ($key === false && !empty($this->modulus)) {
$this->publicExponent = $this->exponent;
return true;