author | weijun |
Wed, 01 Aug 2018 13:35:08 +0800 | |
changeset 51272 | 9d92ff04a29c |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
4190 | 1 |
/* |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
2 |
* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. |
4190 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
4190 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
4190 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
4190 | 24 |
*/ |
25 |
||
26 |
package sun.security.provider.certpath; |
|
27 |
||
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
28 |
import java.security.AlgorithmConstraints; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
29 |
import java.security.CryptoPrimitive; |
39465
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
30 |
import java.security.Timestamp; |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
31 |
import java.security.cert.CertPathValidator; |
4190 | 32 |
import java.util.Collection; |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
33 |
import java.util.Collections; |
38576
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
34 |
import java.util.Date; |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
35 |
import java.util.Set; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
36 |
import java.util.EnumSet; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
37 |
import java.math.BigInteger; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
38 |
import java.security.PublicKey; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
39 |
import java.security.KeyFactory; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
40 |
import java.security.AlgorithmParameters; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
41 |
import java.security.GeneralSecurityException; |
4190 | 42 |
import java.security.cert.Certificate; |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
43 |
import java.security.cert.X509CRL; |
4190 | 44 |
import java.security.cert.X509Certificate; |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
45 |
import java.security.cert.PKIXCertPathChecker; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
46 |
import java.security.cert.TrustAnchor; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
47 |
import java.security.cert.CRLException; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
48 |
import java.security.cert.CertificateException; |
4190 | 49 |
import java.security.cert.CertPathValidatorException; |
8163
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
7040
diff
changeset
|
50 |
import java.security.cert.CertPathValidatorException.BasicReason; |
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
7040
diff
changeset
|
51 |
import java.security.cert.PKIXReason; |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
52 |
import java.security.interfaces.DSAParams; |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
53 |
import java.security.interfaces.DSAPublicKey; |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
54 |
import java.security.spec.DSAPublicKeySpec; |
4190 | 55 |
|
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
56 |
import sun.security.util.AnchorCertificates; |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
57 |
import sun.security.util.ConstraintsParameters; |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
58 |
import sun.security.util.Debug; |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
59 |
import sun.security.util.DisabledAlgorithmConstraints; |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
60 |
import sun.security.validator.Validator; |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
61 |
import sun.security.x509.X509CertImpl; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
62 |
import sun.security.x509.X509CRLImpl; |
4190 | 63 |
import sun.security.x509.AlgorithmId; |
64 |
||
65 |
/** |
|
38576
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
66 |
* A {@code PKIXCertPathChecker} implementation to check whether a |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
67 |
* specified certificate contains the required algorithm constraints. |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
68 |
* <p> |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
69 |
* Certificate fields such as the subject public key, the signature |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
70 |
* algorithm, key usage, extended key usage, etc. need to conform to |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
71 |
* the specified algorithm constraints. |
4190 | 72 |
* |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
73 |
* @see PKIXCertPathChecker |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
74 |
* @see PKIXParameters |
4190 | 75 |
*/ |
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
76 |
public final class AlgorithmChecker extends PKIXCertPathChecker { |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
77 |
private static final Debug debug = Debug.getInstance("certpath"); |
4190 | 78 |
|
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
79 |
private final AlgorithmConstraints constraints; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
80 |
private final PublicKey trustedPubKey; |
38576
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
81 |
private final Date pkixdate; |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
82 |
private PublicKey prevPubKey; |
39465
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
83 |
private final Timestamp jarTimestamp; |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
84 |
private final String variant; |
4190 | 85 |
|
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
86 |
private static final Set<CryptoPrimitive> SIGNATURE_PRIMITIVE_SET = |
23897 | 87 |
Collections.unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE)); |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
88 |
|
33297 | 89 |
private static final Set<CryptoPrimitive> KU_PRIMITIVE_SET = |
90 |
Collections.unmodifiableSet(EnumSet.of( |
|
91 |
CryptoPrimitive.SIGNATURE, |
|
92 |
CryptoPrimitive.KEY_ENCAPSULATION, |
|
93 |
CryptoPrimitive.PUBLIC_KEY_ENCRYPTION, |
|
94 |
CryptoPrimitive.KEY_AGREEMENT)); |
|
95 |
||
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
96 |
private static final DisabledAlgorithmConstraints |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
97 |
certPathDefaultConstraints = new DisabledAlgorithmConstraints( |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
98 |
DisabledAlgorithmConstraints.PROPERTY_CERTPATH_DISABLED_ALGS); |
4190 | 99 |
|
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
100 |
// If there is no "cacerts" keyword, then disable anchor checking |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
101 |
private static final boolean publicCALimits = |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
102 |
certPathDefaultConstraints.checkProperty("jdkCA"); |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
103 |
|
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
104 |
// If anchor checking enabled, this will be true if the trust anchor |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
105 |
// has a match in the cacerts file |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
106 |
private boolean trustedMatch = false; |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
107 |
|
4190 | 108 |
/** |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
109 |
* Create a new {@code AlgorithmChecker} with the given algorithm |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
110 |
* given {@code TrustAnchor} and {@code String} variant. |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
111 |
* |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
112 |
* @param anchor the trust anchor selected to validate the target |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
113 |
* certificate |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
114 |
* @param variant is the Validator variants of the operation. A null value |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
115 |
* passed will set it to Validator.GENERIC. |
38576
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
116 |
*/ |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
117 |
public AlgorithmChecker(TrustAnchor anchor, String variant) { |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
118 |
this(anchor, certPathDefaultConstraints, null, null, variant); |
39465
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
119 |
} |
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
120 |
|
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
121 |
/** |
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
122 |
* Create a new {@code AlgorithmChecker} with the given |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
123 |
* {@code AlgorithmConstraints}, {@code Timestamp}, and {@code String} |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
124 |
* variant. |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
125 |
* |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
126 |
* Note that this constructor can initialize a variation of situations where |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
127 |
* the AlgorithmConstraints, Timestamp, or Variant maybe known. |
39465
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
128 |
* |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
129 |
* @param constraints the algorithm constraints (or null) |
39465
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
130 |
* @param jarTimestamp Timestamp passed for JAR timestamp constraint |
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
131 |
* checking. Set to null if not applicable. |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
132 |
* @param variant is the Validator variants of the operation. A null value |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
133 |
* passed will set it to Validator.GENERIC. |
39465
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
134 |
*/ |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
135 |
public AlgorithmChecker(AlgorithmConstraints constraints, |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
136 |
Timestamp jarTimestamp, String variant) { |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
137 |
this(null, constraints, null, jarTimestamp, variant); |
4190 | 138 |
} |
139 |
||
140 |
/** |
|
38576
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
141 |
* Create a new {@code AlgorithmChecker} with the |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
142 |
* given {@code TrustAnchor}, {@code AlgorithmConstraints}, |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
143 |
* {@code Timestamp}, and {@code String} variant. |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
144 |
* |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
145 |
* @param anchor the trust anchor selected to validate the target |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
146 |
* certificate |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
147 |
* @param constraints the algorithm constraints (or null) |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
148 |
* @param pkixdate The date specified by the PKIXParameters date. If the |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
149 |
* PKIXParameters is null, the current date is used. This |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
150 |
* should be null when jar files are being checked. |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
151 |
* @param jarTimestamp Timestamp passed for JAR timestamp constraint |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
152 |
* checking. Set to null if not applicable. |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
153 |
* @param variant is the Validator variants of the operation. A null value |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
154 |
* passed will set it to Validator.GENERIC. |
4190 | 155 |
*/ |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
156 |
public AlgorithmChecker(TrustAnchor anchor, |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
157 |
AlgorithmConstraints constraints, Date pkixdate, |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
158 |
Timestamp jarTimestamp, String variant) { |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
159 |
|
41562
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
160 |
if (anchor != null) { |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
161 |
if (anchor.getTrustedCert() != null) { |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
162 |
this.trustedPubKey = anchor.getTrustedCert().getPublicKey(); |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
163 |
// Check for anchor certificate restrictions |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
164 |
trustedMatch = checkFingerprint(anchor.getTrustedCert()); |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
165 |
if (trustedMatch && debug != null) { |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
166 |
debug.println("trustedMatch = true"); |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
167 |
} |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
168 |
} else { |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
169 |
this.trustedPubKey = anchor.getCAPublicKey(); |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
170 |
} |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
171 |
} else { |
41562
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
172 |
this.trustedPubKey = null; |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
173 |
if (debug != null) { |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
174 |
debug.println("TrustAnchor is null, trustedMatch is false."); |
1e040ccac110
8165274: SHA1 certpath constraint check fails with OCSP certificate
ascarpino
parents:
39465
diff
changeset
|
175 |
} |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
176 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
177 |
|
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
178 |
this.prevPubKey = this.trustedPubKey; |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
179 |
this.constraints = (constraints == null ? certPathDefaultConstraints : |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
180 |
constraints); |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
181 |
// If we are checking jar files, set pkixdate the same as the timestamp |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
182 |
// for certificate checking |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
183 |
this.pkixdate = (jarTimestamp != null ? jarTimestamp.getTimestamp() : |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
184 |
pkixdate); |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
185 |
this.jarTimestamp = jarTimestamp; |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
186 |
this.variant = (variant == null ? Validator.VAR_GENERIC : variant); |
38576
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
187 |
} |
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
188 |
|
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
189 |
/** |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
190 |
* Create a new {@code AlgorithmChecker} with the given {@code TrustAnchor}, |
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
191 |
* {@code PKIXParameter} date, and {@code varient} |
38576
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
192 |
* |
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
193 |
* @param anchor the trust anchor selected to validate the target |
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
194 |
* certificate |
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
195 |
* @param pkixdate Date the constraints are checked against. The value is |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
196 |
* either the PKIXParameters date or null for the current date. |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
197 |
* @param variant is the Validator variants of the operation. A null value |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
198 |
* passed will set it to Validator.GENERIC. |
38576
ccaac80108c5
8154005: Add algorithm constraint that specifies the restriction date
ascarpino
parents:
37726
diff
changeset
|
199 |
*/ |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
200 |
public AlgorithmChecker(TrustAnchor anchor, Date pkixdate, String variant) { |
44158
49deb8a1ed3f
8176350: Usage constraints don't take effect when using PKIX
ascarpino
parents:
43807
diff
changeset
|
201 |
this(anchor, certPathDefaultConstraints, pkixdate, null, variant); |
4190 | 202 |
} |
203 |
||
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
204 |
// Check this 'cert' for restrictions in the AnchorCertificates |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
205 |
// trusted certificates list |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
206 |
private static boolean checkFingerprint(X509Certificate cert) { |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
207 |
if (!publicCALimits) { |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
208 |
return false; |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
209 |
} |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
210 |
|
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
211 |
if (debug != null) { |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
212 |
debug.println("AlgorithmChecker.contains: " + cert.getSigAlgName()); |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
213 |
} |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
214 |
return AnchorCertificates.contains(cert); |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
215 |
} |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
216 |
|
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
217 |
@Override |
4190 | 218 |
public void init(boolean forward) throws CertPathValidatorException { |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
219 |
// Note that this class does not support forward mode. |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
220 |
if (!forward) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
221 |
if (trustedPubKey != null) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
222 |
prevPubKey = trustedPubKey; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
223 |
} else { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
224 |
prevPubKey = null; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
225 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
226 |
} else { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
227 |
throw new |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
228 |
CertPathValidatorException("forward checking not supported"); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
229 |
} |
4190 | 230 |
} |
231 |
||
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
232 |
@Override |
4190 | 233 |
public boolean isForwardCheckingSupported() { |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
234 |
// Note that as this class does not support forward mode, the method |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
235 |
// will always returns false. |
4190 | 236 |
return false; |
237 |
} |
|
238 |
||
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
239 |
@Override |
4190 | 240 |
public Set<String> getSupportedExtensions() { |
241 |
return null; |
|
242 |
} |
|
243 |
||
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
244 |
@Override |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
245 |
public void check(Certificate cert, |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
246 |
Collection<String> unresolvedCritExts) |
4190 | 247 |
throws CertPathValidatorException { |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
248 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
249 |
if (!(cert instanceof X509Certificate) || constraints == null) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
250 |
// ignore the check for non-x.509 certificate or null constraints |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
251 |
return; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
252 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
253 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
254 |
// check the key usage and key size |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
255 |
boolean[] keyUsage = ((X509Certificate) cert).getKeyUsage(); |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
256 |
if (keyUsage != null && keyUsage.length < 9) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
257 |
throw new CertPathValidatorException( |
8163
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
7040
diff
changeset
|
258 |
"incorrect KeyUsage extension", |
d9bcc1208691
7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm
xuelei
parents:
7040
diff
changeset
|
259 |
null, null, -1, PKIXReason.INVALID_KEY_USAGE); |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
260 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
261 |
|
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
262 |
X509CertImpl x509Cert; |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
263 |
AlgorithmId algorithmId; |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
264 |
try { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
265 |
x509Cert = X509CertImpl.toImpl((X509Certificate)cert); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
266 |
algorithmId = (AlgorithmId)x509Cert.get(X509CertImpl.SIG_ALG); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
267 |
} catch (CertificateException ce) { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
268 |
throw new CertPathValidatorException(ce); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
269 |
} |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
270 |
|
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
271 |
AlgorithmParameters currSigAlgParams = algorithmId.getParameters(); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
272 |
PublicKey currPubKey = cert.getPublicKey(); |
45889
605589f46d2a
8184673: Fix compatibility issue in AlgorithmChecker for 3rd party JCE providers
clanger
parents:
44158
diff
changeset
|
273 |
String currSigAlg = x509Cert.getSigAlgName(); |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
274 |
|
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
275 |
// Check the signature algorithm and parameters against constraints. |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
276 |
if (!constraints.permits(SIGNATURE_PRIMITIVE_SET, currSigAlg, |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
277 |
currSigAlgParams)) { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
278 |
throw new CertPathValidatorException( |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
279 |
"Algorithm constraints check failed on signature " + |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
280 |
"algorithm: " + currSigAlg, null, null, -1, |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
281 |
BasicReason.ALGORITHM_CONSTRAINED); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
282 |
} |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
283 |
|
33297 | 284 |
// Assume all key usage bits are set if key usage is not present |
285 |
Set<CryptoPrimitive> primitives = KU_PRIMITIVE_SET; |
|
286 |
||
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
287 |
if (keyUsage != null) { |
33297 | 288 |
primitives = EnumSet.noneOf(CryptoPrimitive.class); |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
289 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
290 |
if (keyUsage[0] || keyUsage[1] || keyUsage[5] || keyUsage[6]) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
291 |
// keyUsage[0]: KeyUsage.digitalSignature |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
292 |
// keyUsage[1]: KeyUsage.nonRepudiation |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
293 |
// keyUsage[5]: KeyUsage.keyCertSign |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
294 |
// keyUsage[6]: KeyUsage.cRLSign |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
295 |
primitives.add(CryptoPrimitive.SIGNATURE); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
296 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
297 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
298 |
if (keyUsage[2]) { // KeyUsage.keyEncipherment |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
299 |
primitives.add(CryptoPrimitive.KEY_ENCAPSULATION); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
300 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
301 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
302 |
if (keyUsage[3]) { // KeyUsage.dataEncipherment |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
303 |
primitives.add(CryptoPrimitive.PUBLIC_KEY_ENCRYPTION); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
304 |
} |
4190 | 305 |
|
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
306 |
if (keyUsage[4]) { // KeyUsage.keyAgreement |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
307 |
primitives.add(CryptoPrimitive.KEY_AGREEMENT); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
308 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
309 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
310 |
// KeyUsage.encipherOnly and KeyUsage.decipherOnly are |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
311 |
// undefined in the absence of the keyAgreement bit. |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
312 |
|
33297 | 313 |
if (primitives.isEmpty()) { |
314 |
throw new CertPathValidatorException( |
|
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
315 |
"incorrect KeyUsage extension bits", |
33297 | 316 |
null, null, -1, PKIXReason.INVALID_KEY_USAGE); |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
317 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
318 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
319 |
|
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
320 |
ConstraintsParameters cp = |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
321 |
new ConstraintsParameters((X509Certificate)cert, |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
322 |
trustedMatch, pkixdate, jarTimestamp, variant); |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
323 |
|
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
324 |
// Check against local constraints if it is DisabledAlgorithmConstraints |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
325 |
if (constraints instanceof DisabledAlgorithmConstraints) { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
326 |
((DisabledAlgorithmConstraints)constraints).permits(currSigAlg, cp); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
327 |
// DisabledAlgorithmsConstraints does not check primitives, so key |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
328 |
// additional key check. |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
329 |
|
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
330 |
} else { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
331 |
// Perform the default constraints checking anyway. |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
332 |
certPathDefaultConstraints.permits(currSigAlg, cp); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
333 |
// Call locally set constraints to check key with primitives. |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
334 |
if (!constraints.permits(primitives, currPubKey)) { |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
335 |
throw new CertPathValidatorException( |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
336 |
"Algorithm constraints check failed on key " + |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
337 |
currPubKey.getAlgorithm() + " with size of " + |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
338 |
sun.security.util.KeyUtil.getKeySize(currPubKey) + |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
339 |
"bits", |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
340 |
null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
341 |
} |
33297 | 342 |
} |
343 |
||
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
344 |
// If there is no previous key, set one and exit |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
345 |
if (prevPubKey == null) { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
346 |
prevPubKey = currPubKey; |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
347 |
return; |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
348 |
} |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
349 |
|
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
350 |
// Check with previous cert for signature algorithm and public key |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
351 |
if (!constraints.permits( |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
352 |
SIGNATURE_PRIMITIVE_SET, |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
353 |
currSigAlg, prevPubKey, currSigAlgParams)) { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
354 |
throw new CertPathValidatorException( |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
355 |
"Algorithm constraints check failed on " + |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
356 |
"signature algorithm: " + currSigAlg, |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
357 |
null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
358 |
} |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
359 |
|
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
360 |
// Inherit key parameters from previous key |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
361 |
if (PKIX.isDSAPublicKeyWithoutParams(currPubKey)) { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
362 |
// Inherit DSA parameters from previous key |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
363 |
if (!(prevPubKey instanceof DSAPublicKey)) { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
364 |
throw new CertPathValidatorException("Input key is not " + |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
365 |
"of a appropriate type for inheriting parameters"); |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
366 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
367 |
|
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
368 |
DSAParams params = ((DSAPublicKey)prevPubKey).getParams(); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
369 |
if (params == null) { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
370 |
throw new CertPathValidatorException( |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
371 |
"Key parameters missing from public key."); |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
372 |
} |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
373 |
|
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
374 |
try { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
375 |
BigInteger y = ((DSAPublicKey)currPubKey).getY(); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
376 |
KeyFactory kf = KeyFactory.getInstance("DSA"); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
377 |
DSAPublicKeySpec ks = new DSAPublicKeySpec(y, params.getP(), |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
378 |
params.getQ(), params.getG()); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
379 |
currPubKey = kf.generatePublic(ks); |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
380 |
} catch (GeneralSecurityException e) { |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
381 |
throw new CertPathValidatorException("Unable to generate " + |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
382 |
"key with inherited parameters: " + e.getMessage(), e); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
383 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
384 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
385 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
386 |
// reset the previous public key |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
387 |
prevPubKey = currPubKey; |
4190 | 388 |
} |
389 |
||
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
390 |
/** |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
391 |
* Try to set the trust anchor of the checker. |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
392 |
* <p> |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
393 |
* If there is no trust anchor specified and the checker has not started, |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
394 |
* set the trust anchor. |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
395 |
* |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
396 |
* @param anchor the trust anchor selected to validate the target |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
397 |
* certificate |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
398 |
*/ |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
399 |
void trySetTrustAnchor(TrustAnchor anchor) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
400 |
// Don't bother if the check has started or trust anchor has already |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
401 |
// specified. |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
402 |
if (prevPubKey == null) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
403 |
if (anchor == null) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
404 |
throw new IllegalArgumentException( |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
405 |
"The trust anchor cannot be null"); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
406 |
} |
4190 | 407 |
|
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
408 |
// Don't bother to change the trustedPubKey. |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
409 |
if (anchor.getTrustedCert() != null) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
410 |
prevPubKey = anchor.getTrustedCert().getPublicKey(); |
37726
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
411 |
// Check for anchor certificate restrictions |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
412 |
trustedMatch = checkFingerprint(anchor.getTrustedCert()); |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
413 |
if (trustedMatch && debug != null) { |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
414 |
debug.println("trustedMatch = true"); |
bbecfff95ec3
8140422: Add mechanism to allow non default root CAs to be not subject to algorithm restrictions
ascarpino
parents:
33297
diff
changeset
|
415 |
} |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
416 |
} else { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
417 |
prevPubKey = anchor.getCAPublicKey(); |
4190 | 418 |
} |
419 |
} |
|
420 |
} |
|
421 |
||
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
422 |
/** |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
423 |
* Check the signature algorithm with the specified public key. |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
424 |
* |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
425 |
* @param key the public key to verify the CRL signature |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
426 |
* @param crl the target CRL |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
427 |
* @param variant is the Validator variants of the operation. A null value |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
428 |
* passed will set it to Validator.GENERIC. |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
429 |
*/ |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
430 |
static void check(PublicKey key, X509CRL crl, String variant) |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
431 |
throws CertPathValidatorException { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
432 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
433 |
X509CRLImpl x509CRLImpl = null; |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
434 |
try { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
435 |
x509CRLImpl = X509CRLImpl.toImpl(crl); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
436 |
} catch (CRLException ce) { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
437 |
throw new CertPathValidatorException(ce); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
438 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
439 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
440 |
AlgorithmId algorithmId = x509CRLImpl.getSigAlgId(); |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
441 |
check(key, algorithmId, variant); |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
442 |
} |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
443 |
|
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
444 |
/** |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
445 |
* Check the signature algorithm with the specified public key. |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
446 |
* |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
447 |
* @param key the public key to verify the CRL signature |
39465
8c06651d9138
8154015: Apply algorithm constraints to timestamped code
ascarpino
parents:
38576
diff
changeset
|
448 |
* @param algorithmId signature algorithm Algorithm ID |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
449 |
* @param variant is the Validator variants of the operation. A null value |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
450 |
* passed will set it to Validator.GENERIC. |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
451 |
*/ |
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
452 |
static void check(PublicKey key, AlgorithmId algorithmId, String variant) |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
453 |
throws CertPathValidatorException { |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
454 |
String sigAlgName = algorithmId.getName(); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
455 |
AlgorithmParameters sigAlgParams = algorithmId.getParameters(); |
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
456 |
|
43701
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
457 |
certPathDefaultConstraints.permits(new ConstraintsParameters( |
fe8c324ba97c
8160655: Fix denyAfter and usage types for security properties
ascarpino
parents:
42357
diff
changeset
|
458 |
sigAlgName, sigAlgParams, key, variant)); |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
459 |
} |
4190 | 460 |
} |
7040
659824c2a550
6792180: Enhance to reject weak algorithms or conform to crypto recommendations
xuelei
parents:
5506
diff
changeset
|
461 |