Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update x509.php to parse ASN1_GENERALIZEDTIME #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/helpers/x509.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,12 @@ private static function parsecrl($crl, $oidprint = false) {
unset($curr[$key]);
continue;
}
if($value['type'] == '17' && !array_key_exists('thisUpdate', $curr)) {
if(($value['type'] == '17' || $value['type'] == '18') && !array_key_exists('thisUpdate', $curr)) {
Copy link
Contributor

@parallels999 parallels999 Jul 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better readability with in_array

if(in_array($value['type'], ['17', '18']) && !array_key_exists('thisUpdate', $curr)) {

$curr['thisUpdate']=hex2bin($value['value_hex']);
unset($curr[$key]);
continue;
}
if($value['type'] == '17' && !array_key_exists('nextUpdate', $curr)) {
if(($value['type'] == '17' || $value['type'] == '18') && !array_key_exists('nextUpdate', $curr)) {
$curr['nextUpdate']=hex2bin($value['value_hex']);
unset($curr[$key]);
continue;
Expand Down Expand Up @@ -612,11 +612,13 @@ private static function parsecrl($crl, $oidprint = false) {
$differ=array_diff_key($arrModel['TBSCertList'],$crl['TBSCertList']);
if(count($differ) > 0) {
foreach($differ as $key=>$val) {
// TODO?
}
return false;
}
} else {
foreach($differ as $key=>$val) {
// TODO?
}
return false;
}
Expand Down