mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-05 21:17:53 +00:00
RSA: if setPublicKey is called unneccessarily return false
This commit is contained in:
parent
d2f6362878
commit
402b7e8176
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user