From e2fcd9d951a1a8ace97f42f7295c590431dcb85c Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 21 Oct 2015 09:44:39 -0500 Subject: [PATCH] RSA: misc fixes to select plugins --- phpseclib/Crypt/RSA/{BLOB.php => MSBLOB.php} | 6 +++--- phpseclib/Crypt/RSA/OpenSSH.php | 6 +++--- phpseclib/Crypt/RSA/PuTTY.php | 4 ++-- tests/Unit/Crypt/RSA/LoadKeyTest.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename phpseclib/Crypt/RSA/{BLOB.php => MSBLOB.php} (98%) diff --git a/phpseclib/Crypt/RSA/BLOB.php b/phpseclib/Crypt/RSA/MSBLOB.php similarity index 98% rename from phpseclib/Crypt/RSA/BLOB.php rename to phpseclib/Crypt/RSA/MSBLOB.php index 90585b62..2f04a1c3 100644 --- a/phpseclib/Crypt/RSA/BLOB.php +++ b/phpseclib/Crypt/RSA/MSBLOB.php @@ -1,6 +1,6 @@ * @access public */ -class BLOB +class MSBLOB { /**#@+ * @access private diff --git a/phpseclib/Crypt/RSA/OpenSSH.php b/phpseclib/Crypt/RSA/OpenSSH.php index 7665e998..73447d2a 100644 --- a/phpseclib/Crypt/RSA/OpenSSH.php +++ b/phpseclib/Crypt/RSA/OpenSSH.php @@ -19,7 +19,7 @@ namespace phpseclib\Crypt\RSA; use phpseclib\Math\BigInteger; /** - * XML Formatted RSA Key Handler + * OpenSSH Formatted RSA Key Handler * * @package RSA * @author Jim Wigginton @@ -41,9 +41,9 @@ class OpenSSH * @access public * @param string $comment */ - static function setEncryptionAlgorithm($comment) + static function setComment($comment) { - self::$comment = $comment; + self::$comment = str_replace(array("\r", "\n"), '', $comment); } /** diff --git a/phpseclib/Crypt/RSA/PuTTY.php b/phpseclib/Crypt/RSA/PuTTY.php index 2323e555..6838ee35 100644 --- a/phpseclib/Crypt/RSA/PuTTY.php +++ b/phpseclib/Crypt/RSA/PuTTY.php @@ -41,9 +41,9 @@ class PuTTY * @access public * @param string $comment */ - static function setEncryptionAlgorithm($comment) + static function setComment($comment) { - self::$comment = $comment; + self::$comment = str_replace(array("\r", "\n"), '', $comment); } /** diff --git a/tests/Unit/Crypt/RSA/LoadKeyTest.php b/tests/Unit/Crypt/RSA/LoadKeyTest.php index 54b34c5b..28322e26 100644 --- a/tests/Unit/Crypt/RSA/LoadKeyTest.php +++ b/tests/Unit/Crypt/RSA/LoadKeyTest.php @@ -431,7 +431,7 @@ Private-MAC: 35134b7434bf828b21404099861d455e660e8740'; $this->assertGreaterThanOrEqual(1, strlen("$privKey")); $pubKey = new RSA(); - $pubKey->load($privKey->getPublicKey('blob')); + $pubKey->load($privKey->getPublicKey('msblob')); $this->assertGreaterThanOrEqual(1, strlen("$pubKey"));