Skip to content

Commit

Permalink
ASN1: add unit test for malformed ASN1 strings
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Mar 2, 2020
1 parent db6ce98 commit 935fa40
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Unit/File/X509/X509Test.php
Expand Up @@ -733,4 +733,18 @@ public function testNameConstraintIP()
$r = $x509->loadX509($r);
$this->assertSame($r['tbsCertificate']['extensions'][5]['extnValue']['excludedSubtrees'][1]['base']['iPAddress'], array('0.0.0.0', '0.0.0.0'));
}

/**
* @group github1456
*/
public function testRandomString()
{
$a = 'da7e705569d4196cd49cf3b3d92cd435ca34ccbe';
$a = pack('H*', $a);

$x509 = new File_X509();
$r = $x509->loadX509($a);

$this->assertFalse($r);
}
}

0 comments on commit 935fa40

Please sign in to comment.