From 08335acd63cb64e30eb1502f5b5bf26d3c59c877 Mon Sep 17 00:00:00 2001 From: Gabriel Padilha Santos Date: Wed, 18 Oct 2023 13:45:10 -0300 Subject: [PATCH] ELY-2691 Merge if statement with the enclosing one in X509RevocationTrustManager#checkCertPathLength --- .../wildfly/security/ssl/X509RevocationTrustManager.java | 8 ++------ 1 file changed, 2 insertions(+), 6 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..afad0cb37b2 100644 --- a/ssl/src/main/java/org/wildfly/security/ssl/X509RevocationTrustManager.java +++ b/ssl/src/main/java/org/wildfly/security/ssl/X509RevocationTrustManager.java @@ -394,12 +394,8 @@ private void checkCertPathLength(X509Certificate currCert) throws CertPathValida X500Principal issuer = currCert.getIssuerX500Principal(); int pathLenConstraint = -1; - if (currCert.getVersion() < 3) { // version 1 or version 2 - if (i == 1) { - if (subject.equals(issuer)) { - pathLenConstraint = Integer.MAX_VALUE; - } - } + if (currCert.getVersion() < 3 && i == 1 && subject.equals(issuer)) { // version 1 or version 2 + pathLenConstraint = Integer.MAX_VALUE; } else { pathLenConstraint = currCert.getBasicConstraints(); }