- 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
This commit is contained in:
Jim Wigginton 2011-03-19 03:32:22 +00:00
parent 458f4f7ef0
commit 06e8afb418

View File

@ -1776,8 +1776,8 @@ class Crypt_RSA {
return false; return false;
} }
$maskedDB = substr($em, 0, $em - $this->hLen - 1); $maskedDB = substr($em, 0, -$this->hLen - 1);
$h = substr($em, $em - $this->hLen - 1, $this->hLen); $h = substr($em, -$this->hLen - 1, $this->hLen);
$temp = chr(0xFF << ($emBits & 7)); $temp = chr(0xFF << ($emBits & 7));
if ((~$maskedDB[0] & $temp) != $temp) { if ((~$maskedDB[0] & $temp) != $temp) {
return false; return false;