1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
From: terrafrost <terrafrost@gmail.com>
Date: Sat, 3 Apr 2021 16:33:23 -0500
Subject: RSA: tweak to new validation method
Origin: upstream, https://github.com/phpseclib/phpseclib/pull/1635/commits/4a3e08c2733a40de94ee82c21085c915cc667f7e
---
phpseclib/Crypt/RSA.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php
index f714416..d9c5a3f 100644
--- a/phpseclib/Crypt/RSA.php
+++ b/phpseclib/Crypt/RSA.php
@@ -3034,7 +3034,7 @@ class 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;
}
|