From c8bf68ac026d5d9dca28f9d3eb045a712248265c Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 5 Apr 2014 18:07:35 -0500 Subject: [PATCH] ASN1: make it so bit string's can have an optional minimum size --- phpseclib/File/ASN1.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index 8627b814..fce33fbd 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -972,6 +972,11 @@ class File_ASN1 } } + if (isset($mapping['min']) && $mapping['min'] >= 1 && $size < $mapping['min']) + { + $size = $mapping['min'] - 1; + } + $offset = 8 - (($size + 1) & 7); $offset = $offset !== 8 ? $offset : 0;