From a2f4a2cbbafa7b8beb061fa3d69d9f6bf5e73012 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 22 Sep 2014 23:03:06 -0500 Subject: [PATCH] ASN1: add unit test for non-constructed context-specific change --- phpseclib/File/ASN1.php | 2 +- tests/Unit/File/ASN1Test.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index f4a7591e..eaa47eff 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -1348,4 +1348,4 @@ class File_ASN1 } return $out; } -} \ No newline at end of file +} diff --git a/tests/Unit/File/ASN1Test.php b/tests/Unit/File/ASN1Test.php index 4565edbd..fe35f688 100644 --- a/tests/Unit/File/ASN1Test.php +++ b/tests/Unit/File/ASN1Test.php @@ -268,4 +268,13 @@ class Unit_File_ASN1Test extends PhpseclibTestCase $decoded = $asn1->decodeBER(base64_decode($str)); $this->assertCount(3, $decoded[0]['content']); } + + /** + * @group github477 + */ + public function contextSpecificNonConstructed() + { + $decoded = $asn1->decodeBER(base64_decode('MBaAFJtUo7c00HsI5EPZ4bkICfkOY2Pv')); + $this->assertInternalType('string', $decoded[0]['content'][0]['content']); + } }