diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index da70d415..2774e7e8 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -950,6 +950,9 @@ class File_ASN1 case FILE_ASN1_TYPE_INTEGER: case FILE_ASN1_TYPE_ENUMERATED: if (!isset($mapping['mapping'])) { + if (is_numeric($source)) { + $source = new Math_BigInteger($source); + } $value = $source->toBytes(true); } else { $value = array_search($source, $mapping['mapping']);