mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-09 15:20:58 +00:00
RSA: some of the exceptions being thrown weren't valid
This commit is contained in:
parent
f300e825b0
commit
453e6fcf18
@ -2747,7 +2747,7 @@ class RSA
|
|||||||
// Length checking
|
// Length checking
|
||||||
|
|
||||||
if (strlen($s) != $this->k) {
|
if (strlen($s) != $this->k) {
|
||||||
throw new \RuntimeSignature('Invalid signature');
|
throw new \RuntimeException('Invalid signature');
|
||||||
}
|
}
|
||||||
|
|
||||||
// RSA verification
|
// RSA verification
|
||||||
@ -2755,11 +2755,11 @@ class RSA
|
|||||||
$s = $this->_os2ip($s);
|
$s = $this->_os2ip($s);
|
||||||
$m2 = $this->_rsavp1($s);
|
$m2 = $this->_rsavp1($s);
|
||||||
if ($m2 === false) {
|
if ($m2 === false) {
|
||||||
throw new \RuntimeSignature('Invalid signature');
|
throw new \RuntimeException('Invalid signature');
|
||||||
}
|
}
|
||||||
$em = $this->_i2osp($m2, $this->k);
|
$em = $this->_i2osp($m2, $this->k);
|
||||||
if ($em === false) {
|
if ($em === false) {
|
||||||
throw new \RuntimeSignature('Invalid signature');
|
throw new \RuntimeException('Invalid signature');
|
||||||
}
|
}
|
||||||
|
|
||||||
// EMSA-PKCS1-v1_5 encoding
|
// EMSA-PKCS1-v1_5 encoding
|
||||||
|
Loading…
Reference in New Issue
Block a user