mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-27 00:58:25 +00:00
- validateDate didn't work
This commit is contained in:
parent
30391fe2b6
commit
8d34cb11e9
@ -1556,9 +1556,19 @@ class File_X509 {
|
|||||||
$date = time();
|
$date = time();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$notBefore = $this->currentCert['tbsCertificate']['validity']['notBefore']['generalTime'];
|
||||||
|
if (!isset($notBefore)) {
|
||||||
|
$notBefore = $this->currentCert['tbsCertificate']['validity']['notBefore']['utcTime'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$notAfter = $this->currentCert['tbsCertificate']['validity']['notAfter']['generalTime'];
|
||||||
|
if (!isset($notAfter)) {
|
||||||
|
$notAfter = $this->currentCert['tbsCertificate']['validity']['notAfter']['utcTime'];
|
||||||
|
}
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case time() < @strtotime($this->currentCert['tbsCertificate']['validity']['notBefore']):
|
case $date < @strtotime($notBefore):
|
||||||
case time() > @strtotime($this->currentCert['tbsCertificate']['validity']['notAfter']):
|
case $date > @strtotime($notAfter):
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user