From a451dd69f85dd3c8c1c9b6542a6c0393a9f6b0b9 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 29 May 2017 06:31:54 -0500 Subject: [PATCH] RSA: reset variables if bad key was loaded --- phpseclib/Crypt/RSA.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 3eacfe16..b734c9f8 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -1661,6 +1661,15 @@ class Crypt_RSA } if ($components === false) { + $this->comment = null; + $this->modulus = null; + $this->k = null; + $this->exponent = null; + $this->primes = null; + $this->exponents = null; + $this->coefficients = null; + $this->publicExponent = null; + return false; }