diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index de3d3ed5..770c6747 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -3119,7 +3119,7 @@ class Crypt_RSA $em2 = $this->_emsa_pkcs1_v1_5_encode($m, $this->k); $em3 = $this->_emsa_pkcs1_v1_5_encode_without_null($m, $this->k); - if ($em2 === false || $em3 === false) { + if ($em2 === false && $em3 === false) { user_error('RSA modulus too short'); return false; }