diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2013-11-08 07:36:07 +0400 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2013-11-08 07:36:07 +0400 |
commit | 308cc3f5e3525ef94bbf6ac5b522275f37577a68 (patch) | |
tree | 9df4705f6da33a84a90341824de8c21ea3ecc1f7 /core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java | |
parent | cc6a790cde64d893ea5087c80c7a4af619e18f28 (diff) |
Call sealHashAlgorithms() call after server_hello_done sent/received
Refactor some of the calls around the handshake hash
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java')
-rw-r--r-- | core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java b/core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java index 9c283763..0f7336c9 100644 --- a/core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java +++ b/core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java @@ -23,7 +23,7 @@ class RecordStream private ByteArrayOutputStream buffer = new ByteArrayOutputStream(); private TlsContext context = null; - private TlsHandshakeHash hash = null; + private TlsHandshakeHash handshakeHash = null; private ProtocolVersion readVersion = null, writeVersion = null; private boolean restrictReadVersion = true; @@ -46,8 +46,8 @@ class RecordStream void init(TlsContext context) { this.context = context; - this.hash = new DeferredHash(); - this.hash.init(context); + this.handshakeHash = new DeferredHash(); + this.handshakeHash.init(context); } int getPlaintextLimit() @@ -89,12 +89,6 @@ class RecordStream this.restrictReadVersion = enabled; } - void notifyHelloComplete() - { - this.hash = this.hash.notifyPRFDetermined(); - this.hash.sealHashAlgorithms(); - } - void setPendingConnectionState(TlsCompression tlsCompression, TlsCipher tlsCipher) { this.pendingCompression = tlsCompression; @@ -286,9 +280,14 @@ class RecordStream output.flush(); } + TlsHandshakeHash getHandshakeHash() + { + return handshakeHash; + } + void updateHandshakeData(byte[] message, int offset, int len) { - hash.update(message, offset, len); + handshakeHash.update(message, offset, len); } /** @@ -296,7 +295,7 @@ class RecordStream */ byte[] getCurrentHash(byte[] sender) { - Digest d = hash.fork(); + Digest d = handshakeHash.fork(); if (TlsUtils.isSSL(context)) { |