From b818827248e6b9cf0170c8f4d9448440e1e054eb 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 ELY-2691 Merge if statement with the enclosing one in X509RevocationTrustManager#checkCertPathLength --- .../wildfly/security/ssl/X509RevocationTrustManager.java | 8 +++----- 1 file changed, 3 insertions(+), 5 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..8d83b96f05d 100644 --- a/ssl/src/main/java/org/wildfly/security/ssl/X509RevocationTrustManager.java +++ b/ssl/src/main/java/org/wildfly/security/ssl/X509RevocationTrustManager.java @@ -394,11 +394,9 @@ 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) { // version 1 or version 2 + if (i == 1 && subject.equals(issuer)) { + pathLenConstraint = Integer.MAX_VALUE; } } else { pathLenConstraint = currCert.getBasicConstraints();