From b6b854932a2917ce425211d89b91cf43b37543db Mon Sep 17 00:00:00 2001 From: Gabriel Padilha Santos Date: Wed, 18 Oct 2023 09:55:14 -0300 Subject: [PATCH] ELY-2692 Merge an if statement with the enclosing one in X509RevocationTrustManager ELY-2692 Merge an if statement with the enclosing one in X509RevocationTrustManager --- .../security/ssl/X509RevocationTrustManager.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ssl/src/main/java/org/wildfly/security/ssl/X509RevocationTrustManager.java b/ssl/src/main/java/org/wildfly/security/ssl/X509RevocationTrustManager.java index aef9cf3d35e..df82d42870a 100644 --- a/ssl/src/main/java/org/wildfly/security/ssl/X509RevocationTrustManager.java +++ b/ssl/src/main/java/org/wildfly/security/ssl/X509RevocationTrustManager.java @@ -408,15 +408,14 @@ private void checkCertPathLength(X509Certificate currCert) throws CertPathValida pathLenConstraint = maxPathLength; } - if (!subject.equals(issuer)) { - if (pathLenConstraint < i) { - throw new CertPathValidatorException - ("check failed: pathLenConstraint violated - " - + "this cert must be the last cert in the " - + "certification path", null, null, -1, - PKIXReason.PATH_TOO_LONG); - } + if (!subject.equals(issuer) && pathLenConstraint < i) { + throw new CertPathValidatorException + ("check failed: pathLenConstraint violated - " + + "this cert must be the last cert in the " + + "certification path", null, null, -1, + PKIXReason.PATH_TOO_LONG); } + if (pathLenConstraint < maxPathLength) maxPathLength = pathLenConstraint; }