RSA: some of the exceptions being thrown weren't valid

This commit is contained in:
terrafrost 2015-08-31 22:44:41 -05:00
parent f300e825b0
commit 453e6fcf18

View File

@ -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