From 402b7e81760336a1d3f2d9162f49dfb54e6bed0d Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 5 Oct 2013 21:30:57 -0500 Subject: [PATCH] RSA: if setPublicKey is called unneccessarily return false --- phpseclib/Crypt/RSA.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 50642eb7..106f9cae 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -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;