From c12500cace5e70e9bfc0dcb72030f2a063aca21e Mon Sep 17 00:00:00 2001 From: terrafrost Date: Thu, 28 Jul 2016 13:08:47 -0500 Subject: [PATCH] RSA: code cleanup --- phpseclib/Crypt/RSA.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 43f6c844..87a0a6e3 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -794,11 +794,7 @@ class RSA return false; } - $oldFormat = $this->privateKeyFormat; - $this->privateKeyFormat = $type; - $temp = $type::savePrivateKey($this->modulus, $this->publicExponent, $this->exponent, $this->primes, $this->exponents, $this->coefficients, $this->password); - $this->privateKeyFormat = $oldFormat; - return $temp; + return $type::savePrivateKey($this->modulus, $this->publicExponent, $this->exponent, $this->primes, $this->exponents, $this->coefficients, $this->password); } /** @@ -969,11 +965,7 @@ class RSA return false; } - $oldFormat = $this->publicKeyFormat; - $this->publicKeyFormat = $type; - $temp = $type::savePublicKey($this->modulus, $this->publicExponent); - $this->publicKeyFormat = $oldFormat; - return $temp; + return $type::savePublicKey($this->modulus, $this->publicExponent); } /** @@ -1161,9 +1153,9 @@ class RSA /** * Determines the private key format * - * @see self::createKey() + * @see self::__toString() * @access public - * @param int $format + * @param string $format */ function setPrivateKeyFormat($format) { @@ -1173,9 +1165,9 @@ class RSA /** * Determines the public key format * - * @see self::createKey() + * @see self::__toString() * @access public - * @param int $format + * @param string $format */ function setPublicKeyFormat($format) {