Skip to content

Commit

Permalink
VPN: OpenVPN: Instances - when cert_depth is left empty, it should …
Browse files Browse the repository at this point in the history
…ignore the value. #7228 (comment)

Changing allowed to the depth found should have this effect.
  • Loading branch information
AdSchellevis authored and fichtner committed Mar 12, 2024
1 parent 52eed1a commit 519f4cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/opnsense/scripts/openvpn/tls_verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function do_verify($serverid)
return "OpenVPN '$serverid' was not found. Denying authentication for user {$username}";
}
$certificate_depth = getenv('certificate_depth') !== false ? getenv('certificate_depth') : 0;
$allowed_depth = !empty($a_server['cert_depth']) ? $a_server['cert_depth'] : 1;
$allowed_depth = !empty($a_server['cert_depth']) ? $a_server['cert_depth'] : $certificate_depth;
if ($certificate_depth > $allowed_depth) {
return "Certificate depth {$certificate_depth} exceeded max allowed depth of {$allowed_depth}.";
} elseif ($a_server['use_ocsp'] && $certificate_depth == 0) {
Expand Down

0 comments on commit 519f4cb

Please sign in to comment.