diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index da70d415..11e48541 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_int($source)) { + $source = new Math_BigInteger($source); + } $value = $source->toBytes(true); } else { $value = array_search($source, $mapping['mapping']);