From 06e8afb418e4cb40ac087d69b808f4eeca80cbde Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Sat, 19 Mar 2011 03:32:22 +0000 Subject: [PATCH] - fixed a bug that could prevent _emsa_pss_verify from working in rare circumstances (thanks Lesque!) git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@148 21d32557-59b3-4da0-833f-c5933fad653e --- phpseclib/Crypt/RSA.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 9512ee65..8a4b76cf 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -1776,8 +1776,8 @@ class Crypt_RSA { return false; } - $maskedDB = substr($em, 0, $em - $this->hLen - 1); - $h = substr($em, $em - $this->hLen - 1, $this->hLen); + $maskedDB = substr($em, 0, -$this->hLen - 1); + $h = substr($em, -$this->hLen - 1, $this->hLen); $temp = chr(0xFF << ($emBits & 7)); if ((~$maskedDB[0] & $temp) != $temp) { return false;