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;