Tests: add unit test for EC pub key with excessively large integer

This commit is contained in:
terrafrost 2024-02-24 08:42:27 -06:00
parent 0358eb163c
commit e17409a3e3
2 changed files with 12 additions and 0 deletions

View File

@ -1392,4 +1392,16 @@ JYhGgW6KsKViE0hzQB8dSAcNcfwQPSKzOd02crXdJ7uYvZZK9prN83Oe1iDaizeA
$this->assertFalse($x509->validateURL('https://aa')); $this->assertFalse($x509->validateURL('https://aa'));
} }
public function testLargeInteger()
{
// cert has an elliptic curve public key with a specified curve (vs a named curve) with
// an excessively large integer value
$cert = file_get_contents(__DIR__ . '/mal-cert-01.der');
$x509 = new X509();
$x509->loadX509($cert);
$this->expectException(\RuntimeException::class);
$x509->getPublicKey();
}
} }

Binary file not shown.