mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
Trust: add serialNumber and issuer in Store::parseX509(), requested in https://github.com/opnsense/core/issues/8141#issuecomment-2571771937
Since we map subjects, we should do the same when adding an issuer if it exists. serialNumber is just a plain simple field.
This commit is contained in:
parent
e150a571de
commit
f72e066e4d
@ -418,11 +418,19 @@ class Store
|
||||
// valid from/to and name of this cert
|
||||
$result['valid_from'] = $crt['validFrom_time_t'];
|
||||
$result['valid_to'] = $crt['validTo_time_t'];
|
||||
$result['name'] = $crt['name'];
|
||||
foreach (['name', 'serialNumber'] as $cpy) {
|
||||
$result[$cpy] = $crt[$cpy] ?? null;
|
||||
}
|
||||
foreach (self::$issuer_map as $key => $target) {
|
||||
if (!empty($crt['subject'][$key])) {
|
||||
$result[$target] = $crt['subject'][$key];
|
||||
}
|
||||
if (!empty($crt['issuer']) && !empty($crt['issuer'][$key])) {
|
||||
if (empty($result['issuer'])) {
|
||||
$result['issuer'] = [];
|
||||
}
|
||||
$result['issuer'][$target] = $crt['issuer'][$key];
|
||||
}
|
||||
}
|
||||
// OCSP URI
|
||||
if (!empty($crt['extensions']) && !empty($crt['extensions']['authorityInfoAccess'])) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user