jdk/src/share/classes/sun/security/validator/SimpleValidator.java
changeset 12678 e40db477dd56
parent 11902 a94ba35d9c4a
equal deleted inserted replaced
12677:2b25f3fc4f81 12678:e40db477dd56
   309         }
   309         }
   310 
   310 
   311         // if the certificate is self-issued, ignore the pathLenConstraint
   311         // if the certificate is self-issued, ignore the pathLenConstraint
   312         // checking.
   312         // checking.
   313         if (!X509CertImpl.isSelfIssued(cert)) {
   313         if (!X509CertImpl.isSelfIssued(cert)) {
   314             if (maxPathLen <= 1) {   // reserved one for end-entity certificate
   314             if (maxPathLen <= 0) {
   315                 throw new ValidatorException("Violated path length constraints",
   315                 throw new ValidatorException("Violated path length constraints",
   316                     ValidatorException.T_CA_EXTENSIONS, cert);
   316                     ValidatorException.T_CA_EXTENSIONS, cert);
   317             }
   317             }
   318 
   318 
   319             maxPathLen--;
   319             maxPathLen--;