Skip to content

Commit 7d00b08

Browse files
author
duke
committedJan 5, 2021
Automatic merge of jdk:master into master
2 parents 437a9ff + 2499ac3 commit 7d00b08

13 files changed

+33
-32
lines changed
 

‎src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ final class DHClientKeyExchange {
6767
*/
6868
private static final
6969
class DHClientKeyExchangeMessage extends HandshakeMessage {
70-
private byte[] y; // 1 to 2^16 - 1 bytes
70+
private final byte[] y; // 1 to 2^16 - 1 bytes
7171

7272
DHClientKeyExchangeMessage(
7373
HandshakeContext handshakeContext) throws IOException {

‎src/java.base/share/classes/sun/security/ssl/EphemeralKeyManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private static class EphemeralKeyPair {
109109

110110
private KeyPair keyPair;
111111
private int uses;
112-
private long expirationTime;
112+
private final long expirationTime;
113113

114114
private EphemeralKeyPair(KeyPair keyPair) {
115115
this.keyPair = keyPair;

‎src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ abstract boolean isCookieValid(ServerHandshakeContext context,
122122
class D10HelloCookieManager extends HelloCookieManager {
123123

124124
final SecureRandom secureRandom;
125-
private int cookieVersion; // allow to wrap, version + sequence
126-
private byte[] cookieSecret;
127-
private byte[] legacySecret;
125+
private int cookieVersion; // allow to wrap, version + sequence
126+
private final byte[] cookieSecret;
127+
private final byte[] legacySecret;
128128

129129
private final ReentrantLock d10ManagerLock = new ReentrantLock();
130130

‎src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public boolean permits(Set<CryptoPrimitive> primitives,
225225
private static class SupportedSignatureAlgorithmConstraints
226226
implements AlgorithmConstraints {
227227
// supported signature algorithms
228-
private String[] supportedAlgorithms;
228+
private final String[] supportedAlgorithms;
229229

230230
SupportedSignatureAlgorithmConstraints(String[] supportedAlgorithms) {
231231
if (supportedAlgorithms != null) {

‎src/java.base/share/classes/sun/security/ssl/SSLCipher.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ enum SSLCipher {
411411
private static final HashMap<String, Long> cipherLimits = new HashMap<>();
412412

413413
// Keywords found on the jdk.tls.keyLimits security property.
414-
final static String tag[] = {"KEYUPDATE"};
414+
final static String[] tag = {"KEYUPDATE"};
415415

416416
static {
417417
final long max = 4611686018427387904L; // 2^62
@@ -424,12 +424,12 @@ public String run() {
424424
});
425425

426426
if (prop != null) {
427-
String propvalue[] = prop.split(",");
427+
String[] propvalue = prop.split(",");
428428

429429
for (String entry : propvalue) {
430430
int index;
431431
// If this is not a UsageLimit, goto to next entry.
432-
String values[] = entry.trim().toUpperCase().split(" ");
432+
String[] values = entry.trim().toUpperCase().split(" ");
433433

434434
if (values[1].contains(tag[0])) {
435435
index = 0;

‎src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,15 @@ public Object clone() {
434434
//
435435
// See Effective Java Second Edition: Item 71.
436436
private static final class CustomizedClientSignatureSchemes {
437-
private static List<SignatureScheme> signatureSchemes =
437+
private static final List<SignatureScheme> signatureSchemes =
438438
getCustomizedSignatureScheme("jdk.tls.client.SignatureSchemes");
439439
}
440440

441441
// lazy initialization holder class idiom for static default parameters
442442
//
443443
// See Effective Java Second Edition: Item 71.
444444
private static final class CustomizedServerSignatureSchemes {
445-
private static List<SignatureScheme> signatureSchemes =
445+
private static final List<SignatureScheme> signatureSchemes =
446446
getCustomizedSignatureScheme("jdk.tls.server.SignatureSchemes");
447447
}
448448

‎src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ private static class HandshakeMemo extends RecordMemo {
371371
}
372372

373373
final class HandshakeFragment {
374-
private LinkedList<RecordMemo> handshakeMemos = new LinkedList<>();
374+
private final LinkedList<RecordMemo> handshakeMemos =
375+
new LinkedList<>();
375376

376377
void queueUpFragment(byte[] source,
377378
int offset, int length) throws IOException {

‎src/java.base/share/classes/sun/security/ssl/SSLExtensions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*/
3939
final class SSLExtensions {
4040
private final HandshakeMessage handshakeMessage;
41-
private Map<SSLExtension, byte[]> extMap = new LinkedHashMap<>();
41+
private final Map<SSLExtension, byte[]> extMap = new LinkedHashMap<>();
4242
private int encodedLength;
4343

4444
// Extension map for debug logging

‎src/java.base/share/classes/sun/security/ssl/SSLKeyExchange.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -265,78 +265,78 @@ static SSLKeyExchange valueOf(NamedGroup namedGroup) {
265265
}
266266

267267
private static class SSLKeyExRSA {
268-
private static SSLKeyExchange KE = new SSLKeyExchange(
268+
private static final SSLKeyExchange KE = new SSLKeyExchange(
269269
List.of(X509Authentication.RSA), T12KeyAgreement.RSA);
270270
}
271271

272272
private static class SSLKeyExRSAExport {
273-
private static SSLKeyExchange KE = new SSLKeyExchange(
273+
private static final SSLKeyExchange KE = new SSLKeyExchange(
274274
List.of(X509Authentication.RSA), T12KeyAgreement.RSA_EXPORT);
275275
}
276276

277277
private static class SSLKeyExDHEDSS {
278-
private static SSLKeyExchange KE = new SSLKeyExchange(
278+
private static final SSLKeyExchange KE = new SSLKeyExchange(
279279
List.of(X509Authentication.DSA), T12KeyAgreement.DHE);
280280
}
281281

282282
private static class SSLKeyExDHEDSSExport {
283-
private static SSLKeyExchange KE = new SSLKeyExchange(
283+
private static final SSLKeyExchange KE = new SSLKeyExchange(
284284
List.of(X509Authentication.DSA), T12KeyAgreement.DHE_EXPORT);
285285
}
286286

287287
private static class SSLKeyExDHERSA {
288-
private static SSLKeyExchange KE = new SSLKeyExchange(
288+
private static final SSLKeyExchange KE = new SSLKeyExchange(
289289
List.of(X509Authentication.RSA), T12KeyAgreement.DHE);
290290
}
291291

292292
private static class SSLKeyExDHERSAOrPSS {
293-
private static SSLKeyExchange KE = new SSLKeyExchange(
293+
private static final SSLKeyExchange KE = new SSLKeyExchange(
294294
List.of(X509Authentication.RSA_OR_PSS), T12KeyAgreement.DHE);
295295
}
296296

297297
private static class SSLKeyExDHERSAExport {
298-
private static SSLKeyExchange KE = new SSLKeyExchange(
298+
private static final SSLKeyExchange KE = new SSLKeyExchange(
299299
List.of(X509Authentication.RSA), T12KeyAgreement.DHE_EXPORT);
300300
}
301301

302302
private static class SSLKeyExDHANON {
303-
private static SSLKeyExchange KE = new SSLKeyExchange(
303+
private static final SSLKeyExchange KE = new SSLKeyExchange(
304304
null, T12KeyAgreement.DHE);
305305
}
306306

307307
private static class SSLKeyExDHANONExport {
308-
private static SSLKeyExchange KE = new SSLKeyExchange(
308+
private static final SSLKeyExchange KE = new SSLKeyExchange(
309309
null, T12KeyAgreement.DHE_EXPORT);
310310
}
311311

312312
private static class SSLKeyExECDHECDSA {
313-
private static SSLKeyExchange KE = new SSLKeyExchange(
313+
private static final SSLKeyExchange KE = new SSLKeyExchange(
314314
List.of(X509Authentication.EC), T12KeyAgreement.ECDH);
315315
}
316316

317317
private static class SSLKeyExECDHRSA {
318-
private static SSLKeyExchange KE = new SSLKeyExchange(
318+
private static final SSLKeyExchange KE = new SSLKeyExchange(
319319
List.of(X509Authentication.EC), T12KeyAgreement.ECDH);
320320
}
321321

322322
private static class SSLKeyExECDHEECDSA {
323-
private static SSLKeyExchange KE = new SSLKeyExchange(
323+
private static final SSLKeyExchange KE = new SSLKeyExchange(
324324
List.of(X509Authentication.EC, X509Authentication.EDDSA),
325325
T12KeyAgreement.ECDHE);
326326
}
327327

328328
private static class SSLKeyExECDHERSA {
329-
private static SSLKeyExchange KE = new SSLKeyExchange(
329+
private static final SSLKeyExchange KE = new SSLKeyExchange(
330330
List.of(X509Authentication.RSA), T12KeyAgreement.ECDHE);
331331
}
332332

333333
private static class SSLKeyExECDHERSAOrPSS {
334-
private static SSLKeyExchange KE = new SSLKeyExchange(
334+
private static final SSLKeyExchange KE = new SSLKeyExchange(
335335
List.of(X509Authentication.RSA_OR_PSS), T12KeyAgreement.ECDHE);
336336
}
337337

338338
private static class SSLKeyExECDHANON {
339-
private static SSLKeyExchange KE = new SSLKeyExchange(
339+
private static final SSLKeyExchange KE = new SSLKeyExchange(
340340
null, T12KeyAgreement.ECDHE);
341341
}
342342

‎src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ final class SSLSessionImpl extends ExtendedSSLSession {
125125
/*
126126
* Use of session caches is globally enabled/disabled.
127127
*/
128-
private static boolean defaultRejoinable = true;
128+
private static final boolean defaultRejoinable = true;
129129

130130
// server name indication
131131
final SNIServerName serverNameIndication;

‎src/java.base/share/classes/sun/security/ssl/SunJSSE.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class SunJSSE extends java.security.Provider {
5656
@java.io.Serial
5757
private static final long serialVersionUID = 3231825739635378733L;
5858

59-
private static String info = "Sun JSSE provider" +
59+
private static final String info = "Sun JSSE provider" +
6060
"(PKCS12, SunX509/PKIX key/trust factories, " +
6161
"SSLv3/TLSv1/TLSv1.1/TLSv1.2/TLSv1.3/DTLSv1.0/DTLSv1.2)";
6262

‎src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ final class SunX509KeyManagerImpl extends X509ExtendedKeyManager {
8787
* The credentials from the KeyStore as
8888
* Map: String(alias) -> X509Credentials(credentials)
8989
*/
90-
private Map<String,X509Credentials> credentialsMap;
90+
private final Map<String,X509Credentials> credentialsMap;
9191

9292
/*
9393
* Cached server aliases for the case issuers == null.

‎src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public TrustStoreDescriptor run() {
149149
for (String fileName : fileNames) {
150150
File f = new File(fileName);
151151
if (f.isFile() && f.canRead()) {
152-
temporaryName = fileName;;
152+
temporaryName = fileName;
153153
temporaryFile = f;
154154
temporaryTime = f.lastModified();
155155

0 commit comments

Comments
 (0)
Please sign in to comment.