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

Merge pull request #1578 from kylekatarnls/fix/end-as-date-time

Allow to pass end date as DateTime
This commit is contained in:
terrafrost 2021-01-12 10:31:24 -06:00 committed by GitHub
commit fcf691124e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3061,7 +3061,7 @@ class X509
-- http://tools.ietf.org/html/rfc5280#section-4.1.2.5 -- http://tools.ietf.org/html/rfc5280#section-4.1.2.5
*/ */
if (strtolower($date) == 'lifetime') { if (is_string($date) && strtolower($date) === 'lifetime') {
$temp = '99991231235959Z'; $temp = '99991231235959Z';
$temp = chr(ASN1::TYPE_GENERALIZED_TIME) . ASN1::encodeLength(strlen($temp)) . $temp; $temp = chr(ASN1::TYPE_GENERALIZED_TIME) . ASN1::encodeLength(strlen($temp)) . $temp;
$this->endDate = new Element($temp); $this->endDate = new Element($temp);