jdk/src/java.base/share/classes/sun/security/validator/SimpleValidator.java
changeset 43701 fe8c324ba97c
parent 42464 38d967704a9f
child 44158 49deb8a1ed3f
equal deleted inserted replaced
43700:ee6b5bd26bf9 43701:fe8c324ba97c
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   153                 ValidatorException.T_UNTRUSTED_CERT, anchorCert, cpve);
   153                 ValidatorException.T_UNTRUSTED_CERT, anchorCert, cpve);
   154         }
   154         }
   155 
   155 
   156         // create default algorithm constraints checker
   156         // create default algorithm constraints checker
   157         TrustAnchor anchor = new TrustAnchor(anchorCert, null);
   157         TrustAnchor anchor = new TrustAnchor(anchorCert, null);
   158         AlgorithmChecker defaultAlgChecker = new AlgorithmChecker(anchor);
   158         AlgorithmChecker defaultAlgChecker =
       
   159                 new AlgorithmChecker(anchor, variant);
   159 
   160 
   160         // create application level algorithm constraints checker
   161         // create application level algorithm constraints checker
   161         AlgorithmChecker appAlgChecker = null;
   162         AlgorithmChecker appAlgChecker = null;
   162         if (constraints != null) {
   163         if (constraints != null) {
   163             appAlgChecker = new AlgorithmChecker(anchor, constraints);
   164             appAlgChecker = new AlgorithmChecker(anchor, constraints, null,
       
   165                     variant);
   164         }
   166         }
   165 
   167 
   166         // verify top down, starting at the certificate issued by
   168         // verify top down, starting at the certificate issued by
   167         // the trust anchor
   169         // the trust anchor
   168         int maxPathLength = chain.length - 1;
   170         int maxPathLength = chain.length - 1;