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-25 18:31:28 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-06-25 18:31:28 +0400
commit427947633dec58cee061a3f63b9ca36089182d45 (patch)
treef2aea498d115c537ac0c081190d6717dff69f4ae /core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java
parente1f9f545c7ef93dd24dfd3009eb9877d0ad23b5d (diff)
Re-order a few things to make client/server have more similar flow
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java
index d0ed9e9a..50e4fe74 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java
@@ -103,27 +103,25 @@ public class DTLSServerProtocol
}
byte[] serverHelloBody = generateServerHello(state);
+
if (state.maxFragmentLength >= 0)
{
int plainTextLimit = 1 << (8 + state.maxFragmentLength);
recordLayer.setPlaintextLimit(plainTextLimit);
}
- handshake.sendMessage(HandshakeType.server_hello, serverHelloBody);
- // TODO This block could really be done before actually sending the hello
- {
- securityParameters.cipherSuite = state.selectedCipherSuite;
- securityParameters.compressionAlgorithm = state.selectedCompressionMethod;
- securityParameters.prfAlgorithm = TlsProtocol.getPRFAlgorithm(state.serverContext, state.selectedCipherSuite);
+ securityParameters.cipherSuite = state.selectedCipherSuite;
+ securityParameters.compressionAlgorithm = state.selectedCompressionMethod;
+ securityParameters.prfAlgorithm = TlsProtocol.getPRFAlgorithm(state.serverContext, state.selectedCipherSuite);
- /*
- * RFC 5264 7.4.9. Any cipher suite which does not explicitly specify verify_data_length
- * has a verify_data_length equal to 12. This includes all existing cipher suites.
- */
- securityParameters.verifyDataLength = 12;
+ /*
+ * RFC 5264 7.4.9. Any cipher suite which does not explicitly specify verify_data_length has
+ * a verify_data_length equal to 12. This includes all existing cipher suites.
+ */
+ securityParameters.verifyDataLength = 12;
- handshake.notifyHelloComplete();
- }
+ handshake.sendMessage(HandshakeType.server_hello, serverHelloBody);
+ handshake.notifyHelloComplete();
Vector serverSupplementalData = state.server.getServerSupplementalData();
if (serverSupplementalData != null)