mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-05 21:17:53 +00:00
Tests/ASN1: add tests for constructed mismatches
This commit is contained in:
parent
8b8cbecb9b
commit
c1d21edb94
@ -418,4 +418,25 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
|
||||
$decoded = $asn1->decodeBER($em);
|
||||
$this->assertFalse($decoded[0]);
|
||||
}
|
||||
|
||||
public function testConstructedMismatch()
|
||||
{
|
||||
$asn1 = new File_ASN1();
|
||||
|
||||
$em = pack('H*', '1031300d0609608648016503040201050004207509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9');
|
||||
$decoded = $asn1->decodeBER($em);
|
||||
$this->assertFalse($decoded[0]);
|
||||
|
||||
$em = pack('H*', '3031100d0609608648016503040201050004207509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9');
|
||||
$decoded = $asn1->decodeBER($em);
|
||||
$this->assertFalse($decoded[0]);
|
||||
|
||||
$em = pack('H*', '3031300d2609608648016503040201050004207509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9');
|
||||
$decoded = $asn1->decodeBER($em);
|
||||
$this->assertFalse($decoded[0]);
|
||||
|
||||
$em = pack('H*', '3031300d06096086480165030402012d0004207509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9');
|
||||
$decoded = $asn1->decodeBER($em);
|
||||
$this->assertFalse($decoded[0]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user