Skip to content

Commit dcf63f8

Browse files
committed
8257788: Class fields could be local in the SunJSSE provider
Reviewed-by: shade
1 parent d29c78d commit dcf63f8

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,6 @@ static final class OCSPStatusRequest extends CertStatusRequest {
323323

324324
final List<ResponderId> responderIds;
325325
final List<Extension> extensions;
326-
private final int ridListLen;
327-
private final int extListLen;
328326

329327
static {
330328
OCSPStatusRequest ocspReq = null;
@@ -360,7 +358,7 @@ private OCSPStatusRequest(byte statusType,
360358
List<Extension> exts = new ArrayList<>();
361359
ByteBuffer m = ByteBuffer.wrap(encoded);
362360

363-
this.ridListLen = Record.getInt16(m);
361+
int ridListLen = Record.getInt16(m);
364362
if (m.remaining() < (ridListLen + 2)) {
365363
throw new SSLProtocolException(
366364
"Invalid OCSP status request: insufficient data");
@@ -384,7 +382,7 @@ private OCSPStatusRequest(byte statusType,
384382
}
385383

386384
byte[] extListBytes = Record.getBytes16(m);
387-
this.extListLen = extListBytes.length;
385+
int extListLen = extListBytes.length;
388386
if (extListLen > 0) {
389387
try {
390388
DerInputStream dis = new DerInputStream(extListBytes);

src/java.base/share/classes/sun/security/ssl/HKDF.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
* derivation process.
4545
*/
4646
final class HKDF {
47-
private final String hmacAlg;
4847
private final Mac hmacObj;
4948
private final int hmacLen;
5049

@@ -61,7 +60,7 @@ final class HKDF {
6160
HKDF(String hashAlg) throws NoSuchAlgorithmException {
6261
Objects.requireNonNull(hashAlg,
6362
"Must provide underlying HKDF Digest algorithm.");
64-
hmacAlg = "Hmac" + hashAlg.replace("-", "");
63+
String hmacAlg = "Hmac" + hashAlg.replace("-", "");
6564
hmacObj = Mac.getInstance(hmacAlg);
6665
hmacLen = hmacObj.getMacLength();
6766
}

src/java.base/share/classes/sun/security/ssl/SSLSecretDerivation.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,15 @@ final class SSLSecretDerivation implements SSLKeyDerivation {
6060
(byte)0x48, (byte)0x98, (byte)0xB9, (byte)0x5B
6161
};
6262

63-
private final HandshakeContext context;
64-
private final String hkdfAlg;
6563
private final HashAlg hashAlg;
6664
private final SecretKey secret;
6765
private final byte[] transcriptHash; // handshake messages transcript hash
6866

6967
SSLSecretDerivation(
7068
HandshakeContext context, SecretKey secret) {
71-
this.context = context;
7269
this.secret = secret;
7370
this.hashAlg = context.negotiatedCipherSuite.hashAlg;
74-
this.hkdfAlg =
75-
"HKDF-Expand/Hmac" + hashAlg.name.replace("-", "");
71+
String hkdfAlg = "HKDF-Expand/Hmac" + hashAlg.name.replace("-", "");
7672
context.handshakeHash.update();
7773
this.transcriptHash = context.handshakeHash.digest();
7874
}

src/java.base/share/classes/sun/security/ssl/SSLTrafficKeyDerivation.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,10 @@ String getAlgorithm(CipherSuite cs, String algorithm) {
203203

204204
@SuppressWarnings("deprecation")
205205
static final class LegacyTrafficKeyDerivation implements SSLKeyDerivation {
206-
private final HandshakeContext context;
207-
private final SecretKey masterSecret;
208206
private final TlsKeyMaterialSpec keyMaterialSpec;
209207

210208
LegacyTrafficKeyDerivation(
211209
HandshakeContext context, SecretKey masterSecret) {
212-
this.context = context;
213-
this.masterSecret = masterSecret;
214210

215211
CipherSuite cipherSuite = context.negotiatedCipherSuite;
216212
ProtocolVersion protocolVersion = context.negotiatedProtocol;

0 commit comments

Comments
 (0)