1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-03 18:18:05 +01:00

RSA: make sure that parameters is null for relaxed PKCS1 signatures

This commit is contained in:
terrafrost 2021-04-03 11:33:49 -05:00
parent c6a22faf60
commit 42fc46e9a9

View File

@ -188,6 +188,10 @@ class PublicKey extends RSA implements Common\PublicKey
return false;
}
if (isset($decoded['digestAlgorithm']['parameters']) && $decoded['digestAlgorithm']['parameters'] !== ['null' => '']) {
return false;
}
$hash = $decoded['digestAlgorithm']['algorithm'];
$hash = substr($hash, 0, 3) == 'id-' ?
substr($hash, 3) :