mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 18:55:13 +00:00
Tests: add unit test for EC pub key with excessively large integer
This commit is contained in:
parent
0358eb163c
commit
e17409a3e3
@ -1392,4 +1392,16 @@ JYhGgW6KsKViE0hzQB8dSAcNcfwQPSKzOd02crXdJ7uYvZZK9prN83Oe1iDaizeA
|
||||
|
||||
$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();
|
||||
}
|
||||
}
|
||||
|
BIN
tests/Unit/File/X509/mal-cert-01.der
Normal file
BIN
tests/Unit/File/X509/mal-cert-01.der
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user