Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2013-06-22 13:50:56 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-06-22 13:50:56 +0400
commitbd21c5063237cec265538422e81d44cfa6e71809 (patch)
treeca534d06f8fc62dacd0281a45bdb576f22c60b29 /core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java
parent6856192e4537b11a73d98b57f2684e7bfbb7838a (diff)
ChangeCipherSpec doesn't need a queue, and shouldn't have handshake
states associated with it. Server sends ChangeCipherSpec eagerly.
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java38
1 files changed, 3 insertions, 35 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java
index 45992278..2308ee08 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java
@@ -117,31 +117,6 @@ public class TlsClientProtocol
return tlsClient;
}
- protected void handleChangeCipherSpecMessage()
- throws IOException
- {
- switch (this.connection_state)
- {
- case CS_CLIENT_FINISHED:
- {
- if (this.expectSessionTicket)
- {
- /*
- * RFC 5077 3.3. This message MUST be sent if the server included a SessionTicket
- * extension in the ServerHello.
- */
- this.failWithError(AlertLevel.fatal, AlertDescription.handshake_failure);
- }
- // NB: Fall through to next case label
- }
- case CS_SERVER_SESSION_TICKET:
- this.connection_state = CS_SERVER_CHANGE_CIPHER_SPEC;
- break;
- default:
- this.failWithError(AlertLevel.fatal, AlertDescription.handshake_failure);
- }
- }
-
protected void handleHandshakeMessage(short type, byte[] data)
throws IOException
{
@@ -215,7 +190,7 @@ public class TlsClientProtocol
case HandshakeType.finished:
switch (this.connection_state)
{
- case CS_SERVER_CHANGE_CIPHER_SPEC:
+ case CS_CLIENT_FINISHED:
processFinishedMessage(buf);
this.connection_state = CS_SERVER_FINISHED;
break;
@@ -334,15 +309,10 @@ public class TlsClientProtocol
* in our CipherSuite.
*/
sendClientKeyExchangeMessage();
+ this.connection_state = CS_CLIENT_KEY_EXCHANGE;
establishMasterSecret(getContext(), keyExchange);
-
- /*
- * Initialize our cipher suite
- */
- recordStream.setPendingConnectionState(tlsClient.getCompression(), tlsClient.getCipher());
-
- this.connection_state = CS_CLIENT_KEY_EXCHANGE;
+ recordStream.setPendingConnectionState(getPeer().getCompression(), getPeer().getCipher());
if (clientCreds != null && clientCreds instanceof TlsSignerCredentials)
{
@@ -359,8 +329,6 @@ public class TlsClientProtocol
}
sendChangeCipherSpecMessage();
- this.connection_state = CS_CLIENT_CHANGE_CIPHER_SPEC;
-
sendFinishedMessage();
this.connection_state = CS_CLIENT_FINISHED;
break;