Address TLS 1.3 comments output stream classes, go through JsseJce class to get Mac instance.
Summary: TLS 1.3 comments output stream classes, go through JsseJce class to get
Mac instance.
--- a/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java Thu Jun 07 07:23:15 2018 +0800
+++ b/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java Wed Jun 06 23:53:47 2018 -0700
@@ -65,7 +65,7 @@
@Override
void finishHandshake() {
-// fragmenter = null;
+ // Nothing to do here currently.
}
@Override
--- a/src/java.base/share/classes/sun/security/ssl/HKDF.java Thu Jun 07 07:23:15 2018 +0800
+++ b/src/java.base/share/classes/sun/security/ssl/HKDF.java Wed Jun 06 23:53:47 2018 -0700
@@ -62,7 +62,7 @@
Objects.requireNonNull(hashAlg,
"Must provide underlying HKDF Digest algorithm.");
hmacAlg = "Hmac" + hashAlg.replace("-", "");
- hmacObj = Mac.getInstance(hmacAlg);
+ hmacObj = JsseJce.getMac(hmacAlg);
hmacLen = hmacObj.getMacLength();
}
--- a/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java Thu Jun 07 07:23:15 2018 +0800
+++ b/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java Wed Jun 06 23:53:47 2018 -0700
@@ -125,8 +125,8 @@
}
enum KeyUpdateRequest {
- NOTREQUSTED ((byte)0, "update_not_requested"),
- REQUSTED ((byte)1, "update_requested");
+ NOTREQUESTED ((byte)0, "update_not_requested"),
+ REQUESTED ((byte)1, "update_requested");
final byte id;
final String name;
@@ -169,7 +169,7 @@
public byte[] produce(ConnectionContext context) throws IOException {
PostHandshakeContext hc = (PostHandshakeContext)context;
return handshakeProducer.produce(context,
- new KeyUpdateMessage(hc, KeyUpdateRequest.REQUSTED));
+ new KeyUpdateMessage(hc, KeyUpdateRequest.REQUESTED));
}
}
@@ -234,10 +234,10 @@
return;
}
- if (km.status == KeyUpdateRequest.REQUSTED) {
+ if (km.status == KeyUpdateRequest.REQUESTED) {
// Update the write key and IV.
handshakeProducer.produce(hc,
- new KeyUpdateMessage(hc, KeyUpdateRequest.NOTREQUSTED));
+ new KeyUpdateMessage(hc, KeyUpdateRequest.NOTREQUESTED));
}
// clean handshake context
--- a/src/java.base/share/classes/sun/security/ssl/OutputRecord.java Thu Jun 07 07:23:15 2018 +0800
+++ b/src/java.base/share/classes/sun/security/ssl/OutputRecord.java Wed Jun 06 23:53:47 2018 -0700
@@ -288,11 +288,9 @@
ProtocolVersion protocolVersion) {
if (!encCipher.isNullCipher()) {
// inner plaintext, using zero length padding.
- int pos = destination.position();
- destination.position(destination.limit());
- destination.limit(destination.limit() + 1);
- destination.put(contentType);
- destination.position(pos);
+ int endOfPt = destination.limit();
+ destination.limit(endOfPt + 1);
+ destination.put(endOfPt, contentType);
}
// use the right TLSCiphertext.opaque_type and legacy_record_version
--- a/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java Thu Jun 07 07:23:15 2018 +0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java Wed Jun 06 23:53:47 2018 -0700
@@ -256,7 +256,7 @@
PostHandshakeContext p = new PostHandshakeContext(tc);
KeyUpdate.handshakeProducer.produce(p,
- new KeyUpdateMessage(p, KeyUpdateRequest.REQUSTED));
+ new KeyUpdateMessage(p, KeyUpdateRequest.REQUESTED));
}
}
--- a/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java Thu Jun 07 07:23:15 2018 +0800
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java Wed Jun 06 23:53:47 2018 -0700
@@ -312,7 +312,7 @@
PostHandshakeContext p = new PostHandshakeContext(tc);
KeyUpdate.handshakeProducer.produce(p,
- new KeyUpdateMessage(p, KeyUpdateRequest.REQUSTED));
+ new KeyUpdateMessage(p, KeyUpdateRequest.REQUESTED));
}
}
}