1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-12 17:17:26 +01:00

ASN1: Integers should by at least 1 byte long.

Fixes https://github.com/phpseclib/phpseclib/issues/126.
This commit is contained in:
Patrick Monnerat 2013-07-01 14:38:35 +02:00
parent e644c42efa
commit 23d48c4fc5

View File

@ -926,10 +926,10 @@ class File_ASN1 {
} }
$value = new Math_BigInteger($value); $value = new Math_BigInteger($value);
$value = $value->toBytes(true); $value = $value->toBytes(true);
}
if (!strlen($value)) { if (!strlen($value)) {
$value = chr(0); $value = chr(0);
} }
}
break; break;
case FILE_ASN1_TYPE_UTC_TIME: case FILE_ASN1_TYPE_UTC_TIME:
case FILE_ASN1_TYPE_GENERALIZED_TIME: case FILE_ASN1_TYPE_GENERALIZED_TIME: