From 2fee2d4f98761b6543d467166ad5143780aa0830 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Thu, 7 May 2015 00:26:39 -0500 Subject: [PATCH 1/2] backport e3betht's PR to 1.0 --- README.md | 2 +- phpseclib/Crypt/RSA.php | 4 ++-- phpseclib/Net/SFTP/Stream.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f7659e0b..a904de5e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # phpseclib - PHP Secure Communications Library -[![Build Status](https://secure.travis-ci.org/phpseclib/phpseclib.png?branch=master)](http://travis-ci.org/phpseclib/phpseclib) +[![Build Status](https://secure.travis-ci.org/phpseclib/phpseclib.png?branch=master)](http://travis-ci.org/phpseclib/phpseclib) [![Code Climate](https://codeclimate.com/github/phpseclib/phpseclib/badges/gpa.svg)](https://codeclimate.com/github/phpseclib/phpseclib) MIT-licensed pure-PHP implementations of an arbitrary-precision integer arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael, diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 3c420693..3146ca14 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -2567,7 +2567,7 @@ class Crypt_RSA // be output. $emLen = ($emBits + 1) >> 3; // ie. ceil($emBits / 8) - $sLen = $this->sLen == false ? $this->hLen : $this->sLen; + $sLen = $this->sLen === false ? $this->hLen : $this->sLen; $mHash = $this->hash->hash($m); if ($emLen < $this->hLen + $sLen + 2) { @@ -2605,7 +2605,7 @@ class Crypt_RSA // be output. $emLen = ($emBits + 1) >> 3; // ie. ceil($emBits / 8); - $sLen = $this->sLen == false ? $this->hLen : $this->sLen; + $sLen = $this->sLen === false ? $this->hLen : $this->sLen; $mHash = $this->hash->hash($m); if ($emLen < $this->hLen + $sLen + 2) { diff --git a/phpseclib/Net/SFTP/Stream.php b/phpseclib/Net/SFTP/Stream.php index eda1cdba..7db29979 100644 --- a/phpseclib/Net/SFTP/Stream.php +++ b/phpseclib/Net/SFTP/Stream.php @@ -511,7 +511,7 @@ class Net_SFTP_Stream $path_from = $this->_parse_path($path_from); $path_to = parse_url($path_to); - if ($path_from == false) { + if ($path_from === false) { return false; } From ae41aca61032fc70a5bd02896bd627a43c17ba21 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Thu, 7 May 2015 08:16:03 -0500 Subject: [PATCH 2/2] README: rm codeclimate badge it's giving us a low score for code who's complexity can't easily be changed and dinging us for "short variables" that are based on the RFC's of the undyling encryption algorithms --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a904de5e..f56f6ae9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # phpseclib - PHP Secure Communications Library -[![Build Status](https://secure.travis-ci.org/phpseclib/phpseclib.png?branch=master)](http://travis-ci.org/phpseclib/phpseclib) [![Code Climate](https://codeclimate.com/github/phpseclib/phpseclib/badges/gpa.svg)](https://codeclimate.com/github/phpseclib/phpseclib) +[![Build Status](https://secure.travis-ci.org/phpseclib/phpseclib.png?branch=1.0)](http://travis-ci.org/phpseclib/phpseclib) MIT-licensed pure-PHP implementations of an arbitrary-precision integer arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael, @@ -16,7 +16,7 @@ PEAR Channel: [phpseclib.sourceforge.net](http://phpseclib.sourceforge.net/pear. ## Documentation * [Documentation / Manual](http://phpseclib.sourceforge.net/) -* [API Documentation](http://phpseclib.bantux.org/api/master/) (generated by Sami) +* [API Documentation](http://phpseclib.bantux.org/api/1.0/) (generated by Sami) ## Support