diff --git a/src/share/classes/sun/security/ssl/AppInputStream.java b/src/share/classes/sun/security/ssl/AppInputStream.java
index 6c4797813691cc12661156ee2c8beffa13ba76a5..9904f4ac865a1cd15496e2494e0b20658ae0fc9f 100644
--- a/src/share/classes/sun/security/ssl/AppInputStream.java
+++ b/src/share/classes/sun/security/ssl/AppInputStream.java
@@ -55,6 +55,7 @@ class AppInputStream extends InputStream {
* Return the minimum number of bytes that can be read without blocking.
* Currently not synchronized.
*/
+ @Override
public int available() throws IOException {
if (c.checkEOF() || (r.isAppDataValid() == false)) {
return 0;
@@ -65,6 +66,7 @@ class AppInputStream extends InputStream {
/**
* Read a single byte, returning -1 on non-fault EOF status.
*/
+ @Override
public synchronized int read() throws IOException {
int n = read(oneByte, 0, 1);
if (n <= 0) { // EOF
@@ -79,6 +81,7 @@ class AppInputStream extends InputStream {
* are responsible only for blocking to fill at most one buffer,
* and returning "-1" on non-fault EOF status.
*/
+ @Override
public synchronized int read(byte b[], int off, int len)
throws IOException {
if (b == null) {
@@ -124,6 +127,7 @@ class AppInputStream extends InputStream {
* is static and may garbled by concurrent use, but we are not interested
* in the data anyway.
*/
+ @Override
public synchronized long skip(long n) throws IOException {
long skipped = 0;
while (n > 0) {
@@ -141,6 +145,7 @@ class AppInputStream extends InputStream {
/*
* Socket close is already synchronized, no need to block here.
*/
+ @Override
public void close() throws IOException {
c.close();
}
diff --git a/src/share/classes/sun/security/ssl/AppOutputStream.java b/src/share/classes/sun/security/ssl/AppOutputStream.java
index f9f6e9e8ab9ce8dbe8bbf8aae54e111e2950f23a..f76d907d2e60ecc67fcfc79a30168b0d6264c291 100644
--- a/src/share/classes/sun/security/ssl/AppOutputStream.java
+++ b/src/share/classes/sun/security/ssl/AppOutputStream.java
@@ -56,6 +56,7 @@ class AppOutputStream extends OutputStream {
/**
* Write the data out, NOW.
*/
+ @Override
synchronized public void write(byte b[], int off, int len)
throws IOException {
if (b == null) {
@@ -131,6 +132,7 @@ class AppOutputStream extends OutputStream {
/**
* Write one byte now.
*/
+ @Override
synchronized public void write(int i) throws IOException {
oneByte[0] = (byte)i;
write(oneByte, 0, 1);
@@ -139,6 +141,7 @@ class AppOutputStream extends OutputStream {
/*
* Socket close is already synchronized, no need to block here.
*/
+ @Override
public void close() throws IOException {
c.close();
}
diff --git a/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java b/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
index 1542585ebe8e74794d4b229808616b92dcde8ca1..240bc052d47cc92e19466f77e89fb4cea87e0f31 100644
--- a/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
+++ b/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
@@ -102,6 +102,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* associated with this socket, if any.
* @see java.net.Socket#getChannel
*/
+ @Override
public final SocketChannel getChannel() {
if (self == this) {
return super.getChannel();
@@ -114,6 +115,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Binds the address to the socket.
* @see java.net.Socket#bind
*/
+ @Override
public void bind(SocketAddress bindpoint) throws IOException {
/*
* Bind to this socket
@@ -131,6 +133,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Returns the address of the endpoint this socket is connected to
* @see java.net.Socket#getLocalSocketAddress
*/
+ @Override
public SocketAddress getLocalSocketAddress() {
if (self == this) {
return super.getLocalSocketAddress();
@@ -143,6 +146,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Returns the address of the endpoint this socket is connected to
* @see java.net.Socket#getRemoteSocketAddress
*/
+ @Override
public SocketAddress getRemoteSocketAddress() {
if (self == this) {
return super.getRemoteSocketAddress();
@@ -164,6 +168,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* @param endpoint the SocketAddress
* @throws IOException if an error occurs during the connection
*/
+ @Override
public final void connect(SocketAddress endpoint) throws IOException {
connect(endpoint, 0);
}
@@ -172,6 +177,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Returns the connection state of the socket.
* @see java.net.Socket#isConnected
*/
+ @Override
public final boolean isConnected() {
if (self == this) {
return super.isConnected();
@@ -184,6 +190,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Returns the binding state of the socket.
* @see java.net.Socket#isBound
*/
+ @Override
public final boolean isBound() {
if (self == this) {
return super.isBound();
@@ -203,6 +210,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
*
* @throws UnsupportedOperationException
*/
+ @Override
public final void shutdownInput() throws IOException {
throw new UnsupportedOperationException("The method shutdownInput()" +
" is not supported in SSLSocket");
@@ -215,6 +223,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
*
* @throws UnsupportedOperationException
*/
+ @Override
public final void shutdownOutput() throws IOException {
throw new UnsupportedOperationException("The method shutdownOutput()" +
" is not supported in SSLSocket");
@@ -225,6 +234,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Returns the input state of the socket
* @see java.net.Socket#isInputShutdown
*/
+ @Override
public final boolean isInputShutdown() {
if (self == this) {
return super.isInputShutdown();
@@ -237,6 +247,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Returns the output state of the socket
* @see java.net.Socket#isOutputShutdown
*/
+ @Override
public final boolean isOutputShutdown() {
if (self == this) {
return super.isOutputShutdown();
@@ -252,6 +263,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* rather than forcing them to be explicitly reclaimed at
* the penalty of prematurly killing SSL sessions.
*/
+ @Override
protected final void finalize() throws Throwable {
try {
close();
@@ -281,6 +293,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
/**
* Returns the address of the remote peer for this connection.
*/
+ @Override
public final InetAddress getInetAddress() {
if (self == this) {
return super.getInetAddress();
@@ -295,6 +308,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* @return the local address to which the socket is bound.
* @since JDK1.1
*/
+ @Override
public final InetAddress getLocalAddress() {
if (self == this) {
return super.getLocalAddress();
@@ -306,6 +320,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
/**
* Returns the number of the remote port that this connection uses.
*/
+ @Override
public final int getPort() {
if (self == this) {
return super.getPort();
@@ -317,6 +332,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
/**
* Returns the number of the local port that this connection uses.
*/
+ @Override
public final int getLocalPort() {
if (self == this) {
return super.getLocalPort();
@@ -333,6 +349,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Enables or disables the Nagle optimization.
* @see java.net.Socket#setTcpNoDelay
*/
+ @Override
public final void setTcpNoDelay(boolean value) throws SocketException {
if (self == this) {
super.setTcpNoDelay(value);
@@ -348,6 +365,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
*
* @see java.net.Socket#getTcpNoDelay
*/
+ @Override
public final boolean getTcpNoDelay() throws SocketException {
if (self == this) {
return super.getTcpNoDelay();
@@ -360,6 +378,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Assigns the socket's linger timeout.
* @see java.net.Socket#setSoLinger
*/
+ @Override
public final void setSoLinger(boolean flag, int linger)
throws SocketException {
if (self == this) {
@@ -373,6 +392,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Returns the socket's linger timeout.
* @see java.net.Socket#getSoLinger
*/
+ @Override
public final int getSoLinger() throws SocketException {
if (self == this) {
return super.getSoLinger();
@@ -388,6 +408,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* this for an SSLSocket. An implementation can be provided if a need
* arises in future.
*/
+ @Override
public final void sendUrgentData(int data) throws SocketException {
throw new SocketException("This method is not supported "
+ "by SSLSockets");
@@ -401,6 +422,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Setting OOBInline does not have any effect on SSLSocket,
* since currently we don't support sending urgent data.
*/
+ @Override
public final void setOOBInline(boolean on) throws SocketException {
throw new SocketException("This method is ineffective, since"
+ " sending urgent data is not supported by SSLSockets");
@@ -410,6 +432,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Tests if OOBINLINE is enabled.
* @see java.net.Socket#getOOBInline
*/
+ @Override
public final boolean getOOBInline() throws SocketException {
throw new SocketException("This method is ineffective, since"
+ " sending urgent data is not supported by SSLSockets");
@@ -419,6 +442,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Returns the socket timeout.
* @see java.net.Socket#getSoTimeout
*/
+ @Override
public final int getSoTimeout() throws SocketException {
if (self == this) {
return super.getSoTimeout();
@@ -427,6 +451,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
}
}
+ @Override
public final void setSendBufferSize(int size) throws SocketException {
if (self == this) {
super.setSendBufferSize(size);
@@ -435,6 +460,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
}
}
+ @Override
public final int getSendBufferSize() throws SocketException {
if (self == this) {
return super.getSendBufferSize();
@@ -443,6 +469,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
}
}
+ @Override
public final void setReceiveBufferSize(int size) throws SocketException {
if (self == this) {
super.setReceiveBufferSize(size);
@@ -451,6 +478,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
}
}
+ @Override
public final int getReceiveBufferSize() throws SocketException {
if (self == this) {
return super.getReceiveBufferSize();
@@ -463,6 +491,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Enable/disable SO_KEEPALIVE.
* @see java.net.Socket#setKeepAlive
*/
+ @Override
public final void setKeepAlive(boolean on) throws SocketException {
if (self == this) {
super.setKeepAlive(on);
@@ -475,6 +504,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Tests if SO_KEEPALIVE is enabled.
* @see java.net.Socket#getKeepAlive
*/
+ @Override
public final boolean getKeepAlive() throws SocketException {
if (self == this) {
return super.getKeepAlive();
@@ -488,6 +518,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* packets sent from this Socket.
* @see java.net.Socket#setTrafficClass
*/
+ @Override
public final void setTrafficClass(int tc) throws SocketException {
if (self == this) {
super.setTrafficClass(tc);
@@ -501,6 +532,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* sent from this Socket.
* @see java.net.Socket#getTrafficClass
*/
+ @Override
public final int getTrafficClass() throws SocketException {
if (self == this) {
return super.getTrafficClass();
@@ -513,6 +545,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Enable/disable SO_REUSEADDR.
* @see java.net.Socket#setReuseAddress
*/
+ @Override
public final void setReuseAddress(boolean on) throws SocketException {
if (self == this) {
super.setReuseAddress(on);
@@ -525,6 +558,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
* Tests if SO_REUSEADDR is enabled.
* @see java.net.Socket#getReuseAddress
*/
+ @Override
public final boolean getReuseAddress() throws SocketException {
if (self == this) {
return super.getReuseAddress();
@@ -538,6 +572,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket {
*
* @see java.net.Socket#setPerformancePreferences(int, int, int)
*/
+ @Override
public void setPerformancePreferences(int connectionTime,
int latency, int bandwidth) {
if (self == this) {
diff --git a/src/share/classes/sun/security/ssl/ByteBufferInputStream.java b/src/share/classes/sun/security/ssl/ByteBufferInputStream.java
index 71916217de5cee7d2854c0725c994373643bf03a..d6734b668da49e6a70bf1dad92f3a0002038d192 100644
--- a/src/share/classes/sun/security/ssl/ByteBufferInputStream.java
+++ b/src/share/classes/sun/security/ssl/ByteBufferInputStream.java
@@ -50,6 +50,7 @@ class ByteBufferInputStream extends InputStream {
*
* Increments position().
*/
+ @Override
public int read() throws IOException {
if (bb == null) {
@@ -67,6 +68,7 @@ class ByteBufferInputStream extends InputStream {
*
* Increments position().
*/
+ @Override
public int read(byte b[]) throws IOException {
if (bb == null) {
@@ -81,6 +83,7 @@ class ByteBufferInputStream extends InputStream {
*
* Increments position().
*/
+ @Override
public int read(byte b[], int off, int len) throws IOException {
if (bb == null) {
@@ -108,6 +111,7 @@ class ByteBufferInputStream extends InputStream {
* Skips over and discards n
bytes of data from this input
* stream.
*/
+ @Override
public long skip(long n) throws IOException {
if (bb == null) {
@@ -135,6 +139,7 @@ class ByteBufferInputStream extends InputStream {
* from this input stream without blocking by the next caller of a
* method for this input stream.
*/
+ @Override
public int available() throws IOException {
if (bb == null) {
@@ -150,6 +155,7 @@ class ByteBufferInputStream extends InputStream {
*
* @exception IOException if an I/O error occurs.
*/
+ @Override
public void close() throws IOException {
bb = null;
}
@@ -157,12 +163,14 @@ class ByteBufferInputStream extends InputStream {
/**
* Marks the current position in this input stream.
*/
+ @Override
public synchronized void mark(int readlimit) {}
/**
* Repositions this stream to the position at the time the
* mark
method was last called on this input stream.
*/
+ @Override
public synchronized void reset() throws IOException {
throw new IOException("mark/reset not supported");
}
@@ -171,6 +179,7 @@ class ByteBufferInputStream extends InputStream {
* Tests if this input stream supports the mark
and
* reset
methods.
*/
+ @Override
public boolean markSupported() {
return false;
}
diff --git a/src/share/classes/sun/security/ssl/CipherBox.java b/src/share/classes/sun/security/ssl/CipherBox.java
index 4305b44635b1ebdc96d47b053a31dc39b78ea40d..362f9b5d904c56e0bc3a81a920abcd9950184b4c 100644
--- a/src/share/classes/sun/security/ssl/CipherBox.java
+++ b/src/share/classes/sun/security/ssl/CipherBox.java
@@ -32,7 +32,6 @@ import java.util.Hashtable;
import java.security.*;
import javax.crypto.*;
-import javax.crypto.spec.SecretKeySpec;
import javax.crypto.spec.IvParameterSpec;
import java.nio.*;
diff --git a/src/share/classes/sun/security/ssl/CipherSuite.java b/src/share/classes/sun/security/ssl/CipherSuite.java
index 49851d863707e56fe22934cdfa6a7ec1024dd58f..555304880b7a5d4cd108bf6827fe0978ff447c9b 100644
--- a/src/share/classes/sun/security/ssl/CipherSuite.java
+++ b/src/share/classes/sun/security/ssl/CipherSuite.java
@@ -37,7 +37,6 @@ import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
-import sun.security.ssl.CipherSuite.*;
import static sun.security.ssl.CipherSuite.KeyExchange.*;
import static sun.security.ssl.CipherSuite.PRF.*;
import static sun.security.ssl.JsseJce.*;
@@ -203,6 +202,7 @@ final class CipherSuite implements Comparable {
* Note that for unsupported CipherSuites parsed from a handshake
* message we violate the equals() contract.
*/
+ @Override
public int compareTo(CipherSuite o) {
return o.priority - priority;
}
@@ -210,6 +210,7 @@ final class CipherSuite implements Comparable {
/**
* Returns this.name.
*/
+ @Override
public String toString() {
return name;
}
@@ -378,6 +379,7 @@ final class CipherSuite implements Comparable {
}
}
+ @Override
public String toString() {
return name;
}
@@ -527,6 +529,7 @@ final class CipherSuite implements Comparable {
return b.booleanValue();
}
+ @Override
public String toString() {
return description;
}
@@ -562,6 +565,7 @@ final class CipherSuite implements Comparable {
return new MAC(this, protocolVersion, secret);
}
+ @Override
public String toString() {
return name;
}
diff --git a/src/share/classes/sun/security/ssl/CipherSuiteList.java b/src/share/classes/sun/security/ssl/CipherSuiteList.java
index bf69b35aacac4e4b025e0963a79063c270fbbf79..162d5344f7a97ecf00cc550e02d3660ef9042e87 100644
--- a/src/share/classes/sun/security/ssl/CipherSuiteList.java
+++ b/src/share/classes/sun/security/ssl/CipherSuiteList.java
@@ -177,6 +177,7 @@ final class CipherSuiteList {
return suiteNames.clone();
}
+ @Override
public String toString() {
return cipherSuites.toString();
}
diff --git a/src/share/classes/sun/security/ssl/ClientHandshaker.java b/src/share/classes/sun/security/ssl/ClientHandshaker.java
index d18af55b2b08622428e032f67f0f6e8efe7fe025..c03d12f005dfaa022a626d42176b24ac244f60ed 100644
--- a/src/share/classes/sun/security/ssl/ClientHandshaker.java
+++ b/src/share/classes/sun/security/ssl/ClientHandshaker.java
@@ -45,7 +45,6 @@ import javax.net.ssl.*;
import javax.security.auth.Subject;
import sun.security.ssl.HandshakeMessage.*;
-import sun.security.ssl.CipherSuite.*;
import static sun.security.ssl.CipherSuite.KeyExchange.*;
/**
@@ -128,6 +127,7 @@ final class ClientHandshaker extends Handshaker {
* is processed, and writes responses as needed using the connection
* in the constructor.
*/
+ @Override
void processMessage(byte type, int messageLen) throws IOException {
if (state > type
&& (type != HandshakeMessage.ht_hello_request
@@ -505,6 +505,7 @@ final class ClientHandshaker extends Handshaker {
try {
subject = AccessController.doPrivileged(
new PrivilegedExceptionAction() {
+ @Override
public Subject run() throws Exception {
return Krb5Helper.getClientSubject(getAccSE());
}});
@@ -1104,6 +1105,7 @@ final class ClientHandshaker extends Handshaker {
/*
* Returns a ClientHello message to kickstart renegotiations
*/
+ @Override
HandshakeMessage getKickstartMessage() throws SSLException {
// session ID of the ClientHello message
SessionId sessionId = SSLSessionImpl.nullSession.getSessionId();
@@ -1279,6 +1281,7 @@ final class ClientHandshaker extends Handshaker {
/*
* Fault detected during handshake.
*/
+ @Override
void handshakeAlert(byte description) throws SSLProtocolException {
String message = Alerts.alertDescription(description);
diff --git a/src/share/classes/sun/security/ssl/DHClientKeyExchange.java b/src/share/classes/sun/security/ssl/DHClientKeyExchange.java
index 8838193a57bd4ed9a5800d9b94139708389be04a..f78bdc26420fcc547c69309872b985134b4f107b 100644
--- a/src/share/classes/sun/security/ssl/DHClientKeyExchange.java
+++ b/src/share/classes/sun/security/ssl/DHClientKeyExchange.java
@@ -39,6 +39,7 @@ import java.math.BigInteger;
*/
final class DHClientKeyExchange extends HandshakeMessage {
+ @Override
int messageType() {
return ht_client_key_exchange;
}
@@ -75,6 +76,7 @@ final class DHClientKeyExchange extends HandshakeMessage {
dh_Yc = input.getBytes16();
}
+ @Override
int messageLength() {
if (dh_Yc == null) {
return 0;
@@ -83,10 +85,12 @@ final class DHClientKeyExchange extends HandshakeMessage {
}
}
+ @Override
void send(HandshakeOutStream s) throws IOException {
s.putBytes16(dh_Yc);
}
+ @Override
void print(PrintStream s) throws IOException {
s.println("*** ClientKeyExchange, DH");
diff --git a/src/share/classes/sun/security/ssl/ECDHClientKeyExchange.java b/src/share/classes/sun/security/ssl/ECDHClientKeyExchange.java
index d89945c56150ac0a8029bd72eec9e6d9014effd2..4f10c985af40225931a068722f3a6c6a931b611a 100644
--- a/src/share/classes/sun/security/ssl/ECDHClientKeyExchange.java
+++ b/src/share/classes/sun/security/ssl/ECDHClientKeyExchange.java
@@ -41,6 +41,7 @@ import java.security.spec.*;
*/
final class ECDHClientKeyExchange extends HandshakeMessage {
+ @Override
int messageType() {
return ht_client_key_exchange;
}
@@ -63,14 +64,17 @@ final class ECDHClientKeyExchange extends HandshakeMessage {
encodedPoint = input.getBytes8();
}
+ @Override
int messageLength() {
return encodedPoint.length + 1;
}
+ @Override
void send(HandshakeOutStream s) throws IOException {
s.putBytes8(encodedPoint);
}
+ @Override
void print(PrintStream s) throws IOException {
s.println("*** ECDHClientKeyExchange");
diff --git a/src/share/classes/sun/security/ssl/ECDHCrypt.java b/src/share/classes/sun/security/ssl/ECDHCrypt.java
index 84dc4678f6708cb82189856d25abdc7bdd205d77..4f2da07f41649f74a3be4c3e0d0503a7ea3fff57 100644
--- a/src/share/classes/sun/security/ssl/ECDHCrypt.java
+++ b/src/share/classes/sun/security/ssl/ECDHCrypt.java
@@ -31,7 +31,6 @@ import java.security.spec.*;
import javax.crypto.SecretKey;
import javax.crypto.KeyAgreement;
-import javax.crypto.spec.*;
/**
* Helper class for the ECDH key exchange. It generates the appropriate
diff --git a/src/share/classes/sun/security/ssl/EngineInputRecord.java b/src/share/classes/sun/security/ssl/EngineInputRecord.java
index 3014242b1bca18f7e3a3781a07315cf6808fab83..6b0643852030b5ebe1d330962ed0e9544b404ff7 100644
--- a/src/share/classes/sun/security/ssl/EngineInputRecord.java
+++ b/src/share/classes/sun/security/ssl/EngineInputRecord.java
@@ -64,6 +64,7 @@ final class EngineInputRecord extends InputRecord {
this.engine = engine;
}
+ @Override
byte contentType() {
if (internalData) {
return super.contentType();
@@ -271,6 +272,7 @@ final class EngineInputRecord extends InputRecord {
* data to be generated/output before the exception is ever
* generated.
*/
+ @Override
void writeBuffer(OutputStream s, byte [] buf, int off, int len)
throws IOException {
/*
diff --git a/src/share/classes/sun/security/ssl/EngineOutputRecord.java b/src/share/classes/sun/security/ssl/EngineOutputRecord.java
index e5eb7f759c45c11c99f686f1f4310e4441be670e..e9d39805b36bfe1211b4db5990b5026c2454d66e 100644
--- a/src/share/classes/sun/security/ssl/EngineOutputRecord.java
+++ b/src/share/classes/sun/security/ssl/EngineOutputRecord.java
@@ -29,9 +29,6 @@ package sun.security.ssl;
import java.io.*;
import java.nio.*;
-import javax.net.ssl.SSLException;
-import sun.misc.HexDumpEncoder;
-
/**
* A OutputRecord class extension which uses external ByteBuffers
@@ -95,6 +92,7 @@ final class EngineOutputRecord extends OutputRecord {
finishedMsg = true;
}
+ @Override
public void flush() throws IOException {
finishedMsg = false;
}
diff --git a/src/share/classes/sun/security/ssl/EngineWriter.java b/src/share/classes/sun/security/ssl/EngineWriter.java
index c930af7779c78b4bc959286635852c7fdbe6585a..e08dbb06069a1a3ab40489bc75bfd2ada1d590fe 100644
--- a/src/share/classes/sun/security/ssl/EngineWriter.java
+++ b/src/share/classes/sun/security/ssl/EngineWriter.java
@@ -25,7 +25,6 @@
package sun.security.ssl;
-import javax.net.ssl.*;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.LinkedList;
diff --git a/src/share/classes/sun/security/ssl/ExtensionType.java b/src/share/classes/sun/security/ssl/ExtensionType.java
index a447642bb7729a3d4a48cd1e0ea9b98bbd344b83..99de20a6ca5bcf92a2804cea31a364d264f66180 100644
--- a/src/share/classes/sun/security/ssl/ExtensionType.java
+++ b/src/share/classes/sun/security/ssl/ExtensionType.java
@@ -38,6 +38,7 @@ final class ExtensionType {
this.name = name;
}
+ @Override
public String toString() {
return name;
}
diff --git a/src/share/classes/sun/security/ssl/HandshakeHash.java b/src/share/classes/sun/security/ssl/HandshakeHash.java
index ffb8f322606b58d8983ca2048a2a7de93d286e33..6c6a0f6c090594e0a89be6b16d57b9a8a78c3b44 100644
--- a/src/share/classes/sun/security/ssl/HandshakeHash.java
+++ b/src/share/classes/sun/security/ssl/HandshakeHash.java
@@ -28,9 +28,6 @@ package sun.security.ssl;
import java.io.ByteArrayOutputStream;
import java.security.*;
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Locale;
import java.util.Set;
@@ -391,11 +388,13 @@ final class CloneableDigest extends MessageDigest implements Cloneable {
// }
}
+ @Override
protected int engineGetDigestLength() {
checkState();
return digests[0].getDigestLength();
}
+ @Override
protected void engineUpdate(byte b) {
checkState();
for (int i = 0; (i < digests.length) && (digests[i] != null); i++) {
@@ -403,6 +402,7 @@ final class CloneableDigest extends MessageDigest implements Cloneable {
}
}
+ @Override
protected void engineUpdate(byte[] b, int offset, int len) {
checkState();
for (int i = 0; (i < digests.length) && (digests[i] != null); i++) {
@@ -410,6 +410,7 @@ final class CloneableDigest extends MessageDigest implements Cloneable {
}
}
+ @Override
protected byte[] engineDigest() {
checkState();
byte[] digest = digests[0].digest();
@@ -417,6 +418,7 @@ final class CloneableDigest extends MessageDigest implements Cloneable {
return digest;
}
+ @Override
protected int engineDigest(byte[] buf, int offset, int len)
throws DigestException {
checkState();
@@ -436,6 +438,7 @@ final class CloneableDigest extends MessageDigest implements Cloneable {
}
}
+ @Override
protected void engineReset() {
checkState();
for (int i = 0; (i < digests.length) && (digests[i] != null); i++) {
@@ -443,6 +446,7 @@ final class CloneableDigest extends MessageDigest implements Cloneable {
}
}
+ @Override
public Object clone() {
checkState();
for (int i = digests.length - 1; i >= 0; i--) {
diff --git a/src/share/classes/sun/security/ssl/HandshakeInStream.java b/src/share/classes/sun/security/ssl/HandshakeInStream.java
index a6c061129ee05a983ec74ad3d4ce3f5f05bf0ae3..4b1ed4623eafa039fff394f1827c18e9ed7329a9 100644
--- a/src/share/classes/sun/security/ssl/HandshakeInStream.java
+++ b/src/share/classes/sun/security/ssl/HandshakeInStream.java
@@ -28,7 +28,6 @@ package sun.security.ssl;
import java.io.InputStream;
import java.io.IOException;
-import java.security.MessageDigest;
import javax.net.ssl.SSLException;
@@ -74,6 +73,7 @@ public class HandshakeInStream extends InputStream {
* Note that this returns the bytes remaining in the buffer, not
* the bytes remaining in the current handshake message.
*/
+ @Override
public int available() {
return r.available();
}
@@ -81,6 +81,7 @@ public class HandshakeInStream extends InputStream {
/*
* Get a byte of handshake data.
*/
+ @Override
public int read() throws IOException {
int n = r.read();
if (n == -1) {
@@ -92,6 +93,7 @@ public class HandshakeInStream extends InputStream {
/*
* Get a bunch of bytes of handshake data.
*/
+ @Override
public int read(byte b [], int off, int len) throws IOException {
// we read from a ByteArrayInputStream, it always returns the
// data in a single read if enough is available
@@ -105,6 +107,7 @@ public class HandshakeInStream extends InputStream {
/*
* Skip some handshake data.
*/
+ @Override
public long skip(long n) throws IOException {
return r.skip(n);
}
@@ -117,6 +120,7 @@ public class HandshakeInStream extends InputStream {
* read, data that has already been consumed is lost even if marked).
*/
+ @Override
public void mark(int readlimit) {
r.mark(readlimit);
}
@@ -126,6 +130,7 @@ public class HandshakeInStream extends InputStream {
r.reset();
}
+ @Override
public boolean markSupported() {
return true;
}
diff --git a/src/share/classes/sun/security/ssl/HandshakeMessage.java b/src/share/classes/sun/security/ssl/HandshakeMessage.java
index 746773590d3bbe85563c7707fb6362830b8c5c4e..e4b67ebf54a02ce1cfdb967d890e303a1c151690 100644
--- a/src/share/classes/sun/security/ssl/HandshakeMessage.java
+++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java
@@ -170,6 +170,7 @@ public abstract class HandshakeMessage {
* session parameters after a connection has been (re)established.
*/
static final class HelloRequest extends HandshakeMessage {
+ @Override
int messageType() { return ht_hello_request; }
HelloRequest() { }
@@ -179,13 +180,16 @@ static final class HelloRequest extends HandshakeMessage {
// nothing in this message
}
+ @Override
int messageLength() { return 0; }
+ @Override
void send(HandshakeOutStream out) throws IOException
{
// nothing in this messaage
}
+ @Override
void print(PrintStream out) throws IOException
{
out.println("*** HelloRequest (empty)");
@@ -329,6 +333,7 @@ static final class ClientHello extends HandshakeMessage {
static final
class ServerHello extends HandshakeMessage
{
+ @Override
int messageType() { return ht_server_hello; }
ProtocolVersion protocolVersion;
@@ -355,6 +360,7 @@ class ServerHello extends HandshakeMessage
}
}
+ @Override
int messageLength()
{
// almost fixed size, except session ID and extensions:
@@ -366,6 +372,7 @@ class ServerHello extends HandshakeMessage
return 38 + sessionId.length() + extensions.length();
}
+ @Override
void send(HandshakeOutStream s) throws IOException
{
s.putInt8(protocolVersion.major);
@@ -378,6 +385,7 @@ class ServerHello extends HandshakeMessage
extensions.send(s);
}
+ @Override
void print(PrintStream s) throws IOException
{
s.println("*** ServerHello, " + protocolVersion);
@@ -416,6 +424,7 @@ class ServerHello extends HandshakeMessage
static final
class CertificateMsg extends HandshakeMessage
{
+ @Override
int messageType() { return ht_certificate; }
private X509Certificate[] chain;
@@ -450,6 +459,7 @@ class CertificateMsg extends HandshakeMessage
chain = v.toArray(new X509Certificate[v.size()]);
}
+ @Override
int messageLength() {
if (encodedChain == null) {
messageLength = 3;
@@ -468,6 +478,7 @@ class CertificateMsg extends HandshakeMessage
return messageLength;
}
+ @Override
void send(HandshakeOutStream s) throws IOException {
s.putInt24(messageLength() - 3);
for (byte[] b : encodedChain) {
@@ -475,6 +486,7 @@ class CertificateMsg extends HandshakeMessage
}
}
+ @Override
void print(PrintStream s) throws IOException {
s.println("*** Certificate chain");
@@ -528,6 +540,7 @@ class CertificateMsg extends HandshakeMessage
*/
static abstract class ServerKeyExchange extends HandshakeMessage
{
+ @Override
int messageType() { return ht_server_key_exchange; }
}
@@ -635,17 +648,20 @@ class RSA_ServerKeyExchange extends ServerKeyExchange
return signature.verify(signatureBytes);
}
+ @Override
int messageLength() {
return 6 + rsa_modulus.length + rsa_exponent.length
+ signatureBytes.length;
}
+ @Override
void send(HandshakeOutStream s) throws IOException {
s.putBytes16(rsa_modulus);
s.putBytes16(rsa_exponent);
s.putBytes16(signatureBytes);
}
+ @Override
void print(PrintStream s) throws IOException {
s.println("*** RSA ServerKeyExchange");
@@ -874,6 +890,7 @@ class DH_ServerKeyExchange extends ServerKeyExchange
dh_Ys = toByteArray(obj.getPublicKey());
}
+ @Override
int messageLength() {
int temp = 6; // overhead for p, g, y(s) values.
@@ -895,6 +912,7 @@ class DH_ServerKeyExchange extends ServerKeyExchange
return temp;
}
+ @Override
void send(HandshakeOutStream s) throws IOException {
s.putBytes16(dh_p);
s.putBytes16(dh_g);
@@ -914,6 +932,7 @@ class DH_ServerKeyExchange extends ServerKeyExchange
}
}
+ @Override
void print(PrintStream s) throws IOException {
s.println("*** Diffie-Hellman ServerKeyExchange");
@@ -1118,6 +1137,7 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
sig.update(pointBytes);
}
+ @Override
int messageLength() {
int sigLen = 0;
if (signatureBytes != null) {
@@ -1130,6 +1150,7 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
return 4 + pointBytes.length + sigLen;
}
+ @Override
void send(HandshakeOutStream s) throws IOException {
s.putInt8(CURVE_NAMED_CURVE);
s.putInt16(curveId);
@@ -1145,6 +1166,7 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
}
}
+ @Override
void print(PrintStream s) throws IOException {
s.println("*** ECDH ServerKeyExchange");
@@ -1479,6 +1501,7 @@ class CertificateRequest extends HandshakeMessage
static final
class ServerHelloDone extends HandshakeMessage
{
+ @Override
int messageType() { return ht_server_hello_done; }
ServerHelloDone() { }
@@ -1488,16 +1511,19 @@ class ServerHelloDone extends HandshakeMessage
// nothing to do
}
+ @Override
int messageLength()
{
return 0;
}
+ @Override
void send(HandshakeOutStream s) throws IOException
{
// nothing to send
}
+ @Override
void print(PrintStream s) throws IOException
{
s.println("*** ServerHelloDone");
@@ -1712,6 +1738,7 @@ static final class CertificateVerify extends HandshakeMessage {
private static void makeAccessible(final AccessibleObject o) {
AccessController.doPrivileged(new PrivilegedAction